All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tip-bot2 for Kim Phillips" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Kim Phillips <kim.phillips@amd.com>,
	Song Liu <songliubraving@fb.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Jin Yao <yao.jin@linux.intel.com>, Jiri Olsa <jolsa@redhat.com>,
	Kan Liang <kan.liang@linux.intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>, x86 <x86@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [tip: perf/urgent] perf symbols: Convert symbol__is_idle() to use strlist
Date: Sat, 15 Feb 2020 08:41:54 -0000	[thread overview]
Message-ID: <158175611459.13786.11186292336771135984.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20200210163147.25358-1-kim.phillips@amd.com>

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@amd.com>
AuthorDate:    Mon, 10 Feb 2020 10:31:47 -06:00
Committer:     Arnaldo Carvalho de Melo <acme@redhat.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@amd.com>
Acked-by: Song Liu <songliubraving@fb.com>
Tested-by: Arnaldo 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.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.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,

  parent reply	other threads:[~2020-02-15  8:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-07 23:06 [PATCH 1/3 v2] perf stat: don't report a null stalled cycles per insn metric Kim Phillips
2020-02-07 23:06 ` [PATCH 2/3 v2] perf symbols: Update the list of kernel idle symbols Kim Phillips
2020-02-10 18:52   ` Song Liu
2020-02-15  8:41   ` [tip: perf/urgent] " tip-bot2 for Kim Phillips
2020-02-10 16:31 ` [PATCH 3/3 v2] perf symbols: convert symbol__is_idle to use strlist Kim Phillips
2020-02-10 18:51   ` Song Liu
2020-02-10 19:32     ` Arnaldo Carvalho de Melo
2020-02-15  8:41   ` tip-bot2 for Kim Phillips [this message]
2020-02-10 18:53 ` [PATCH 1/3 v2] perf stat: don't report a null stalled cycles per insn metric Song Liu
2020-02-15  8:41 ` [tip: perf/urgent] perf stat: Don't " tip-bot2 for Kim Phillips

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=158175611459.13786.11186292336771135984.tip-bot2@tip-bot2 \
    --to=tip-bot2@linutronix.de \
    --cc=acme@redhat.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dave@stgolabs.net \
    --cc=jolsa@redhat.com \
    --cc=kan.liang@linux.intel.com \
    --cc=kim.phillips@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=songliubraving@fb.com \
    --cc=x86@kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.