diff options
Diffstat (limited to 'tools/perf/builtin-inject.c')
-rw-r--r-- | tools/perf/builtin-inject.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index f4591a1438b4..c14f40b858bc 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -8,8 +8,8 @@ */ #include "builtin.h" -#include "perf.h" #include "util/color.h" +#include "util/dso.h" #include "util/evlist.h" #include "util/evsel.h" #include "util/map.h" @@ -96,7 +96,7 @@ static int perf_event__repipe_op2_synth(struct perf_session *session, static int perf_event__repipe_attr(struct perf_tool *tool, union perf_event *event, - struct perf_evlist **pevlist) + struct evlist **pevlist) { struct perf_inject *inject = container_of(tool, struct perf_inject, tool); @@ -215,13 +215,13 @@ static int perf_event__drop_aux(struct perf_tool *tool, typedef int (*inject_handler)(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, - struct perf_evsel *evsel, + struct evsel *evsel, struct machine *machine); static int perf_event__repipe_sample(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, - struct perf_evsel *evsel, + struct evsel *evsel, struct machine *machine) { if (evsel && evsel->handler) { @@ -424,7 +424,7 @@ static int dso__inject_build_id(struct dso *dso, struct perf_tool *tool, static int perf_event__inject_buildid(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, - struct perf_evsel *evsel __maybe_unused, + struct evsel *evsel __maybe_unused, struct machine *machine) { struct addr_location al; @@ -465,7 +465,7 @@ repipe: static int perf_inject__sched_process_exit(struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample, - struct perf_evsel *evsel __maybe_unused, + struct evsel *evsel __maybe_unused, struct machine *machine __maybe_unused) { struct perf_inject *inject = container_of(tool, struct perf_inject, tool); @@ -485,7 +485,7 @@ static int perf_inject__sched_process_exit(struct perf_tool *tool, static int perf_inject__sched_switch(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, - struct perf_evsel *evsel, + struct evsel *evsel, struct machine *machine) { struct perf_inject *inject = container_of(tool, struct perf_inject, tool); @@ -509,7 +509,7 @@ static int perf_inject__sched_switch(struct perf_tool *tool, static int perf_inject__sched_stat(struct perf_tool *tool, union perf_event *event __maybe_unused, struct perf_sample *sample, - struct perf_evsel *evsel, + struct evsel *evsel, struct machine *machine) { struct event_entry *ent; @@ -530,8 +530,8 @@ found: sample_sw.period = sample->period; sample_sw.time = sample->time; - perf_event__synthesize_sample(event_sw, evsel->attr.sample_type, - evsel->attr.read_format, &sample_sw); + perf_event__synthesize_sample(event_sw, evsel->core.attr.sample_type, + evsel->core.attr.read_format, &sample_sw); build_id__mark_dso_hit(tool, event_sw, &sample_sw, evsel, machine); return perf_event__repipe(tool, event_sw, &sample_sw, machine); } @@ -541,10 +541,10 @@ static void sig_handler(int sig __maybe_unused) session_done = 1; } -static int perf_evsel__check_stype(struct perf_evsel *evsel, +static int perf_evsel__check_stype(struct evsel *evsel, u64 sample_type, const char *sample_msg) { - struct perf_event_attr *attr = &evsel->attr; + struct perf_event_attr *attr = &evsel->core.attr; const char *name = perf_evsel__name(evsel); if (!(attr->sample_type & sample_type)) { @@ -559,7 +559,7 @@ static int perf_evsel__check_stype(struct perf_evsel *evsel, static int drop_sample(struct perf_tool *tool __maybe_unused, union perf_event *event __maybe_unused, struct perf_sample *sample __maybe_unused, - struct perf_evsel *evsel __maybe_unused, + struct evsel *evsel __maybe_unused, struct machine *machine __maybe_unused) { return 0; @@ -567,8 +567,8 @@ static int drop_sample(struct perf_tool *tool __maybe_unused, static void strip_init(struct perf_inject *inject) { - struct perf_evlist *evlist = inject->session->evlist; - struct perf_evsel *evsel; + struct evlist *evlist = inject->session->evlist; + struct evsel *evsel; inject->tool.context_switch = perf_event__drop; @@ -576,10 +576,10 @@ static void strip_init(struct perf_inject *inject) evsel->handler = drop_sample; } -static bool has_tracking(struct perf_evsel *evsel) +static bool has_tracking(struct evsel *evsel) { - return evsel->attr.mmap || evsel->attr.mmap2 || evsel->attr.comm || - evsel->attr.task; + return evsel->core.attr.mmap || evsel->core.attr.mmap2 || evsel->core.attr.comm || + evsel->core.attr.task; } #define COMPAT_MASK (PERF_SAMPLE_ID | PERF_SAMPLE_TID | PERF_SAMPLE_TIME | \ @@ -590,10 +590,10 @@ static bool has_tracking(struct perf_evsel *evsel) * their selected event to exist, except if there is only 1 selected event left * and it has a compatible sample type. */ -static bool ok_to_remove(struct perf_evlist *evlist, - struct perf_evsel *evsel_to_remove) +static bool ok_to_remove(struct evlist *evlist, + struct evsel *evsel_to_remove) { - struct perf_evsel *evsel; + struct evsel *evsel; int cnt = 0; bool ok = false; @@ -603,8 +603,8 @@ static bool ok_to_remove(struct perf_evlist *evlist, evlist__for_each_entry(evlist, evsel) { if (evsel->handler != drop_sample) { cnt += 1; - if ((evsel->attr.sample_type & COMPAT_MASK) == - (evsel_to_remove->attr.sample_type & COMPAT_MASK)) + if ((evsel->core.attr.sample_type & COMPAT_MASK) == + (evsel_to_remove->core.attr.sample_type & COMPAT_MASK)) ok = true; } } @@ -614,16 +614,16 @@ static bool ok_to_remove(struct perf_evlist *evlist, static void strip_fini(struct perf_inject *inject) { - struct perf_evlist *evlist = inject->session->evlist; - struct perf_evsel *evsel, *tmp; + struct evlist *evlist = inject->session->evlist; + struct evsel *evsel, *tmp; /* Remove non-synthesized evsels if possible */ evlist__for_each_entry_safe(evlist, tmp, evsel) { if (evsel->handler == drop_sample && ok_to_remove(evlist, evsel)) { pr_debug("Deleting %s\n", perf_evsel__name(evsel)); - perf_evlist__remove(evlist, evsel); - perf_evsel__delete(evsel); + evlist__remove(evlist, evsel); + evsel__delete(evsel); } } } @@ -651,7 +651,7 @@ static int __cmd_inject(struct perf_inject *inject) if (inject->build_ids) { inject->tool.sample = perf_event__inject_buildid; } else if (inject->sched_stat) { - struct perf_evsel *evsel; + struct evsel *evsel; evlist__for_each_entry(session->evlist, evsel) { const char *name = perf_evsel__name(evsel); @@ -712,7 +712,7 @@ static int __cmd_inject(struct perf_inject *inject) * remove the evsel. */ if (inject->itrace_synth_opts.set) { - struct perf_evsel *evsel; + struct evsel *evsel; perf_header__clear_feat(&session->header, HEADER_AUXTRACE); @@ -724,8 +724,8 @@ static int __cmd_inject(struct perf_inject *inject) if (evsel) { pr_debug("Deleting %s\n", perf_evsel__name(evsel)); - perf_evlist__remove(session->evlist, evsel); - perf_evsel__delete(evsel); + evlist__remove(session->evlist, evsel); + evsel__delete(evsel); } if (inject->strip) strip_fini(inject); |