diff options
author | Taeung Song <treeze.taeung@gmail.com> | 2016-11-04 15:44:20 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-14 13:08:11 -0300 |
commit | c6fc018a7a64c2c3ea56529fd8d0ca0f43408b0f (patch) | |
tree | aa04093a5c7428ccca5cb8b8b5c498cb537445a4 /tools/perf/util/config.c | |
parent | 36662794bb520be828df8e2f3404264f5e7a7973 (diff) | |
download | op-kernel-dev-c6fc018a7a64c2c3ea56529fd8d0ca0f43408b0f.zip op-kernel-dev-c6fc018a7a64c2c3ea56529fd8d0ca0f43408b0f.tar.gz |
perf config: Add support setting variables in a config file
Add setting feature that can add config variables with their values to a
config file (i.e. user or system config file) or modify config key-value
pairs in a config file. For the syntax examples:
perf config [<file-option>] [section.name[=value] ...]
e.g. You can set the ui.show-headers to false with
# perf config ui.show-headers=false
If you want to add or modify several config items, you can do like
# perf config annotate.show_nr_jumps=false kmem.default=slab
Committer notes:
Testing it:
$ perf config -l
top.children=true
report.children=false
$
$ perf config top.children=false
$ perf config -l
top.children=false
report.children=false
$
$ perf config kmem.default=slab
$ perf config -l
top.children=false
report.children=false
kmem.default=slab
$
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Nambong Ha <over3025@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Cc: Wookje Kwon <aweee0@gmail.com>
Link: http://lkml.kernel.org/r/1478241862-31230-5-git-send-email-treeze.taeung@gmail.com
[ Combined patch with docs update with this one ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/config.c')
-rw-r--r-- | tools/perf/util/config.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c index 18dae74..c8fb65d 100644 --- a/tools/perf/util/config.c +++ b/tools/perf/util/config.c @@ -602,6 +602,12 @@ out_free: return -1; } +int perf_config_set__collect(struct perf_config_set *set, + const char *var, const char *value) +{ + return collect_config(var, value, set); +} + static int perf_config_set__init(struct perf_config_set *set) { int ret = -1; |