diff options
author | Jin Yao <yao.jin@linux.intel.com> | 2018-05-22 07:38:35 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-23 09:26:40 -0400 |
commit | 787e4da9f95fd44376b3af6fa163ac0b3a48a1fc (patch) | |
tree | b3bea4396b06e51281a0d5cfc8990325338ff099 /tools/perf/util/annotate.c | |
parent | a8ce99b0ee9ad32debad0a9f28d21451ba237cc1 (diff) |
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 <yao.jin@linux.intel.com>
Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1526989115-14435-1-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r-- | tools/perf/util/annotate.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index 6612c7f90af4..71897689dacf 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c | |||
@@ -1965,6 +1965,7 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1965 | u64 len; | 1965 | u64 len; |
1966 | int width = symbol_conf.show_total_period ? 12 : 8; | 1966 | int width = symbol_conf.show_total_period ? 12 : 8; |
1967 | int graph_dotted_len; | 1967 | int graph_dotted_len; |
1968 | char buf[512]; | ||
1968 | 1969 | ||
1969 | filename = strdup(dso->long_name); | 1970 | filename = strdup(dso->long_name); |
1970 | if (!filename) | 1971 | if (!filename) |
@@ -1977,8 +1978,11 @@ int symbol__annotate_printf(struct symbol *sym, struct map *map, | |||
1977 | 1978 | ||
1978 | len = symbol__size(sym); | 1979 | len = symbol__size(sym); |
1979 | 1980 | ||
1980 | if (perf_evsel__is_group_event(evsel)) | 1981 | if (perf_evsel__is_group_event(evsel)) { |
1981 | width *= evsel->nr_members; | 1982 | width *= evsel->nr_members; |
1983 | perf_evsel__group_desc(evsel, buf, sizeof(buf)); | ||
1984 | evsel_name = buf; | ||
1985 | } | ||
1982 | 1986 | ||
1983 | graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n", | 1987 | graph_dotted_len = printf(" %-*.*s| Source code & Disassembly of %s for %s (%" PRIu64 " samples)\n", |
1984 | width, width, symbol_conf.show_total_period ? "Period" : | 1988 | width, width, symbol_conf.show_total_period ? "Period" : |