diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-11-02 01:50:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-05 12:03:58 -0500 |
commit | 9783adf777a445a1e9d0db4857a3a896a9f42d4a (patch) | |
tree | 0d3256acbcdba290afa018cce86456f21febe58b /tools/perf/util | |
parent | 48ed0ece1b8063313284812ef048b26c3c4250af (diff) |
perf tools: Introduce struct hist_browser_timer
Currently various hist browser functions receive 3 arguments for
refreshing histogram but only used from a few places. Also it's only
for perf top command so that it can be NULL for other (and probably
most) cases. Pack them into a struct in order to reduce number of those
unused arguments.
This is a mechanical change and does not intend a functional change.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Irina Tirdea <irina.tirdea@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1351835406-15208-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/annotate.h | 8 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 28 |
2 files changed, 17 insertions, 19 deletions
diff --git a/tools/perf/util/annotate.h b/tools/perf/util/annotate.h index a4dd25a61a07..c6272011625a 100644 --- a/tools/perf/util/annotate.h +++ b/tools/perf/util/annotate.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <stdint.h> | 5 | #include <stdint.h> |
6 | #include "types.h" | 6 | #include "types.h" |
7 | #include "symbol.h" | 7 | #include "symbol.h" |
8 | #include "hist.h" | ||
8 | #include <linux/list.h> | 9 | #include <linux/list.h> |
9 | #include <linux/rbtree.h> | 10 | #include <linux/rbtree.h> |
10 | #include <pthread.h> | 11 | #include <pthread.h> |
@@ -140,14 +141,13 @@ int symbol__tty_annotate(struct symbol *sym, struct map *map, int evidx, | |||
140 | 141 | ||
141 | #ifdef NEWT_SUPPORT | 142 | #ifdef NEWT_SUPPORT |
142 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, | 143 | int symbol__tui_annotate(struct symbol *sym, struct map *map, int evidx, |
143 | void(*timer)(void *arg), void *arg, int delay_secs); | 144 | struct hist_browser_timer *hbt); |
144 | #else | 145 | #else |
145 | static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, | 146 | static inline int symbol__tui_annotate(struct symbol *sym __maybe_unused, |
146 | struct map *map __maybe_unused, | 147 | struct map *map __maybe_unused, |
147 | int evidx __maybe_unused, | 148 | int evidx __maybe_unused, |
148 | void(*timer)(void *arg) __maybe_unused, | 149 | struct hist_browser_timer *hbt |
149 | void *arg __maybe_unused, | 150 | __maybe_unused) |
150 | int delay_secs __maybe_unused) | ||
151 | { | 151 | { |
152 | return 0; | 152 | return 0; |
153 | } | 153 | } |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index b87460971736..96664cce7c7b 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -157,22 +157,25 @@ int hist_entry__period_snprintf(struct perf_hpp *hpp, struct hist_entry *he, | |||
157 | 157 | ||
158 | struct perf_evlist; | 158 | struct perf_evlist; |
159 | 159 | ||
160 | struct hist_browser_timer { | ||
161 | void (*timer)(void *arg); | ||
162 | void *arg; | ||
163 | int refresh; | ||
164 | }; | ||
165 | |||
160 | #ifdef NEWT_SUPPORT | 166 | #ifdef NEWT_SUPPORT |
161 | #include "../ui/keysyms.h" | 167 | #include "../ui/keysyms.h" |
162 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, | 168 | int hist_entry__tui_annotate(struct hist_entry *he, int evidx, |
163 | void(*timer)(void *arg), void *arg, int delay_secs); | 169 | struct hist_browser_timer *hbt); |
164 | 170 | ||
165 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, | 171 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, |
166 | void(*timer)(void *arg), void *arg, | 172 | struct hist_browser_timer *hbt); |
167 | int refresh); | ||
168 | int script_browse(const char *script_opt); | 173 | int script_browse(const char *script_opt); |
169 | #else | 174 | #else |
170 | static inline | 175 | static inline |
171 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, | 176 | int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, |
172 | const char *help __maybe_unused, | 177 | const char *help __maybe_unused, |
173 | void(*timer)(void *arg) __maybe_unused, | 178 | struct hist_browser_timer *hbt __maybe_unused) |
174 | void *arg __maybe_unused, | ||
175 | int refresh __maybe_unused) | ||
176 | { | 179 | { |
177 | return 0; | 180 | return 0; |
178 | } | 181 | } |
@@ -180,10 +183,8 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist __maybe_unused, | |||
180 | static inline int hist_entry__tui_annotate(struct hist_entry *self | 183 | static inline int hist_entry__tui_annotate(struct hist_entry *self |
181 | __maybe_unused, | 184 | __maybe_unused, |
182 | int evidx __maybe_unused, | 185 | int evidx __maybe_unused, |
183 | void(*timer)(void *arg) | 186 | struct hist_browser_timer *hbt |
184 | __maybe_unused, | 187 | __maybe_unused) |
185 | void *arg __maybe_unused, | ||
186 | int delay_secs __maybe_unused) | ||
187 | { | 188 | { |
188 | return 0; | 189 | return 0; |
189 | } | 190 | } |
@@ -199,15 +200,12 @@ static inline int script_browse(const char *script_opt) | |||
199 | 200 | ||
200 | #ifdef GTK2_SUPPORT | 201 | #ifdef GTK2_SUPPORT |
201 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help, | 202 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist, const char *help, |
202 | void(*timer)(void *arg), void *arg, | 203 | struct hist_browser_timer *hbt __maybe_unused); |
203 | int refresh); | ||
204 | #else | 204 | #else |
205 | static inline | 205 | static inline |
206 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused, | 206 | int perf_evlist__gtk_browse_hists(struct perf_evlist *evlist __maybe_unused, |
207 | const char *help __maybe_unused, | 207 | const char *help __maybe_unused, |
208 | void(*timer)(void *arg) __maybe_unused, | 208 | struct hist_browser_timer *hbt __maybe_unused) |
209 | void *arg __maybe_unused, | ||
210 | int refresh __maybe_unused) | ||
211 | { | 209 | { |
212 | return 0; | 210 | return 0; |
213 | } | 211 | } |