All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2)
@ 2013-06-04  9:22 Namhyung Kim
  2013-06-04  9:22 ` [PATCH 1/6] perf gtk/hists: Use GtkTreeStore instead of GtkListStore Namhyung Kim
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Namhyung Kim @ 2013-06-04  9:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

Hi,

This patchset implements callchain support in GTK report browser as
Pekka requested.  Please take a look and give me comments.

v2 changes)
 * fix a bug on percent calculation of children nodes
 * show topmost symbol only when multiple paths exist for a node
 * add alternating background colors (Ingo)
 * put callchain info into existing overhead and symbol column (Arnaldo)

You can get it from 'perf/callchain-gtk-v2' branch on my tree at

 git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git


Any comments are welcome, thanks!
Namhyung

Namhyung Kim (6):
  perf gtk/hists: Use GtkTreeStore instead of GtkListStore
  perf gtk/hists: Add support for callchains
  perf gtk/hists: Display callchain overhead also
  perf gtk/hists: Make column headers resizable
  perf gtk/hists: Add a double-click handler for callchains
  perf gtk/hists: Set rules hint for the hist browser

 tools/perf/ui/gtk/hists.c | 117 ++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 112 insertions(+), 5 deletions(-)

-- 
1.7.11.7


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

* [PATCH 1/6] perf gtk/hists: Use GtkTreeStore instead of GtkListStore
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
@ 2013-06-04  9:22 ` Namhyung Kim
  2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
  2013-06-04  9:22 ` [PATCH 2/6] perf gtk/hists: Add support for callchains Namhyung Kim
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Namhyung Kim @ 2013-06-04  9:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

From: Namhyung Kim <namhyung.kim@lge.com>

The GtkTreeStore can save items in a tree-like way.  This is a
preparation for supporting callgraphs in the hist browser.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 9708dd5fb8f3..cb6a9b45f789 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -131,7 +131,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 	GType col_types[MAX_COLUMNS];
 	GtkCellRenderer *renderer;
 	struct sort_entry *se;
-	GtkListStore *store;
+	GtkTreeStore *store;
 	struct rb_node *nd;
 	GtkWidget *view;
 	int col_idx;
@@ -156,7 +156,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		col_types[nr_cols++] = G_TYPE_STRING;
 	}
 
-	store = gtk_list_store_newv(nr_cols, col_types);
+	store = gtk_tree_store_newv(nr_cols, col_types);
 
 	view = gtk_tree_view_new();
 
@@ -199,7 +199,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		if (percent < min_pcnt)
 			continue;
 
-		gtk_list_store_append(store, &iter);
+		gtk_tree_store_append(store, &iter, NULL);
 
 		col_idx = 0;
 
@@ -209,7 +209,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 			else
 				fmt->entry(&hpp, h);
 
-			gtk_list_store_set(store, &iter, col_idx++, s, -1);
+			gtk_tree_store_set(store, &iter, col_idx++, s, -1);
 		}
 
 		list_for_each_entry(se, &hist_entry__sort_list, list) {
@@ -219,7 +219,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 			se->se_snprintf(h, s, ARRAY_SIZE(s),
 					hists__col_len(hists, se->se_width_idx));
 
-			gtk_list_store_set(store, &iter, col_idx++, s, -1);
+			gtk_tree_store_set(store, &iter, col_idx++, s, -1);
 		}
 	}
 
-- 
1.7.11.7


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

* [PATCH 2/6] perf gtk/hists: Add support for callchains
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
  2013-06-04  9:22 ` [PATCH 1/6] perf gtk/hists: Use GtkTreeStore instead of GtkListStore Namhyung Kim
@ 2013-06-04  9:22 ` Namhyung Kim
  2013-06-04  9:34   ` Pekka Enberg
  2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
  2013-06-04  9:22 ` [PATCH 3/6] perf gtk/hists: Display callchain overhead also Namhyung Kim
                   ` (5 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Namhyung Kim @ 2013-06-04  9:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

From: Namhyung Kim <namhyung.kim@lge.com>

Display callchain information in the symbol column.  It's only enabled
when recorded with -g and has symbol sort key.

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index cb6a9b45f789..226c7e10f3cc 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -124,6 +124,55 @@ void perf_gtk__init_hpp(void)
 				perf_gtk__hpp_color_overhead_guest_us;
 }
 
+static void callchain_list__sym_name(struct callchain_list *cl,
+				     char *bf, size_t bfsize)
+{
+	if (cl->ms.sym)
+		scnprintf(bf, bfsize, "%s", cl->ms.sym->name);
+	else
+		scnprintf(bf, bfsize, "%#" PRIx64, cl->ip);
+}
+
+static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
+				    GtkTreeIter *parent, int col)
+{
+	struct rb_node *nd;
+	bool has_single_node = (rb_first(root) == rb_last(root));
+
+	for (nd = rb_first(root); nd; nd = rb_next(nd)) {
+		struct callchain_node *node;
+		struct callchain_list *chain;
+		GtkTreeIter iter, new_parent;
+		bool need_new_parent;
+
+		node = rb_entry(nd, struct callchain_node, rb_node);
+
+		new_parent = *parent;
+		need_new_parent = !has_single_node && (node->val_nr > 1);
+
+		list_for_each_entry(chain, &node->val, list) {
+			char buf[128];
+
+			gtk_tree_store_append(store, &iter, &new_parent);
+
+			callchain_list__sym_name(chain, buf, sizeof(buf));
+			gtk_tree_store_set(store, &iter, col, buf, -1);
+
+			if (need_new_parent) {
+				/*
+				 * Only show the top-most symbol in a callchain
+				 * if it's not the only callchain.
+				 */
+				new_parent = iter;
+				need_new_parent = false;
+			}
+		}
+
+		/* Now 'iter' contains info of the last callchain_list */
+		perf_gtk__add_callchain(&node->rb_root, store, &iter, col);
+	}
+}
+
 static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 				 float min_pcnt)
 {
@@ -135,6 +184,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 	struct rb_node *nd;
 	GtkWidget *view;
 	int col_idx;
+	int sym_col = -1;
 	int nr_cols;
 	char s[512];
 
@@ -153,6 +203,9 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		if (se->elide)
 			continue;
 
+		if (se == &sort_sym)
+			sym_col = nr_cols;
+
 		col_types[nr_cols++] = G_TYPE_STRING;
 	}
 
@@ -183,6 +236,13 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 							    col_idx++, NULL);
 	}
 
+	if (symbol_conf.use_callchain && sort__has_sym) {
+		GtkTreeViewColumn *column;
+
+		column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), sym_col);
+		gtk_tree_view_set_expander_column(GTK_TREE_VIEW(view), column);
+	}
+
 	gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));
 
 	g_object_unref(GTK_TREE_MODEL(store));
@@ -221,6 +281,11 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 
 			gtk_tree_store_set(store, &iter, col_idx++, s, -1);
 		}
+
+		if (symbol_conf.use_callchain && sort__has_sym) {
+			perf_gtk__add_callchain(&h->sorted_chain, store, &iter,
+						sym_col);
+		}
 	}
 
 	gtk_container_add(GTK_CONTAINER(window), view);
-- 
1.7.11.7


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

* [PATCH 3/6] perf gtk/hists: Display callchain overhead also
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
  2013-06-04  9:22 ` [PATCH 1/6] perf gtk/hists: Use GtkTreeStore instead of GtkListStore Namhyung Kim
  2013-06-04  9:22 ` [PATCH 2/6] perf gtk/hists: Add support for callchains Namhyung Kim
@ 2013-06-04  9:22 ` Namhyung Kim
  2013-06-04  9:35   ` Pekka Enberg
  2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
  2013-06-04  9:22 ` [PATCH 4/6] perf gtk/hists: Make column headers resizable Namhyung Kim
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Namhyung Kim @ 2013-06-04  9:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

From: Namhyung Kim <namhyung.kim@lge.com>

Display callchain percent value in the overhead column.

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 226c7e10f3cc..fa9f8a09233e 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -134,7 +134,7 @@ static void callchain_list__sym_name(struct callchain_list *cl,
 }
 
 static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
-				    GtkTreeIter *parent, int col)
+				    GtkTreeIter *parent, int col, u64 total)
 {
 	struct rb_node *nd;
 	bool has_single_node = (rb_first(root) == rb_last(root));
@@ -144,9 +144,14 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 		struct callchain_list *chain;
 		GtkTreeIter iter, new_parent;
 		bool need_new_parent;
+		double percent;
+		u64 hits, child_total;
 
 		node = rb_entry(nd, struct callchain_node, rb_node);
 
+		hits = callchain_cumul_hits(node);
+		percent = 100.0 * hits / total;
+
 		new_parent = *parent;
 		need_new_parent = !has_single_node && (node->val_nr > 1);
 
@@ -155,6 +160,9 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 
 			gtk_tree_store_append(store, &iter, &new_parent);
 
+			scnprintf(buf, sizeof(buf), "%5.2f%%", percent);
+			gtk_tree_store_set(store, &iter, 0, buf, -1);
+
 			callchain_list__sym_name(chain, buf, sizeof(buf));
 			gtk_tree_store_set(store, &iter, col, buf, -1);
 
@@ -168,8 +176,14 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 			}
 		}
 
+		if (callchain_param.mode == CHAIN_GRAPH_REL)
+			child_total = node->children_hit;
+		else
+			child_total = total;
+
 		/* Now 'iter' contains info of the last callchain_list */
-		perf_gtk__add_callchain(&node->rb_root, store, &iter, col);
+		perf_gtk__add_callchain(&node->rb_root, store, &iter, col,
+					child_total);
 	}
 }
 
@@ -283,8 +297,15 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		}
 
 		if (symbol_conf.use_callchain && sort__has_sym) {
+			u64 total;
+
+			if (callchain_param.mode == CHAIN_GRAPH_REL)
+				total = h->stat.period;
+			else
+				total = hists->stats.total_period;
+
 			perf_gtk__add_callchain(&h->sorted_chain, store, &iter,
-						sym_col);
+						sym_col, total);
 		}
 	}
 
-- 
1.7.11.7


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

* [PATCH 4/6] perf gtk/hists: Make column headers resizable
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
                   ` (2 preceding siblings ...)
  2013-06-04  9:22 ` [PATCH 3/6] perf gtk/hists: Display callchain overhead also Namhyung Kim
@ 2013-06-04  9:22 ` Namhyung Kim
  2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
  2013-06-04  9:22 ` [PATCH 5/6] perf gtk/hists: Add a double-click handler for callchains Namhyung Kim
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Namhyung Kim @ 2013-06-04  9:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

From: Namhyung Kim <namhyung.kim@lge.com>

Sometimes it's annoying to see when some symbols have very wierd long
names.  So it might be a good idea to make column size changable.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index fa9f8a09233e..b4a0dd2404a2 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -250,11 +250,16 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 							    col_idx++, NULL);
 	}
 
-	if (symbol_conf.use_callchain && sort__has_sym) {
+	for (col_idx = 0; col_idx < nr_cols; col_idx++) {
 		GtkTreeViewColumn *column;
 
-		column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), sym_col);
-		gtk_tree_view_set_expander_column(GTK_TREE_VIEW(view), column);
+		column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), col_idx);
+		gtk_tree_view_column_set_resizable(column, TRUE);
+
+		if (col_idx == sym_col) {
+			gtk_tree_view_set_expander_column(GTK_TREE_VIEW(view),
+							  column);
+		}
 	}
 
 	gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));
-- 
1.7.11.7


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

* [PATCH 5/6] perf gtk/hists: Add a double-click handler for callchains
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
                   ` (3 preceding siblings ...)
  2013-06-04  9:22 ` [PATCH 4/6] perf gtk/hists: Make column headers resizable Namhyung Kim
@ 2013-06-04  9:22 ` Namhyung Kim
  2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
  2013-06-04  9:22 ` [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser Namhyung Kim
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Namhyung Kim @ 2013-06-04  9:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

From: Namhyung Kim <namhyung.kim@lge.com>

If callchain is displayed, add "row-activated" signal handler for
handling double-click or pressing ENTER key action.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index b4a0dd2404a2..3a5d01319988 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -187,6 +187,18 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 	}
 }
 
+static void on_row_activated(GtkTreeView *view, GtkTreePath *path,
+			     GtkTreeViewColumn *col __maybe_unused,
+			     gpointer user_data __maybe_unused)
+{
+	bool expanded = gtk_tree_view_row_expanded(view, path);
+
+	if (expanded)
+		gtk_tree_view_collapse_row(view, path);
+	else
+		gtk_tree_view_expand_row(view, path, FALSE);
+}
+
 static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 				 float min_pcnt)
 {
@@ -314,6 +326,8 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		}
 	}
 
+	g_signal_connect(view, "row-activated",
+			 G_CALLBACK(on_row_activated), NULL);
 	gtk_container_add(GTK_CONTAINER(window), view);
 }
 
-- 
1.7.11.7


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

* [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
                   ` (4 preceding siblings ...)
  2013-06-04  9:22 ` [PATCH 5/6] perf gtk/hists: Add a double-click handler for callchains Namhyung Kim
@ 2013-06-04  9:22 ` Namhyung Kim
  2013-06-04  9:35   ` Pekka Enberg
  2013-07-19  7:49   ` [tip:perf/core] " tip-bot for Namhyung Kim
  2013-07-04  8:39 ` [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
  2013-07-05 15:04 ` Arnaldo Carvalho de Melo
  7 siblings, 2 replies; 18+ messages in thread
From: Namhyung Kim @ 2013-06-04  9:22 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

From: Namhyung Kim <namhyung.kim@lge.com>

The 'rules' means that every second line of the tree view has a shaded
background, which makes it easier to see which cell belongs to which
row in the tree view.  It can be useful for a tree view that has a lot
of rows.

Cc: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/ui/gtk/hists.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 3a5d01319988..32549035f50d 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -326,6 +326,8 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		}
 	}
 
+	gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE);
+
 	g_signal_connect(view, "row-activated",
 			 G_CALLBACK(on_row_activated), NULL);
 	gtk_container_add(GTK_CONTAINER(window), view);
-- 
1.7.11.7


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

* Re: [PATCH 2/6] perf gtk/hists: Add support for callchains
  2013-06-04  9:22 ` [PATCH 2/6] perf gtk/hists: Add support for callchains Namhyung Kim
@ 2013-06-04  9:34   ` Pekka Enberg
  2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
  1 sibling, 0 replies; 18+ messages in thread
From: Pekka Enberg @ 2013-06-04  9:34 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Namhyung Kim, LKML, Jiri Olsa, David Ahern

On Tue, Jun 4, 2013 at 12:22 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
>
> Display callchain information in the symbol column.  It's only enabled
> when recorded with -g and has symbol sort key.
>
> Cc: Pekka Enberg <penberg@kernel.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Reviewed-by: Pekka Enberg <penberg@kernel.org>

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

* Re: [PATCH 3/6] perf gtk/hists: Display callchain overhead also
  2013-06-04  9:22 ` [PATCH 3/6] perf gtk/hists: Display callchain overhead also Namhyung Kim
@ 2013-06-04  9:35   ` Pekka Enberg
  2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
  1 sibling, 0 replies; 18+ messages in thread
From: Pekka Enberg @ 2013-06-04  9:35 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Namhyung Kim, LKML, Jiri Olsa, David Ahern

On Tue, Jun 4, 2013 at 12:22 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
>
> Display callchain percent value in the overhead column.
>
> Cc: Pekka Enberg <penberg@kernel.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Reviewed-by: Pekka Enberg <penberg@kernel.org>

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

* Re: [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser
  2013-06-04  9:22 ` [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser Namhyung Kim
@ 2013-06-04  9:35   ` Pekka Enberg
  2013-07-19  7:49   ` [tip:perf/core] " tip-bot for Namhyung Kim
  1 sibling, 0 replies; 18+ messages in thread
From: Pekka Enberg @ 2013-06-04  9:35 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Peter Zijlstra, Paul Mackerras,
	Ingo Molnar, Namhyung Kim, LKML, Jiri Olsa, David Ahern

On Tue, Jun 4, 2013 at 12:22 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> From: Namhyung Kim <namhyung.kim@lge.com>
>
> The 'rules' means that every second line of the tree view has a shaded
> background, which makes it easier to see which cell belongs to which
> row in the tree view.  It can be useful for a tree view that has a lot
> of rows.
>
> Cc: Pekka Enberg <penberg@kernel.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Reviewed-by: Pekka Enberg <penberg@kernel.org>

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

* Re: [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2)
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
                   ` (5 preceding siblings ...)
  2013-06-04  9:22 ` [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser Namhyung Kim
@ 2013-07-04  8:39 ` Namhyung Kim
  2013-07-05 15:04 ` Arnaldo Carvalho de Melo
  7 siblings, 0 replies; 18+ messages in thread
From: Namhyung Kim @ 2013-07-04  8:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

Ping!

On Tue,  4 Jun 2013 18:22:11 +0900, Namhyung Kim wrote:
> Hi,
>
> This patchset implements callchain support in GTK report browser as
> Pekka requested.  Please take a look and give me comments.
>
> v2 changes)
>  * fix a bug on percent calculation of children nodes
>  * show topmost symbol only when multiple paths exist for a node
>  * add alternating background colors (Ingo)
>  * put callchain info into existing overhead and symbol column (Arnaldo)
>
> You can get it from 'perf/callchain-gtk-v2' branch on my tree at
>
>  git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
>
>
> Any comments are welcome, thanks!
> Namhyung
>
> Namhyung Kim (6):
>   perf gtk/hists: Use GtkTreeStore instead of GtkListStore
>   perf gtk/hists: Add support for callchains
>   perf gtk/hists: Display callchain overhead also
>   perf gtk/hists: Make column headers resizable
>   perf gtk/hists: Add a double-click handler for callchains
>   perf gtk/hists: Set rules hint for the hist browser
>
>  tools/perf/ui/gtk/hists.c | 117 ++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 112 insertions(+), 5 deletions(-)

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

* Re: [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2)
  2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
                   ` (6 preceding siblings ...)
  2013-07-04  8:39 ` [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
@ 2013-07-05 15:04 ` Arnaldo Carvalho de Melo
  7 siblings, 0 replies; 18+ messages in thread
From: Arnaldo Carvalho de Melo @ 2013-07-05 15:04 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Peter Zijlstra, Paul Mackerras, Ingo Molnar, Namhyung Kim, LKML,
	Pekka Enberg, Jiri Olsa, David Ahern

Em Tue, Jun 04, 2013 at 06:22:11PM +0900, Namhyung Kim escreveu:
> Hi,
> 
> This patchset implements callchain support in GTK report browser as
> Pekka requested.  Please take a look and give me comments.
> 
> v2 changes)
>  * fix a bug on percent calculation of children nodes
>  * show topmost symbol only when multiple paths exist for a node
>  * add alternating background colors (Ingo)
>  * put callchain info into existing overhead and symbol column (Arnaldo)

Thanks, applied.

- Arnaldo

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

* [tip:perf/core] perf gtk/hists: Use GtkTreeStore instead of GtkListStore
  2013-06-04  9:22 ` [PATCH 1/6] perf gtk/hists: Use GtkTreeStore instead of GtkListStore Namhyung Kim
@ 2013-07-19  7:48   ` tip-bot for Namhyung Kim
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-07-19  7:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, penberg,
	namhyung.kim, namhyung, jolsa, dsahern, tglx

Commit-ID:  f1d9a530553eed9e598d1597a2a348f01810dd4a
Gitweb:     http://git.kernel.org/tip/f1d9a530553eed9e598d1597a2a348f01810dd4a
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Tue, 4 Jun 2013 18:22:12 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 12 Jul 2013 13:52:36 -0300

perf gtk/hists: Use GtkTreeStore instead of GtkListStore

The GtkTreeStore can save items in a tree-like way.  This is a
preparation for supporting callgraphs in the hist browser.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1370337737-30812-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/hists.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 9708dd5..cb6a9b4 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -131,7 +131,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 	GType col_types[MAX_COLUMNS];
 	GtkCellRenderer *renderer;
 	struct sort_entry *se;
-	GtkListStore *store;
+	GtkTreeStore *store;
 	struct rb_node *nd;
 	GtkWidget *view;
 	int col_idx;
@@ -156,7 +156,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		col_types[nr_cols++] = G_TYPE_STRING;
 	}
 
-	store = gtk_list_store_newv(nr_cols, col_types);
+	store = gtk_tree_store_newv(nr_cols, col_types);
 
 	view = gtk_tree_view_new();
 
@@ -199,7 +199,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		if (percent < min_pcnt)
 			continue;
 
-		gtk_list_store_append(store, &iter);
+		gtk_tree_store_append(store, &iter, NULL);
 
 		col_idx = 0;
 
@@ -209,7 +209,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 			else
 				fmt->entry(&hpp, h);
 
-			gtk_list_store_set(store, &iter, col_idx++, s, -1);
+			gtk_tree_store_set(store, &iter, col_idx++, s, -1);
 		}
 
 		list_for_each_entry(se, &hist_entry__sort_list, list) {
@@ -219,7 +219,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 			se->se_snprintf(h, s, ARRAY_SIZE(s),
 					hists__col_len(hists, se->se_width_idx));
 
-			gtk_list_store_set(store, &iter, col_idx++, s, -1);
+			gtk_tree_store_set(store, &iter, col_idx++, s, -1);
 		}
 	}
 

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

* [tip:perf/core] perf gtk/hists: Add support for callchains
  2013-06-04  9:22 ` [PATCH 2/6] perf gtk/hists: Add support for callchains Namhyung Kim
  2013-06-04  9:34   ` Pekka Enberg
@ 2013-07-19  7:48   ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-07-19  7:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, penberg,
	namhyung.kim, namhyung, jolsa, dsahern, tglx

Commit-ID:  2bbc5874251830fee170a0fc97fa5788717d2fd9
Gitweb:     http://git.kernel.org/tip/2bbc5874251830fee170a0fc97fa5788717d2fd9
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Tue, 4 Jun 2013 18:22:13 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 12 Jul 2013 13:52:38 -0300

perf gtk/hists: Add support for callchains

Display callchain information in the symbol column.  It's only enabled
when recorded with -g and has symbol sort key.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1370337737-30812-3-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/hists.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index cb6a9b4..226c7e1 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -124,6 +124,55 @@ void perf_gtk__init_hpp(void)
 				perf_gtk__hpp_color_overhead_guest_us;
 }
 
+static void callchain_list__sym_name(struct callchain_list *cl,
+				     char *bf, size_t bfsize)
+{
+	if (cl->ms.sym)
+		scnprintf(bf, bfsize, "%s", cl->ms.sym->name);
+	else
+		scnprintf(bf, bfsize, "%#" PRIx64, cl->ip);
+}
+
+static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
+				    GtkTreeIter *parent, int col)
+{
+	struct rb_node *nd;
+	bool has_single_node = (rb_first(root) == rb_last(root));
+
+	for (nd = rb_first(root); nd; nd = rb_next(nd)) {
+		struct callchain_node *node;
+		struct callchain_list *chain;
+		GtkTreeIter iter, new_parent;
+		bool need_new_parent;
+
+		node = rb_entry(nd, struct callchain_node, rb_node);
+
+		new_parent = *parent;
+		need_new_parent = !has_single_node && (node->val_nr > 1);
+
+		list_for_each_entry(chain, &node->val, list) {
+			char buf[128];
+
+			gtk_tree_store_append(store, &iter, &new_parent);
+
+			callchain_list__sym_name(chain, buf, sizeof(buf));
+			gtk_tree_store_set(store, &iter, col, buf, -1);
+
+			if (need_new_parent) {
+				/*
+				 * Only show the top-most symbol in a callchain
+				 * if it's not the only callchain.
+				 */
+				new_parent = iter;
+				need_new_parent = false;
+			}
+		}
+
+		/* Now 'iter' contains info of the last callchain_list */
+		perf_gtk__add_callchain(&node->rb_root, store, &iter, col);
+	}
+}
+
 static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 				 float min_pcnt)
 {
@@ -135,6 +184,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 	struct rb_node *nd;
 	GtkWidget *view;
 	int col_idx;
+	int sym_col = -1;
 	int nr_cols;
 	char s[512];
 
@@ -153,6 +203,9 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		if (se->elide)
 			continue;
 
+		if (se == &sort_sym)
+			sym_col = nr_cols;
+
 		col_types[nr_cols++] = G_TYPE_STRING;
 	}
 
@@ -183,6 +236,13 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 							    col_idx++, NULL);
 	}
 
+	if (symbol_conf.use_callchain && sort__has_sym) {
+		GtkTreeViewColumn *column;
+
+		column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), sym_col);
+		gtk_tree_view_set_expander_column(GTK_TREE_VIEW(view), column);
+	}
+
 	gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));
 
 	g_object_unref(GTK_TREE_MODEL(store));
@@ -221,6 +281,11 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 
 			gtk_tree_store_set(store, &iter, col_idx++, s, -1);
 		}
+
+		if (symbol_conf.use_callchain && sort__has_sym) {
+			perf_gtk__add_callchain(&h->sorted_chain, store, &iter,
+						sym_col);
+		}
 	}
 
 	gtk_container_add(GTK_CONTAINER(window), view);

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

* [tip:perf/core] perf gtk/hists: Display callchain overhead also
  2013-06-04  9:22 ` [PATCH 3/6] perf gtk/hists: Display callchain overhead also Namhyung Kim
  2013-06-04  9:35   ` Pekka Enberg
@ 2013-07-19  7:48   ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-07-19  7:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, penberg,
	namhyung.kim, namhyung, jolsa, dsahern, tglx

Commit-ID:  cc60f24e225e50a0b57398f9ba105fd8ffcf4bb3
Gitweb:     http://git.kernel.org/tip/cc60f24e225e50a0b57398f9ba105fd8ffcf4bb3
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Tue, 4 Jun 2013 18:22:14 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 12 Jul 2013 13:52:40 -0300

perf gtk/hists: Display callchain overhead also

Display callchain percent value in the overhead column.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1370337737-30812-4-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/hists.c | 27 ++++++++++++++++++++++++---
 1 file changed, 24 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 226c7e1..fa9f8a0 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -134,7 +134,7 @@ static void callchain_list__sym_name(struct callchain_list *cl,
 }
 
 static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
-				    GtkTreeIter *parent, int col)
+				    GtkTreeIter *parent, int col, u64 total)
 {
 	struct rb_node *nd;
 	bool has_single_node = (rb_first(root) == rb_last(root));
@@ -144,9 +144,14 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 		struct callchain_list *chain;
 		GtkTreeIter iter, new_parent;
 		bool need_new_parent;
+		double percent;
+		u64 hits, child_total;
 
 		node = rb_entry(nd, struct callchain_node, rb_node);
 
+		hits = callchain_cumul_hits(node);
+		percent = 100.0 * hits / total;
+
 		new_parent = *parent;
 		need_new_parent = !has_single_node && (node->val_nr > 1);
 
@@ -155,6 +160,9 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 
 			gtk_tree_store_append(store, &iter, &new_parent);
 
+			scnprintf(buf, sizeof(buf), "%5.2f%%", percent);
+			gtk_tree_store_set(store, &iter, 0, buf, -1);
+
 			callchain_list__sym_name(chain, buf, sizeof(buf));
 			gtk_tree_store_set(store, &iter, col, buf, -1);
 
@@ -168,8 +176,14 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 			}
 		}
 
+		if (callchain_param.mode == CHAIN_GRAPH_REL)
+			child_total = node->children_hit;
+		else
+			child_total = total;
+
 		/* Now 'iter' contains info of the last callchain_list */
-		perf_gtk__add_callchain(&node->rb_root, store, &iter, col);
+		perf_gtk__add_callchain(&node->rb_root, store, &iter, col,
+					child_total);
 	}
 }
 
@@ -283,8 +297,15 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		}
 
 		if (symbol_conf.use_callchain && sort__has_sym) {
+			u64 total;
+
+			if (callchain_param.mode == CHAIN_GRAPH_REL)
+				total = h->stat.period;
+			else
+				total = hists->stats.total_period;
+
 			perf_gtk__add_callchain(&h->sorted_chain, store, &iter,
-						sym_col);
+						sym_col, total);
 		}
 	}
 

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

* [tip:perf/core] perf gtk/hists: Make column headers resizable
  2013-06-04  9:22 ` [PATCH 4/6] perf gtk/hists: Make column headers resizable Namhyung Kim
@ 2013-07-19  7:48   ` tip-bot for Namhyung Kim
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-07-19  7:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, penberg,
	namhyung.kim, namhyung, jolsa, dsahern, tglx

Commit-ID:  1a309426b4fae258dbd86ac0c575a849bf163b7b
Gitweb:     http://git.kernel.org/tip/1a309426b4fae258dbd86ac0c575a849bf163b7b
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Tue, 4 Jun 2013 18:22:15 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 12 Jul 2013 13:52:42 -0300

perf gtk/hists: Make column headers resizable

Sometimes it's annoying to see when some symbols have very wierd long
names.  So it might be a good idea to make column size changable.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1370337737-30812-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/hists.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index fa9f8a0..b4a0dd2 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -250,11 +250,16 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 							    col_idx++, NULL);
 	}
 
-	if (symbol_conf.use_callchain && sort__has_sym) {
+	for (col_idx = 0; col_idx < nr_cols; col_idx++) {
 		GtkTreeViewColumn *column;
 
-		column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), sym_col);
-		gtk_tree_view_set_expander_column(GTK_TREE_VIEW(view), column);
+		column = gtk_tree_view_get_column(GTK_TREE_VIEW(view), col_idx);
+		gtk_tree_view_column_set_resizable(column, TRUE);
+
+		if (col_idx == sym_col) {
+			gtk_tree_view_set_expander_column(GTK_TREE_VIEW(view),
+							  column);
+		}
 	}
 
 	gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));

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

* [tip:perf/core] perf gtk/hists: Add a double-click handler for callchains
  2013-06-04  9:22 ` [PATCH 5/6] perf gtk/hists: Add a double-click handler for callchains Namhyung Kim
@ 2013-07-19  7:48   ` tip-bot for Namhyung Kim
  0 siblings, 0 replies; 18+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-07-19  7:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, penberg,
	namhyung.kim, namhyung, jolsa, dsahern, tglx

Commit-ID:  450f390ad2538c5e35d830fa5c624708a77dce0a
Gitweb:     http://git.kernel.org/tip/450f390ad2538c5e35d830fa5c624708a77dce0a
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Tue, 4 Jun 2013 18:22:16 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 12 Jul 2013 13:52:43 -0300

perf gtk/hists: Add a double-click handler for callchains

If callchain is displayed, add "row-activated" signal handler for
handling double-click or pressing ENTER key action.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1370337737-30812-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/hists.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index b4a0dd2..3a5d013 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -187,6 +187,18 @@ static void perf_gtk__add_callchain(struct rb_root *root, GtkTreeStore *store,
 	}
 }
 
+static void on_row_activated(GtkTreeView *view, GtkTreePath *path,
+			     GtkTreeViewColumn *col __maybe_unused,
+			     gpointer user_data __maybe_unused)
+{
+	bool expanded = gtk_tree_view_row_expanded(view, path);
+
+	if (expanded)
+		gtk_tree_view_collapse_row(view, path);
+	else
+		gtk_tree_view_expand_row(view, path, FALSE);
+}
+
 static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 				 float min_pcnt)
 {
@@ -314,6 +326,8 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		}
 	}
 
+	g_signal_connect(view, "row-activated",
+			 G_CALLBACK(on_row_activated), NULL);
 	gtk_container_add(GTK_CONTAINER(window), view);
 }
 

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

* [tip:perf/core] perf gtk/hists: Set rules hint for the hist browser
  2013-06-04  9:22 ` [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser Namhyung Kim
  2013-06-04  9:35   ` Pekka Enberg
@ 2013-07-19  7:49   ` tip-bot for Namhyung Kim
  1 sibling, 0 replies; 18+ messages in thread
From: tip-bot for Namhyung Kim @ 2013-07-19  7:49 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: acme, linux-kernel, paulus, hpa, mingo, a.p.zijlstra, penberg,
	namhyung.kim, namhyung, jolsa, dsahern, tglx

Commit-ID:  9d58d2f66c92fe47dd395947a3d51b9ace7dcc92
Gitweb:     http://git.kernel.org/tip/9d58d2f66c92fe47dd395947a3d51b9ace7dcc92
Author:     Namhyung Kim <namhyung.kim@lge.com>
AuthorDate: Tue, 4 Jun 2013 18:22:17 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 12 Jul 2013 13:52:45 -0300

perf gtk/hists: Set rules hint for the hist browser

The 'rules' means that every second line of the tree view has a shaded
background, which makes it easier to see which cell belongs to which
row in the tree view.  It can be useful for a tree view that has a lot
of rows.

Reviewed-by: Pekka Enberg <penberg@kernel.org>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1370337737-30812-7-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/gtk/hists.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 3a5d013..3254903 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -326,6 +326,8 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists,
 		}
 	}
 
+	gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(view), TRUE);
+
 	g_signal_connect(view, "row-activated",
 			 G_CALLBACK(on_row_activated), NULL);
 	gtk_container_add(GTK_CONTAINER(window), view);

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

end of thread, other threads:[~2013-07-19  7:49 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-04  9:22 [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
2013-06-04  9:22 ` [PATCH 1/6] perf gtk/hists: Use GtkTreeStore instead of GtkListStore Namhyung Kim
2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
2013-06-04  9:22 ` [PATCH 2/6] perf gtk/hists: Add support for callchains Namhyung Kim
2013-06-04  9:34   ` Pekka Enberg
2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
2013-06-04  9:22 ` [PATCH 3/6] perf gtk/hists: Display callchain overhead also Namhyung Kim
2013-06-04  9:35   ` Pekka Enberg
2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
2013-06-04  9:22 ` [PATCH 4/6] perf gtk/hists: Make column headers resizable Namhyung Kim
2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
2013-06-04  9:22 ` [PATCH 5/6] perf gtk/hists: Add a double-click handler for callchains Namhyung Kim
2013-07-19  7:48   ` [tip:perf/core] " tip-bot for Namhyung Kim
2013-06-04  9:22 ` [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser Namhyung Kim
2013-06-04  9:35   ` Pekka Enberg
2013-07-19  7:49   ` [tip:perf/core] " tip-bot for Namhyung Kim
2013-07-04  8:39 ` [PATCHSET 0/6] perf report: Add support for callchains on GTK browser (v2) Namhyung Kim
2013-07-05 15:04 ` Arnaldo Carvalho de Melo

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.