From mboxrd@z Thu Jan 1 00:00:00 1970 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 EDEA4C3DA59 for ; Mon, 22 Jul 2024 10:41:43 +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: Content-Type:In-Reply-To:From:References:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/rWH+H03PCaGi5QwU26jKIkWLdeSGKZEreDqizBbrvk=; b=TKxPb40BatxbHyJg4g4Ml8Fxhu jCoyg05/0IB9juLizJA+ciTvGav/Ckw+iJWKQSG3LGgV0Urf3+0DQzkah25gmcbbdRGORryPXIVev MT9xLIhgoyWPaiWNDKcbQLRmDKP+xl06tYyEz6I2OrFGfJRepJugnbpvZNaS0V1MSCUTe5CavIm4K 8Z4clKTObJ3pha17xkUkSieY7paMQU83TfZMOpt+5nJbmKTj5kMnDAzSV0T7C2pkZFqKPQ/OzRf1n aovoXSEaSdXFlUc9rQ59iTnfwoYR0EWq75arM7Usyw40tYB3ojy6OxCLTkLemX9fnw9GcWyufjBRl +aJt8E7g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVqTz-00000009HSP-3FgA; Mon, 22 Jul 2024 10:41:31 +0000 Received: from mgamail.intel.com ([192.198.163.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sVqTZ-00000009HOC-2keI for linux-arm-kernel@lists.infradead.org; Mon, 22 Jul 2024 10:41:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721644866; x=1753180866; h=message-id:date:mime-version:subject:to:references:from: in-reply-to:content-transfer-encoding; bh=EFV2wzzwODmtn/7Y0xB5l/izBemdfK2HYblHgY6ccaE=; b=ZzUwk1tjKwSutIlTjxzVzLM+6kqShIgw7kMqc4CzT54F042Ofexq0uNB t0tbtvCCdPUmwcH71xfdBtMfZthEp/6E/uKC970NnINGLhLY6e1u5lmGX tE1uiFiE26h9pMXqOznxDoFpObSyIq7m1o+t6yBt8iBrEcEB5JXY2RAic M/wNTxjdRRHJGDtZGNwCwVl+gcguqnG4FaGH1i5oQstbZibg6cctIvlDR X6dXIX/qXPr/PkwWFPU3+WeFwup95RA9SyizeiuVl55UKKSFMAJKPEfZi itShsuYa6LgRPIThstdlsbjwN8/5ciAftM0Sp0xhSckKy+U3xuqGWr4AU g==; X-CSE-ConnectionGUID: FQRNysapS+izsbotddgPfg== X-CSE-MsgGUID: R+nQuxeLSIKZJ/Wi96BGlg== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="19354518" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="19354518" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 03:41:05 -0700 X-CSE-ConnectionGUID: 7BLo0Y8NTTuX5AE51ygT5g== X-CSE-MsgGUID: c1KscY52SLGWR2kBiOV+OQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="82857199" Received: from ahunter6-mobl1.ger.corp.intel.com (HELO [10.0.2.15]) ([10.246.41.28]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 03:41:01 -0700 Message-ID: <3c25ed2b-9538-4d10-9152-ed1e6106b41a@intel.com> Date: Mon, 22 Jul 2024 13:40:56 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/6] perf pmu: Directly use evsel's PMU pointer To: Leo Yan , Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , 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 References: <20240721202113.380750-1-leo.yan@arm.com> <20240721202113.380750-2-leo.yan@arm.com> Content-Language: en-US From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki In-Reply-To: <20240721202113.380750-2-leo.yan@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240722_034105_780886_70B2AD28 X-CRM114-Status: GOOD ( 14.28 ) 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 On 21/07/24 23:21, Leo Yan wrote: > 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; Assumes event parser has populated evsel->pmu for auxtrace events. Could use a comment to that effect. > > return pmu && pmu->auxtrace; > }