diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-01-05 08:54:45 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-01-13 04:09:10 -0500 |
commit | b9a63b9b56d6910a25e3d4905525aef150420a9b (patch) | |
tree | fb31094583f801d9ceae0bfea465244c07686b90 /tools/perf/builtin-report.c | |
parent | de1764892a61a3ed212973cc028c80dd083179dd (diff) |
perf report: Fix --no-call-chain option handling
To avoid the funny:
[root@doppio ~]# perf record -a -f sleep 2s
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.334 MB perf.data (~14572 samples) ]
[root@doppio ~]# perf report --no-call-graph
selected -g but no callchain data. Did you call perf record without -g?
And fix the bug reported by peterz when we do indeed record with
callchains and then ask for a report without:
[root@doppio ~]# perf record -a -g -f sleep 2s
[root@doppio ~]# perf report --no-call-graph
Segmentation fault
[root@doppio ~]#
Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1262699685-27820-1-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools/perf/builtin-report.c')
-rw-r--r-- | tools/perf/builtin-report.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 4292d7afcd60..80d691a4191f 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -35,6 +35,7 @@ static char const *input_name = "perf.data"; | |||
35 | 35 | ||
36 | static int force; | 36 | static int force; |
37 | static bool hide_unresolved; | 37 | static bool hide_unresolved; |
38 | static bool dont_use_callchains; | ||
38 | 39 | ||
39 | static int show_threads; | 40 | static int show_threads; |
40 | static struct perf_read_values show_threads_values; | 41 | static struct perf_read_values show_threads_values; |
@@ -172,7 +173,8 @@ static int perf_session__setup_sample_type(struct perf_session *self) | |||
172 | " -g?\n"); | 173 | " -g?\n"); |
173 | return -1; | 174 | return -1; |
174 | } | 175 | } |
175 | } else if (callchain_param.mode != CHAIN_NONE && !symbol_conf.use_callchain) { | 176 | } else if (!dont_use_callchains && callchain_param.mode != CHAIN_NONE && |
177 | !symbol_conf.use_callchain) { | ||
176 | symbol_conf.use_callchain = true; | 178 | symbol_conf.use_callchain = true; |
177 | if (register_callchain_param(&callchain_param) < 0) { | 179 | if (register_callchain_param(&callchain_param) < 0) { |
178 | fprintf(stderr, "Can't register callchain" | 180 | fprintf(stderr, "Can't register callchain" |
@@ -246,11 +248,19 @@ out_delete: | |||
246 | 248 | ||
247 | static int | 249 | static int |
248 | parse_callchain_opt(const struct option *opt __used, const char *arg, | 250 | parse_callchain_opt(const struct option *opt __used, const char *arg, |
249 | int unset __used) | 251 | int unset) |
250 | { | 252 | { |
251 | char *tok; | 253 | char *tok; |
252 | char *endptr; | 254 | char *endptr; |
253 | 255 | ||
256 | /* | ||
257 | * --no-call-graph | ||
258 | */ | ||
259 | if (unset) { | ||
260 | dont_use_callchains = true; | ||
261 | return 0; | ||
262 | } | ||
263 | |||
254 | symbol_conf.use_callchain = true; | 264 | symbol_conf.use_callchain = true; |
255 | 265 | ||
256 | if (!arg) | 266 | if (!arg) |