diff options
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 4fd31d29b2ab..7b6cde87d2af 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -35,6 +35,7 @@ #include "util/mmap.h" #include "util/session.h" #include "util/thread.h" +#include "util/stat.h" #include "util/symbol.h" #include "util/synthetic-events.h" #include "util/top.h" @@ -263,7 +264,7 @@ static void perf_top__show_details(struct perf_top *top) printf("Showing %s for %s\n", evsel__name(top->sym_evsel), symbol->name); printf(" Events Pcnt (>=%d%%)\n", annotate_opts.min_pcnt); - more = symbol__annotate_printf(&he->ms, top->sym_evsel); + more = hist_entry__annotate_printf(he, top->sym_evsel); if (top->evlist->enabled) { if (top->zero) @@ -1157,6 +1158,7 @@ static int deliver_event(struct ordered_events *qe, return 0; } + perf_sample__init(&sample, /*all=*/false); ret = evlist__parse_sample(evlist, event, &sample); if (ret) { pr_err("Can't parse sample, err = %d\n", ret); @@ -1167,8 +1169,10 @@ static int deliver_event(struct ordered_events *qe, assert(evsel != NULL); if (event->header.type == PERF_RECORD_SAMPLE) { - if (evswitch__discard(&top->evswitch, evsel)) - return 0; + if (evswitch__discard(&top->evswitch, evsel)) { + ret = 0; + goto next_event; + } ++top->samples; } @@ -1219,6 +1223,7 @@ static int deliver_event(struct ordered_events *qe, ret = 0; next_event: + perf_sample__exit(&sample); return ret; } @@ -1305,7 +1310,11 @@ static int __cmd_top(struct perf_top *top) } } - evlist__uniquify_name(top->evlist); + /* + * Use global stat_config that is zero meaning aggr_mode is AGGR_NONE + * and hybrid_merge is false. + */ + evlist__uniquify_evsel_names(top->evlist, &stat_config); ret = perf_top__start_counters(top); if (ret) return ret; @@ -1786,7 +1795,7 @@ int cmd_top(int argc, const char **argv) if (!callchain_param.enabled) { symbol_conf.cumulate_callchain = false; - perf_hpp__cancel_cumulate(); + perf_hpp__cancel_cumulate(top.evlist); } if (symbol_conf.cumulate_callchain && !callchain_param.order_set) @@ -1818,6 +1827,9 @@ int cmd_top(int argc, const char **argv) goto out_delete_evlist; } + if (!evlist__needs_bpf_sb_event(top.evlist)) + top.record_opts.no_bpf_event = true; + #ifdef HAVE_LIBBPF_SUPPORT if (!top.record_opts.no_bpf_event) { top.sb_evlist = evlist__new(); |