diff options
author | Jiri Olsa <jolsa@kernel.org> | 2017-10-11 11:01:43 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-11-16 12:45:35 -0500 |
commit | e425da6caed1a2872e9543bba83488dbe4bbe3f3 (patch) | |
tree | b2ea0d3b2a30ef867c59d115e32532b03349ceea /tools/perf/ui/browsers/annotate.c | |
parent | f681d593d1ce7d2fc665c4047b45f4316408b892 (diff) |
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: 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-21-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers/annotate.c')
-rw-r--r-- | tools/perf/ui/browsers/annotate.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 4c54d5e76008..613682432940 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -444,17 +444,16 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, | |||
444 | struct map_symbol *ms = browser->b.priv; | 444 | struct map_symbol *ms = browser->b.priv; |
445 | struct symbol *sym = ms->sym; | 445 | struct symbol *sym = ms->sym; |
446 | struct annotation *notes = symbol__annotation(sym); | 446 | struct annotation *notes = symbol__annotation(sym); |
447 | struct annotation_line *next; | ||
448 | struct disasm_line *pos; | 447 | struct disasm_line *pos; |
449 | s64 len = symbol__size(sym); | ||
450 | 448 | ||
451 | browser->entries = RB_ROOT; | 449 | browser->entries = RB_ROOT; |
452 | 450 | ||
453 | pthread_mutex_lock(¬es->lock); | 451 | pthread_mutex_lock(¬es->lock); |
454 | 452 | ||
453 | symbol__calc_percent(sym, evsel); | ||
454 | |||
455 | list_for_each_entry(pos, ¬es->src->source, al.node) { | 455 | list_for_each_entry(pos, ¬es->src->source, al.node) { |
456 | struct browser_disasm_line *bpos = disasm_line__browser(pos); | 456 | struct browser_disasm_line *bpos = disasm_line__browser(pos); |
457 | const char *path = NULL; | ||
458 | double max_percent = 0.0; | 457 | double max_percent = 0.0; |
459 | int i; | 458 | int i; |
460 | 459 | ||
@@ -463,17 +462,11 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, | |||
463 | continue; | 462 | continue; |
464 | } | 463 | } |
465 | 464 | ||
466 | next = annotation_line__next(&pos->al, ¬es->src->source); | ||
467 | |||
468 | for (i = 0; i < browser->nr_events; i++) { | 465 | for (i = 0; i < browser->nr_events; i++) { |
469 | struct sym_hist_entry sample; | 466 | struct annotation_data *sample = &pos->al.samples[i]; |
470 | 467 | ||
471 | bpos->samples[i].percent = disasm__calc_percent(notes, | 468 | bpos->samples[i].percent = sample->percent; |
472 | evsel->idx + i, | 469 | bpos->samples[i].he = sample->he; |
473 | pos->al.offset, | ||
474 | next ? next->offset : len, | ||
475 | &path, &sample); | ||
476 | bpos->samples[i].he = sample; | ||
477 | 470 | ||
478 | if (max_percent < bpos->samples[i].percent) | 471 | if (max_percent < bpos->samples[i].percent) |
479 | max_percent = bpos->samples[i].percent; | 472 | max_percent = bpos->samples[i].percent; |