Skip to content

Commit 74cfc17

Browse files
committed
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>
1 parent 712a4b6 commit 74cfc17

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎tools/perf/builtin-report.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@ static int __cmd_report(void)
350350
perf_session__fprintf_dsos(session, stdout);
351351

352352
next = rb_first(&session->hists_tree);
353+
354+
if (next == NULL) {
355+
ui__warning("The %s file has no samples!\n", input_name);
356+
goto out_delete;
357+
}
358+
353359
while (next) {
354360
struct hists *hists;
355361

0 commit comments

Comments
 (0)