summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorJiri Olsa2017-10-11 17:01:39 +0200
committerArnaldo Carvalho de Melo2017-11-13 13:40:00 +0100
commit7e304557ead5b309d59807b2f05ed47f2c0076c6 (patch)
treee5800975a0a43926db288a7fd4342ac31224e3f1 /tools/perf/util/annotate.c
parentperf annotate: Add annotated_source__purge function (diff)
downloadkernel-qcow2-linux-7e304557ead5b309d59807b2f05ed47f2c0076c6.tar.gz
kernel-qcow2-linux-7e304557ead5b309d59807b2f05ed47f2c0076c6.tar.xz
kernel-qcow2-linux-7e304557ead5b309d59807b2f05ed47f2c0076c6.zip
perf annotate: Add samples into struct annotation_line
Add samples array into struct annotation_line to hold the annotation data. The data is populated in the following patches. Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Andi Kleen <andi@firstfloor.org> Cc: David Ahern <dsahern@gmail.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20171011150158.11895-17-jolsa@kernel.org 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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 0c2eb95ba90a..313fb2e90dba 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -911,7 +911,14 @@ static struct annotation_line *
annotation_line__new(struct annotate_args *args, size_t privsize)
{
struct annotation_line *al;
+ struct perf_evsel *evsel = args->evsel;
size_t size = privsize + sizeof(*al);
+ int nr = 1;
+
+ if (perf_evsel__is_group_event(evsel))
+ nr = evsel->nr_members;
+
+ size += sizeof(al->samples[0]) * nr;
al = zalloc(size);
if (al) {
@@ -920,6 +927,7 @@ annotation_line__new(struct annotate_args *args, size_t privsize)
al->offset = args->offset;
al->line = strdup(args->line);
al->line_nr = args->line_nr;
+ al->samples_nr = nr;
}
return al;