Commit bc5f15be authored by Kim Phillips's avatar Kim Phillips Committed by Arnaldo Carvalho de Melo

perf symbols: Convert symbol__is_idle() to use strlist

Use the more optimized strlist implementation to do the idle function
lookup.
Signed-off-by: default avatarKim Phillips <kim.phillips@amd.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Tested-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20200210163147.25358-1-kim.phillips@amd.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 0e71459a
......@@ -654,13 +654,17 @@ static bool symbol__is_idle(const char *name)
NULL
};
int i;
static struct strlist *idle_symbols_list;
for (i = 0; idle_symbols[i]; i++) {
if (!strcmp(idle_symbols[i], name))
return true;
}
if (idle_symbols_list)
return strlist__has_entry(idle_symbols_list, name);
return false;
idle_symbols_list = strlist__new(NULL, NULL);
for (i = 0; idle_symbols[i]; i++)
strlist__add(idle_symbols_list, idle_symbols[i]);
return strlist__has_entry(idle_symbols_list, name);
}
static int map__process_kallsym_symbol(void *arg, const char *name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment