[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-91b4eaea93f5be95f4477554399680a53aff2343@git.kernel.org>
Date: Sun, 5 Jul 2009 09:51:51 GMT
From: tip-bot for Frederic Weisbecker <fweisbec@...il.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, anton@...ba.org, paulus@...ba.org,
acme@...hat.com, hpa@...or.com, mingo@...hat.com,
a.p.zijlstra@...llo.nl, efault@....de, jens.axboe@...cle.com,
fweisbec@...il.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:perfcounters/urgent] perf report: Warn on callchain output request from non-callchain file
Commit-ID: 91b4eaea93f5be95f4477554399680a53aff2343
Gitweb: http://git.kernel.org/tip/91b4eaea93f5be95f4477554399680a53aff2343
Author: Frederic Weisbecker <fweisbec@...il.com>
AuthorDate: Sun, 5 Jul 2009 07:39:17 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Sun, 5 Jul 2009 10:30:21 +0200
perf report: Warn on callchain output request from non-callchain file
perf report segfaults while trying to handle callchains from a non
callchain data file.
Instead of a segfault, print a useful message to the user.
Reported-by: Jens Axboe <jens.axboe@...cle.com>
Reported-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@...il.com>
Cc: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Mike Galbraith <efault@....de>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Anton Blanchard <anton@...ba.org>
Cc: Jens Axboe <jens.axboe@...cle.com>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
LKML-Reference: <1246772361-9960-1-git-send-email-fweisbec@...il.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
tools/perf/builtin-report.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index fa937f5..9f9575a 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -1684,9 +1684,19 @@ static int __cmd_report(void)
sample_type = perf_header__sample_type();
- if (sort__has_parent && !(sample_type & PERF_SAMPLE_CALLCHAIN)) {
- fprintf(stderr, "selected --sort parent, but no callchain data\n");
- exit(-1);
+ if (!(sample_type & PERF_SAMPLE_CALLCHAIN)) {
+ if (sort__has_parent) {
+ fprintf(stderr, "selected --sort parent, but no"
+ " callchain data. Did you call"
+ " perf record without -g?\n");
+ exit(-1);
+ }
+ if (callchain) {
+ fprintf(stderr, "selected -c but no callchain data."
+ " Did you call perf record without"
+ " -g?\n");
+ exit(-1);
+ }
}
if (load_kernel() < 0) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists