mirror of https://gitee.com/openkylin/linux.git
perf tools: Remove perf_tool from event_op2
Now that we keep a perf_tool pointer inside perf_session, there's no need to have a perf_tool argument in the event_op2 callback. Remove it. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20180913125450.21342-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
e381d1c21e
commit
89f1688a57
|
@ -283,12 +283,11 @@ static int process_sample_event(struct perf_tool *tool,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_feature_event(struct perf_tool *tool,
|
static int process_feature_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
if (event->feat.feat_id < HEADER_LAST_FEATURE)
|
if (event->feat.feat_id < HEADER_LAST_FEATURE)
|
||||||
return perf_event__process_feature(tool, event, session);
|
return perf_event__process_feature(session, event);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,12 +86,10 @@ static int perf_event__drop_oe(struct perf_tool *tool __maybe_unused,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int perf_event__repipe_op2_synth(struct perf_tool *tool,
|
static int perf_event__repipe_op2_synth(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session
|
|
||||||
__maybe_unused)
|
|
||||||
{
|
{
|
||||||
return perf_event__repipe_synth(tool, event);
|
return perf_event__repipe_synth(session->tool, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int perf_event__repipe_attr(struct perf_tool *tool,
|
static int perf_event__repipe_attr(struct perf_tool *tool,
|
||||||
|
@ -362,26 +360,24 @@ static int perf_event__repipe_exit(struct perf_tool *tool,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int perf_event__repipe_tracing_data(struct perf_tool *tool,
|
static int perf_event__repipe_tracing_data(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
perf_event__repipe_synth(tool, event);
|
perf_event__repipe_synth(session->tool, event);
|
||||||
err = perf_event__process_tracing_data(tool, event, session);
|
err = perf_event__process_tracing_data(session, event);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int perf_event__repipe_id_index(struct perf_tool *tool,
|
static int perf_event__repipe_id_index(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
perf_event__repipe_synth(tool, event);
|
perf_event__repipe_synth(session->tool, event);
|
||||||
err = perf_event__process_id_index(tool, event, session);
|
err = perf_event__process_id_index(session, event);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
|
@ -201,14 +201,13 @@ static void setup_forced_leader(struct report *report,
|
||||||
perf_evlist__force_leader(evlist);
|
perf_evlist__force_leader(evlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_feature_event(struct perf_tool *tool,
|
static int process_feature_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
struct report *rep = container_of(tool, struct report, tool);
|
struct report *rep = container_of(session->tool, struct report, tool);
|
||||||
|
|
||||||
if (event->feat.feat_id < HEADER_LAST_FEATURE)
|
if (event->feat.feat_id < HEADER_LAST_FEATURE)
|
||||||
return perf_event__process_feature(tool, event, session);
|
return perf_event__process_feature(session, event);
|
||||||
|
|
||||||
if (event->feat.feat_id != HEADER_LAST_FEATURE) {
|
if (event->feat.feat_id != HEADER_LAST_FEATURE) {
|
||||||
pr_err("failed: wrong feature ID: %" PRIu64 "\n",
|
pr_err("failed: wrong feature ID: %" PRIu64 "\n",
|
||||||
|
|
|
@ -2965,9 +2965,8 @@ static void script__setup_sample_type(struct perf_script *script)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
|
static int process_stat_round_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
struct stat_round_event *round = &event->stat_round;
|
struct stat_round_event *round = &event->stat_round;
|
||||||
struct perf_evsel *counter;
|
struct perf_evsel *counter;
|
||||||
|
@ -2981,9 +2980,8 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_stat_config_event(struct perf_tool *tool __maybe_unused,
|
static int process_stat_config_event(struct perf_session *session __maybe_unused,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
perf_event__read_stat_config(&stat_config, &event->stat_config);
|
perf_event__read_stat_config(&stat_config, &event->stat_config);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3009,10 +3007,10 @@ static int set_maps(struct perf_script *script)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_thread_map_event(struct perf_tool *tool,
|
int process_thread_map_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
|
struct perf_tool *tool = session->tool;
|
||||||
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
||||||
|
|
||||||
if (script->threads) {
|
if (script->threads) {
|
||||||
|
@ -3028,10 +3026,10 @@ int process_thread_map_event(struct perf_tool *tool,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_cpu_map_event(struct perf_tool *tool __maybe_unused,
|
int process_cpu_map_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
|
struct perf_tool *tool = session->tool;
|
||||||
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
||||||
|
|
||||||
if (script->cpus) {
|
if (script->cpus) {
|
||||||
|
@ -3046,21 +3044,21 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused,
|
||||||
return set_maps(script);
|
return set_maps(script);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_feature_event(struct perf_tool *tool,
|
static int process_feature_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
if (event->feat.feat_id < HEADER_LAST_FEATURE)
|
if (event->feat.feat_id < HEADER_LAST_FEATURE)
|
||||||
return perf_event__process_feature(tool, event, session);
|
return perf_event__process_feature(session, event);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_AUXTRACE_SUPPORT
|
#ifdef HAVE_AUXTRACE_SUPPORT
|
||||||
static int perf_script__process_auxtrace_info(struct perf_tool *tool,
|
static int perf_script__process_auxtrace_info(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
int ret = perf_event__process_auxtrace_info(tool, event, session);
|
struct perf_tool *tool = session->tool;
|
||||||
|
|
||||||
|
int ret = perf_event__process_auxtrace_info(session, event);
|
||||||
|
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
struct perf_script *script = container_of(tool, struct perf_script, tool);
|
||||||
|
|
|
@ -1354,9 +1354,8 @@ static int __cmd_record(int argc, const char **argv)
|
||||||
return argc;
|
return argc;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
|
static int process_stat_round_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
struct stat_round_event *stat_round = &event->stat_round;
|
struct stat_round_event *stat_round = &event->stat_round;
|
||||||
struct perf_evsel *counter;
|
struct perf_evsel *counter;
|
||||||
|
@ -1381,10 +1380,10 @@ static int process_stat_round_event(struct perf_tool *tool __maybe_unused,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_stat_config_event(struct perf_tool *tool,
|
int process_stat_config_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
|
struct perf_tool *tool = session->tool;
|
||||||
struct perf_stat *st = container_of(tool, struct perf_stat, tool);
|
struct perf_stat *st = container_of(tool, struct perf_stat, tool);
|
||||||
|
|
||||||
perf_event__read_stat_config(&stat_config, &event->stat_config);
|
perf_event__read_stat_config(&stat_config, &event->stat_config);
|
||||||
|
@ -1424,10 +1423,10 @@ static int set_maps(struct perf_stat *st)
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_thread_map_event(struct perf_tool *tool,
|
int process_thread_map_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
|
struct perf_tool *tool = session->tool;
|
||||||
struct perf_stat *st = container_of(tool, struct perf_stat, tool);
|
struct perf_stat *st = container_of(tool, struct perf_stat, tool);
|
||||||
|
|
||||||
if (st->threads) {
|
if (st->threads) {
|
||||||
|
@ -1443,10 +1442,10 @@ int process_thread_map_event(struct perf_tool *tool,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_cpu_map_event(struct perf_tool *tool,
|
int process_cpu_map_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
|
struct perf_tool *tool = session->tool;
|
||||||
struct perf_stat *st = container_of(tool, struct perf_stat, tool);
|
struct perf_stat *st = container_of(tool, struct perf_stat, tool);
|
||||||
struct cpu_map *cpus;
|
struct cpu_map *cpus;
|
||||||
|
|
||||||
|
|
|
@ -906,9 +906,8 @@ int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_event__process_auxtrace_info(struct perf_tool *tool __maybe_unused,
|
int perf_event__process_auxtrace_info(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
enum auxtrace_type type = event->auxtrace_info.type;
|
enum auxtrace_type type = event->auxtrace_info.type;
|
||||||
|
|
||||||
|
@ -1185,9 +1184,8 @@ void events_stats__auxtrace_error_warn(const struct events_stats *stats)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_event__process_auxtrace_error(struct perf_tool *tool __maybe_unused,
|
int perf_event__process_auxtrace_error(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
if (auxtrace__dont_decode(session))
|
if (auxtrace__dont_decode(session))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -517,15 +517,13 @@ int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr,
|
||||||
struct perf_tool *tool,
|
struct perf_tool *tool,
|
||||||
struct perf_session *session,
|
struct perf_session *session,
|
||||||
perf_event__handler_t process);
|
perf_event__handler_t process);
|
||||||
int perf_event__process_auxtrace_info(struct perf_tool *tool,
|
int perf_event__process_auxtrace_info(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
s64 perf_event__process_auxtrace(struct perf_tool *tool,
|
s64 perf_event__process_auxtrace(struct perf_tool *tool,
|
||||||
union perf_event *event,
|
union perf_event *event,
|
||||||
struct perf_session *session);
|
struct perf_session *session);
|
||||||
int perf_event__process_auxtrace_error(struct perf_tool *tool,
|
int perf_event__process_auxtrace_error(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
int itrace_parse_synth_opts(const struct option *opt, const char *str,
|
int itrace_parse_synth_opts(const struct option *opt, const char *str,
|
||||||
int unset);
|
int unset);
|
||||||
void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts);
|
void itrace_synth_opts__set_default(struct itrace_synth_opts *synth_opts);
|
||||||
|
|
|
@ -3448,10 +3448,10 @@ int perf_event__synthesize_features(struct perf_tool *tool,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_event__process_feature(struct perf_tool *tool,
|
int perf_event__process_feature(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
|
struct perf_tool *tool = session->tool;
|
||||||
struct feat_fd ff = { .fd = 0 };
|
struct feat_fd ff = { .fd = 0 };
|
||||||
struct feature_event *fe = (struct feature_event *)event;
|
struct feature_event *fe = (struct feature_event *)event;
|
||||||
int type = fe->header.type;
|
int type = fe->header.type;
|
||||||
|
@ -3856,9 +3856,8 @@ int perf_event__synthesize_tracing_data(struct perf_tool *tool, int fd,
|
||||||
return aligned_size;
|
return aligned_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_event__process_tracing_data(struct perf_tool *tool __maybe_unused,
|
int perf_event__process_tracing_data(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
ssize_t size_read, padding, size = event->tracing_data.size;
|
ssize_t size_read, padding, size = event->tracing_data.size;
|
||||||
int fd = perf_data__fd(session->data);
|
int fd = perf_data__fd(session->data);
|
||||||
|
@ -3924,9 +3923,8 @@ int perf_event__synthesize_build_id(struct perf_tool *tool,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_event__process_build_id(struct perf_tool *tool __maybe_unused,
|
int perf_event__process_build_id(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
__event_process_build_id(&event->build_id,
|
__event_process_build_id(&event->build_id,
|
||||||
event->build_id.filename,
|
event->build_id.filename,
|
||||||
|
|
|
@ -116,9 +116,8 @@ int perf_event__synthesize_extra_attr(struct perf_tool *tool,
|
||||||
perf_event__handler_t process,
|
perf_event__handler_t process,
|
||||||
bool is_pipe);
|
bool is_pipe);
|
||||||
|
|
||||||
int perf_event__process_feature(struct perf_tool *tool,
|
int perf_event__process_feature(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
|
|
||||||
int perf_event__synthesize_attr(struct perf_tool *tool,
|
int perf_event__synthesize_attr(struct perf_tool *tool,
|
||||||
struct perf_event_attr *attr, u32 ids, u64 *id,
|
struct perf_event_attr *attr, u32 ids, u64 *id,
|
||||||
|
@ -148,17 +147,15 @@ size_t perf_event__fprintf_event_update(union perf_event *event, FILE *fp);
|
||||||
int perf_event__synthesize_tracing_data(struct perf_tool *tool,
|
int perf_event__synthesize_tracing_data(struct perf_tool *tool,
|
||||||
int fd, struct perf_evlist *evlist,
|
int fd, struct perf_evlist *evlist,
|
||||||
perf_event__handler_t process);
|
perf_event__handler_t process);
|
||||||
int perf_event__process_tracing_data(struct perf_tool *tool,
|
int perf_event__process_tracing_data(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
|
|
||||||
int perf_event__synthesize_build_id(struct perf_tool *tool,
|
int perf_event__synthesize_build_id(struct perf_tool *tool,
|
||||||
struct dso *pos, u16 misc,
|
struct dso *pos, u16 misc,
|
||||||
perf_event__handler_t process,
|
perf_event__handler_t process,
|
||||||
struct machine *machine);
|
struct machine *machine);
|
||||||
int perf_event__process_build_id(struct perf_tool *tool,
|
int perf_event__process_build_id(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
bool is_perf_magic(u64 magic);
|
bool is_perf_magic(u64 magic);
|
||||||
|
|
||||||
#define NAME_ALIGN 64
|
#define NAME_ALIGN 64
|
||||||
|
|
|
@ -199,12 +199,10 @@ void perf_session__delete(struct perf_session *session)
|
||||||
free(session);
|
free(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_event_synth_tracing_data_stub(struct perf_tool *tool
|
static int process_event_synth_tracing_data_stub(struct perf_session *session
|
||||||
__maybe_unused,
|
__maybe_unused,
|
||||||
union perf_event *event
|
union perf_event *event
|
||||||
__maybe_unused,
|
__maybe_unused)
|
||||||
struct perf_session *session
|
|
||||||
__maybe_unused)
|
|
||||||
{
|
{
|
||||||
dump_printf(": unhandled!\n");
|
dump_printf(": unhandled!\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -288,9 +286,8 @@ static s64 process_event_auxtrace_stub(struct perf_tool *tool __maybe_unused,
|
||||||
return event->auxtrace.size;
|
return event->auxtrace.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_event_op2_stub(struct perf_tool *tool __maybe_unused,
|
static int process_event_op2_stub(struct perf_session *session __maybe_unused,
|
||||||
union perf_event *event __maybe_unused,
|
union perf_event *event __maybe_unused)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
dump_printf(": unhandled!\n");
|
dump_printf(": unhandled!\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -298,9 +295,8 @@ static int process_event_op2_stub(struct perf_tool *tool __maybe_unused,
|
||||||
|
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_event_thread_map_stub(struct perf_tool *tool __maybe_unused,
|
int process_event_thread_map_stub(struct perf_session *session __maybe_unused,
|
||||||
union perf_event *event __maybe_unused,
|
union perf_event *event __maybe_unused)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
if (dump_trace)
|
if (dump_trace)
|
||||||
perf_event__fprintf_thread_map(event, stdout);
|
perf_event__fprintf_thread_map(event, stdout);
|
||||||
|
@ -310,9 +306,8 @@ int process_event_thread_map_stub(struct perf_tool *tool __maybe_unused,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_event_cpu_map_stub(struct perf_tool *tool __maybe_unused,
|
int process_event_cpu_map_stub(struct perf_session *session __maybe_unused,
|
||||||
union perf_event *event __maybe_unused,
|
union perf_event *event __maybe_unused)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
if (dump_trace)
|
if (dump_trace)
|
||||||
perf_event__fprintf_cpu_map(event, stdout);
|
perf_event__fprintf_cpu_map(event, stdout);
|
||||||
|
@ -322,9 +317,8 @@ int process_event_cpu_map_stub(struct perf_tool *tool __maybe_unused,
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
int process_event_stat_config_stub(struct perf_tool *tool __maybe_unused,
|
int process_event_stat_config_stub(struct perf_session *session __maybe_unused,
|
||||||
union perf_event *event __maybe_unused,
|
union perf_event *event __maybe_unused)
|
||||||
struct perf_session *session __maybe_unused)
|
|
||||||
{
|
{
|
||||||
if (dump_trace)
|
if (dump_trace)
|
||||||
perf_event__fprintf_stat_config(event, stdout);
|
perf_event__fprintf_stat_config(event, stdout);
|
||||||
|
@ -333,10 +327,8 @@ int process_event_stat_config_stub(struct perf_tool *tool __maybe_unused,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_stat_stub(struct perf_tool *tool __maybe_unused,
|
static int process_stat_stub(struct perf_session *perf_session __maybe_unused,
|
||||||
union perf_event *event __maybe_unused,
|
union perf_event *event)
|
||||||
struct perf_session *perf_session
|
|
||||||
__maybe_unused)
|
|
||||||
{
|
{
|
||||||
if (dump_trace)
|
if (dump_trace)
|
||||||
perf_event__fprintf_stat(event, stdout);
|
perf_event__fprintf_stat(event, stdout);
|
||||||
|
@ -345,10 +337,8 @@ static int process_stat_stub(struct perf_tool *tool __maybe_unused,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int process_stat_round_stub(struct perf_tool *tool __maybe_unused,
|
static int process_stat_round_stub(struct perf_session *perf_session __maybe_unused,
|
||||||
union perf_event *event __maybe_unused,
|
union perf_event *event)
|
||||||
struct perf_session *perf_session
|
|
||||||
__maybe_unused)
|
|
||||||
{
|
{
|
||||||
if (dump_trace)
|
if (dump_trace)
|
||||||
perf_event__fprintf_stat_round(event, stdout);
|
perf_event__fprintf_stat_round(event, stdout);
|
||||||
|
@ -1374,37 +1364,37 @@ static s64 perf_session__process_user_event(struct perf_session *session,
|
||||||
case PERF_RECORD_HEADER_TRACING_DATA:
|
case PERF_RECORD_HEADER_TRACING_DATA:
|
||||||
/* setup for reading amidst mmap */
|
/* setup for reading amidst mmap */
|
||||||
lseek(fd, file_offset, SEEK_SET);
|
lseek(fd, file_offset, SEEK_SET);
|
||||||
return tool->tracing_data(tool, event, session);
|
return tool->tracing_data(session, event);
|
||||||
case PERF_RECORD_HEADER_BUILD_ID:
|
case PERF_RECORD_HEADER_BUILD_ID:
|
||||||
return tool->build_id(tool, event, session);
|
return tool->build_id(session, event);
|
||||||
case PERF_RECORD_FINISHED_ROUND:
|
case PERF_RECORD_FINISHED_ROUND:
|
||||||
return tool->finished_round(tool, event, oe);
|
return tool->finished_round(tool, event, oe);
|
||||||
case PERF_RECORD_ID_INDEX:
|
case PERF_RECORD_ID_INDEX:
|
||||||
return tool->id_index(tool, event, session);
|
return tool->id_index(session, event);
|
||||||
case PERF_RECORD_AUXTRACE_INFO:
|
case PERF_RECORD_AUXTRACE_INFO:
|
||||||
return tool->auxtrace_info(tool, event, session);
|
return tool->auxtrace_info(session, event);
|
||||||
case PERF_RECORD_AUXTRACE:
|
case PERF_RECORD_AUXTRACE:
|
||||||
/* setup for reading amidst mmap */
|
/* setup for reading amidst mmap */
|
||||||
lseek(fd, file_offset + event->header.size, SEEK_SET);
|
lseek(fd, file_offset + event->header.size, SEEK_SET);
|
||||||
return tool->auxtrace(tool, event, session);
|
return tool->auxtrace(tool, event, session);
|
||||||
case PERF_RECORD_AUXTRACE_ERROR:
|
case PERF_RECORD_AUXTRACE_ERROR:
|
||||||
perf_session__auxtrace_error_inc(session, event);
|
perf_session__auxtrace_error_inc(session, event);
|
||||||
return tool->auxtrace_error(tool, event, session);
|
return tool->auxtrace_error(session, event);
|
||||||
case PERF_RECORD_THREAD_MAP:
|
case PERF_RECORD_THREAD_MAP:
|
||||||
return tool->thread_map(tool, event, session);
|
return tool->thread_map(session, event);
|
||||||
case PERF_RECORD_CPU_MAP:
|
case PERF_RECORD_CPU_MAP:
|
||||||
return tool->cpu_map(tool, event, session);
|
return tool->cpu_map(session, event);
|
||||||
case PERF_RECORD_STAT_CONFIG:
|
case PERF_RECORD_STAT_CONFIG:
|
||||||
return tool->stat_config(tool, event, session);
|
return tool->stat_config(session, event);
|
||||||
case PERF_RECORD_STAT:
|
case PERF_RECORD_STAT:
|
||||||
return tool->stat(tool, event, session);
|
return tool->stat(session, event);
|
||||||
case PERF_RECORD_STAT_ROUND:
|
case PERF_RECORD_STAT_ROUND:
|
||||||
return tool->stat_round(tool, event, session);
|
return tool->stat_round(session, event);
|
||||||
case PERF_RECORD_TIME_CONV:
|
case PERF_RECORD_TIME_CONV:
|
||||||
session->time_conv = event->time_conv;
|
session->time_conv = event->time_conv;
|
||||||
return tool->time_conv(tool, event, session);
|
return tool->time_conv(session, event);
|
||||||
case PERF_RECORD_HEADER_FEATURE:
|
case PERF_RECORD_HEADER_FEATURE:
|
||||||
return tool->feature(tool, event, session);
|
return tool->feature(session, event);
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
@ -2133,9 +2123,8 @@ int __perf_session__set_tracepoints_handlers(struct perf_session *session,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_event__process_id_index(struct perf_tool *tool __maybe_unused,
|
int perf_event__process_id_index(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
struct perf_evlist *evlist = session->evlist;
|
struct perf_evlist *evlist = session->evlist;
|
||||||
struct id_index_event *ie = &event->id_index;
|
struct id_index_event *ie = &event->id_index;
|
||||||
|
|
|
@ -120,9 +120,8 @@ int perf_session__deliver_synth_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event,
|
||||||
struct perf_sample *sample);
|
struct perf_sample *sample);
|
||||||
|
|
||||||
int perf_event__process_id_index(struct perf_tool *tool,
|
int perf_event__process_id_index(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
|
|
||||||
int perf_event__synthesize_id_index(struct perf_tool *tool,
|
int perf_event__synthesize_id_index(struct perf_tool *tool,
|
||||||
perf_event__handler_t process,
|
perf_event__handler_t process,
|
||||||
|
|
|
@ -374,9 +374,8 @@ int perf_stat_process_counter(struct perf_stat_config *config,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int perf_event__process_stat_event(struct perf_tool *tool __maybe_unused,
|
int perf_event__process_stat_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event)
|
||||||
struct perf_session *session)
|
|
||||||
{
|
{
|
||||||
struct perf_counts_values count;
|
struct perf_counts_values count;
|
||||||
struct stat_event *st = &event->stat;
|
struct stat_event *st = &event->stat;
|
||||||
|
|
|
@ -199,9 +199,8 @@ int perf_stat_process_counter(struct perf_stat_config *config,
|
||||||
struct perf_tool;
|
struct perf_tool;
|
||||||
union perf_event;
|
union perf_event;
|
||||||
struct perf_session;
|
struct perf_session;
|
||||||
int perf_event__process_stat_event(struct perf_tool *tool,
|
int perf_event__process_stat_event(struct perf_session *session,
|
||||||
union perf_event *event,
|
union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
|
|
||||||
size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp);
|
size_t perf_event__fprintf_stat(union perf_event *event, FILE *fp);
|
||||||
size_t perf_event__fprintf_stat_round(union perf_event *event, FILE *fp);
|
size_t perf_event__fprintf_stat_round(union perf_event *event, FILE *fp);
|
||||||
|
|
|
@ -26,8 +26,7 @@ typedef int (*event_attr_op)(struct perf_tool *tool,
|
||||||
union perf_event *event,
|
union perf_event *event,
|
||||||
struct perf_evlist **pevlist);
|
struct perf_evlist **pevlist);
|
||||||
|
|
||||||
typedef int (*event_op2)(struct perf_tool *tool, union perf_event *event,
|
typedef int (*event_op2)(struct perf_session *session, union perf_event *event);
|
||||||
struct perf_session *session);
|
|
||||||
|
|
||||||
typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
|
typedef int (*event_oe)(struct perf_tool *tool, union perf_event *event,
|
||||||
struct ordered_events *oe);
|
struct ordered_events *oe);
|
||||||
|
|
Loading…
Reference in New Issue