[PATCH 9/9] perf top: Reuse report.percent-limit config variable

From: Namhyung Kim
Date: Mon May 13 2013 - 22:10:12 EST


From: Namhyung Kim <namhyung.kim@xxxxxxx>

Make the config variable also works for perf top.

Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/