John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 1 | #ifndef __PERF_HIST_H |
| 2 | #define __PERF_HIST_H |
John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 3 | |
Arnaldo Carvalho de Melo | 4e4f06e | 2009-12-14 13:10:39 -0200 | [diff] [blame] | 4 | #include <linux/types.h> |
John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 5 | #include "callchain.h" |
John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 6 | |
John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 7 | extern struct callchain_param callchain_param; |
John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 8 | |
Arnaldo Carvalho de Melo | 4e4f06e | 2009-12-14 13:10:39 -0200 | [diff] [blame] | 9 | struct hist_entry; |
| 10 | struct addr_location; |
| 11 | struct symbol; |
Eric B Munson | d403d0a | 2010-03-05 12:51:06 -0300 | [diff] [blame] | 12 | struct rb_root; |
Arnaldo Carvalho de Melo | 4e4f06e | 2009-12-14 13:10:39 -0200 | [diff] [blame] | 13 | |
Arnaldo Carvalho de Melo | 1c02c4d | 2010-05-10 13:04:11 -0300 | [diff] [blame^] | 14 | struct events_stats { |
| 15 | u64 total; |
| 16 | u64 lost; |
| 17 | }; |
| 18 | |
| 19 | struct hists { |
| 20 | struct rb_node rb_node; |
| 21 | struct rb_root entries; |
| 22 | struct events_stats stats; |
| 23 | u64 config; |
| 24 | u64 event_stream; |
| 25 | u32 type; |
| 26 | }; |
| 27 | |
| 28 | struct hist_entry *__hists__add_entry(struct hists *self, |
| 29 | struct addr_location *al, |
| 30 | struct symbol *parent, u64 count); |
John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 31 | extern int64_t hist_entry__cmp(struct hist_entry *, struct hist_entry *); |
| 32 | extern int64_t hist_entry__collapse(struct hist_entry *, struct hist_entry *); |
Arnaldo Carvalho de Melo | 1c02c4d | 2010-05-10 13:04:11 -0300 | [diff] [blame^] | 33 | int hist_entry__fprintf(struct hist_entry *self, struct hists *pair_hists, |
| 34 | bool show_displacement, long displacement, FILE *fp, |
| 35 | u64 total); |
| 36 | int hist_entry__snprintf(struct hist_entry *self, char *bf, size_t size, |
| 37 | struct hists *pair_hists, bool show_displacement, |
| 38 | long displacement, bool color, u64 total); |
Arnaldo Carvalho de Melo | 4e4f06e | 2009-12-14 13:10:39 -0200 | [diff] [blame] | 39 | void hist_entry__free(struct hist_entry *); |
| 40 | |
Arnaldo Carvalho de Melo | 1c02c4d | 2010-05-10 13:04:11 -0300 | [diff] [blame^] | 41 | u64 hists__output_resort(struct hists *self); |
| 42 | void hists__collapse_resort(struct hists *self); |
| 43 | size_t hists__fprintf(struct hists *self, struct hists *pair, |
| 44 | bool show_displacement, FILE *fp); |
John Kacur | 3d1d07e | 2009-09-28 15:32:55 +0200 | [diff] [blame] | 45 | #endif /* __PERF_HIST_H */ |