OSDN Git Service

perf config: Make show_config() use perf_config_set
authorTaeung Song <treeze.taeung@gmail.com>
Thu, 14 Apr 2016 07:53:19 +0000 (16:53 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 14 Apr 2016 12:15:47 +0000 (09:15 -0300)
commit860b8d4b3f893c97f905b978ecf62f48816dc5de
tree12aeecb0452bd85432b8c15f48fb1e7957bbc498
parent20105ca1240c3d3ac8cc79bf195022e5e5c1c3fb
perf config: Make show_config() use perf_config_set

Currently show_config() has a problem when user and system config files
have the same config variables i.e.:

  # cat ~/.perfconfig
  [top]
          children = false

When $(sysconfdir) is /usr/local/etc

  # cat /usr/local/etc/perfconfig
  [top]
          children = true

Before:

  # perf config --user --list
  top.children=false

  # perf config --system --list
  top.children=true

  # perf config --list
  top.children=true
   top.children=false

Because perf_config() can call show_config() each the config file (user
and system).  Fix it.

After:

  # perf config --user --list
  top.children=false

  # perf config --system --list
  top.children=true

  # perf config --list
  top.children=false

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: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1460620401-23430-3-git-send-email-treeze.taeung@gmail.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-config.c