Skip to content

Commit

Permalink
perf report: Tell the user when a perf.data file has no samples
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
Arnaldo Carvalho de Melo committed Feb 17, 2011
1 parent 712a4b6 commit 74cfc17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 74cfc17

Please sign in to comment.