aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-top.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2013-11-18 15:32:45 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2013-11-27 12:58:37 -0500
commit82d1deb0546a4af7a2ddbcfed99690b3a61776c5 (patch)
treee681eedec436d66b72d6af89a9b880e94dea52ea /tools/perf/builtin-top.c
parentd2ff1b1499c8e0ad2fc79376a4215ba37771823f (diff)
perf symbols: Move idle syms check from top to generic function
Allows list of idle symbols to be leveraged by other commands, such as the upcoming timehist command. Signed-off-by: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/r/1384806771-2945-3-git-send-email-dsahern@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r--tools/perf/builtin-top.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c
index 531522d3d97b..03d37a76c612 100644
--- a/tools/perf/builtin-top.c
+++ b/tools/perf/builtin-top.c
@@ -634,26 +634,9 @@ repeat:
634 return NULL; 634 return NULL;
635} 635}
636 636
637/* Tag samples to be skipped. */
638static const char *skip_symbols[] = {
639 "intel_idle",
640 "default_idle",
641 "native_safe_halt",
642 "cpu_idle",
643 "enter_idle",
644 "exit_idle",
645 "mwait_idle",
646 "mwait_idle_with_hints",
647 "poll_idle",
648 "ppc64_runlatch_off",
649 "pseries_dedicated_idle_sleep",
650 NULL
651};
652
653static int symbol_filter(struct map *map __maybe_unused, struct symbol *sym) 637static int symbol_filter(struct map *map __maybe_unused, struct symbol *sym)
654{ 638{
655 const char *name = sym->name; 639 const char *name = sym->name;
656 int i;
657 640
658 /* 641 /*
659 * ppc64 uses function descriptors and appends a '.' to the 642 * ppc64 uses function descriptors and appends a '.' to the
@@ -671,12 +654,8 @@ static int symbol_filter(struct map *map __maybe_unused, struct symbol *sym)
671 strstr(name, "_text_end")) 654 strstr(name, "_text_end"))
672 return 1; 655 return 1;
673 656
674 for (i = 0; skip_symbols[i]; i++) { 657 if (symbol__is_idle(sym))
675 if (!strcmp(skip_symbols[i], name)) { 658 sym->ignore = true;
676 sym->ignore = true;
677 break;
678 }
679 }
680 659
681 return 0; 660 return 0;
682} 661}