aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2018-05-25 16:28:37 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-06-04 09:28:52 -0400
commit982d410bc6b405a75086236d3c1da1f18c40d6dd (patch)
tree79c972cc96866830d8bd0aa8778aeb24740094cb /tools/perf/builtin-top.c
parent9132d3d92d8953ee79690408a9a24d938be22cd8 (diff)
perf annotate stdio: Use annotation_options consistently
Accross all the routines, this way we can have eventually have a consistent set of defaults for all UIs. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-6qgtixurjgdk5u0n3rw78ges@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 4284840022a3..5e58cd4de90b 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -243,10 +243,9 @@ static void perf_top__show_details(struct perf_top *top)
243 goto out_unlock; 243 goto out_unlock;
244 244
245 printf("Showing %s for %s\n", perf_evsel__name(top->sym_evsel), symbol->name); 245 printf("Showing %s for %s\n", perf_evsel__name(top->sym_evsel), symbol->name);
246 printf(" Events Pcnt (>=%d%%)\n", top->sym_pcnt_filter); 246 printf(" Events Pcnt (>=%d%%)\n", top->annotation_opts.min_pcnt);
247 247
248 more = symbol__annotate_printf(symbol, he->ms.map, top->sym_evsel, 248 more = symbol__annotate_printf(symbol, he->ms.map, top->sym_evsel, &top->annotation_opts);
249 0, top->sym_pcnt_filter, top->print_entries, 4);
250 249
251 if (top->evlist->enabled) { 250 if (top->evlist->enabled) {
252 if (top->zero) 251 if (top->zero)
@@ -406,7 +405,7 @@ static void perf_top__print_mapped_keys(struct perf_top *top)
406 405
407 fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", top->count_filter); 406 fprintf(stdout, "\t[f] profile display filter (count). \t(%d)\n", top->count_filter);
408 407
409 fprintf(stdout, "\t[F] annotate display filter (percent). \t(%d%%)\n", top->sym_pcnt_filter); 408 fprintf(stdout, "\t[F] annotate display filter (percent). \t(%d%%)\n", top->annotation_opts.min_pcnt);
410 fprintf(stdout, "\t[s] annotate symbol. \t(%s)\n", name?: "NULL"); 409 fprintf(stdout, "\t[s] annotate symbol. \t(%s)\n", name?: "NULL");
411 fprintf(stdout, "\t[S] stop annotation.\n"); 410 fprintf(stdout, "\t[S] stop annotation.\n");
412 411
@@ -509,7 +508,7 @@ static bool perf_top__handle_keypress(struct perf_top *top, int c)
509 prompt_integer(&top->count_filter, "Enter display event count filter"); 508 prompt_integer(&top->count_filter, "Enter display event count filter");
510 break; 509 break;
511 case 'F': 510 case 'F':
512 prompt_percent(&top->sym_pcnt_filter, 511 prompt_percent(&top->annotation_opts.min_pcnt,
513 "Enter details display event filter (percent)"); 512 "Enter details display event filter (percent)");
514 break; 513 break;
515 case 'K': 514 case 'K':
@@ -1259,7 +1258,7 @@ int cmd_top(int argc, const char **argv)
1259 .overwrite = 1, 1258 .overwrite = 1,
1260 }, 1259 },
1261 .max_stack = sysctl__max_stack(), 1260 .max_stack = sysctl__max_stack(),
1262 .sym_pcnt_filter = 5, 1261 .annotation_opts = annotation__default_options,
1263 .nr_threads_synthesize = UINT_MAX, 1262 .nr_threads_synthesize = UINT_MAX,
1264 }; 1263 };
1265 struct record_opts *opts = &top.record_opts; 1264 struct record_opts *opts = &top.record_opts;
@@ -1385,6 +1384,9 @@ int cmd_top(int argc, const char **argv)
1385 if (status < 0) 1384 if (status < 0)
1386 return status; 1385 return status;
1387 1386
1387 top.annotation_opts.min_pcnt = 5;
1388 top.annotation_opts.context = 4;
1389
1388 top.evlist = perf_evlist__new(); 1390 top.evlist = perf_evlist__new();
1389 if (top.evlist == NULL) 1391 if (top.evlist == NULL)
1390 return -ENOMEM; 1392 return -ENOMEM;