perf report: Add support for callchains on GTK browser (v2)
Namhyung Kim
maintainercover perf report: Add support for callchains on GTK browser (v2)
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(-)
Signature · 1 line
1.7.11.7
Namhyung Kim
maintainerPATCH 1/6 perf gtk/hists: Use GtkTreeStore instead of GtkListStore
From: Namhyung Kim <[email protected]>
The GtkTreeStore can save items in a tree-like way. This is a preparation for supporting callgraphs in the hist browser.
--- tools/perf/ui/gtk/hists.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tools/perf/ui/gtk/hists.c +5 -5
@@ -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 ); } }
Signature · 1 line
1.7.11.7
tip-bot for Namhyung Kim
merge bot[tip:perf/core] perf gtk/hists: Use GtkTreeStore instead of GtkListStore
perf gtk/hists: Use GtkTreeStore instead of GtkListStore
Commit-ID: f1d9a530553eed9e598d1597a2a348f01810dd4a Gitweb: http://git.kernel.org/tip/f1d9a530553eed9e598d1597a2a348f01810dd4a Author: Namhyung Kim <[email protected]> AuthorDate: Tue, 4 Jun 2013 18:22:12 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> 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.
--- tools/perf/ui/gtk/hists.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
tools/perf/ui/gtk/hists.c +5 -5
@@ -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 ); } }
Namhyung Kim
maintainerPATCH 2/6 perf gtk/hists: Add support for callchains
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
Display callchain information in the symbol column. It's only enabled when recorded with -g and has symbol sort key.
--- tools/perf/ui/gtk/hists.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+)
tools/perf/ui/gtk/hists.c +65 -0
@@ -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);
Signature · 1 line
1.7.11.7
Re: [PATCH 2/6] perf gtk/hists: Add support for callchains
Quoted 7 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
Display callchain information in the symbol column. It's only enabled when recorded with -g and has symbol sort key.
Cc Pekka Enberg <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
tip-bot for Namhyung Kim
merge bot[tip:perf/core] perf gtk/hists: Add support for callchains
In reply to Namhyung Kimperf gtk/hists: Add support for callchains
Commit-ID: 2bbc5874251830fee170a0fc97fa5788717d2fd9 Gitweb: http://git.kernel.org/tip/2bbc5874251830fee170a0fc97fa5788717d2fd9 Author: Namhyung Kim <[email protected]> AuthorDate: Tue, 4 Jun 2013 18:22:13 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> 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.
--- tools/perf/ui/gtk/hists.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+)
tools/perf/ui/gtk/hists.c +65 -0
@@ -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);
Namhyung Kim
maintainerPATCH 3/6 perf gtk/hists: Display callchain overhead also
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
Display callchain percent value in the overhead column.
--- tools/perf/ui/gtk/hists.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
tools/perf/ui/gtk/hists.c +24 -3
@@ -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); } }
Signature · 1 line
1.7.11.7
Re: [PATCH 3/6] perf gtk/hists: Display callchain overhead also
Quoted 6 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
Display callchain percent value in the overhead column.
Cc Pekka Enberg <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
tip-bot for Namhyung Kim
merge bot[tip:perf/core] perf gtk/hists: Display callchain overhead also
In reply to Namhyung Kimperf gtk/hists: Display callchain overhead also
Commit-ID: cc60f24e225e50a0b57398f9ba105fd8ffcf4bb3 Gitweb: http://git.kernel.org/tip/cc60f24e225e50a0b57398f9ba105fd8ffcf4bb3 Author: Namhyung Kim <[email protected]> AuthorDate: Tue, 4 Jun 2013 18:22:14 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 12 Jul 2013 13:52:40 -0300
perf gtk/hists: Display callchain overhead also
Display callchain percent value in the overhead column.
--- tools/perf/ui/gtk/hists.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
tools/perf/ui/gtk/hists.c +24 -3
@@ -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); } }
Namhyung Kim
maintainerPATCH 4/6 perf gtk/hists: Make column headers resizable
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
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.
--- tools/perf/ui/gtk/hists.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
tools/perf/ui/gtk/hists.c +8 -3
@@ -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));
Signature · 1 line
1.7.11.7
tip-bot for Namhyung Kim
merge bot[tip:perf/core] perf gtk/hists: Make column headers resizable
perf gtk/hists: Make column headers resizable
Commit-ID: 1a309426b4fae258dbd86ac0c575a849bf163b7b Gitweb: http://git.kernel.org/tip/1a309426b4fae258dbd86ac0c575a849bf163b7b Author: Namhyung Kim <[email protected]> AuthorDate: Tue, 4 Jun 2013 18:22:15 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> 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.
--- tools/perf/ui/gtk/hists.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
tools/perf/ui/gtk/hists.c +8 -3
@@ -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));
Namhyung Kim
maintainerPATCH 5/6 perf gtk/hists: Add a double-click handler for callchains
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
If callchain is displayed, add "row-activated" signal handler for handling double-click or pressing ENTER key action.
--- tools/perf/ui/gtk/hists.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
tools/perf/ui/gtk/hists.c +14 -0
@@ -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); }
Signature · 1 line
1.7.11.7
tip-bot for Namhyung Kim
merge bot[tip:perf/core] perf gtk/hists: Add a double-click handler for callchains
perf gtk/hists: Add a double-click handler for callchains
Commit-ID: 450f390ad2538c5e35d830fa5c624708a77dce0a Gitweb: http://git.kernel.org/tip/450f390ad2538c5e35d830fa5c624708a77dce0a Author: Namhyung Kim <[email protected]> AuthorDate: Tue, 4 Jun 2013 18:22:16 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> 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.
--- tools/perf/ui/gtk/hists.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
tools/perf/ui/gtk/hists.c +14 -0
@@ -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); }
Namhyung Kim
maintainerPATCH 6/6 perf gtk/hists: Set rules hint for the hist browser
In reply to Namhyung KimFrom: Namhyung Kim <[email protected]>
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.
--- tools/perf/ui/gtk/hists.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/ui/gtk/hists.c +2 -0
@@ -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);
Signature · 1 line
1.7.11.7
Re: [PATCH 6/6] perf gtk/hists: Set rules hint for the hist browser
Quoted 9 lines · Namhyung Kim
From: Namhyung Kim <[email protected]>
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 <[email protected]>Signed-off-by Namhyung Kim <[email protected]>
tip-bot for Namhyung Kim
merge bot[tip:perf/core] perf gtk/hists: Set rules hint for the hist browser
In reply to Namhyung Kimperf gtk/hists: Set rules hint for the hist browser
Commit-ID: 9d58d2f66c92fe47dd395947a3d51b9ace7dcc92 Gitweb: http://git.kernel.org/tip/9d58d2f66c92fe47dd395947a3d51b9ace7dcc92 Author: Namhyung Kim <[email protected]> AuthorDate: Tue, 4 Jun 2013 18:22:17 +0900 Committer: Arnaldo Carvalho de Melo <[email protected]> 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.
--- tools/perf/ui/gtk/hists.c | 2 ++ 1 file changed, 2 insertions(+)
tools/perf/ui/gtk/hists.c +2 -0
@@ -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);
Namhyung Kim
maintainerPing!
Quoted 29 lines · Namhyung Kim
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.gitAny comments are welcome, thanks!
NamhyungNamhyung 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 browsertools/perf/ui/gtk/hists.c | 117 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 112 insertions(+), 5 deletions(-)
Arnaldo Carvalho de Melo
AppliedEm Tue, Jun 04, 2013 at 06:22:11PM +0900, Namhyung Kim escreveu:
Quoted 10 lines
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