aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/symbol.c30
-rw-r--r--tools/perf/util/symbol.h1
2 files changed, 31 insertions, 0 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index c0c36965fff0..f55c18da1e40 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -573,6 +573,36 @@ static u8 kallsyms2elf_type(char type)
573 return isupper(type) ? STB_GLOBAL : STB_LOCAL; 573 return isupper(type) ? STB_GLOBAL : STB_LOCAL;
574} 574}
575 575
576bool symbol__is_idle(struct symbol *sym)
577{
578 const char * const idle_symbols[] = {
579 "cpu_idle",
580 "intel_idle",
581 "default_idle",
582 "native_safe_halt",
583 "enter_idle",
584 "exit_idle",
585 "mwait_idle",
586 "mwait_idle_with_hints",
587 "poll_idle",
588 "ppc64_runlatch_off",
589 "pseries_dedicated_idle_sleep",
590 NULL
591 };
592
593 int i;
594
595 if (!sym)
596 return false;
597
598 for (i = 0; idle_symbols[i]; i++) {
599 if (!strcmp(idle_symbols[i], sym->name))
600 return true;
601 }
602
603 return false;
604}
605
576static int map__process_kallsym_symbol(void *arg, const char *name, 606static int map__process_kallsym_symbol(void *arg, const char *name,
577 char type, u64 start) 607 char type, u64 start)
578{ 608{
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 07de8fea2f48..ad13c5d50b91 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -240,6 +240,7 @@ size_t symbol__fprintf(struct symbol *sym, FILE *fp);
240bool symbol_type__is_a(char symbol_type, enum map_type map_type); 240bool symbol_type__is_a(char symbol_type, enum map_type map_type);
241bool symbol__restricted_filename(const char *filename, 241bool symbol__restricted_filename(const char *filename,
242 const char *restricted_filename); 242 const char *restricted_filename);
243bool symbol__is_idle(struct symbol *sym);
243 244
244int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss, 245int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
245 struct symsrc *runtime_ss, symbol_filter_t filter, 246 struct symsrc *runtime_ss, symbol_filter_t filter,