All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCHES 0/7] Add support for showing headers in the hist browser.
@ 2014-07-03 21:42 Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 1/7] perf ui browser: Add ->rows to disambiguate from ->height Arnaldo Carvalho de Melo
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	Corey Ashford, David Ahern, Don Zickus, Frederic Weisbecker,
	Ingo Molnar, Jiri Olsa, Mike Galbraith, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Stephane Eranian

Hi Jiri,

	As you guys know this allows showing the columns headers on the hists
browsers, used in 'perf top' and 'perf report'. So, to test it, just apply,
fire one of those tools and press 'H' repeatedly.

	Please take a look, this should be mostly equivalent to your patchkit in
intent, but fixes some problems and is more consistent with how I first designed
the ui_browser code.

	Please let me know if you are ok with it and if I can have your
Acked-by and perhaps Tested-by tags for the code I wrote.

	Namhyung, since you reviewed the previous patchkit, I'd like to know
if I can keep the acked-by and perhaps a tested-by too. This should address the
problems that Jiri pointed out in our private conversation.

Thanks,

- Arnaldo

Arnaldo Carvalho de Melo (5):
  perf ui browser: Add ->rows to disambiguate from ->height
  perf ui browser: Allow overriding refresh_dimensions method
  perf hists browser: Introduce gotorc method
  perf hists browser: Override ui_browser refresh_dimensions method
  perf hists browser: Add support for showing columns header

Jiri Olsa (2):
  perf hists browser: Display columns header text on 'H' press
  perf hists browser: Add ui.show-headers config file option

 tools/perf/ui/browser.c        |  37 ++++++------
 tools/perf/ui/browser.h        |   3 +-
 tools/perf/ui/browsers/hists.c | 128 +++++++++++++++++++++++++++++++++++------
 tools/perf/util/config.c       |  13 +++++
 tools/perf/util/symbol.c       |   1 +
 tools/perf/util/symbol.h       |   3 +-
 6 files changed, 149 insertions(+), 36 deletions(-)

-- 
1.9.3


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH 1/7] perf ui browser: Add ->rows to disambiguate from ->height
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
@ 2014-07-03 21:42 ` Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 2/7] perf ui browser: Allow overriding refresh_dimensions method Arnaldo Carvalho de Melo
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Don Zickus, Frederic Weisbecker, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

The ui_browser->height is about the whole browser "window", including
any header, status lines or any other space needed for some "Yes", "No",
etc buttons a descendent browser, like hist_browser, may have.

Since the navigation is done mostly on the ui_browser methods, it needs
to know how many rows are on the screen, while details about what other
components are, say, if a header (that may be composed of multiple
lines, etc) is present.

Besides this we'll need to add a ui_browser->refresh_dimensions() hook
so that browsers like hist_browser can update ->rows in response to
screen resizes, this will come in a follow up patch.

This patch just adds ->rows and updates it when updating ->height, keeps
using ->height for the only other widget that can come with ui_browser,
the scrollbar, that goes on using all the height on the rightmost column
in the screen, using ->rows for the keyboard navigation needs.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xexmwg1mv7u03j5imn66jdak@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browser.c        | 30 +++++++++++++++---------------
 tools/perf/ui/browser.h        |  2 +-
 tools/perf/ui/browsers/hists.c | 16 ++++++++--------
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index 9d2294efc00c..adb294a3ec08 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -150,7 +150,7 @@ unsigned int ui_browser__rb_tree_refresh(struct ui_browser *browser)
 	while (nd != NULL) {
 		ui_browser__gotorc(browser, row, 0);
 		browser->write(browser, nd, row);
-		if (++row == browser->height)
+		if (++row == browser->rows)
 			break;
 		nd = rb_next(nd);
 	}
@@ -166,7 +166,7 @@ bool ui_browser__is_current_entry(struct ui_browser *browser, unsigned row)
 void ui_browser__refresh_dimensions(struct ui_browser *browser)
 {
 	browser->width = SLtt_Screen_Cols - 1;
-	browser->height = SLtt_Screen_Rows - 2;
+	browser->height = browser->rows = SLtt_Screen_Rows - 2;
 	browser->y = 1;
 	browser->x = 0;
 }
@@ -389,7 +389,7 @@ int ui_browser__run(struct ui_browser *browser, int delay_secs)
 			if (browser->index == browser->nr_entries - 1)
 				break;
 			++browser->index;
-			if (browser->index == browser->top_idx + browser->height) {
+			if (browser->index == browser->top_idx + browser->rows) {
 				++browser->top_idx;
 				browser->seek(browser, +1, SEEK_CUR);
 			}
@@ -405,10 +405,10 @@ int ui_browser__run(struct ui_browser *browser, int delay_secs)
 			break;
 		case K_PGDN:
 		case ' ':
-			if (browser->top_idx + browser->height > browser->nr_entries - 1)
+			if (browser->top_idx + browser->rows > browser->nr_entries - 1)
 				break;
 
-			offset = browser->height;
+			offset = browser->rows;
 			if (browser->index + offset > browser->nr_entries - 1)
 				offset = browser->nr_entries - 1 - browser->index;
 			browser->index += offset;
@@ -419,10 +419,10 @@ int ui_browser__run(struct ui_browser *browser, int delay_secs)
 			if (browser->top_idx == 0)
 				break;
 
-			if (browser->top_idx < browser->height)
+			if (browser->top_idx < browser->rows)
 				offset = browser->top_idx;
 			else
-				offset = browser->height;
+				offset = browser->rows;
 
 			browser->index -= offset;
 			browser->top_idx -= offset;
@@ -432,7 +432,7 @@ int ui_browser__run(struct ui_browser *browser, int delay_secs)
 			ui_browser__reset_index(browser);
 			break;
 		case K_END:
-			offset = browser->height - 1;
+			offset = browser->rows - 1;
 			if (offset >= browser->nr_entries)
 				offset = browser->nr_entries - 1;
 
@@ -462,7 +462,7 @@ unsigned int ui_browser__list_head_refresh(struct ui_browser *browser)
 		if (!browser->filter || !browser->filter(browser, pos)) {
 			ui_browser__gotorc(browser, row, 0);
 			browser->write(browser, pos, row);
-			if (++row == browser->height)
+			if (++row == browser->rows)
 				break;
 		}
 	}
@@ -587,7 +587,7 @@ unsigned int ui_browser__argv_refresh(struct ui_browser *browser)
 		if (!browser->filter || !browser->filter(browser, *pos)) {
 			ui_browser__gotorc(browser, row, 0);
 			browser->write(browser, pos, row);
-			if (++row == browser->height)
+			if (++row == browser->rows)
 				break;
 		}
 
@@ -623,7 +623,7 @@ static void __ui_browser__line_arrow_up(struct ui_browser *browser,
 
 	SLsmg_set_char_set(1);
 
-	if (start < browser->top_idx + browser->height) {
+	if (start < browser->top_idx + browser->rows) {
 		row = start - browser->top_idx;
 		ui_browser__gotorc(browser, row, column);
 		SLsmg_write_char(SLSMG_LLCORN_CHAR);
@@ -633,7 +633,7 @@ static void __ui_browser__line_arrow_up(struct ui_browser *browser,
 		if (row-- == 0)
 			goto out;
 	} else
-		row = browser->height - 1;
+		row = browser->rows - 1;
 
 	if (end > browser->top_idx)
 		end_row = end - browser->top_idx;
@@ -675,8 +675,8 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser,
 	} else
 		row = 0;
 
-	if (end >= browser->top_idx + browser->height)
-		end_row = browser->height - 1;
+	if (end >= browser->top_idx + browser->rows)
+		end_row = browser->rows - 1;
 	else
 		end_row = end - browser->top_idx;
 
@@ -684,7 +684,7 @@ static void __ui_browser__line_arrow_down(struct ui_browser *browser,
 	SLsmg_draw_vline(end_row - row + 1);
 
 	ui_browser__gotorc(browser, end_row, column);
-	if (end < browser->top_idx + browser->height) {
+	if (end < browser->top_idx + browser->rows) {
 		SLsmg_write_char(SLSMG_LLCORN_CHAR);
 		ui_browser__gotorc(browser, end_row, column + 1);
 		SLsmg_write_char(SLSMG_HLINE_CHAR);
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h
index 03d4d6295f10..cb8f39a1646f 100644
--- a/tools/perf/ui/browser.h
+++ b/tools/perf/ui/browser.h
@@ -14,7 +14,7 @@
 struct ui_browser {
 	u64	      index, top_idx;
 	void	      *top, *entries;
-	u16	      y, x, width, height;
+	u16	      y, x, width, height, rows;
 	int	      current_color;
 	void	      *priv;
 	const char    *title;
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 2185091c5227..e16aff45b564 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -392,10 +392,10 @@ static int hist_browser__run(struct hist_browser *browser,
 			struct hist_entry *h = rb_entry(browser->b.top,
 							struct hist_entry, rb_node);
 			ui_helpline__pop();
-			ui_helpline__fpush("%d: nr_ent=(%d,%d), height=%d, idx=%d, fve: idx=%d, row_off=%d, nrows=%d",
+			ui_helpline__fpush("%d: nr_ent=(%d,%d), rows=%d, idx=%d, fve: idx=%d, row_off=%d, nrows=%d",
 					   seq++, browser->b.nr_entries,
 					   browser->hists->nr_entries,
-					   browser->b.height,
+					   browser->b.rows,
 					   browser->b.index,
 					   browser->b.top_idx,
 					   h->row_offset, h->nr_rows);
@@ -514,7 +514,7 @@ static int hist_browser__show_callchain_node_rb_tree(struct hist_browser *browse
 			slsmg_write_nstring(str, width);
 			free(alloc_str);
 
-			if (++row == browser->b.height)
+			if (++row == browser->b.rows)
 				goto out;
 do_next:
 			if (folded_sign == '+')
@@ -527,7 +527,7 @@ do_next:
 									 new_level, row, row_offset,
 									 is_current_entry);
 		}
-		if (row == browser->b.height)
+		if (row == browser->b.rows)
 			goto out;
 		node = next;
 	}
@@ -573,7 +573,7 @@ static int hist_browser__show_callchain_node(struct hist_browser *browser,
 		slsmg_printf("%c ", folded_sign);
 		slsmg_write_nstring(s, width - 2);
 
-		if (++row == browser->b.height)
+		if (++row == browser->b.rows)
 			goto out;
 	}
 
@@ -602,7 +602,7 @@ static int hist_browser__show_callchain(struct hist_browser *browser,
 		row += hist_browser__show_callchain_node(browser, node, level,
 							 row, row_offset,
 							 is_current_entry);
-		if (row == browser->b.height)
+		if (row == browser->b.rows)
 			break;
 	}
 
@@ -776,7 +776,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 	} else
 		--row_offset;
 
-	if (folded_sign == '-' && row != browser->b.height) {
+	if (folded_sign == '-' && row != browser->b.rows) {
 		printed += hist_browser__show_callchain(browser, &entry->sorted_chain,
 							1, row, &row_offset,
 							&current_entry);
@@ -817,7 +817,7 @@ static unsigned int hist_browser__refresh(struct ui_browser *browser)
 			continue;
 
 		row += hist_browser__show_entry(hb, h, row);
-		if (row == browser->height)
+		if (row == browser->rows)
 			break;
 	}
 
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 2/7] perf ui browser: Allow overriding refresh_dimensions method
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 1/7] perf ui browser: Add ->rows to disambiguate from ->height Arnaldo Carvalho de Melo
@ 2014-07-03 21:42 ` Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 3/7] perf hists browser: Introduce gotorc method Arnaldo Carvalho de Melo
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Don Zickus, Frederic Weisbecker, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Some browsers, like the hist_browser, may want to be notified everytime
a refresh_dimensions is needed, so that it can reset ui_browser->rows,
for instance, or do some other related reaction to screen resizings.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ielvluuemzn30bneh0zk3twi@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browser.c | 7 +++++--
 tools/perf/ui/browser.h | 1 +
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/ui/browser.c b/tools/perf/ui/browser.c
index adb294a3ec08..6680fa5cb9dd 100644
--- a/tools/perf/ui/browser.c
+++ b/tools/perf/ui/browser.c
@@ -250,7 +250,10 @@ int ui_browser__show(struct ui_browser *browser, const char *title,
 	int err;
 	va_list ap;
 
-	ui_browser__refresh_dimensions(browser);
+	if (browser->refresh_dimensions == NULL)
+		browser->refresh_dimensions = ui_browser__refresh_dimensions;
+
+	browser->refresh_dimensions(browser);
 
 	pthread_mutex_lock(&ui__lock);
 	__ui_browser__show_title(browser, title);
@@ -367,7 +370,7 @@ int ui_browser__run(struct ui_browser *browser, int delay_secs)
 
 		if (key == K_RESIZE) {
 			ui__refresh_dimensions(false);
-			ui_browser__refresh_dimensions(browser);
+			browser->refresh_dimensions(browser);
 			__ui_browser__show_title(browser, browser->title);
 			ui_helpline__puts(browser->helpline);
 			continue;
diff --git a/tools/perf/ui/browser.h b/tools/perf/ui/browser.h
index cb8f39a1646f..92ae72113965 100644
--- a/tools/perf/ui/browser.h
+++ b/tools/perf/ui/browser.h
@@ -19,6 +19,7 @@ struct ui_browser {
 	void	      *priv;
 	const char    *title;
 	char	      *helpline;
+	void 	      (*refresh_dimensions)(struct ui_browser *browser);
 	unsigned int  (*refresh)(struct ui_browser *browser);
 	void	      (*write)(struct ui_browser *browser, void *entry, int row);
 	void	      (*seek)(struct ui_browser *browser, off_t offset, int whence);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 3/7] perf hists browser: Introduce gotorc method
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 1/7] perf ui browser: Add ->rows to disambiguate from ->height Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 2/7] perf ui browser: Allow overriding refresh_dimensions method Arnaldo Carvalho de Melo
@ 2014-07-03 21:42 ` Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 4/7] perf hists browser: Override ui_browser refresh_dimensions method Arnaldo Carvalho de Melo
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Don Zickus, Frederic Weisbecker, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

That will allow us to add a row offset to open up space for the column
headers.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-otc3ployokfci5qi81o7jo22@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index e16aff45b564..ca63564d203a 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -63,6 +63,11 @@ static void hist_browser__refresh_dimensions(struct hist_browser *browser)
 			     sizeof("[k]"));
 }
 
+static void hist_browser__gotorc(struct hist_browser *browser, int row, int column)
+{
+	ui_browser__gotorc(&browser->b, row, column);
+}
+
 static void hist_browser__reset(struct hist_browser *browser)
 {
 	/*
@@ -508,7 +513,7 @@ static int hist_browser__show_callchain_node_rb_tree(struct hist_browser *browse
 			}
 
 			ui_browser__set_color(&browser->b, color);
-			ui_browser__gotorc(&browser->b, row, 0);
+			hist_browser__gotorc(browser, row, 0);
 			slsmg_write_nstring(" ", offset + extra_offset);
 			slsmg_printf("%c ", folded_sign);
 			slsmg_write_nstring(str, width);
@@ -567,7 +572,7 @@ static int hist_browser__show_callchain_node(struct hist_browser *browser,
 
 		s = callchain_list__sym_name(chain, bf, sizeof(bf),
 					     browser->show_dso);
-		ui_browser__gotorc(&browser->b, row, 0);
+		hist_browser__gotorc(browser, row, 0);
 		ui_browser__set_color(&browser->b, color);
 		slsmg_write_nstring(" ", offset);
 		slsmg_printf("%c ", folded_sign);
@@ -732,7 +737,7 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 			.ptr		= &arg,
 		};
 
-		ui_browser__gotorc(&browser->b, row, 0);
+		hist_browser__gotorc(browser, row, 0);
 
 		perf_hpp__for_each_format(fmt) {
 			if (perf_hpp__should_skip(fmt))
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 4/7] perf hists browser: Override ui_browser refresh_dimensions method
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
                   ` (2 preceding siblings ...)
  2014-07-03 21:42 ` [PATCH 3/7] perf hists browser: Introduce gotorc method Arnaldo Carvalho de Melo
@ 2014-07-03 21:42 ` Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 5/7] perf hists browser: Add support for showing columns header Arnaldo Carvalho de Melo
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Adrian Hunter,
	David Ahern, Don Zickus, Frederic Weisbecker, Mike Galbraith,
	Namhyung Kim, Paul Mackerras, Peter Zijlstra, Stephane Eranian

From: Arnaldo Carvalho de Melo <acme@redhat.com>

This requires some more work so that we can really just use the width of
current entries when we want to partition the screen.

Right now its just a prep patch so that we can have where to update
ui_browser->rows when introducing the column headers line, that will be
togglable, so we need to update it everytime we refresh the dimensions
of the browser.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-ovk654rx525b4657y0mh6ku9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index ca63564d203a..ef7abf896f5a 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -56,11 +56,19 @@ static u32 hist_browser__nr_entries(struct hist_browser *hb)
 	return nr_entries + hb->nr_callchain_rows;
 }
 
-static void hist_browser__refresh_dimensions(struct hist_browser *browser)
+static void hist_browser__refresh_dimensions(struct ui_browser *browser)
 {
+	struct hist_browser *hb = container_of(browser, struct hist_browser, b);
+
 	/* 3 == +/- toggle symbol before actual hist_entry rendering */
-	browser->b.width = 3 + (hists__sort_list_width(browser->hists) +
-			     sizeof("[k]"));
+	browser->width = 3 + (hists__sort_list_width(hb->hists) + sizeof("[k]"));
+	/*
+ 	 * FIXME: Just keeping existing behaviour, but this really should be
+ 	 *	  before updating browser->width, as it will invalidate the
+ 	 *	  calculation above. Fix this and the fallout in another
+ 	 *	  changeset.
+ 	 */
+	ui_browser__refresh_dimensions(browser);
 }
 
 static void hist_browser__gotorc(struct hist_browser *browser, int row, int column)
@@ -78,7 +86,7 @@ static void hist_browser__reset(struct hist_browser *browser)
 
 	hist_browser__update_nr_entries(browser);
 	browser->b.nr_entries = hist_browser__nr_entries(browser);
-	hist_browser__refresh_dimensions(browser);
+	hist_browser__refresh_dimensions(&browser->b);
 	ui_browser__reset_index(&browser->b);
 }
 
@@ -360,7 +368,6 @@ static int hist_browser__run(struct hist_browser *browser,
 	browser->b.entries = &browser->hists->entries;
 	browser->b.nr_entries = hist_browser__nr_entries(browser);
 
-	hist_browser__refresh_dimensions(browser);
 	hists__browser_title(browser->hists, title, sizeof(title));
 
 	if (ui_browser__show(&browser->b, title,
@@ -1195,6 +1202,7 @@ static struct hist_browser *hist_browser__new(struct hists *hists)
 	if (browser) {
 		browser->hists = hists;
 		browser->b.refresh = hist_browser__refresh;
+		browser->b.refresh_dimensions = hist_browser__refresh_dimensions;
 		browser->b.seek = ui_browser__hists_seek;
 		browser->b.use_navkeypressed = true;
 	}
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 5/7] perf hists browser: Add support for showing columns header
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
                   ` (3 preceding siblings ...)
  2014-07-03 21:42 ` [PATCH 4/7] perf hists browser: Override ui_browser refresh_dimensions method Arnaldo Carvalho de Melo
@ 2014-07-03 21:42 ` Arnaldo Carvalho de Melo
  2014-07-03 21:42 ` [PATCH 6/7] perf hists browser: Display columns header text on 'H' press Arnaldo Carvalho de Melo
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Arnaldo Carvalho de Melo <jolsa@kernel.org>

Open up space to show a one-line header text whenever 'H' is pressed,
hide it on another key press.

Follow up patch will format this line from the set of headers used.

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: Jiri Olsa <jolsa@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/n/tip-m894d6qk30h3qofw4k8neq4q@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 42 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index ef7abf896f5a..2be71bf17b71 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -26,6 +26,7 @@ struct hist_browser {
 	struct map_symbol   *selection;
 	int		     print_seq;
 	bool		     show_dso;
+	bool		     show_headers;
 	float		     min_pcnt;
 	u64		     nr_non_filtered_entries;
 	u64		     nr_callchain_rows;
@@ -56,6 +57,21 @@ static u32 hist_browser__nr_entries(struct hist_browser *hb)
 	return nr_entries + hb->nr_callchain_rows;
 }
 
+static void hist_browser__update_rows(struct hist_browser *hb)
+{
+	struct ui_browser *browser = &hb->b;
+	u16 header_offset = hb->show_headers ? 1 : 0, index_row;
+
+	browser->rows = browser->height - header_offset;
+	/*
+	 * Verify if we were at the last line and that line isn't
+	 * visibe because we now show the header line(s).
+	 */
+	index_row = browser->index - browser->top_idx;
+	if (index_row >= browser->rows)
+		browser->index -= index_row - browser->rows + 1;
+}
+
 static void hist_browser__refresh_dimensions(struct ui_browser *browser)
 {
 	struct hist_browser *hb = container_of(browser, struct hist_browser, b);
@@ -69,11 +85,14 @@ static void hist_browser__refresh_dimensions(struct ui_browser *browser)
  	 *	  changeset.
  	 */
 	ui_browser__refresh_dimensions(browser);
+	hist_browser__update_rows(hb);
 }
 
 static void hist_browser__gotorc(struct hist_browser *browser, int row, int column)
 {
-	ui_browser__gotorc(&browser->b, row, column);
+	u16 header_offset = browser->show_headers ? 1 : 0;
+
+	ui_browser__gotorc(&browser->b, row + header_offset, column);
 }
 
 static void hist_browser__reset(struct hist_browser *browser)
@@ -421,6 +440,10 @@ static int hist_browser__run(struct hist_browser *browser,
 			/* Expand the whole world. */
 			hist_browser__set_folding(browser, true);
 			break;
+		case 'H':
+			browser->show_headers = !browser->show_headers;
+			hist_browser__update_rows(browser);
+			break;
 		case K_ENTER:
 			if (hist_browser__toggle_fold(browser))
 				break;
@@ -799,6 +822,13 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 	return printed;
 }
 
+static void hist_browser__show_headers(struct hist_browser *browser)
+{
+	ui_browser__gotorc(&browser->b, 0, 0);
+	ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
+	slsmg_write_nstring(" ", browser->b.width + 1);
+}
+
 static void ui_browser__hists_init_top(struct ui_browser *browser)
 {
 	if (browser->top == NULL) {
@@ -812,9 +842,15 @@ static void ui_browser__hists_init_top(struct ui_browser *browser)
 static unsigned int hist_browser__refresh(struct ui_browser *browser)
 {
 	unsigned row = 0;
+	u16 header_offset = 0;
 	struct rb_node *nd;
 	struct hist_browser *hb = container_of(browser, struct hist_browser, b);
 
+	if (hb->show_headers) {
+		hist_browser__show_headers(hb);
+		header_offset = 1;
+	}
+
 	ui_browser__hists_init_top(browser);
 
 	for (nd = browser->top; nd; nd = rb_next(nd)) {
@@ -833,7 +869,7 @@ static unsigned int hist_browser__refresh(struct ui_browser *browser)
 			break;
 	}
 
-	return row;
+	return row + header_offset;
 }
 
 static struct rb_node *hists__filter_entries(struct rb_node *nd,
@@ -1205,6 +1241,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 = false;
 	}
 
 	return browser;
@@ -1434,6 +1471,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
 	"d             Zoom into current DSO\n"				\
 	"E             Expand all callchains\n"				\
 	"F             Toggle percentage of filtered entries\n"		\
+	"H             Display column headers\n"			\
 
 	/* help messages are sorted by lexical order of the hotkey */
 	const char report_help[] = HIST_BROWSER_HELP_COMMON
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 6/7] perf hists browser: Display columns header text on 'H' press
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
                   ` (4 preceding siblings ...)
  2014-07-03 21:42 ` [PATCH 5/7] perf hists browser: Add support for showing columns header Arnaldo Carvalho de Melo
@ 2014-07-03 21:42 ` Arnaldo Carvalho de Melo
  2014-07-03 21:43 ` [PATCH 7/7] perf hists browser: Add ui.show-headers config file option Arnaldo Carvalho de Melo
  2014-07-03 21:48 ` [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
  7 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:42 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Jiri Olsa, Arnaldo Carvalho de Melo, Corey Ashford,
	David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim,
	Paul Mackerras, Peter Zijlstra, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

Displaying columns header text whenever 'H' is pressed,
and hiding it on on another press.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
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>
Link: http://lkml.kernel.org/n/tip-w9pcqpum5erza2a05ysvollz@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 47 ++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 45 insertions(+), 2 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 2be71bf17b71..5fa2e181ef0c 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -822,11 +822,54 @@ static int hist_browser__show_entry(struct hist_browser *browser,
 	return printed;
 }
 
+static int advance_hpp_check(struct perf_hpp *hpp, int inc)
+{
+	advance_hpp(hpp, inc);
+	return hpp->size <= 0;
+}
+
+static int hists__scnprintf_headers(char *buf, size_t size, struct hists *hists)
+{
+	struct perf_hpp dummy_hpp = {
+		.buf    = buf,
+		.size   = size,
+	};
+	struct perf_hpp_fmt *fmt;
+	size_t ret = 0;
+
+	if (symbol_conf.use_callchain) {
+		ret = scnprintf(buf, size, "  ");
+		if (advance_hpp_check(&dummy_hpp, ret))
+			return ret;
+	}
+
+	perf_hpp__for_each_format(fmt) {
+		if (perf_hpp__should_skip(fmt))
+			continue;
+
+		/* We need to add the length of the columns header. */
+		perf_hpp__reset_width(fmt, hists);
+
+		ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
+		if (advance_hpp_check(&dummy_hpp, ret))
+			break;
+
+		ret = scnprintf(dummy_hpp.buf, dummy_hpp.size, "  ");
+		if (advance_hpp_check(&dummy_hpp, ret))
+			break;
+	}
+
+	return ret;
+}
+
 static void hist_browser__show_headers(struct hist_browser *browser)
 {
+	char headers[1024];
+
+	hists__scnprintf_headers(headers, sizeof(headers), browser->hists);
 	ui_browser__gotorc(&browser->b, 0, 0);
 	ui_browser__set_color(&browser->b, HE_COLORSET_ROOT);
-	slsmg_write_nstring(" ", browser->b.width + 1);
+	slsmg_write_nstring(headers, browser->b.width + 1);
 }
 
 static void ui_browser__hists_init_top(struct ui_browser *browser)
@@ -1241,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 = false;
+		browser->show_headers = true;
 	}
 
 	return browser;
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PATCH 7/7] perf hists browser: Add ui.show-headers config file option
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
                   ` (5 preceding siblings ...)
  2014-07-03 21:42 ` [PATCH 6/7] perf hists browser: Display columns header text on 'H' press Arnaldo Carvalho de Melo
@ 2014-07-03 21:43 ` Arnaldo Carvalho de Melo
  2014-07-03 21:48 ` [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
  7 siblings, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:43 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Jiri Olsa, Corey Ashford, David Ahern,
	Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Paul Mackerras,
	Peter Zijlstra, Arnaldo Carvalho de Melo

From: Jiri Olsa <jolsa@kernel.org>

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 = true

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>

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c |  2 +-
 tools/perf/util/config.c       | 13 +++++++++++++
 tools/perf/util/symbol.c       |  1 +
 tools/perf/util/symbol.h       |  3 ++-
 4 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 5fa2e181ef0c..a94b11fc5e00 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -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;
diff --git a/tools/perf/util/config.c b/tools/perf/util/config.c
index 24519e14ac56..1e5e2e5af6b1 100644
--- a/tools/perf/util/config.c
+++ b/tools/perf/util/config.c
@@ -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;
 }
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 7b9096f29cdb..2e6a2e219eb9 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -34,6 +34,7 @@ struct symbol_conf symbol_conf = {
 	.annotate_src		= true,
 	.demangle		= true,
 	.cumulate_callchain	= true,
+	.show_hist_headers	= true,
 	.symfs			= "",
 };
 
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 615c752dd767..a81877b1dee0 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -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,
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [RFC PATCHES 0/7] Add support for showing headers in the hist browser.
  2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
                   ` (6 preceding siblings ...)
  2014-07-03 21:43 ` [PATCH 7/7] perf hists browser: Add ui.show-headers config file option Arnaldo Carvalho de Melo
@ 2014-07-03 21:48 ` Arnaldo Carvalho de Melo
  2014-07-04  8:53   ` Namhyung Kim
  7 siblings, 1 reply; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-03 21:48 UTC (permalink / raw)
  To: Jiri Olsa
  Cc: linux-kernel, Adrian Hunter, Corey Ashford, David Ahern,
	Don Zickus, Frederic Weisbecker, Ingo Molnar, Jiri Olsa,
	Mike Galbraith, Namhyung Kim, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian

Em Thu, Jul 03, 2014 at 06:42:53PM -0300, Arnaldo Carvalho de Melo escreveu:
> 	Please let me know if you are ok with it and if I can have your
> Acked-by and perhaps Tested-by tags for the code I wrote.
> 
> 	Namhyung, since you reviewed the previous patchkit, I'd like to know
> if I can keep the acked-by and perhaps a tested-by too. This should address the
> problems that Jiri pointed out in our private conversation.

Forgot to mention, it is available in this branch:

  git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
  tmp.perf/ui/show_headers

- Arnaldo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCHES 0/7] Add support for showing headers in the hist browser.
  2014-07-03 21:48 ` [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
@ 2014-07-04  8:53   ` Namhyung Kim
  2014-07-04 12:50     ` Arnaldo Carvalho de Melo
  2014-07-07 18:23     ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 13+ messages in thread
From: Namhyung Kim @ 2014-07-04  8:53 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, linux-kernel, Adrian Hunter, Corey Ashford,
	David Ahern, Don Zickus, Frederic Weisbecker, Ingo Molnar,
	Jiri Olsa, Mike Galbraith, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian

Hi Arnaldo,

On Thu, 3 Jul 2014 18:48:11 -0300, Arnaldo Carvalho de Melo wrote:
> Em Thu, Jul 03, 2014 at 06:42:53PM -0300, Arnaldo Carvalho de Melo escreveu:
>> 	Please let me know if you are ok with it and if I can have your
>> Acked-by and perhaps Tested-by tags for the code I wrote.
>> 
>> 	Namhyung, since you reviewed the previous patchkit, I'd like to know
>> if I can keep the acked-by and perhaps a tested-by too. This should address the
>> problems that Jiri pointed out in our private conversation.
>
> Forgot to mention, it is available in this branch:
>
>   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
>   tmp.perf/ui/show_headers

Thanks, you can keep my acks with fixing 7/7 changelog typo
(s/true/false/).

I think it might even go to the perf/urgent as the cumulative children
patchset added a new children column which might confuse old users (like
you ;-) ).  But I also think it needs to fix column/header alignment
first, hmm...

Thanks,
Namhyung

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCHES 0/7] Add support for showing headers in the hist browser.
  2014-07-04  8:53   ` Namhyung Kim
@ 2014-07-04 12:50     ` Arnaldo Carvalho de Melo
  2014-07-07 18:23     ` Arnaldo Carvalho de Melo
  1 sibling, 0 replies; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-04 12:50 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Jiri Olsa, linux-kernel, Adrian Hunter, Corey Ashford,
	David Ahern, Don Zickus, Frederic Weisbecker, Ingo Molnar,
	Jiri Olsa, Mike Galbraith, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian

Em Fri, Jul 04, 2014 at 05:53:02PM +0900, Namhyung Kim escreveu:
> On Thu, 3 Jul 2014 18:48:11 -0300, Arnaldo Carvalho de Melo wrote:
> > Em Thu, Jul 03, 2014 at 06:42:53PM -0300, Arnaldo Carvalho de Melo escreveu:
> >> 	Namhyung, since you reviewed the previous patchkit, I'd like to know
> >> if I can keep the acked-by and perhaps a tested-by too. This should address the
> >> problems that Jiri pointed out in our private conversation.

> > Forgot to mention, it is available in this branch:

> >   git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git
> >   tmp.perf/ui/show_headers

> Thanks, you can keep my acks with fixing 7/7 changelog typo
> (s/true/false/).

Ok
 
> I think it might even go to the perf/urgent as the cumulative children
> patchset added a new children column which might confuse old users (like
> you ;-) ).

Unsure about that, quite a lot of patches :-)

> But I also think it needs to fix column/header alignment
> first, hmm...

Yeah, I noticed that after posting the patches, and it is even worse in
'perf top', it gets worse over time, as new symbols are added, etc. Will
take a look at that.

- Arnaldo

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [RFC PATCHES 0/7] Add support for showing headers in the hist browser.
  2014-07-04  8:53   ` Namhyung Kim
  2014-07-04 12:50     ` Arnaldo Carvalho de Melo
@ 2014-07-07 18:23     ` Arnaldo Carvalho de Melo
  2014-07-08  8:05       ` Namhyung Kim
  1 sibling, 1 reply; 13+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-07-07 18:23 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Jiri Olsa, linux-kernel, Adrian Hunter, Corey Ashford,
	David Ahern, Don Zickus, Frederic Weisbecker, Ingo Molnar,
	Jiri Olsa, Mike Galbraith, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian

Em Fri, Jul 04, 2014 at 05:53:02PM +0900, Namhyung Kim escreveu:
> you ;-) ).  But I also think it needs to fix column/header alignment
> first, hmm...

This one liner should do the trick, i.e. left justify it.

- Arnaldo

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 1ec57dd82284..14e5a039bc45 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1215,7 +1215,7 @@ static int __sort__hpp_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
 	hse = container_of(fmt, struct hpp_sort_entry, hpp);
 	len = hists__col_len(&evsel->hists, hse->se->se_width_idx);
 
-	return scnprintf(hpp->buf, hpp->size, "%*s", len, hse->se->se_header);
+	return scnprintf(hpp->buf, hpp->size, "%-*s", len, hse->se->se_header);
 }
 
 static int __sort__hpp_width(struct perf_hpp_fmt *fmt,

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [RFC PATCHES 0/7] Add support for showing headers in the hist browser.
  2014-07-07 18:23     ` Arnaldo Carvalho de Melo
@ 2014-07-08  8:05       ` Namhyung Kim
  0 siblings, 0 replies; 13+ messages in thread
From: Namhyung Kim @ 2014-07-08  8:05 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Jiri Olsa, linux-kernel, Adrian Hunter, Corey Ashford,
	David Ahern, Don Zickus, Frederic Weisbecker, Ingo Molnar,
	Jiri Olsa, Mike Galbraith, Paul Mackerras, Peter Zijlstra,
	Stephane Eranian

On Tue, Jul 8, 2014 at 3:23 AM, Arnaldo Carvalho de Melo
<acme@kernel.org> wrote:
> Em Fri, Jul 04, 2014 at 05:53:02PM +0900, Namhyung Kim escreveu:
>> you ;-) ).  But I also think it needs to fix column/header alignment
>> first, hmm...
>
> This one liner should do the trick, i.e. left justify it.

Yes, but it needs some more tweaks.  I'll try to fix it soon..

Thanks,
Namhyung


>
> - Arnaldo
>
> diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
> index 1ec57dd82284..14e5a039bc45 100644
> --- a/tools/perf/util/sort.c
> +++ b/tools/perf/util/sort.c
> @@ -1215,7 +1215,7 @@ static int __sort__hpp_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
>         hse = container_of(fmt, struct hpp_sort_entry, hpp);
>         len = hists__col_len(&evsel->hists, hse->se->se_width_idx);
>
> -       return scnprintf(hpp->buf, hpp->size, "%*s", len, hse->se->se_header);
> +       return scnprintf(hpp->buf, hpp->size, "%-*s", len, hse->se->se_header);
>  }
>
>  static int __sort__hpp_width(struct perf_hpp_fmt *fmt,

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-07-08  8:06 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-03 21:42 [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
2014-07-03 21:42 ` [PATCH 1/7] perf ui browser: Add ->rows to disambiguate from ->height Arnaldo Carvalho de Melo
2014-07-03 21:42 ` [PATCH 2/7] perf ui browser: Allow overriding refresh_dimensions method Arnaldo Carvalho de Melo
2014-07-03 21:42 ` [PATCH 3/7] perf hists browser: Introduce gotorc method Arnaldo Carvalho de Melo
2014-07-03 21:42 ` [PATCH 4/7] perf hists browser: Override ui_browser refresh_dimensions method Arnaldo Carvalho de Melo
2014-07-03 21:42 ` [PATCH 5/7] perf hists browser: Add support for showing columns header Arnaldo Carvalho de Melo
2014-07-03 21:42 ` [PATCH 6/7] perf hists browser: Display columns header text on 'H' press Arnaldo Carvalho de Melo
2014-07-03 21:43 ` [PATCH 7/7] perf hists browser: Add ui.show-headers config file option Arnaldo Carvalho de Melo
2014-07-03 21:48 ` [RFC PATCHES 0/7] Add support for showing headers in the hist browser Arnaldo Carvalho de Melo
2014-07-04  8:53   ` Namhyung Kim
2014-07-04 12:50     ` Arnaldo Carvalho de Melo
2014-07-07 18:23     ` Arnaldo Carvalho de Melo
2014-07-08  8:05       ` Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.