Commit | Line | Data |
---|---|---|
3d1d07ec JK |
1 | #ifndef __PERF_HIST_H |
2 | #define __PERF_HIST_H | |
3d1d07ec | 3 | |
4e4f06e4 | 4 | #include <linux/types.h> |
3d1d07ec | 5 | #include "callchain.h" |
3d1d07ec | 6 | |
3d1d07ec | 7 | extern struct callchain_param callchain_param; |
3d1d07ec | 8 | |
4e4f06e4 ACM |
9 | struct hist_entry; |
10 | struct addr_location; | |
11 | struct symbol; | |
d403d0ac | 12 | struct rb_root; |
4e4f06e4 | 13 | |
1c02c4d2 ACM |
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; | |
fefb0b94 | 22 | u64 nr_entries; |
1c02c4d2 ACM |
23 | struct events_stats stats; |
24 | u64 config; | |
25 | u64 event_stream; | |
26 | u32 type; | |
fefb0b94 | 27 | u32 max_sym_namelen; |
1c02c4d2 ACM |
28 | }; |
29 | ||
30 | struct hist_entry *__hists__add_entry(struct hists *self, | |
31 | struct addr_location *al, | |
32 | struct symbol *parent, u64 count); | |
3d1d07ec JK |
33 | extern int64_t hist_entry__cmp(struct hist_entry *, struct hist_entry *); |
34 | extern int64_t hist_entry__collapse(struct hist_entry *, struct hist_entry *); | |
1c02c4d2 ACM |
35 | int hist_entry__fprintf(struct hist_entry *self, struct hists *pair_hists, |
36 | bool show_displacement, long displacement, FILE *fp, | |
37 | u64 total); | |
38 | int hist_entry__snprintf(struct hist_entry *self, char *bf, size_t size, | |
39 | struct hists *pair_hists, bool show_displacement, | |
40 | long displacement, bool color, u64 total); | |
4e4f06e4 ACM |
41 | void hist_entry__free(struct hist_entry *); |
42 | ||
fefb0b94 | 43 | void hists__output_resort(struct hists *self); |
1c02c4d2 ACM |
44 | void hists__collapse_resort(struct hists *self); |
45 | size_t hists__fprintf(struct hists *self, struct hists *pair, | |
46 | bool show_displacement, FILE *fp); | |
b09e0190 ACM |
47 | |
48 | void hists__filter_by_dso(struct hists *self, const struct dso *dso); | |
49 | void hists__filter_by_thread(struct hists *self, const struct thread *thread); | |
50 | ||
51 | #ifdef NO_NEWT_SUPPORT | |
52 | static inline int hists__browse(struct hists self __used, | |
53 | const char *helpline __used, | |
54 | const char *input_name __used) | |
55 | { | |
56 | return 0; | |
57 | } | |
58 | #else | |
59 | int hists__browse(struct hists *self, const char *helpline, | |
60 | const char *input_name); | |
61 | #endif | |
3d1d07ec | 62 | #endif /* __PERF_HIST_H */ |