perf config: Add support setting variables in a config file
authorTaeung Song <treeze.taeung@gmail.com>
Fri, 4 Nov 2016 06:44:20 +0000 (15:44 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 14 Nov 2016 16:08:11 +0000 (13:08 -0300)
commitc6fc018a7a64c2c3ea56529fd8d0ca0f43408b0f
treeaa04093a5c7428ccca5cb8b8b5c498cb537445a4
parent36662794bb520be828df8e2f3404264f5e7a7973
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>
tools/perf/Documentation/perf-config.txt
tools/perf/builtin-config.c
tools/perf/util/config.c
tools/perf/util/config.h