diff options
Diffstat (limited to 'tools/perf/util/hist.h')
-rw-r--r-- | tools/perf/util/hist.h | 75 |
1 files changed, 25 insertions, 50 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index ce8dc61ce2c3..b621347a1585 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include "callchain.h" | 6 | #include "callchain.h" |
7 | #include "header.h" | 7 | #include "header.h" |
8 | #include "color.h" | 8 | #include "color.h" |
9 | #include "ui/progress.h" | ||
9 | 10 | ||
10 | extern struct callchain_param callchain_param; | 11 | extern struct callchain_param callchain_param; |
11 | 12 | ||
@@ -46,6 +47,8 @@ enum hist_column { | |||
46 | HISTC_CPU, | 47 | HISTC_CPU, |
47 | HISTC_SRCLINE, | 48 | HISTC_SRCLINE, |
48 | HISTC_MISPREDICT, | 49 | HISTC_MISPREDICT, |
50 | HISTC_IN_TX, | ||
51 | HISTC_ABORT, | ||
49 | HISTC_SYMBOL_FROM, | 52 | HISTC_SYMBOL_FROM, |
50 | HISTC_SYMBOL_TO, | 53 | HISTC_SYMBOL_TO, |
51 | HISTC_DSO_FROM, | 54 | HISTC_DSO_FROM, |
@@ -58,6 +61,7 @@ enum hist_column { | |||
58 | HISTC_MEM_TLB, | 61 | HISTC_MEM_TLB, |
59 | HISTC_MEM_LVL, | 62 | HISTC_MEM_LVL, |
60 | HISTC_MEM_SNOOP, | 63 | HISTC_MEM_SNOOP, |
64 | HISTC_TRANSACTION, | ||
61 | HISTC_NR_COLS, /* Last entry */ | 65 | HISTC_NR_COLS, /* Last entry */ |
62 | }; | 66 | }; |
63 | 67 | ||
@@ -80,54 +84,43 @@ struct hists { | |||
80 | u16 col_len[HISTC_NR_COLS]; | 84 | u16 col_len[HISTC_NR_COLS]; |
81 | }; | 85 | }; |
82 | 86 | ||
83 | struct hist_entry *__hists__add_entry(struct hists *self, | 87 | struct hist_entry *__hists__add_entry(struct hists *hists, |
84 | struct addr_location *al, | 88 | struct addr_location *al, |
85 | struct symbol *parent, u64 period, | 89 | struct symbol *parent, |
86 | u64 weight); | 90 | struct branch_info *bi, |
91 | struct mem_info *mi, u64 period, | ||
92 | u64 weight, u64 transaction); | ||
87 | int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right); | 93 | int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right); |
88 | int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right); | 94 | int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right); |
89 | int hist_entry__sort_snprintf(struct hist_entry *self, char *bf, size_t size, | 95 | int hist_entry__transaction_len(void); |
96 | int hist_entry__sort_snprintf(struct hist_entry *he, char *bf, size_t size, | ||
90 | struct hists *hists); | 97 | struct hists *hists); |
91 | void hist_entry__free(struct hist_entry *); | 98 | void hist_entry__free(struct hist_entry *); |
92 | 99 | ||
93 | struct hist_entry *__hists__add_branch_entry(struct hists *self, | 100 | void hists__output_resort(struct hists *hists); |
94 | struct addr_location *al, | 101 | void hists__collapse_resort(struct hists *hists, struct ui_progress *prog); |
95 | struct symbol *sym_parent, | ||
96 | struct branch_info *bi, | ||
97 | u64 period, | ||
98 | u64 weight); | ||
99 | |||
100 | struct hist_entry *__hists__add_mem_entry(struct hists *self, | ||
101 | struct addr_location *al, | ||
102 | struct symbol *sym_parent, | ||
103 | struct mem_info *mi, | ||
104 | u64 period, | ||
105 | u64 weight); | ||
106 | |||
107 | void hists__output_resort(struct hists *self); | ||
108 | void hists__collapse_resort(struct hists *self); | ||
109 | 102 | ||
110 | void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel); | 103 | void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel); |
111 | void hists__output_recalc_col_len(struct hists *hists, int max_rows); | 104 | void hists__output_recalc_col_len(struct hists *hists, int max_rows); |
112 | 105 | ||
113 | void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h); | 106 | void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h); |
114 | void hists__inc_nr_events(struct hists *self, u32 type); | 107 | void hists__inc_nr_events(struct hists *hists, u32 type); |
115 | void events_stats__inc(struct events_stats *stats, u32 type); | 108 | void events_stats__inc(struct events_stats *stats, u32 type); |
116 | size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); | 109 | size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); |
117 | 110 | ||
118 | size_t hists__fprintf(struct hists *self, bool show_header, int max_rows, | 111 | size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, |
119 | int max_cols, float min_pcnt, FILE *fp); | 112 | int max_cols, float min_pcnt, FILE *fp); |
120 | 113 | ||
121 | int hist_entry__inc_addr_samples(struct hist_entry *self, int evidx, u64 addr); | 114 | int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 addr); |
122 | int hist_entry__annotate(struct hist_entry *self, size_t privsize); | 115 | int hist_entry__annotate(struct hist_entry *he, size_t privsize); |
123 | 116 | ||
124 | void hists__filter_by_dso(struct hists *hists); | 117 | void hists__filter_by_dso(struct hists *hists); |
125 | void hists__filter_by_thread(struct hists *hists); | 118 | void hists__filter_by_thread(struct hists *hists); |
126 | void hists__filter_by_symbol(struct hists *hists); | 119 | void hists__filter_by_symbol(struct hists *hists); |
127 | 120 | ||
128 | u16 hists__col_len(struct hists *self, enum hist_column col); | 121 | u16 hists__col_len(struct hists *hists, enum hist_column col); |
129 | void hists__set_col_len(struct hists *self, enum hist_column col, u16 len); | 122 | void hists__set_col_len(struct hists *hists, enum hist_column col, u16 len); |
130 | bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len); | 123 | bool hists__new_col_len(struct hists *hists, enum hist_column col, u16 len); |
131 | void hists__reset_col_len(struct hists *hists); | 124 | void hists__reset_col_len(struct hists *hists); |
132 | void hists__calc_col_len(struct hists *hists, struct hist_entry *he); | 125 | void hists__calc_col_len(struct hists *hists, struct hist_entry *he); |
133 | 126 | ||
@@ -196,7 +189,7 @@ struct hist_browser_timer { | |||
196 | int refresh; | 189 | int refresh; |
197 | }; | 190 | }; |
198 | 191 | ||
199 | #ifdef SLANG_SUPPORT | 192 | #ifdef HAVE_SLANG_SUPPORT |
200 | #include "../ui/keysyms.h" | 193 | #include "../ui/keysyms.h" |
201 | int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel, | 194 | int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel, |
202 | struct hist_browser_timer *hbt); | 195 | struct hist_browser_timer *hbt); |
@@ -217,12 +210,9 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, | |||
217 | return 0; | 210 | return 0; |
218 | } | 211 | } |
219 | 212 | ||
220 | static inline int hist_entry__tui_annotate(struct hist_entry *self | 213 | static inline int hist_entry__tui_annotate(struct hist_entry *he __maybe_unused, |
221 | __maybe_unused, | 214 | struct perf_evsel *evsel __maybe_unused, |
222 | struct perf_evsel *evsel | 215 | struct hist_browser_timer *hbt __maybe_unused) |
223 | __maybe_unused, | ||
224 | struct hist_browser_timer *hbt | ||
225 | __maybe_unused) | ||
226 | { | 216 | { |
227 | return 0; | 217 | return 0; |
228 | } | 218 | } |
@@ -237,20 +227,5 @@ static inline int script_browse(const char *script_opt __maybe_unused) | |||
237 | #define K_SWITCH_INPUT_DATA -3000 | 227 | #define K_SWITCH_INPUT_DATA -3000 |
238 | #endif | 228 | #endif |
239 | 229 | ||
240 | #ifdef GTK2_SUPPORT | 230 | unsigned int hists__sort_list_width(struct hists *hists); |
241 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help, | ||
242 | struct hist_browser_timer *hbt __maybe_unused, | ||
243 | float min_pcnt); | ||
244 | #else | ||
245 | static inline | ||
246 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused, | ||
247 | const char *help __maybe_unused, | ||
248 | struct hist_browser_timer *hbt __maybe_unused, | ||
249 | float min_pcnt __maybe_unused) | ||
250 | { | ||
251 | return 0; | ||
252 | } | ||
253 | #endif | ||
254 | |||
255 | unsigned int hists__sort_list_width(struct hists *self); | ||
256 | #endif /* __PERF_HIST_H */ | 231 | #endif /* __PERF_HIST_H */ |