提交 82d1deb0 编写于 作者: D David Ahern 提交者: Arnaldo Carvalho de Melo

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: NDavid 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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 d2ff1b14
......@@ -634,26 +634,9 @@ static void *display_thread(void *arg)
return NULL;
}
/* Tag samples to be skipped. */
static const char *skip_symbols[] = {
"intel_idle",
"default_idle",
"native_safe_halt",
"cpu_idle",
"enter_idle",
"exit_idle",
"mwait_idle",
"mwait_idle_with_hints",
"poll_idle",
"ppc64_runlatch_off",
"pseries_dedicated_idle_sleep",
NULL
};
static int symbol_filter(struct map *map __maybe_unused, struct symbol *sym)
{
const char *name = sym->name;
int i;
/*
* 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)
strstr(name, "_text_end"))
return 1;
for (i = 0; skip_symbols[i]; i++) {
if (!strcmp(skip_symbols[i], name)) {
if (symbol__is_idle(sym))
sym->ignore = true;
break;
}
}
return 0;
}
......
......@@ -573,6 +573,36 @@ static u8 kallsyms2elf_type(char type)
return isupper(type) ? STB_GLOBAL : STB_LOCAL;
}
bool symbol__is_idle(struct symbol *sym)
{
const char * const idle_symbols[] = {
"cpu_idle",
"intel_idle",
"default_idle",
"native_safe_halt",
"enter_idle",
"exit_idle",
"mwait_idle",
"mwait_idle_with_hints",
"poll_idle",
"ppc64_runlatch_off",
"pseries_dedicated_idle_sleep",
NULL
};
int i;
if (!sym)
return false;
for (i = 0; idle_symbols[i]; i++) {
if (!strcmp(idle_symbols[i], sym->name))
return true;
}
return false;
}
static int map__process_kallsym_symbol(void *arg, const char *name,
char type, u64 start)
{
......
......@@ -240,6 +240,7 @@ size_t symbol__fprintf(struct symbol *sym, FILE *fp);
bool symbol_type__is_a(char symbol_type, enum map_type map_type);
bool symbol__restricted_filename(const char *filename,
const char *restricted_filename);
bool symbol__is_idle(struct symbol *sym);
int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
struct symsrc *runtime_ss, symbol_filter_t filter,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册