diff options
-rw-r--r-- | tools/perf/Documentation/perf-top.txt | 18 | ||||
-rw-r--r-- | tools/perf/builtin-top.c | 23 |
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 | ||
1018 | static int | 1018 | static int |
1019 | parse_callchain_opt(const struct option *opt, const char *arg, int unset) | 1019 | callchain_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 | ||
1025 | static int | ||
1026 | parse_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), |