Skip to content

Commit 787e4da

Browse files
Jin Yaoacmel
authored andcommitted
perf annotate: Show group event string for stdio
When we enable the group, for tui/stdio2, the output first line includes the group event string. While for stdio, it will show only one event. For example, perf record -e cycles,branches ./div perf annotate --group --stdio Percent | Source code & Disassembly of div for cycles (44407 samples) ...... The first line doesn't include the event 'branches'. With this patch, it will show the correct group even string. perf annotate --group --stdio Percent | Source code & Disassembly of div for cycles, branches (44407 samples) ...... Signed-off-by: Jin Yao <[email protected]> Suggested-by: Arnaldo Carvalho de Melo <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent a8ce99b commit 787e4da

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/perf/util/annotate.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,6 +1965,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
19651965
u64 len;
19661966
int width = symbol_conf.show_total_period ? 12 : 8;
19671967
int graph_dotted_len;
1968+
char buf[512];
19681969

19691970
filename = strdup(dso->long_name);
19701971
if (!filename)
@@ -1977,8 +1978,11 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map,
19771978

19781979
len = symbol__size(sym);
19791980

1980-
if (perf_evsel__is_group_event(evsel))
1981+
if (perf_evsel__is_group_event(evsel)) {
19811982
width *= evsel->nr_members;
1983+
perf_evsel__group_desc(evsel, buf, sizeof(buf));
1984+
evsel_name = buf;
1985+
}
19821986

19831987
graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n",
19841988
width, width, symbol_conf.show_total_period ? "Period" :

0 commit comments

Comments
 (0)