Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2666289ybv; Sat, 15 Feb 2020 00:43:12 -0800 (PST) X-Google-Smtp-Source: APXvYqxa3M/ooYT7r/8z+K1sJhk/rfGObRlJ2qqzj/GlCuHVAlbTdePMUzwFwq283PQ9Vty4Te4r X-Received: by 2002:a9d:760d:: with SMTP id k13mr5117810otl.42.1581756191110; Sat, 15 Feb 2020 00:43:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581756191; cv=none; d=google.com; s=arc-20160816; b=jYINeqOA4kX54OGsmGqoaL4KYpdneT343ceVjGhCl9nMPwyS7tU8jSF1lB5xAetPIC Sw6e0tDWKIG2yS97sneQmKkJixHeoh7JiQD5siro5QeOjHWajc+qwaAV4Reps8DE2AYS NBGu++FzeZF3UO5caOu0hmq83/U9AXO1xrjQ2GkYei/dpSKd/Dmix7wu+7K1eLmLbfYu Vbx+3Zt5Dt735Z56iBfTQLy+Ey1T0M4CEnWt3MTU/XdnB9LC7uU4DRSIsIZVatZgtW2R AbFvd+CHC8zSP/UsF3ulRuACluDkQtvW8PMC+7GKV9hy/J4CIlDAMv4TGRIxvkaW6kJX 9tQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=OF4I6l1h0oUVETUWTa0f4N1cydhoxO3hg7ePQdBUsPc=; b=TOXtjb6gMN3sYRg9Z18N+6zCsN41O71ibt6l42zLIvM4GcsamID+hBCrvp9UTRXivy sQ1AmHNBc8H4FeyjzWKcCnW/kbHJUYs0WdV2E5nnz2QBmNGvG/HGc4X6VXNzyc2HZELB dG4lOJ9AZJcNmKe1x5gf/E3ChnqfbkC4HGd4KHHnv9Zk9eX6MGrfjqa/otSayEz0o6gi L10lpQL04FZKk/aUaDUCtbPC9twyDreg0cbd1FnCdmCeITH/KkT+xgyr1nBuMQIjxiSa k2ewNr+wnkJWASbznGOZuyGaYRLSsG0t7jg5O2+EWEotIXUf8ebKkT1HKFL3fGIK2mPJ eRgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u21si3962812otq.137.2020.02.15.00.42.59; Sat, 15 Feb 2020 00:43:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727804AbgBOIm1 (ORCPT + 99 others); Sat, 15 Feb 2020 03:42:27 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:56858 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbgBOImO (ORCPT ); Sat, 15 Feb 2020 03:42:14 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1j2t1T-0005Ko-F5; Sat, 15 Feb 2020 09:41:59 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id E165D1C205F; Sat, 15 Feb 2020 09:41:54 +0100 (CET) Date: Sat, 15 Feb 2020 08:41:54 -0000 From: "tip-bot2 for Kim Phillips" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf symbols: Convert symbol__is_idle() to use strlist Cc: Kim Phillips , Song Liu , Arnaldo Carvalho de Melo , Alexander Shishkin , Andi Kleen , Cong Wang , Davidlohr Bueso , Jin Yao , Jiri Olsa , Kan Liang , Mark Rutland , Namhyung Kim , Peter Zijlstra , x86 , LKML In-Reply-To: <20200210163147.25358-1-kim.phillips@amd.com> References: <20200210163147.25358-1-kim.phillips@amd.com> MIME-Version: 1.0 Message-ID: <158175611459.13786.11186292336771135984.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 AuthorDate: Mon, 10 Feb 2020 10:31:47 -06:00 Committer: Arnaldo Carvalho de Melo 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 Acked-by: Song Liu Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Andi Kleen Cc: Cong Wang Cc: Davidlohr Bueso Cc: Jin Yao Cc: Jiri Olsa Cc: Kan Liang Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lore.kernel.org/lkml/20200210163147.25358-1-kim.phillips@amd.com Signed-off-by: Arnaldo Carvalho de Melo --- 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,