aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2009-06-30 19:00:46 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-30 19:25:19 -0400
commit2ab52083ffc057014e502cf3473adc41436922fa (patch)
treeb169ba14b8bce50bd5c6ee01787657b0626b5d92 /tools
parent6717534ddc328ae5cdf89f1ef802db83fc451f19 (diff)
perf top: Move skip symbols to an array
Move the list of symbols we skip into an array, making it easier to add new ones. Signed-off-by: Anton Blanchard <anton@samba.org> Cc: a.p.zijlstra@chello.nl Cc: paulus@samba.org LKML-Reference: <20090630230140.904782938@samba.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-top.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 5c2965562c5d..731ec6d79c1c 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -286,11 +286,22 @@ static void *display_thread(void *arg)
286 return NULL; 286 return NULL;
287} 287}
288 288
289/* Tag samples to be skipped. */
290char *skip_symbols[] = {
291 "default_idle",
292 "cpu_idle",
293 "enter_idle",
294 "exit_idle",
295 "mwait_idle",
296 NULL
297};
298
289static int symbol_filter(struct dso *self, struct symbol *sym) 299static int symbol_filter(struct dso *self, struct symbol *sym)
290{ 300{
291 static int filter_match; 301 static int filter_match;
292 struct sym_entry *syme; 302 struct sym_entry *syme;
293 const char *name = sym->name; 303 const char *name = sym->name;
304 int i;
294 305
295 if (!strcmp(name, "_text") || 306 if (!strcmp(name, "_text") ||
296 !strcmp(name, "_etext") || 307 !strcmp(name, "_etext") ||
@@ -302,13 +313,12 @@ static int symbol_filter(struct dso *self, struct symbol *sym)
302 return 1; 313 return 1;
303 314
304 syme = dso__sym_priv(self, sym); 315 syme = dso__sym_priv(self, sym);
305 /* Tag samples to be skipped. */ 316 for (i = 0; skip_symbols[i]; i++) {
306 if (!strcmp("default_idle", name) || 317 if (!strcmp(skip_symbols[i], name)) {
307 !strcmp("cpu_idle", name) || 318 syme->skip = 1;
308 !strcmp("enter_idle", name) || 319 break;
309 !strcmp("exit_idle", name) || 320 }
310 !strcmp("mwait_idle", name)) 321 }
311 syme->skip = 1;
312 322
313 if (filter_match == 1) { 323 if (filter_match == 1) {
314 filter_end = sym->start; 324 filter_end = sym->start;