diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-08-07 20:16:24 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-09 06:54:42 -0400 |
commit | b1a88349c37624755b28ac3b3152b48f52c1f487 (patch) | |
tree | 7dbcf52f06be731e6041c0371b9b185d92cf1eed /tools | |
parent | b0efe213f84f7fd5ccfe07053e3d9fb827b7c188 (diff) |
perf tools: callchain: Fix 'perf report' display to be callchain by default
If we recorded with -g option to record the callchain, right now
we require a -g option to perf report as well - and people reported
this as unnecessary complication: the user already specified -g
once, no need to require it a second time.
So if the recording includes call-chains, display the callchain by
default from perf report.
( The user can override this default using "-g none" option from
perf report. )
Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
LKML-Reference: <1249690585-9145-3-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-report.c | 16 | ||||
-rw-r--r-- | tools/perf/util/callchain.h | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index a5e2f8df411c..c4a8e108e521 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c | |||
@@ -68,7 +68,7 @@ static int callchain; | |||
68 | 68 | ||
69 | static | 69 | static |
70 | struct callchain_param callchain_param = { | 70 | struct callchain_param callchain_param = { |
71 | .mode = CHAIN_GRAPH_ABS, | 71 | .mode = CHAIN_GRAPH_REL, |
72 | .min_percent = 0.5 | 72 | .min_percent = 0.5 |
73 | }; | 73 | }; |
74 | 74 | ||
@@ -1836,6 +1836,13 @@ static int __cmd_report(void) | |||
1836 | " -g?\n"); | 1836 | " -g?\n"); |
1837 | exit(-1); | 1837 | exit(-1); |
1838 | } | 1838 | } |
1839 | } else if (callchain_param.mode != CHAIN_NONE && !callchain) { | ||
1840 | callchain = 1; | ||
1841 | if (register_callchain_param(&callchain_param) < 0) { | ||
1842 | fprintf(stderr, "Can't register callchain" | ||
1843 | " params\n"); | ||
1844 | exit(-1); | ||
1845 | } | ||
1839 | } | 1846 | } |
1840 | 1847 | ||
1841 | if (load_kernel() < 0) { | 1848 | if (load_kernel() < 0) { |
@@ -1974,6 +1981,13 @@ parse_callchain_opt(const struct option *opt __used, const char *arg, | |||
1974 | else if (!strncmp(tok, "fractal", strlen(arg))) | 1981 | else if (!strncmp(tok, "fractal", strlen(arg))) |
1975 | callchain_param.mode = CHAIN_GRAPH_REL; | 1982 | callchain_param.mode = CHAIN_GRAPH_REL; |
1976 | 1983 | ||
1984 | else if (!strncmp(tok, "none", strlen(arg))) { | ||
1985 | callchain_param.mode = CHAIN_NONE; | ||
1986 | callchain = 0; | ||
1987 | |||
1988 | return 0; | ||
1989 | } | ||
1990 | |||
1977 | else | 1991 | else |
1978 | return -1; | 1992 | return -1; |
1979 | 1993 | ||
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h index b2d128e07c88..a926ae4f5a16 100644 --- a/tools/perf/util/callchain.h +++ b/tools/perf/util/callchain.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include "symbol.h" | 7 | #include "symbol.h" |
8 | 8 | ||
9 | enum chain_mode { | 9 | enum chain_mode { |
10 | CHAIN_NONE, | ||
10 | CHAIN_FLAT, | 11 | CHAIN_FLAT, |
11 | CHAIN_GRAPH_ABS, | 12 | CHAIN_GRAPH_ABS, |
12 | CHAIN_GRAPH_REL | 13 | CHAIN_GRAPH_REL |