diff options
| author | Taeung Song <[email protected]> | 2017-07-19 21:36:45 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2017-07-21 11:23:38 +0000 |
| commit | 896bccd3cb8d95cbc565687715516009c5169e71 (patch) | |
| tree | 32faa9f4668fb1b503926520ab0cf471f3220c73 /tools/perf/ui/gtk/annotate.c | |
| parent | tools lib: Update copy of strtobool from the kernel sources (diff) | |
| download | kernel-896bccd3cb8d95cbc565687715516009c5169e71.tar.gz kernel-896bccd3cb8d95cbc565687715516009c5169e71.zip | |
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 <[email protected]>
Suggested-by: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/ui/gtk/annotate.c')
| -rw-r--r-- | tools/perf/ui/gtk/annotate.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/ui/gtk/annotate.c b/tools/perf/ui/gtk/annotate.c index 87e3760624f2..d736fd57ab9b 100644 --- a/tools/perf/ui/gtk/annotate.c +++ b/tools/perf/ui/gtk/annotate.c @@ -34,10 +34,10 @@ static int perf_gtk__get_percent(char *buf, size_t size, struct symbol *sym, return 0; symhist = annotation__histogram(symbol__annotation(sym), evidx); - if (!symbol_conf.event_group && !symhist->addr[dl->offset]) + if (!symbol_conf.event_group && !symhist->addr[dl->offset].nr_samples) return 0; - percent = 100.0 * symhist->addr[dl->offset] / symhist->sum; + percent = 100.0 * symhist->addr[dl->offset].nr_samples / symhist->sum; markup = perf_gtk__get_percent_color(percent); if (markup) |
