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.h49
1 files changed, 34 insertions, 15 deletions
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index 66cb31fe81d2..8b091a51e4a2 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <pthread.h> 5#include <pthread.h>
6#include "callchain.h" 6#include "callchain.h"
7#include "header.h"
7 8
8extern struct callchain_param callchain_param; 9extern struct callchain_param callchain_param;
9 10
@@ -114,6 +115,9 @@ bool hists__new_col_len(struct hists *self, enum hist_column col, u16 len);
114void hists__reset_col_len(struct hists *hists); 115void hists__reset_col_len(struct hists *hists);
115void hists__calc_col_len(struct hists *hists, struct hist_entry *he); 116void hists__calc_col_len(struct hists *hists, struct hist_entry *he);
116 117
118void hists__match(struct hists *leader, struct hists *other);
119int hists__link(struct hists *leader, struct hists *other);
120
117struct perf_hpp { 121struct perf_hpp {
118 char *buf; 122 char *buf;
119 size_t size; 123 size_t size;
@@ -140,8 +144,12 @@ enum {
140 PERF_HPP__OVERHEAD_GUEST_US, 144 PERF_HPP__OVERHEAD_GUEST_US,
141 PERF_HPP__SAMPLES, 145 PERF_HPP__SAMPLES,
142 PERF_HPP__PERIOD, 146 PERF_HPP__PERIOD,
147 PERF_HPP__PERIOD_BASELINE,
143 PERF_HPP__DELTA, 148 PERF_HPP__DELTA,
149 PERF_HPP__RATIO,
150 PERF_HPP__WEIGHTED_DIFF,
144 PERF_HPP__DISPL, 151 PERF_HPP__DISPL,
152 PERF_HPP__FORMULA,
145 153
146 PERF_HPP__MAX_INDEX 154 PERF_HPP__MAX_INDEX
147}; 155};
@@ -153,21 +161,27 @@ int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he,
153 161
154struct perf_evlist; 162struct perf_evlist;
155 163
164struct hist_browser_timer {
165 void (*timer)(void *arg);
166 void *arg;
167 int refresh;
168};
169
156#ifdef NEWT_SUPPORT 170#ifdef NEWT_SUPPORT
157#include "../ui/keysyms.h" 171#include "../ui/keysyms.h"
158int hist_entry__tui_annotate(struct hist_entry *he, int evidx, 172int hist_entry__tui_annotate(struct hist_entry *he, int evidx,
159 void(*timer)(void *arg), void *arg, int delay_secs); 173 struct hist_browser_timer *hbt);
160 174
161int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, 175int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help,
162 void(*timer)(void *arg), void *arg, 176 struct hist_browser_timer *hbt,
163 int refresh); 177 struct perf_session_env *env);
178int script_browse(const char *script_opt);
164#else 179#else
165static inline 180static inline
166int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, 181int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused,
167 const char *help __maybe_unused, 182 const char *help __maybe_unused,
168 void(*timer)(void *arg) __maybe_unused, 183 struct hist_browser_timer *hbt __maybe_unused,
169 void *arg __maybe_unused, 184 struct perf_session_env *env __maybe_unused)
170 int refresh __maybe_unused)
171{ 185{
172 return 0; 186 return 0;
173} 187}
@@ -175,28 +189,29 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused,
175static inline int hist_entry__tui_annotate(struct hist_entry *self 189static inline int hist_entry__tui_annotate(struct hist_entry *self
176 __maybe_unused, 190 __maybe_unused,
177 int evidx __maybe_unused, 191 int evidx __maybe_unused,
178 void(*timer)(void *arg) 192 struct hist_browser_timer *hbt
179 __maybe_unused, 193 __maybe_unused)
180 void *arg __maybe_unused,
181 int delay_secs __maybe_unused)
182{ 194{
183 return 0; 195 return 0;
184} 196}
197
198static inline int script_browse(const char *script_opt __maybe_unused)
199{
200 return 0;
201}
202
185#define K_LEFT -1 203#define K_LEFT -1
186#define K_RIGHT -2 204#define K_RIGHT -2
187#endif 205#endif
188 206
189#ifdef GTK2_SUPPORT 207#ifdef GTK2_SUPPORT
190int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help, 208int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help,
191 void(*timer)(void *arg), void *arg, 209 struct hist_browser_timer *hbt __maybe_unused);
192 int refresh);
193#else 210#else
194static inline 211static inline
195int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused, 212int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused,
196 const char *help __maybe_unused, 213 const char *help __maybe_unused,
197 void(*timer)(void *arg) __maybe_unused, 214 struct hist_browser_timer *hbt __maybe_unused)
198 void *arg __maybe_unused,
199 int refresh __maybe_unused)
200{ 215{
201 return 0; 216 return 0;
202} 217}
@@ -204,4 +219,8 @@ int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused,
204 219
205unsigned int hists__sort_list_width(struct hists *self); 220unsigned int hists__sort_list_width(struct hists *self);
206 221
222double perf_diff__compute_delta(struct hist_entry *he);
223double perf_diff__compute_ratio(struct hist_entry *he);
224s64 perf_diff__compute_wdiff(struct hist_entry *he);
225int perf_diff__formula(char *buf, size_t size, struct hist_entry *he);
207#endif /* __PERF_HIST_H */ 226#endif /* __PERF_HIST_H */