diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2013-01-22 04:09:44 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-01-31 11:07:48 -0500 |
commit | 717e263fc354d53d0961e952b779d14a42c8ea66 (patch) | |
tree | 8bac96ac04d96d7544d9443fb29599480bb88a2f /tools/perf/ui | |
parent | fc24d7c25c9d880ae012548d522fe13caee556ed (diff) |
perf report: Show group description when event group is enabled
When using event group viewer, it's better to show the group description
rather than the leader information alone.
If a leader did not contain any member, it's a non-group event.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@redhat.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>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1358845787-1350-17-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 25 | ||||
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 14 |
2 files changed, 36 insertions, 3 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 167f7701f94e..20ccd57753f7 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1189,6 +1189,21 @@ static int hists__browser_title(struct hists *hists, char *bf, size_t size, | |||
1189 | const struct thread *thread = hists->thread_filter; | 1189 | const struct thread *thread = hists->thread_filter; |
1190 | unsigned long nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; | 1190 | unsigned long nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; |
1191 | u64 nr_events = hists->stats.total_period; | 1191 | u64 nr_events = hists->stats.total_period; |
1192 | struct perf_evsel *evsel = hists_to_evsel(hists); | ||
1193 | char buf[512]; | ||
1194 | size_t buflen = sizeof(buf); | ||
1195 | |||
1196 | if (symbol_conf.event_group && evsel->nr_members > 1) { | ||
1197 | struct perf_evsel *pos; | ||
1198 | |||
1199 | perf_evsel__group_desc(evsel, buf, buflen); | ||
1200 | ev_name = buf; | ||
1201 | |||
1202 | for_each_group_member(pos, evsel) { | ||
1203 | nr_samples += pos->hists.stats.nr_events[PERF_RECORD_SAMPLE]; | ||
1204 | nr_events += pos->hists.stats.total_period; | ||
1205 | } | ||
1206 | } | ||
1192 | 1207 | ||
1193 | nr_samples = convert_unit(nr_samples, &unit); | 1208 | nr_samples = convert_unit(nr_samples, &unit); |
1194 | printed = scnprintf(bf, size, | 1209 | printed = scnprintf(bf, size, |
@@ -1585,6 +1600,16 @@ static void perf_evsel_menu__write(struct ui_browser *browser, | |||
1585 | ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : | 1600 | ui_browser__set_color(browser, current_entry ? HE_COLORSET_SELECTED : |
1586 | HE_COLORSET_NORMAL); | 1601 | HE_COLORSET_NORMAL); |
1587 | 1602 | ||
1603 | if (symbol_conf.event_group && evsel->nr_members > 1) { | ||
1604 | struct perf_evsel *pos; | ||
1605 | |||
1606 | ev_name = perf_evsel__group_name(evsel); | ||
1607 | |||
1608 | for_each_group_member(pos, evsel) { | ||
1609 | nr_events += pos->hists.stats.nr_events[PERF_RECORD_SAMPLE]; | ||
1610 | } | ||
1611 | } | ||
1612 | |||
1588 | nr_events = convert_unit(nr_events, &unit); | 1613 | nr_events = convert_unit(nr_events, &unit); |
1589 | printed = scnprintf(bf, sizeof(bf), "%lu%c%s%s", nr_events, | 1614 | printed = scnprintf(bf, sizeof(bf), "%lu%c%s%s", nr_events, |
1590 | unit, unit == ' ' ? "" : " ", ev_name); | 1615 | unit, unit == ' ' ? "" : " ", ev_name); |
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 9c02c4c0f3b7..1e764a8ad259 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -270,10 +270,18 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, | |||
270 | const char *evname = perf_evsel__name(pos); | 270 | const char *evname = perf_evsel__name(pos); |
271 | GtkWidget *scrolled_window; | 271 | GtkWidget *scrolled_window; |
272 | GtkWidget *tab_label; | 272 | GtkWidget *tab_label; |
273 | char buf[512]; | ||
274 | size_t size = sizeof(buf); | ||
273 | 275 | ||
274 | if (symbol_conf.event_group && | 276 | if (symbol_conf.event_group) { |
275 | !perf_evsel__is_group_leader(pos)) | 277 | if (!perf_evsel__is_group_leader(pos)) |
276 | continue; | 278 | continue; |
279 | |||
280 | if (pos->nr_members > 1) { | ||
281 | perf_evsel__group_desc(pos, buf, size); | ||
282 | evname = buf; | ||
283 | } | ||
284 | } | ||
277 | 285 | ||
278 | scrolled_window = gtk_scrolled_window_new(NULL, NULL); | 286 | scrolled_window = gtk_scrolled_window_new(NULL, NULL); |
279 | 287 | ||