[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <158175611459.13786.11186292336771135984.tip-bot2@tip-bot2>
Date: Sat, 15 Feb 2020 08:41:54 -0000
From: "tip-bot2 for Kim Phillips" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Kim Phillips <kim.phillips@....com>,
Song Liu <songliubraving@...com>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Davidlohr Bueso <dave@...olabs.net>,
Jin Yao <yao.jin@...ux.intel.com>,
Jiri Olsa <jolsa@...hat.com>,
Kan Liang <kan.liang@...ux.intel.com>,
Mark Rutland <mark.rutland@....com>,
Namhyung Kim <namhyung@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, x86 <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: [tip: perf/urgent] perf symbols: Convert symbol__is_idle() to use strlist
The following commit has been merged into the perf/urgent branch of tip:
Commit-ID: bc5f15be2c814ca1ff6bb4e62d5b275a8c88cbb1
Gitweb: https://git.kernel.org/tip/bc5f15be2c814ca1ff6bb4e62d5b275a8c88cbb1
Author: Kim Phillips <kim.phillips@....com>
AuthorDate: Mon, 10 Feb 2020 10:31:47 -06:00
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitterDate: Mon, 10 Feb 2020 16:30:51 -03:00
perf symbols: Convert symbol__is_idle() to use strlist
Use the more optimized strlist implementation to do the idle function
lookup.
Signed-off-by: Kim Phillips <kim.phillips@....com>
Acked-by: Song Liu <songliubraving@...com>
Tested-by: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andi Kleen <ak@...ux.intel.com>
Cc: Cong Wang <xiyou.wangcong@...il.com>
Cc: Davidlohr Bueso <dave@...olabs.net>
Cc: Jin Yao <yao.jin@...ux.intel.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Kan Liang <kan.liang@...ux.intel.com>
Cc: Mark Rutland <mark.rutland@....com>
Cc: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Link: http://lore.kernel.org/lkml/20200210163147.25358-1-kim.phillips@amd.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/symbol.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index f3120c4..1077013 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -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,
Powered by blists - more mailing lists