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>
This commit is contained in:
Jiri Olsa
2017-10-11 17:01:34 +02:00
committed by Arnaldo Carvalho de Melo
orang tua d03a686ea6
melakukan c4c724364d
3 mengubah file dengan 13 tambahan dan 10 penghapusan

Melihat File

@@ -440,7 +440,8 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
struct map_symbol *ms = browser->b.priv;
struct symbol *sym = ms->sym;
struct annotation *notes = symbol__annotation(sym);
struct disasm_line *pos, *next;
struct annotation_line *next;
struct disasm_line *pos;
s64 len = symbol__size(sym);
browser->entries = RB_ROOT;
@@ -458,7 +459,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
continue;
}
next = disasm__get_next_ip_line(&notes->src->source, pos);
next = annotation_line__next(&pos->al, &notes->src->source);
for (i = 0; i < browser->nr_events; i++) {
struct sym_hist_entry sample;
@@ -466,7 +467,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
bpos->samples[i].percent = disasm__calc_percent(notes,
evsel->idx + i,
pos->al.offset,
next ? next->al.offset : len,
next ? next->offset : len,
&path, &sample);
bpos->samples[i].he = sample;