mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf annotate: Improve error message for symbol filter
@ 2016-07-06  8:50 Namhyung Kim
  0 siblings, 0 replies; only message in thread
From: Namhyung Kim @ 2016-07-06  8:50 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ingo Molnar, Peter Zijlstra, Jiri Olsa, LKML, David Ahern, Andi Kleen

When symbol filter is given and it doesn't have a sample, the error
message is a bit confusing.

Before:

  $ perf annotate --stdio non_existing_function
  Error:
  The perf.data file has no samples!

After:

  $ perf annotate --stdio non_existing_function
  Error:
  The non_existing_function symbol has no samples!

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/builtin-annotate.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 9c1034d81b4f..ba8a75ec5801 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -256,7 +256,13 @@ static int __cmd_annotate(struct perf_annotate *ann)
 	}
 
 	if (total_nr_samples == 0) {
-		ui__error("The %s file has no samples!\n", session->file->path);
+		if (ann->sym_hist_filter) {
+			ui__error("The %s symbol has no samples!\n",
+				  ann->sym_hist_filter);
+		} else {
+			ui__error("The %s file has no samples!\n",
+				  session->file->path);
+		}
 		goto out;
 	}
 
-- 
2.8.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-07-06  8:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-06  8:50 [PATCH] perf annotate: Improve error message for symbol filter Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®