Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757009Ab1BRKjT (ORCPT ); Fri, 18 Feb 2011 05:39:19 -0500 Received: from hera.kernel.org ([140.211.167.34]:53348 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756718Ab1BRKjO (ORCPT ); Fri, 18 Feb 2011 05:39:14 -0500 Date: Fri, 18 Feb 2011 10:38:24 GMT From: tip-bot for Arnaldo Carvalho de Melo Cc: linux-kernel@vger.kernel.org, eranian@google.com, paulus@samba.org, acme@redhat.com, hpa@zytor.com, mingo@redhat.com, tzanussi@gmail.com, peterz@infradead.org, efault@gmx.de, fweisbec@gmail.com, rostedt@goodmis.org, tglx@linutronix.de, mingo@elte.hu Reply-To: mingo@redhat.com, hpa@zytor.com, acme@redhat.com, paulus@samba.org, eranian@google.com, linux-kernel@vger.kernel.org, tzanussi@gmail.com, efault@gmx.de, peterz@infradead.org, fweisbec@gmail.com, rostedt@goodmis.org, tglx@linutronix.de, mingo@elte.hu In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf report: Tell the user when a perf.data file has no samples Message-ID: Git-Commit-ID: 74cfc17dc1a69c37ce6c8a76c1ce84bcb796eb0e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (hera.kernel.org [127.0.0.1]); Fri, 18 Feb 2011 10:38:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1800 Lines: 52 Commit-ID: 74cfc17dc1a69c37ce6c8a76c1ce84bcb796eb0e Gitweb: http://git.kernel.org/tip/74cfc17dc1a69c37ce6c8a76c1ce84bcb796eb0e Author: Arnaldo Carvalho de Melo AuthorDate: Thu, 17 Feb 2011 14:40:46 -0200 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 17 Feb 2011 14:40:46 -0200 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 Cc: Frederic Weisbecker Cc: Ingo Molnar Cc: Mike Galbraith Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Cc: Steven Rostedt Cc: Tom Zanussi LKML-Reference: Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-report.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index f9a99a1..dddcc7e 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; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/