From 7ef17aafc98406d01ebbf7fe98ef1332b70d20bb Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Tue, 15 Dec 2009 10:32:47 -0500 Subject: perf probe: Fix to show which probe point is not found Fix perf probe to show which probe point is not found. With out this patch, it shows just "No probe point found." This doesn't help users if they specify several probes. e.g. # perf probe -f --add schedule --add test Fatal: No probe point found. This patch makes error message more helpful as below. # perf probe --add schedule --add test Fatal: Probe point 'test' not found. - probe not added. Signed-off-by: Masami Hiramatsu Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo Cc: Steven Rostedt Cc: Jim Keniston Cc: Ananth N Mavinakayanahalli Cc: Christoph Hellwig Cc: Frank Ch. Eigler Cc: Jason Baron Cc: K.Prasad Cc: Peter Zijlstra Cc: Srikar Dronamraju Cc: systemtap Cc: DLE Cc: Frederic Weisbecker LKML-Reference: <20091215153247.17436.49068.stgit@dhcp-100-2-132.bos.redhat.com> Signed-off-by: Ingo Molnar --- tools/perf/builtin-probe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tools/perf/builtin-probe.c') diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c index 6b0e4cf322d..520b064b46d 100644 --- a/tools/perf/builtin-probe.c +++ b/tools/perf/builtin-probe.c @@ -265,8 +265,11 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used) ret = find_probepoint(fd, pp); if (ret > 0) continue; - if (ret == 0) /* No error but failed to find probe point. */ - die("No probe point found."); + if (ret == 0) { /* No error but failed to find probe point. */ + synthesize_perf_probe_point(pp); + die("Probe point '%s' not found. - probe not added.", + pp->probes[0]); + } /* Error path */ if (session.need_dwarf) { if (ret == -ENOENT) -- cgit v1.2.3