lkml.org 
[lkml]   [2013]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 9/9] perf top: Reuse report.percent-limit config variable
Date
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


\
 
 \ /
  Last update: 2013-05-14 04:21    [W:0.227 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site