perf hists browser: Add ui.show-headers config file option
authorJiri Olsa <jolsa@kernel.org>
Fri, 27 Jun 2014 16:26:58 +0000 (18:26 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 7 Jul 2014 18:23:31 +0000 (15:23 -0300)
Adding ui.show-headers config file option to define if the histogram
entries headers will start visible or not.

Currently columns headers are displayed by default, following
lines in ~/.perfconfig file will disable that:

  [ui]
        show-headers = false

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1403886418-5556-4-git-send-email-jolsa@kernel.org
[ renamed symbol_conf.show_headers to .show_hist_headers ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browsers/hists.c
tools/perf/util/config.c
tools/perf/util/symbol.c
tools/perf/util/symbol.h

index 5fa2e181ef0cb63349b7badcff2df685bc8e00e9..a94b11fc5e00263bd1adf50a456925fbc895d5aa 100644 (file)
@@ -1284,7 +1284,7 @@ static struct hist_browser *hist_browser__new(struct hists *hists)
                browser->b.refresh_dimensions = hist_browser__refresh_dimensions;
                browser->b.seek = ui_browser__hists_seek;
                browser->b.use_navkeypressed = true;
-               browser->show_headers = true;
+               browser->show_headers = symbol_conf.show_hist_headers;
        }
 
        return browser;
index 24519e14ac569cf62a8cadce29c9073d5ac9ae64..1e5e2e5af6b1d05b18b1f6b92b88c4e62e85f33c 100644 (file)
@@ -350,6 +350,16 @@ static int perf_default_core_config(const char *var __maybe_unused,
        return 0;
 }
 
+static int perf_ui_config(const char *var, const char *value)
+{
+       /* Add other config variables here. */
+       if (!strcmp(var, "ui.show-headers")) {
+               symbol_conf.show_hist_headers = perf_config_bool(var, value);
+               return 0;
+       }
+       return 0;
+}
+
 int perf_default_config(const char *var, const char *value,
                        void *dummy __maybe_unused)
 {
@@ -359,6 +369,9 @@ int perf_default_config(const char *var, const char *value,
        if (!prefixcmp(var, "hist."))
                return perf_hist_config(var, value);
 
+       if (!prefixcmp(var, "ui."))
+               return perf_ui_config(var, value);
+
        /* Add other config variables here. */
        return 0;
 }
index 7b9096f29cdbf7f8c2afabb041e2563b0e70c0da..2e6a2e219eb95f4dc33a44332635f90b02077523 100644 (file)
@@ -34,6 +34,7 @@ struct symbol_conf symbol_conf = {
        .annotate_src           = true,
        .demangle               = true,
        .cumulate_callchain     = true,
+       .show_hist_headers      = true,
        .symfs                  = "",
 };
 
index 615c752dd7673600b33f8e051f35ba85ce1cd866..a81877b1dee0ec65efe783ec90e6a504b29d7518 100644 (file)
@@ -118,7 +118,8 @@ struct symbol_conf {
                        annotate_src,
                        event_group,
                        demangle,
-                       filter_relative;
+                       filter_relative,
+                       show_hist_headers;
        const char      *vmlinux_name,
                        *kallsyms_name,
                        *source_prefix,