diff options
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 76cd510d34d0..ed99ec4a309f 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -991,6 +991,16 @@ parse_callchain_opt(const struct option *opt, const char *arg, int unset) | |||
991 | return record_parse_callchain_opt(opt, arg, unset); | 991 | return record_parse_callchain_opt(opt, arg, unset); |
992 | } | 992 | } |
993 | 993 | ||
994 | static int perf_top_config(const char *var, const char *value, void *cb) | ||
995 | { | ||
996 | struct perf_top *top = cb; | ||
997 | |||
998 | if (!strcmp(var, "top.call-graph")) | ||
999 | return record_parse_callchain(value, &top->record_opts); | ||
1000 | |||
1001 | return perf_default_config(var, value, cb); | ||
1002 | } | ||
1003 | |||
994 | static int | 1004 | static int |
995 | parse_percent_limit(const struct option *opt, const char *arg, | 1005 | parse_percent_limit(const struct option *opt, const char *arg, |
996 | int unset __maybe_unused) | 1006 | int unset __maybe_unused) |
@@ -1115,6 +1125,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) | |||
1115 | if (top.evlist == NULL) | 1125 | if (top.evlist == NULL) |
1116 | return -ENOMEM; | 1126 | return -ENOMEM; |
1117 | 1127 | ||
1128 | perf_config(perf_top_config, &top); | ||
1129 | |||
1118 | argc = parse_options(argc, argv, options, top_usage, 0); | 1130 | argc = parse_options(argc, argv, options, top_usage, 0); |
1119 | if (argc) | 1131 | if (argc) |
1120 | usage_with_options(top_usage, options); | 1132 | usage_with_options(top_usage, options); |