From patchwork Sun Jul 21 20:21:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13738094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5BD9EC3DA61 for ; Sun, 21 Jul 2024 20:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=hau6ZNUSRnLBbU2RrAwrK804PnwlKFqUbEOp59khKMU=; b=P2gJAWvmTsj88K0lBd5wTTbQWg 46oNOjfv5o/DaMZDgJjO1o/r7sPS/0QYft6MB7mKimX+ZJ0juekhlwSRseRgASWrLXh64gD29GGfm moAlXyQ0+LjDIujptWqgOnFzqWRdAsp76Ad9PjPGXCUqhnK+xK3A0DzTpaTaw8dKUh+tDXqa/5F5l veBSelZGDwWOR8wq7IOGuLYDJDVnYtALXQxG6gzSU2JLckZUR6a+iNKBR8DA4NAPCg0Pc5z0Z6/KY +wnrWclnDGFCVR0rUDB8PYqqVlr8/uSmjDd62zPjz79vaQfdBy53uks3qlrU6g3jFCdV+ZQTrO++B xjjnWtXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVd4T-00000007Uq2-2h4P; Sun, 21 Jul 2024 20:22:17 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVd3n-00000007Ueq-1WNw for linux-arm-kernel@lists.infradead.org; Sun, 21 Jul 2024 20:21:37 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 28E481007; Sun, 21 Jul 2024 13:21:58 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3099C3F73F; Sun, 21 Jul 2024 13:21:30 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , John Garry , Will Deacon , Jiri Olsa , Mark Rutland , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Leo Yan Subject: [PATCH v1 1/6] perf pmu: Directly use evsel's PMU pointer Date: Sun, 21 Jul 2024 21:21:08 +0100 Message-Id: <20240721202113.380750-2-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240721202113.380750-1-leo.yan@arm.com> References: <20240721202113.380750-1-leo.yan@arm.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240721_132135_472340_48E7B5EC X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rather than iterating the whole PMU list for finding the associated PMU device for an evsel, this commit optimizes to directly use evsel's 'pmu' pointer for accessing PMU device. Signed-off-by: Leo Yan --- tools/perf/util/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 986166bc7c78..798cd5a2ebc4 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -1199,7 +1199,7 @@ void perf_pmu__warn_invalid_formats(struct perf_pmu *pmu) bool evsel__is_aux_event(const struct evsel *evsel) { - struct perf_pmu *pmu = evsel__find_pmu(evsel); + struct perf_pmu *pmu = evsel->pmu; return pmu && pmu->auxtrace; }