aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2013-08-07 07:38:55 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-08-07 16:35:35 -0400
commit34f77abcb34e1da4ee3ca5c5a41b673664eee1fa (patch)
treea439d12a05fe89460dd9e2768a8c68bd0454fb42 /tools/perf/ui
parentbbb7f846f88df05646795854a014d73fb00f3b8b (diff)
perf annotate: Put dso name in symbol annotation title
Currently the symbol name is displayed at the top when displaying symbol annotation. Add to this the dso long name. Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1375875537-4509-12-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r--tools/perf/ui/browsers/annotate.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c
index cc64d3f7fc36..0f88a77788fa 100644
--- a/tools/perf/ui/browsers/annotate.c
+++ b/tools/perf/ui/browsers/annotate.c
@@ -428,6 +428,14 @@ static void annotate_browser__init_asm_mode(struct annotate_browser *browser)
428 browser->b.nr_entries = browser->nr_asm_entries; 428 browser->b.nr_entries = browser->nr_asm_entries;
429} 429}
430 430
431#define SYM_TITLE_MAX_SIZE (PATH_MAX + 64)
432
433static int sym_title(struct symbol *sym, struct map *map, char *title,
434 size_t sz)
435{
436 return snprintf(title, sz, "%s %s", sym->name, map->dso->long_name);
437}
438
431static bool annotate_browser__callq(struct annotate_browser *browser, 439static bool annotate_browser__callq(struct annotate_browser *browser,
432 struct perf_evsel *evsel, 440 struct perf_evsel *evsel,
433 struct hist_browser_timer *hbt) 441 struct hist_browser_timer *hbt)
@@ -438,6 +446,7 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
438 struct annotation *notes; 446 struct annotation *notes;
439 struct symbol *target; 447 struct symbol *target;
440 u64 ip; 448 u64 ip;
449 char title[SYM_TITLE_MAX_SIZE];
441 450
442 if (!ins__is_call(dl->ins)) 451 if (!ins__is_call(dl->ins))
443 return false; 452 return false;
@@ -461,7 +470,8 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
461 470
462 pthread_mutex_unlock(&notes->lock); 471 pthread_mutex_unlock(&notes->lock);
463 symbol__tui_annotate(target, ms->map, evsel, hbt); 472 symbol__tui_annotate(target, ms->map, evsel, hbt);
464 ui_browser__show_title(&browser->b, sym->name); 473 sym_title(sym, ms->map, title, sizeof(title));
474 ui_browser__show_title(&browser->b, title);
465 return true; 475 return true;
466} 476}
467 477
@@ -653,8 +663,10 @@ static int annotate_browser__run(struct annotate_browser *browser,
653 const char *help = "Press 'h' for help on key bindings"; 663 const char *help = "Press 'h' for help on key bindings";
654 int delay_secs = hbt ? hbt->refresh : 0; 664 int delay_secs = hbt ? hbt->refresh : 0;
655 int key; 665 int key;
666 char title[SYM_TITLE_MAX_SIZE];
656 667
657 if (ui_browser__show(&browser->b, sym->name, help) < 0) 668 sym_title(sym, ms->map, title, sizeof(title));
669 if (ui_browser__show(&browser->b, title, help) < 0)
658 return -1; 670 return -1;
659 671
660 annotate_browser__calc_percent(browser, evsel); 672 annotate_browser__calc_percent(browser, evsel);