[tip:perf/core] perf annotate/gtk: Support event group view on GTK

From: tip-bot for Namhyung Kim
Date: Thu Mar 21 2013 - 07:26:03 EST


Commit-ID: d8d7cd93e6b5f42bd2ae77680b5dc27415ba7492
Gitweb: http://git.kernel.org/tip/d8d7cd93e6b5f42bd2ae77680b5dc27415ba7492
Author: Namhyung Kim <namhyung.kim@xxxxxxx>
AuthorDate: Tue, 5 Mar 2013 14:53:32 +0900
Committer: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
CommitDate: Fri, 15 Mar 2013 13:06:07 -0300

perf annotate/gtk: Support event group view on GTK

Add support for event group view to GTK annotation browser.

Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: Andi Kleen <andi@xxxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Pekka Enberg <penberg@xxxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Link: http://lkml.kernel.org/r/1362462812-30885-13-git-send-email-namhyung@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/ui/gtk/annotate.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c
index 6e2fc7e..f538794 100644
--- a/tools/perf/ui/gtk/annotate.c
+++ b/tools/perf/ui/gtk/annotate.c
@@ -33,7 +33,7 @@ static int perf_gtk__get_percent(char *buf, size_t size, struct symbol *sym,
return 0;

symhist = annotation__histogram(symbol__annotation(sym), evidx);
- if (!symhist->addr[dl->offset])
+ if (!symbol_conf.event_group && !symhist->addr[dl->offset])
return 0;

percent = 100.0 * symhist->addr[dl->offset] / symhist->sum;
@@ -119,10 +119,24 @@ static int perf_gtk__annotate_symbol(GtkWidget *window, struct symbol *sym,

list_for_each_entry(pos, &notes->src->source, node) {
GtkTreeIter iter;
+ int ret = 0;

gtk_list_store_append(store, &iter);

- if (perf_gtk__get_percent(s, sizeof(s), sym, pos, evsel->idx))
+ if (perf_evsel__is_group_event(evsel)) {
+ for (i = 0; i < evsel->nr_members; i++) {
+ ret += perf_gtk__get_percent(s + ret,
+ sizeof(s) - ret,
+ sym, pos,
+ evsel->idx + i);
+ ret += scnprintf(s + ret, sizeof(s) - ret, " ");
+ }
+ } else {
+ ret = perf_gtk__get_percent(s, sizeof(s), sym, pos,
+ evsel->idx);
+ }
+
+ if (ret)
gtk_list_store_set(store, &iter, ANN_COL__PERCENT, s, -1);
if (perf_gtk__get_offset(s, sizeof(s), sym, map, pos))
gtk_list_store_set(store, &iter, ANN_COL__OFFSET, s, -1);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/