Commit e425da6c authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf annotate: Remove disasm__calc_percent() from annotate_browser__calc_percent()

Remove disasm__calc_percent() from annotate_browser__calc_percent(),
because we already have the data calculated in struct annotation_line.
Signed-off-by: default avatarJiri 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-21-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent f681d593
...@@ -444,17 +444,16 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, ...@@ -444,17 +444,16 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
struct map_symbol *ms = browser->b.priv; struct map_symbol *ms = browser->b.priv;
struct symbol *sym = ms->sym; struct symbol *sym = ms->sym;
struct annotation *notes = symbol__annotation(sym); struct annotation *notes = symbol__annotation(sym);
struct annotation_line *next;
struct disasm_line *pos; struct disasm_line *pos;
s64 len = symbol__size(sym);
browser->entries = RB_ROOT; browser->entries = RB_ROOT;
pthread_mutex_lock(&notes->lock); pthread_mutex_lock(&notes->lock);
symbol__calc_percent(sym, evsel);
list_for_each_entry(pos, &notes->src->source, al.node) { list_for_each_entry(pos, &notes->src->source, al.node) {
struct browser_disasm_line *bpos = disasm_line__browser(pos); struct browser_disasm_line *bpos = disasm_line__browser(pos);
const char *path = NULL;
double max_percent = 0.0; double max_percent = 0.0;
int i; int i;
...@@ -463,17 +462,11 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, ...@@ -463,17 +462,11 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
continue; continue;
} }
next = annotation_line__next(&pos->al, &notes->src->source);
for (i = 0; i < browser->nr_events; i++) { for (i = 0; i < browser->nr_events; i++) {
struct sym_hist_entry sample; struct annotation_data *sample = &pos->al.samples[i];
bpos->samples[i].percent = disasm__calc_percent(notes, bpos->samples[i].percent = sample->percent;
evsel->idx + i, bpos->samples[i].he = sample->he;
pos->al.offset,
next ? next->offset : len,
&path, &sample);
bpos->samples[i].he = sample;
if (max_percent < bpos->samples[i].percent) if (max_percent < bpos->samples[i].percent)
max_percent = bpos->samples[i].percent; max_percent = bpos->samples[i].percent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment