summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorJiri Olsa2017-10-11 17:01:34 +0200
committerArnaldo Carvalho de Melo2017-11-13 13:39:59 +0100
commitc4c724364d398a9746410d5ff482e8c4c7228249 (patch)
treeab2fbbf54cb1b6418f0afcfb6117ffb9bca81fde /tools/perf/util/annotate.c
parentperf annotate: Add evsel into struct annotation_line_args (diff)
downloadkernel-qcow2-linux-c4c724364d398a9746410d5ff482e8c4c7228249.tar.gz
kernel-qcow2-linux-c4c724364d398a9746410d5ff482e8c4c7228249.tar.xz
kernel-qcow2-linux-c4c724364d398a9746410d5ff482e8c4c7228249.zip
perf annotate: Add annotation_line__next function
Rename disasm__get_next_ip_line() to annotation_line__next() to make it work over a generic struct annotation_line. 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-12-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.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 75f54eab22c8..e7da88d7bb27 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -942,10 +942,11 @@ static void disasm__add(struct list_head *head, struct disasm_line *line)
list_add_tail(&line->al.node, head);
}
-struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos)
+struct annotation_line *
+annotation_line__next(struct annotation_line *pos, struct list_head *head)
{
- list_for_each_entry_continue(pos, head, al.node)
- if (pos->al.offset >= 0)
+ list_for_each_entry_continue(pos, head, node)
+ if (pos->offset >= 0)
return pos;
return NULL;
@@ -1096,10 +1097,10 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
struct annotation *notes = symbol__annotation(sym);
s64 offset = dl->al.offset;
const u64 addr = start + offset;
- struct disasm_line *next;
+ struct annotation_line *next;
struct block_range *br;
- next = disasm__get_next_ip_line(&notes->src->source, dl);
+ next = annotation_line__next(&dl->al, &notes->src->source);
if (perf_evsel__is_group_event(evsel)) {
nr_percent = evsel->nr_members;
@@ -1114,7 +1115,7 @@ static int disasm_line__print(struct disasm_line *dl, struct symbol *sym, u64 st
percent = disasm__calc_percent(notes,
notes->src->lines ? i : evsel->idx + i,
offset,
- next ? next->al.offset : (s64) len,
+ next ? next->offset : (s64) len,
&path, &sample);
ppercents[i] = percent;