Commit ae779a63 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

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: default avatarJiri Olsa <jolsa@redhat.com>
Tested-by: default avatarDavid Ahern <dsahern@gmail.com>
Tested-by: default avatarIngo Molnar <mingo@kernel.org>
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Acked-by: default avatarIngo 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 09b0fd45
...@@ -140,20 +140,12 @@ Default is to monitor all CPUS. ...@@ -140,20 +140,12 @@ Default is to monitor all CPUS.
--asm-raw:: --asm-raw::
Show raw instruction encoding of assembly instructions. Show raw instruction encoding of assembly instructions.
-G [type,min,order]:: -G::
Enables call-graph (stack chain/backtrace) recording.
--call-graph:: --call-graph::
Display call chains using type, min percent threshold and order. Setup and enable call-graph (stack chain/backtrace) recording,
type can be either: implies -G.
- flat: single column, linear exposure of call chains.
- graph: use a graph tree, displaying absolute overhead rates.
- fractal: like graph, but displays relative rates. Each branch of
the tree is considered as a new profiled object.
order can be either:
- callee: callee based call graph.
- caller: inverted caller based call graph.
Default: fractal,0.5,callee.
--ignore-callees=<regex>:: --ignore-callees=<regex>::
Ignore callees of the function(s) matching the given regex. Ignore callees of the function(s) matching the given regex.
......
...@@ -1016,16 +1016,16 @@ static int __cmd_top(struct perf_top *top) ...@@ -1016,16 +1016,16 @@ static int __cmd_top(struct perf_top *top)
} }
static int static int
parse_callchain_opt(const struct option *opt, const char *arg, int unset) callchain_opt(const struct option *opt, const char *arg, int unset)
{ {
/*
* --no-call-graph
*/
if (unset)
return 0;
symbol_conf.use_callchain = true; symbol_conf.use_callchain = true;
return record_callchain_opt(opt, arg, unset);
}
static int
parse_callchain_opt(const struct option *opt, const char *arg, int unset)
{
symbol_conf.use_callchain = true;
return record_parse_callchain_opt(opt, arg, unset); return record_parse_callchain_opt(opt, arg, unset);
} }
...@@ -1106,9 +1106,12 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) ...@@ -1106,9 +1106,12 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
"sort by key(s): pid, comm, dso, symbol, parent, weight, local_weight"), "sort by key(s): pid, comm, dso, symbol, parent, weight, local_weight"),
OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples, OPT_BOOLEAN('n', "show-nr-samples", &symbol_conf.show_nr_samples,
"Show a column with the number of samples"), "Show a column with the number of samples"),
OPT_CALLBACK_DEFAULT('G', "call-graph", &top.record_opts, OPT_CALLBACK_NOOPT('G', NULL, &top.record_opts,
"mode[,dump_size]", record_callchain_help, NULL, "enables call-graph recording",
&parse_callchain_opt, "fp"), &callchain_opt),
OPT_CALLBACK(0, "call-graph", &top.record_opts,
"mode[,dump_size]", record_callchain_help,
&parse_callchain_opt),
OPT_CALLBACK(0, "ignore-callees", NULL, "regex", OPT_CALLBACK(0, "ignore-callees", NULL, "regex",
"ignore callees of these functions in call graphs", "ignore callees of these functions in call graphs",
report_parse_ignore_callees_opt), report_parse_ignore_callees_opt),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment