Hi David,
Just minor nits below..
On Mon, 18 Nov 2013 13:32:45 -0700, David Ahern wrote:Allows list of idle symbols to be leveraged by other commands,
such as the upcoming timehist command.
[SNIP]+bool symbol__is_idle(struct symbol *sym)
+{
+ const char * const idle_symbols[] = {
Wouldn't it better making it static? It seems to build a table
everytime otherwise.
+ "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++) {
Also we can use ARRAY_SIZE() here and let the last NULL go IMHO.