aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/hist.h')
-rw-r--r--tools/perf/util/hist.h75
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
10extern struct callchain_param callchain_param; 11extern 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
83struct hist_entry *__hists__add_entry(struct hists *self, 87struct 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);
87int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right); 93int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right);
88int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right); 94int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right);
89int hist_entry__sort_snprintf(struct hist_entry *self, char *bf, size_t size, 95int hist_entry__transaction_len(void);
96int hist_entry__sort_snprintf(struct hist_entry *he, char *bf, size_t size,
90 struct hists *hists); 97 struct hists *hists);
91void hist_entry__free(struct hist_entry *); 98void hist_entry__free(struct hist_entry *);
92 99
93struct hist_entry *__hists__add_branch_entry(struct hists *self, 100void hists__output_resort(struct hists *hists);
94 struct addr_location *al, 101void 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
100struct 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
107void hists__output_resort(struct hists *self);
108void hists__collapse_resort(struct hists *self);
109 102
110void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel); 103void hists__decay_entries(struct hists *hists, bool zap_user, bool zap_kernel);
111void hists__output_recalc_col_len(struct hists *hists, int max_rows); 104void hists__output_recalc_col_len(struct hists *hists, int max_rows);
112 105
113void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h); 106void hists__inc_nr_entries(struct hists *hists, struct hist_entry *h);
114void hists__inc_nr_events(struct hists *self, u32 type); 107void hists__inc_nr_events(struct hists *hists, u32 type);
115void events_stats__inc(struct events_stats *stats, u32 type); 108void events_stats__inc(struct events_stats *stats, u32 type);
116size_t events_stats__fprintf(struct events_stats *stats, FILE *fp); 109size_t events_stats__fprintf(struct events_stats *stats, FILE *fp);
117 110
118size_t hists__fprintf(struct hists *self, bool show_header, int max_rows, 111size_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
121int hist_entry__inc_addr_samples(struct hist_entry *self, int evidx, u64 addr); 114int hist_entry__inc_addr_samples(struct hist_entry *he, int evidx, u64 addr);
122int hist_entry__annotate(struct hist_entry *self, size_t privsize); 115int hist_entry__annotate(struct hist_entry *he, size_t privsize);
123 116
124void hists__filter_by_dso(struct hists *hists); 117void hists__filter_by_dso(struct hists *hists);
125void hists__filter_by_thread(struct hists *hists); 118void hists__filter_by_thread(struct hists *hists);
126void hists__filter_by_symbol(struct hists *hists); 119void hists__filter_by_symbol(struct hists *hists);
127 120
128u16 hists__col_len(struct hists *self, enum hist_column col); 121u16 hists__col_len(struct hists *hists, enum hist_column col);
129void hists__set_col_len(struct hists *self, enum hist_column col, u16 len); 122void hists__set_col_len(struct hists *hists, enum hist_column col, u16 len);
130bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len); 123bool hists__new_col_len(struct hists *hists, enum hist_column col, u16 len);
131void hists__reset_col_len(struct hists *hists); 124void hists__reset_col_len(struct hists *hists);
132void hists__calc_col_len(struct hists *hists, struct hist_entry *he); 125void 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"
201int hist_entry__tui_annotate(struct hist_entry *he, struct perf_evsel *evsel, 194int 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
220static inline int hist_entry__tui_annotate(struct hist_entry *self 213static 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 230unsigned int hists__sort_list_width(struct hists *hists);
241int 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
245static inline
246int 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
255unsigned int hists__sort_list_width(struct hists *self);
256#endif /* __PERF_HIST_H */ 231#endif /* __PERF_HIST_H */