From 8737ebdea02315eaffaebb3b73d55f2f726a4fe0 Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Thu, 10 Feb 2011 18:08:16 +0900 Subject: [PATCH] perf probe: Show filename which contains target function Show filename which contains a target function with the function name on "--lines" mode, because perf-probe just shows the first function even if there are many same-name functions. Originally adopted by Franck Bui-Huu's patch which shows file name instead of function name. I've just modified it to show both of function name and file name, because of completeness of output. E.g.) $ perf probe -L t_show 0 static int t_show(struct seq_file *m, void *v) 1 { 2 struct ftrace_iterator *iter = m->private; ... $ perf probe -L t_show@trace/trace.c 0 static int t_show(struct seq_file *m, void *v) 1 { struct tracer *t = v; ... Original-patch-by: Franck Bui-Huu Cc: 2nddept-manager@sdl.hitachi.co.jp Cc: Franck Bui-Huu Cc: Ingo Molnar Cc: Paul Mackerras Cc: Peter Zijlstra LKML-Reference: <20110210090816.1809.43426.stgit@ltc236.sdl.hitachi.co.jp> Signed-off-by: Masami Hiramatsu Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index cbd76507a56f..0e3ea1321103 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -409,7 +409,7 @@ int show_line_range(struct line_range *lr, const char *module) setup_pager(); if (lr->function) - fprintf(stdout, "<%s:%d>\n", lr->function, + fprintf(stdout, "<%s@%s:%d>\n", lr->function, lr->path, lr->start - lr->offset); else fprintf(stdout, "<%s:%d>\n", lr->path, lr->start); -- 2.20.1