|
From: tip-bot f. M. H. <mhi...@re...> - 2009-12-15 19:27:02
|
Commit-ID: 411edfe5c1ef02a62ec3be56d3e234dbed71ba20 Gitweb: http://git.kernel.org/tip/411edfe5c1ef02a62ec3be56d3e234dbed71ba20 Author: Masami Hiramatsu <mhi...@re...> AuthorDate: Tue, 15 Dec 2009 10:31:35 -0500 Committer: Ingo Molnar <mi...@el...> CommitDate: Tue, 15 Dec 2009 20:22:01 +0100 perf probe: Show need-dwarf message only if it is really needed Show need-dwarf message only if the probe is really requires debuginfo analysis. This also use pr_debug for debugging message instead of pr_warning. Signed-off-by: Masami Hiramatsu <mhi...@re...> Cc: Paul Mackerras <pa...@sa...> Cc: Arnaldo Carvalho de Melo <ac...@re...> Cc: Steven Rostedt <ro...@go...> Cc: Jim Keniston <jke...@us...> Cc: Ananth N Mavinakayanahalli <an...@in...> Cc: Christoph Hellwig <hc...@in...> Cc: Frank Ch. Eigler <fc...@re...> Cc: Jason Baron <jb...@re...> Cc: K.Prasad <pr...@li...> Cc: Peter Zijlstra <pe...@in...> Cc: Srikar Dronamraju <sr...@li...> Cc: systemtap <sys...@so...> Cc: DLE <dle...@li...> Cc: Frederic Weisbecker <fwe...@gm...> LKML-Reference: <200...@dh...> Signed-off-by: Ingo Molnar <mi...@el...> --- tools/perf/builtin-probe.c | 18 +++++++++++------- tools/perf/util/probe-finder.c | 4 +--- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 919037b..438a7bb 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -261,15 +261,19 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) lseek(fd, SEEK_SET, 0); ret = find_probepoint(fd, pp); - if (ret < 0) { - if (session.need_dwarf) - die("Could not analyze debuginfo."); - - pr_warning("An error occurred in debuginfo analysis. Try to use symbols.\n"); - break; - } + if (ret > 0) + continue; if (ret == 0) /* No error but failed to find probe point. */ die("No probe point found."); + /* Error path */ + if (session.need_dwarf) { + if (ret == -ENOENT) + pr_warning("No dwarf info found in the vmlinux - please rebuild with CONFIG_DEBUG_INFO=y.\n"); + die("Could not analyze debuginfo."); + } + pr_debug("An error occurred in debuginfo analysis." + " Try to use symbols.\n"); + break; } close(fd); diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 4585f1d..4b852c0 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -687,10 +687,8 @@ int find_probepoint(int fd, struct probe_point *pp) struct probe_finder pf = {.pp = pp}; ret = dwarf_init(fd, DW_DLC_READ, 0, 0, &__dw_debug, &__dw_error); - if (ret != DW_DLV_OK) { - pr_warning("No dwarf info found in the vmlinux - please rebuild with CONFIG_DEBUG_INFO.\n"); + if (ret != DW_DLV_OK) return -ENOENT; - } pp->found = 0; while (++cu_number) { |