diff options
author | Taeung Song <treeze.taeung@gmail.com> | 2017-07-19 17:36:45 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-21 07:23:38 -0400 |
commit | 896bccd3cb8d95cbc565687715516009c5169e71 (patch) | |
tree | 32faa9f4668fb1b503926520ab0cf471f3220c73 /tools/perf/ui/browsers/annotate.c | |
parent | b99e4850df86dfd9dc2cf3f3494e403ff8b46876 (diff) |
perf annotate: Introduce struct sym_hist_entry
struct sym_hist has addr[] but it should have not only number of samples
but also the sample period. So use new struct symhist_entry to pave the
way to have that.
Committer notes:
This initial patch will only introduce the struct sym_hist_entry and use
only the nr_samples member, which makes the code clearer and paves the
way to save the period as well.
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
Suggested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1500500205-16553-1-git-send-email-treeze.taeung@gmail.com
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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 6794a8bec404..dbe4e630b90f 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c | |||
@@ -450,14 +450,14 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser, | |||
450 | next = disasm__get_next_ip_line(¬es->src->source, pos); | 450 | next = disasm__get_next_ip_line(¬es->src->source, pos); |
451 | 451 | ||
452 | for (i = 0; i < browser->nr_events; i++) { | 452 | for (i = 0; i < browser->nr_events; i++) { |
453 | u64 nr_samples; | 453 | struct sym_hist_entry sample; |
454 | 454 | ||
455 | bpos->samples[i].percent = disasm__calc_percent(notes, | 455 | bpos->samples[i].percent = disasm__calc_percent(notes, |
456 | evsel->idx + i, | 456 | evsel->idx + i, |
457 | pos->offset, | 457 | pos->offset, |
458 | next ? next->offset : len, | 458 | next ? next->offset : len, |
459 | &path, &nr_samples); | 459 | &path, &sample); |
460 | bpos->samples[i].nr = nr_samples; | 460 | bpos->samples[i].nr = sample.nr_samples; |
461 | 461 | ||
462 | if (max_percent < bpos->samples[i].percent) | 462 | if (max_percent < bpos->samples[i].percent) |
463 | max_percent = bpos->samples[i].percent; | 463 | max_percent = bpos->samples[i].percent; |