summaryrefslogtreecommitdiff
path: root/tools/perf/builtin-report.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2011-02-17 19:40:46 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2011-02-17 19:40:46 +0300
commit74cfc17dc1a69c37ce6c8a76c1ce84bcb796eb0e (patch)
tree81b87743f35b80f30b63a8d5be16c2152934ece1 /tools/perf/builtin-report.c
parent712a4b6049724278121d56aba683151d86c8c35a (diff)
downloadlinux-74cfc17dc1a69c37ce6c8a76c1ce84bcb796eb0e.tar.xz
perf report: Tell the user when a perf.data file has no samples
[root@emilia ~]# perf report --stdio The perf.data file has no samples! [root@emilia ~]# The TUI shows a popup warning message with the same message. Reported-by: Ingo Molnar <mingo@elte.hu> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Mike Galbraith <efault@gmx.de> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Tom Zanussi <tzanussi@gmail.com> LKML-Reference: <new-submission> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r--tools/perf/builtin-report.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index f9a99a1ce609..dddcc7ea2bec 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -350,6 +350,12 @@ static int __cmd_report(void)
perf_session__fprintf_dsos(session, stdout);
next = rb_first(&session->hists_tree);
+
+ if (next == NULL) {
+ ui__warning("The %s file has no samples!\n", input_name);
+ goto out_delete;
+ }
+
while (next) {
struct hists *hists;