aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Olsa <jolsa@redhat.com>2013-10-26 10:25:34 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-10-28 15:06:00 -0400
commitae779a630977d93fbebfa06216ea47df5b5c62c8 (patch)
tree9bc0ce90c63e3be089e55da69075f2109f6ca647
parent09b0fd45ff63413df94cbd832a765076b201edbb (diff)
perf top: Split -G and --call-graph
Splitting -G and --call-graph for record command, so we could use '-G' with no option. The '-G' option now takes NO argument and enables the configured unwind method, which is currently the frame pointers method. It will be possible to configure unwind method via config file in upcoming patches. All current '-G' arguments is overtaken by --call-graph option. NOTE: The documentation for top --call-graph option was wrongly copied from report command. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Tested-by: David Ahern <dsahern@gmail.com> Tested-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: David Ahern <dsahern@gmail.com> Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1382797536-32303-3-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/Documentation/perf-top.txt18
-rw-r--r--tools/perf/builtin-top.c23
2 files changed, 18 insertions, 23 deletions
diff --git a/tools/perf/Documentation/perf-top.txt b/tools/perf/Documentation/perf-top.txt
index 58d6598a9686..6a118e71d003 100644
--- a/tools/perf/Documentation/perf-top.txt
+++ b/tools/perf/Documentation/perf-top.txt
@@ -140,20 +140,12 @@ Default is to monitor all CPUS.
140--asm-raw:: 140--asm-raw::
141 Show raw instruction encoding of assembly instructions. 141 Show raw instruction encoding of assembly instructions.
142 142
143-G [type,min,order]:: 143-G::
144 Enables call-graph (stack chain/backtrace) recording.
145
144--call-graph:: 146--call-graph::
145 Display call chains using type, min percent threshold and order. 147 Setup and enable call-graph (stack chain/backtrace) recording,
146 type can be either: 148 implies -G.
147 - flat: single column, linear exposure of call chains.
148 - graph: use a graph tree, displaying absolute overhead rates.
149 - fractal: like graph, but displays relative rates. Each branch of
150 the tree is considered as a new profiled object.
151
152 order can be either:
153 - callee: callee based call graph.
154 - caller: inverted caller based call graph.
155
156 Default: fractal,0.5,callee.
157 149
158--ignore-callees=<regex>:: 150--ignore-callees=<regex>::
159 Ignore callees of the function(s) matching the given regex. 151 Ignore callees of the function(s) matching the given regex.
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 212214162bb2..0df298a0e946 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -1016,16 +1016,16 @@ out_delete:
1016} 1016}
1017 1017
1018static int 1018static int
1019parse_callchain_opt(const struct option *opt, const char *arg, int unset) 1019callchain_opt(const struct option *opt, const char *arg, int unset)
1020{ 1020{
1021 /*
1022 * --no-call-graph
1023 */
1024 if (unset)
1025 return 0;
1026
1027 symbol_conf.use_callchain = true; 1021 symbol_conf.use_callchain = true;
1022 return record_callchain_opt(opt, arg, unset);
1023}
1028 1024
1025static int
1026parse_callchain_opt(const struct option *opt, const char *arg, int unset)
1027{
1028 symbol_conf.use_callchain = true;
1029 return record_parse_callchain_opt(opt, arg, unset); 1029 return record_parse_callchain_opt(opt, arg, unset);
1030} 1030}
1031 1031
@@ -1106,9 +1106,12 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
1106 "sort by key(s): pid, comm, dso, symbol, parent, weight, local_weight"), 1106 "sort by key(s): pid, comm, dso, symbol, parent, weight, local_weight"),
1107 OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, 1107 OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
1108 "Show a column with the number of samples"), 1108 "Show a column with the number of samples"),
1109 OPT_CALLBACK_DEFAULT('G', "call-graph", &top.record_opts, 1109 OPT_CALLBACK_NOOPT('G', NULL, &top.record_opts,
1110 "mode[,dump_size]", record_callchain_help, 1110 NULL, "enables call-graph recording",
1111 &parse_callchain_opt, "fp"), 1111 &callchain_opt),
1112 OPT_CALLBACK(0, "call-graph", &top.record_opts,
1113 "mode[,dump_size]", record_callchain_help,
1114 &parse_callchain_opt),
1112 OPT_CALLBACK(0, "ignore-callees", NULL, "regex", 1115 OPT_CALLBACK(0, "ignore-callees", NULL, "regex",
1113 "ignore callees of these functions in call graphs", 1116 "ignore callees of these functions in call graphs",
1114 report_parse_ignore_callees_opt), 1117 report_parse_ignore_callees_opt),