Messages in this thread Patch in this message | | | From | Namhyung Kim <> | Subject | [PATCH 9/9] perf top: Reuse report.percent-limit config variable | Date | Tue, 14 May 2013 11:09:07 +0900 |
| |
From: Namhyung Kim <namhyung.kim@lge.com>
Make the config variable also works for perf top.
Cc: Andi Kleen <andi@firstfloor.org> Cc: Pekka Enberg <penberg@kernel.org> Signed-off-by: Namhyung Kim <namhyung@kernel.org> --- tools/perf/builtin-top.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index f036af9b6f09..73fd40da47ba 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1032,6 +1032,19 @@ parse_percent_limit(const struct option *opt, const char *arg, return 0; } +static int perf_top_config(const char *var, const char *value, void *cb) +{ + /* share report config variables */ + if (!strcmp(var, "report.percent-limit")) { + struct perf_top *top = cb; + + top->min_percent = strtof(value, NULL); + return 0; + } + + return perf_default_config(var, value, cb); +} + int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) { int status; @@ -1132,6 +1145,8 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) symbol_conf.exclude_other = false; + perf_config(perf_top_config, &top); + argc = parse_options(argc, argv, options, top_usage, 0); if (argc) usage_with_options(top_usage, options); -- 1.7.11.7
| |