public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Jiri Olsa <jolsa@kernel.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Corey Ashford <cjashfor@linux.vnet.ibm.com>,
	David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Paul Mackerras <paulus@samba.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: [PATCH 5/5] perf tools: Add report.show-headers config file option
Date: Thu, 19 Jun 2014 13:41:16 +0200	[thread overview]
Message-ID: <1403178076-14072-6-git-send-email-jolsa@kernel.org> (raw)
In-Reply-To: <1403178076-14072-1-git-send-email-jolsa@kernel.org>

Adding report.show-headers config file option to setup
the appearance of the columns headers.

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

  [report]
        show-headers = true

Cc: Arnaldo Carvalho de Melo <acme@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>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/builtin-report.c    | 4 ++++
 tools/perf/ui/browsers/hists.c | 6 +++++-
 tools/perf/util/symbol.c       | 1 +
 tools/perf/util/symbol.h       | 1 +
 4 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 21d830b..cbc68c6 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -76,6 +76,10 @@ static int report__config(const char *var, const char *value, void *cb)
 		symbol_conf.cumulate_callchain = perf_config_bool(var, value);
 		return 0;
 	}
+	if (!strcmp(var, "report.show-headers")) {
+		symbol_conf.show_headers = perf_config_bool(var, value);
+		return 0;
+	}
 
 	return perf_default_config(var, value, cb);
 }
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index b923f61..a878284 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1260,11 +1260,15 @@ static struct hist_browser *hist_browser__new(struct hists *hists)
 	struct hist_browser *browser = zalloc(sizeof(*browser));
 
 	if (browser) {
+		/* If no config option is set, keep the default 'true'. */
+		bool show_headers = symbol_conf.show_headers == -1 ?
+				    true : symbol_conf.show_headers;
+
 		browser->hists = hists;
 		browser->b.ops.refresh = hist_browser__refresh;
 		browser->b.ops.seek = ui_browser__hists_seek;
 		browser->b.use_navkeypressed = true;
-		browser->show_headers = true;
+		browser->show_headers = show_headers;
 	}
 
 	return browser;
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 7b9096f..45a319b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -35,6 +35,7 @@ struct symbol_conf symbol_conf = {
 	.demangle		= true,
 	.cumulate_callchain	= true,
 	.symfs			= "",
+	.show_headers		= -1,
 };
 
 static enum dso_binary_type binary_type_symtab[] = {
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 615c752..8f1854a 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -139,6 +139,7 @@ struct symbol_conf {
 			*sym_from_list,
 			*sym_to_list;
 	const char	*symfs;
+	int		show_headers;
 };
 
 extern struct symbol_conf symbol_conf;
-- 
1.8.3.1


  parent reply	other threads:[~2014-06-19 11:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-19 11:41 [PATCHv2 0/5] perf tools tui: Display columns headers Jiri Olsa
2014-06-19 11:41 ` [PATCH 1/5] perf tools: Factor ui_browser ops out of ui_browser struct Jiri Olsa
2014-06-19 15:38   ` Arnaldo Carvalho de Melo
2014-06-19 16:49     ` Jiri Olsa
2014-06-19 23:33       ` Namhyung Kim
2014-06-19 11:41 ` [PATCH 2/5] perf tools: Remove ev_name argument from perf_evsel__hists_browse Jiri Olsa
2014-06-19 15:41   ` Arnaldo Carvalho de Melo
2014-06-25  5:51   ` [tip:perf/core] perf hists browser: " tip-bot for Jiri Olsa
2014-06-19 11:41 ` [PATCH 3/5] perf tools: Fix scrollbar refresh row index Jiri Olsa
2014-06-25  5:51   ` [tip:perf/core] perf ui browser: " tip-bot for Jiri Olsa
2014-06-19 11:41 ` [PATCH 4/5] perf tools tui: Display columns header text on 'H' press Jiri Olsa
2014-06-19 11:41 ` Jiri Olsa [this message]
2014-06-19 12:56   ` [PATCH 5/5] perf tools: Add report.show-headers config file option Namhyung Kim
2014-06-19 13:02     ` Jiri Olsa
2014-06-19 13:09       ` Namhyung Kim
2014-06-19 16:51         ` Jiri Olsa
2014-06-19 23:37           ` Namhyung Kim
2014-06-19 15:28     ` Arnaldo Carvalho de Melo
2014-06-19 16:58       ` Jiri Olsa
2014-06-19 23:46         ` Namhyung Kim
2014-06-20  8:03           ` Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403178076-14072-6-git-send-email-jolsa@kernel.org \
    --to=jolsa@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=cjashfor@linux.vnet.ibm.com \
    --cc=dsahern@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox