diff options
| author | Jiri Olsa <[email protected]> | 2018-08-04 13:05:09 +0000 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <[email protected]> | 2018-08-08 18:55:48 +0000 |
| commit | 6d9f0c2d5ef7568c29fa5927748c4915a9c7760a (patch) | |
| tree | 632c0bc56a8edd9297aa5390aac20ff27063f52d /tools/perf/util/annotate.h | |
| parent | perf annotate: Loop group events directly in annotation__calc_percent() (diff) | |
| download | kernel-6d9f0c2d5ef7568c29fa5927748c4915a9c7760a.tar.gz kernel-6d9f0c2d5ef7568c29fa5927748c4915a9c7760a.zip | |
perf annotate: Switch struct annotation_data::percent to array
So we can hold multiple percent values for annotation line.
The first member of this array is current local hits percent value
(PERCENT_HITS_LOCAL index), so no functional change is expected.
Adding annotation_data__percent function to return requested percent
value from struct annotation_data.
Signed-off-by: Jiri Olsa <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/annotate.h')
| -rw-r--r-- | tools/perf/util/annotate.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index 58aa14c55bab..0afbf8075fca 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h @@ -101,8 +101,13 @@ struct sym_hist_entry { u64 period; }; +enum { + PERCENT_HITS_LOCAL, + PERCENT_MAX, +}; + struct annotation_data { - double percent; + double percent[PERCENT_MAX]; double percent_sum; struct sym_hist_entry he; }; @@ -134,6 +139,12 @@ struct disasm_line { struct annotation_line al; }; +static inline double annotation_data__percent(struct annotation_data *data, + unsigned int which) +{ + return which < PERCENT_MAX ? data->percent[which] : -1; +} + static inline struct disasm_line *disasm_line(struct annotation_line *al) { return al ? container_of(al, struct disasm_line, al) : NULL; |
