Skip to content

Commit

Permalink
perf report: Make another loop for linking group hists
Browse files Browse the repository at this point in the history
Now the event grouping viewing requires linking all member hists in a
group to the leader's.  Thus hists__output_resort should be called after
linking all events in evlist.

Introduce symbol_conf.event_group flag to determine whether the feature
is enabled or not.

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: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1358845787-1350-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
  • Loading branch information
Namhyung Kim authored and Arnaldo Carvalho de Melo committed Jan 31, 2013
1 parent a8bb559 commit 6e1f601
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 12 additions & 1 deletion tools/perf/builtin-report.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,26 @@ static int __cmd_report(struct perf_report *rep)
hists->symbol_filter_str = rep->symbol_filter_str;

hists__collapse_resort(hists);
hists__output_resort(hists);
nr_samples += hists->stats.nr_events[PERF_RECORD_SAMPLE];

/* Non-group events are considered as leader */
if (symbol_conf.event_group &&
!perf_evsel__is_group_leader(pos)) {
struct hists *leader_hists = &pos->leader->hists;

hists__match(leader_hists, hists);
hists__link(leader_hists, hists);
}
}

if (nr_samples == 0) {
ui__error("The %s file has no samples!\n", session->filename);
goto out_delete;
}

list_for_each_entry(pos, &session->evlist->entries, node)
hists__output_resort(&pos->hists);

if (use_browser > 0) {
if (use_browser == 1) {
perf_evlist__tui_browse_hists(session->evlist, help,
Expand Down
3 changes: 2 additions & 1 deletion tools/perf/util/symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ struct symbol_conf {
initialized,
kptr_restrict,
annotate_asm_raw,
annotate_src;
annotate_src,
event_group;
const char *vmlinux_name,
*kallsyms_name,
*source_prefix,
Expand Down

0 comments on commit 6e1f601

Please sign in to comment.