diff options
author | Taeung Song <treeze.taeung@gmail.com> | 2017-07-20 06:36:45 +0900 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2017-07-21 08:23:38 -0300 |
commit | 896bccd3cb8d95cbc565687715516009c5169e71 (patch) | |
tree | 32faa9f4668fb1b503926520ab0cf471f3220c73 /tools/perf/util/annotate.h | |
parent | b99e4850df86dfd9dc2cf3f3494e403ff8b46876 (diff) | |
download | op-kernel-dev-896bccd3cb8d95cbc565687715516009c5169e71.zip op-kernel-dev-896bccd3cb8d95cbc565687715516009c5169e71.tar.gz |
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/util/annotate.h')
-rw-r--r-- | tools/perf/util/annotate.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index bac698d..3a17663 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -74,16 +74,21 @@ static inline bool disasm_line__has_offset(const struct disasm_line *dl) return dl->ops.target.offset_avail; } +struct sym_hist_entry { + u64 nr_samples; + u64 period; +}; + void disasm_line__free(struct disasm_line *dl); struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); size_t disasm__fprintf(struct list_head *head, FILE *fp); double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, - s64 end, const char **path, u64 *nr_samples); + s64 end, const char **path, struct sym_hist_entry *sample); struct sym_hist { u64 sum; - u64 addr[0]; + struct sym_hist_entry addr[0]; }; struct cyc_hist { |