aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.h
diff options
context:
space:
mode:
authorTaeung Song <treeze.taeung@gmail.com>2017-07-20 06:36:45 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-07-21 08:23:38 -0300
commit896bccd3cb8d95cbc565687715516009c5169e71 (patch)
tree32faa9f4668fb1b503926520ab0cf471f3220c73 /tools/perf/util/annotate.h
parenttools lib: Update copy of strtobool from the kernel sources (diff)
downloadlinux-dev-896bccd3cb8d95cbc565687715516009c5169e71.tar.xz
linux-dev-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 <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.h9
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)
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 {