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/util/annotate.h | |
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/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 bac698d7cc6a..3a176633b324 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) | |||
74 | return dl->ops.target.offset_avail; | 74 | return dl->ops.target.offset_avail; |
75 | } | 75 | } |
76 | 76 | ||
77 | struct sym_hist_entry { | ||
78 | u64 nr_samples; | ||
79 | u64 period; | ||
80 | }; | ||
81 | |||
77 | void disasm_line__free(struct disasm_line *dl); | 82 | void disasm_line__free(struct disasm_line *dl); |
78 | struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); | 83 | struct disasm_line *disasm__get_next_ip_line(struct list_head *head, struct disasm_line *pos); |
79 | int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); | 84 | int disasm_line__scnprintf(struct disasm_line *dl, char *bf, size_t size, bool raw); |
80 | size_t disasm__fprintf(struct list_head *head, FILE *fp); | 85 | size_t disasm__fprintf(struct list_head *head, FILE *fp); |
81 | double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, | 86 | double disasm__calc_percent(struct annotation *notes, int evidx, s64 offset, |
82 | s64 end, const char **path, u64 *nr_samples); | 87 | s64 end, const char **path, struct sym_hist_entry *sample); |
83 | 88 | ||
84 | struct sym_hist { | 89 | struct sym_hist { |
85 | u64 sum; | 90 | u64 sum; |
86 | u64 addr[0]; | 91 | struct sym_hist_entry addr[0]; |
87 | }; | 92 | }; |
88 | 93 | ||
89 | struct cyc_hist { | 94 | struct cyc_hist { |