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, 58 insertions, 17 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 0b096c27a419..f011ad4756e8 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -75,8 +75,8 @@ struct hist_entry *__hists__add_entry(struct hists *self,
75 struct symbol *parent, u64 period); 75 struct symbol *parent, u64 period);
76int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right); 76int64_t hist_entry__cmp(struct hist_entry *left, struct hist_entry *right);
77int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right); 77int64_t hist_entry__collapse(struct hist_entry *left, struct hist_entry *right);
78int hist_entry__snprintf(struct hist_entry *self, char *bf, size_t size, 78int hist_entry__sort_snprintf(struct hist_entry *self, char *bf, size_t size,
79 struct hists *hists); 79 struct hists *hists);
80void hist_entry__free(struct hist_entry *); 80void hist_entry__free(struct hist_entry *);
81 81
82struct hist_entry *__hists__add_branch_entry(struct hists *self, 82struct hist_entry *__hists__add_branch_entry(struct hists *self,
@@ -112,25 +112,66 @@ void hists__filter_by_symbol(struct hists *hists);
112u16 hists__col_len(struct hists *self, enum hist_column col); 112u16 hists__col_len(struct hists *self, enum hist_column col);
113void hists__set_col_len(struct hists *self, enum hist_column col, u16 len); 113void hists__set_col_len(struct hists *self, enum hist_column col, u16 len);
114bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len); 114bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len);
115void hists__reset_col_len(struct hists *hists);
116void hists__calc_col_len(struct hists *hists, struct hist_entry *he);
117
118struct perf_hpp {
119 char *buf;
120 size_t size;
121 u64 total_period;
122 const char *sep;
123 long displacement;
124 void *ptr;
125};
126
127struct perf_hpp_fmt {
128 bool cond;
129 int (*header)(struct perf_hpp *hpp);
130 int (*width)(struct perf_hpp *hpp);
131 int (*color)(struct perf_hpp *hpp, struct hist_entry *he);
132 int (*entry)(struct perf_hpp *hpp, struct hist_entry *he);
133};
134
135extern struct perf_hpp_fmt perf_hpp__format[];
136
137enum {
138 PERF_HPP__OVERHEAD,
139 PERF_HPP__OVERHEAD_SYS,
140 PERF_HPP__OVERHEAD_US,
141 PERF_HPP__OVERHEAD_GUEST_SYS,
142 PERF_HPP__OVERHEAD_GUEST_US,
143 PERF_HPP__SAMPLES,
144 PERF_HPP__PERIOD,
145 PERF_HPP__DELTA,
146 PERF_HPP__DISPL,
147
148 PERF_HPP__MAX_INDEX
149};
150
151void perf_hpp__init(bool need_pair, bool show_displacement);
152int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
153 bool color);
115 154
116struct perf_evlist; 155struct perf_evlist;
117 156
118#ifdef NO_NEWT_SUPPORT 157#ifdef NO_NEWT_SUPPORT
119static inline 158static inline
120int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __used, 159int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused,
121 const char *help __used, 160 const char *help __maybe_unused,
122 void(*timer)(void *arg) __used, 161 void(*timer)(void *arg) __maybe_unused,
123 void *arg __used, 162 void *arg __maybe_unused,
124 int refresh __used) 163 int refresh __maybe_unused)
125{ 164{
126 return 0; 165 return 0;
127} 166}
128 167
129static inline int hist_entry__tui_annotate(struct hist_entry *self __used, 168static inline int hist_entry__tui_annotate(struct hist_entry *self
130 int evidx __used, 169 __maybe_unused,
131 void(*timer)(void *arg) __used, 170 int evidx __maybe_unused,
132 void *arg __used, 171 void(*timer)(void *arg)
133 int delay_secs __used) 172 __maybe_unused,
173 void *arg __maybe_unused,
174 int delay_secs __maybe_unused)
134{ 175{
135 return 0; 176 return 0;
136} 177}
@@ -148,11 +189,11 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help,
148 189
149#ifdef NO_GTK2_SUPPORT 190#ifdef NO_GTK2_SUPPORT
150static inline 191static inline
151int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __used, 192int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused,
152 const char *help __used, 193 const char *help __maybe_unused,
153 void(*timer)(void *arg) __used, 194 void(*timer)(void *arg) __maybe_unused,
154 void *arg __used, 195 void *arg __maybe_unused,
155 int refresh __used) 196 int refresh __maybe_unused)
156{ 197{
157 return 0; 198 return 0;
158} 199}