From patchwork Tue Aug 6 20:41:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755293 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 ECA8DC52D70 for ; Tue, 6 Aug 2024 20:42:35 +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=QyMMjxX8Ej9BIYhZocJpatjaRBE2PodrKV1qKzCNUoc=; b=xYmJfbnjHdqtvpFO2+h+kFHzqA WVbynI+JDFADPtFZqn13CzyBOowBZ+oCQvWDWBA1W2aKnPL6IuMmdh8C0Ci03RFwrnLsNWvtuq7l3 S1IhumX97nFxNd51+8jdBlffgzziHFNXkwVHRrdSUcgAaFV4qoVEDPSrKnw7J3f24oE05f1XsN9jS tCSkoBm3oemU9gkdtzqgWO6zZbUL20hNiNhtl6miH+uqsZ0P2uBN2ASP/gbKOdTbBmp3S+Mc2YMGk x3cu+IUphnPuXiDq5zAFNN9lq91hryVE+zzc3Nym2twKjr32ycb1EOGJMNGsDy5e1oNNMTO+demi0 gfy++6JQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR0h-00000002qVf-12nf; Tue, 06 Aug 2024 20:42:23 +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 1sbR09-00000002qMB-0Bet for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:41:50 +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 762621063; Tue, 6 Aug 2024 13:42:13 -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 D08DA3F766; Tue, 6 Aug 2024 13:41:45 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 1/9] perf auxtrace: Use evsel__is_aux_event() for checking AUX event Date: Tue, 6 Aug 2024 21:41:22 +0100 Message-Id: <20240806204130.720977-2-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134149_151207_247A6637 X-CRM114-Status: GOOD ( 11.56 ) 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 Use evsel__is_aux_event() to decide if an event is a AUX event, this is a refactoring to replace comparing the PMU type. Signed-off-by: Leo Yan Reviewed-by: Adrian Hunter --- tools/perf/util/auxtrace.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index e2f317063eec..c3f0ef4349fc 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -671,11 +671,11 @@ int auxtrace_record__read_finish(struct auxtrace_record *itr, int idx) { struct evsel *evsel; - if (!itr->evlist || !itr->pmu) + if (!itr->evlist) return -EINVAL; evlist__for_each_entry(itr->evlist, evsel) { - if (evsel->core.attr.type == itr->pmu->type) { + if (evsel__is_aux_event(evsel)) { if (evsel->disabled) return 0; return evlist__enable_event_idx(itr->evlist, evsel, idx); From patchwork Tue Aug 6 20:41:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755295 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 D3D50C52D70 for ; Tue, 6 Aug 2024 20:43:37 +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=ngtolkrBbwiK3Agbf4uXOkA6SvWeNKNvVf9hmKmlZpc=; b=JnaT7nqPEEn05aOG1ERF4rBeuI YGakMRQI6h+bG8R1x6O2jszueJcX6rJlnNkLqxQGBJetOUxzPHAnbu7/1WiSNneHg68jnZWAfRT+X K4MUizLDlXWSPyHRtsdTtK0/mQRMAasy1/+GKvIk0lr37rq8KjVDB9YjbrAZ2vywZVovNMJvX7TBG 7Lu9A52XMaLY/UheSXzwf80rVAE9nIv90vXu+d+KnX7Oovqo0lSkZxuyBcj5NM6WooDjqeayfKHbL z9feURHSoqP11MpEHIAo8srNmPfFIpZ1CoN6akXgmoHrbwyrKzM1RGubJRubDVKuEfpxeGh5UTQxp Gfqjd5KQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR1h-00000002qov-3hmX; Tue, 06 Aug 2024 20:43:25 +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 1sbR0A-00000002qMl-1E6O for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:41:51 +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 922AB113E; Tue, 6 Aug 2024 13:42:15 -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 009943F766; Tue, 6 Aug 2024 13:41:47 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 2/9] perf auxtrace: Remove unused 'pmu' pointer from struct auxtrace_record Date: Tue, 6 Aug 2024 21:41:23 +0100 Message-Id: <20240806204130.720977-3-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134150_435325_0BBAEAC0 X-CRM114-Status: UNSURE ( 8.97 ) X-CRM114-Notice: Please train this message. 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 The 'pmu' pointer in the auxtrace_record structure is not used after support multiple AUX events, remove it. Signed-off-by: Leo Yan Reviewed-by: Adrian Hunter --- tools/perf/arch/arm/util/cs-etm.c | 1 - tools/perf/arch/arm64/util/arm-spe.c | 1 - tools/perf/arch/arm64/util/hisi-ptt.c | 1 - tools/perf/arch/x86/util/intel-bts.c | 1 - tools/perf/arch/x86/util/intel-pt.c | 1 - tools/perf/util/auxtrace.h | 1 - 6 files changed, 6 deletions(-) diff --git a/tools/perf/arch/arm/util/cs-etm.c b/tools/perf/arch/arm/util/cs-etm.c index da6231367993..96aeb7cdbee1 100644 --- a/tools/perf/arch/arm/util/cs-etm.c +++ b/tools/perf/arch/arm/util/cs-etm.c @@ -888,7 +888,6 @@ struct auxtrace_record *cs_etm_record_init(int *err) } ptr->cs_etm_pmu = cs_etm_pmu; - ptr->itr.pmu = cs_etm_pmu; ptr->itr.parse_snapshot_options = cs_etm_parse_snapshot_options; ptr->itr.recording_options = cs_etm_recording_options; ptr->itr.info_priv_size = cs_etm_info_priv_size; diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/util/arm-spe.c index d59f6ca499f2..2be99fdf997d 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c @@ -514,7 +514,6 @@ struct auxtrace_record *arm_spe_recording_init(int *err, } sper->arm_spe_pmu = arm_spe_pmu; - sper->itr.pmu = arm_spe_pmu; sper->itr.snapshot_start = arm_spe_snapshot_start; sper->itr.snapshot_finish = arm_spe_snapshot_finish; sper->itr.find_snapshot = arm_spe_find_snapshot; diff --git a/tools/perf/arch/arm64/util/hisi-ptt.c b/tools/perf/arch/arm64/util/hisi-ptt.c index ba97c8a562a0..eac9739c87e6 100644 --- a/tools/perf/arch/arm64/util/hisi-ptt.c +++ b/tools/perf/arch/arm64/util/hisi-ptt.c @@ -174,7 +174,6 @@ struct auxtrace_record *hisi_ptt_recording_init(int *err, } pttr->hisi_ptt_pmu = hisi_ptt_pmu; - pttr->itr.pmu = hisi_ptt_pmu; pttr->itr.recording_options = hisi_ptt_recording_options; pttr->itr.info_priv_size = hisi_ptt_info_priv_size; pttr->itr.info_fill = hisi_ptt_info_fill; diff --git a/tools/perf/arch/x86/util/intel-bts.c b/tools/perf/arch/x86/util/intel-bts.c index 34696f3d3d5d..85c8186300c8 100644 --- a/tools/perf/arch/x86/util/intel-bts.c +++ b/tools/perf/arch/x86/util/intel-bts.c @@ -434,7 +434,6 @@ struct auxtrace_record *intel_bts_recording_init(int *err) } btsr->intel_bts_pmu = intel_bts_pmu; - btsr->itr.pmu = intel_bts_pmu; btsr->itr.recording_options = intel_bts_recording_options; btsr->itr.info_priv_size = intel_bts_info_priv_size; btsr->itr.info_fill = intel_bts_info_fill; diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c index 4b710e875953..ea510a7486b1 100644 --- a/tools/perf/arch/x86/util/intel-pt.c +++ b/tools/perf/arch/x86/util/intel-pt.c @@ -1197,7 +1197,6 @@ struct auxtrace_record *intel_pt_recording_init(int *err) } ptr->intel_pt_pmu = intel_pt_pmu; - ptr->itr.pmu = intel_pt_pmu; ptr->itr.recording_options = intel_pt_recording_options; ptr->itr.info_priv_size = intel_pt_info_priv_size; ptr->itr.info_fill = intel_pt_info_fill; diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index 8a6ec9565835..95304368103b 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -411,7 +411,6 @@ struct auxtrace_record { int (*read_finish)(struct auxtrace_record *itr, int idx); unsigned int alignment; unsigned int default_aux_sample_size; - struct perf_pmu *pmu; struct evlist *evlist; }; From patchwork Tue Aug 6 20:41:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755297 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 18229C52D70 for ; Tue, 6 Aug 2024 20:44:42 +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=vIHDn+DnKuqbbXU/zw4KpQsPXXLqFocTxehjdZBbB8U=; b=Y7F5diSAh19RI47va64JXGP4Ye bnO9msewSOo5rBWqnaFNk2gmvnNLPrJRfL16wnDksxkWkgIR0qxfvIdqpTTxsSoivEM8rbOTIVkPr Ujb/jbqdd2Kxm4WYKDceJZ8Q52TkiIb4srA9dq71mrpDaTJs4IwmhT2JVke/R6vSseJO98NxaEyTO argbHsl0vwmQRxqAaY0JiIBxXn6IMptcyf7V1g48jrng7H7NNpWkbiONqrum5zc5yKijPvPp45bcj 0hZqvj6uOlITTdLWQMATNmICuLjFgAvFkAiY/nBQZQz6e/DkqCNriFJ8kfFelzc+MWm9vrk+JHeap eE+EfNaw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR2i-00000002r8u-1yM2; Tue, 06 Aug 2024 20:44:28 +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 1sbR0F-00000002qOH-3hm3 for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:41:57 +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 AE3AF1063; Tue, 6 Aug 2024 13:42:17 -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 1C8E63F766; Tue, 6 Aug 2024 13:41:49 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 3/9] perf auxtrace: Refactor auxtrace__evsel_is_auxtrace() Date: Tue, 6 Aug 2024 21:41:24 +0100 Message-Id: <20240806204130.720977-4-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134156_054485_CC042059 X-CRM114-Status: GOOD ( 14.97 ) 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 The auxtrace__evsel_is_auxtrace() function invokes the callback .evsel_is_auxtrace() to check if an event is an AUX trace. In the low-level code, every AUX trace module provides its callback to compare the PMU type. This commit refactors auxtrace__evsel_is_auxtrace() by simply calling evsel__is_aux_event() rather than using the callback function. As a result, the callback .evsel_is_auxtrace() is no longer needed, so the definition and implementations are removed. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 9 --------- tools/perf/util/auxtrace.c | 4 ++-- tools/perf/util/auxtrace.h | 2 -- tools/perf/util/cs-etm.c | 13 +------------ tools/perf/util/hisi-ptt.c | 9 --------- tools/perf/util/intel-bts.c | 10 ---------- tools/perf/util/intel-pt.c | 10 ---------- tools/perf/util/s390-cpumsf.c | 9 --------- 8 files changed, 3 insertions(+), 63 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index afbd5869f6bf..27e393a0beec 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -1053,14 +1053,6 @@ static void arm_spe_free(struct perf_session *session) free(spe); } -static bool arm_spe_evsel_is_auxtrace(struct perf_session *session, - struct evsel *evsel) -{ - struct arm_spe *spe = container_of(session->auxtrace, struct arm_spe, auxtrace); - - return evsel->core.attr.type == spe->pmu_type; -} - static const char * const arm_spe_info_fmts[] = { [ARM_SPE_PMU_TYPE] = " PMU Type %"PRId64"\n", }; @@ -1344,7 +1336,6 @@ int arm_spe_process_auxtrace_info(union perf_event *event, spe->auxtrace.flush_events = arm_spe_flush; spe->auxtrace.free_events = arm_spe_free_events; spe->auxtrace.free = arm_spe_free; - spe->auxtrace.evsel_is_auxtrace = arm_spe_evsel_is_auxtrace; session->auxtrace = &spe->auxtrace; arm_spe_print_info(&auxtrace_info->priv[0]); diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index c3f0ef4349fc..03462ff346e7 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -2874,8 +2874,8 @@ void auxtrace__free(struct perf_session *session) bool auxtrace__evsel_is_auxtrace(struct perf_session *session, struct evsel *evsel) { - if (!session->auxtrace || !session->auxtrace->evsel_is_auxtrace) + if (!session->auxtrace) return false; - return session->auxtrace->evsel_is_auxtrace(session, evsel); + return evsel__is_aux_event(evsel); } diff --git a/tools/perf/util/auxtrace.h b/tools/perf/util/auxtrace.h index 95304368103b..f13c2de17653 100644 --- a/tools/perf/util/auxtrace.h +++ b/tools/perf/util/auxtrace.h @@ -221,8 +221,6 @@ struct auxtrace { struct perf_tool *tool); void (*free_events)(struct perf_session *session); void (*free)(struct perf_session *session); - bool (*evsel_is_auxtrace)(struct perf_session *session, - struct evsel *evsel); }; /** diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index d3e9c64d17d4..dac0f7c7e44d 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -899,16 +899,6 @@ static void cs_etm__free(struct perf_session *session) zfree(&aux); } -static bool cs_etm__evsel_is_auxtrace(struct perf_session *session, - struct evsel *evsel) -{ - struct cs_etm_auxtrace *aux = container_of(session->auxtrace, - struct cs_etm_auxtrace, - auxtrace); - - return evsel->core.attr.type == aux->pmu_type; -} - static struct machine *cs_etm__get_machine(struct cs_etm_queue *etmq, ocsd_ex_level el) { @@ -2877,7 +2867,7 @@ static int cs_etm__setup_timeless_decoding(struct cs_etm_auxtrace *etm) * Find the cs_etm evsel and look at what its timestamp setting was */ evlist__for_each_entry(evlist, evsel) - if (cs_etm__evsel_is_auxtrace(etm->session, evsel)) { + if (evsel__is_aux_event(evsel)) { etm->timeless_decoding = !(evsel->core.attr.config & BIT(ETM_OPT_TS)); return 0; @@ -3380,7 +3370,6 @@ int cs_etm__process_auxtrace_info_full(union perf_event *event, etm->auxtrace.flush_events = cs_etm__flush_events; etm->auxtrace.free_events = cs_etm__free_events; etm->auxtrace.free = cs_etm__free; - etm->auxtrace.evsel_is_auxtrace = cs_etm__evsel_is_auxtrace; session->auxtrace = &etm->auxtrace; err = cs_etm__setup_timeless_decoding(etm); diff --git a/tools/perf/util/hisi-ptt.c b/tools/perf/util/hisi-ptt.c index 37ea987017f6..57dd98afb0d2 100644 --- a/tools/perf/util/hisi-ptt.c +++ b/tools/perf/util/hisi-ptt.c @@ -141,14 +141,6 @@ static void hisi_ptt_free(struct perf_session *session) free(ptt); } -static bool hisi_ptt_evsel_is_auxtrace(struct perf_session *session, - struct evsel *evsel) -{ - struct hisi_ptt *ptt = container_of(session->auxtrace, struct hisi_ptt, auxtrace); - - return evsel->core.attr.type == ptt->pmu_type; -} - static void hisi_ptt_print_info(__u64 type) { if (!dump_trace) @@ -181,7 +173,6 @@ int hisi_ptt_process_auxtrace_info(union perf_event *event, ptt->auxtrace.flush_events = hisi_ptt_flush; ptt->auxtrace.free_events = hisi_ptt_free_events; ptt->auxtrace.free = hisi_ptt_free; - ptt->auxtrace.evsel_is_auxtrace = hisi_ptt_evsel_is_auxtrace; session->auxtrace = &ptt->auxtrace; hisi_ptt_print_info(auxtrace_info->priv[0]); diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index ec1b3bd9f530..2b571e56f9c9 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -728,15 +728,6 @@ static void intel_bts_free(struct perf_session *session) free(bts); } -static bool intel_bts_evsel_is_auxtrace(struct perf_session *session, - struct evsel *evsel) -{ - struct intel_bts *bts = container_of(session->auxtrace, struct intel_bts, - auxtrace); - - return evsel->core.attr.type == bts->pmu_type; -} - struct intel_bts_synth { struct perf_tool dummy_tool; struct perf_session *session; @@ -892,7 +883,6 @@ int intel_bts_process_auxtrace_info(union perf_event *event, bts->auxtrace.flush_events = intel_bts_flush; bts->auxtrace.free_events = intel_bts_free_events; bts->auxtrace.free = intel_bts_free; - bts->auxtrace.evsel_is_auxtrace = intel_bts_evsel_is_auxtrace; session->auxtrace = &bts->auxtrace; intel_bts_print_info(&auxtrace_info->priv[0], INTEL_BTS_PMU_TYPE, diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index d6d7b7512505..1608d0e38679 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -3589,15 +3589,6 @@ static void intel_pt_free(struct perf_session *session) free(pt); } -static bool intel_pt_evsel_is_auxtrace(struct perf_session *session, - struct evsel *evsel) -{ - struct intel_pt *pt = container_of(session->auxtrace, struct intel_pt, - auxtrace); - - return evsel->core.attr.type == pt->pmu_type; -} - static int intel_pt_process_auxtrace_event(struct perf_session *session, union perf_event *event, struct perf_tool *tool __maybe_unused) @@ -4356,7 +4347,6 @@ int intel_pt_process_auxtrace_info(union perf_event *event, pt->auxtrace.flush_events = intel_pt_flush; pt->auxtrace.free_events = intel_pt_free_events; pt->auxtrace.free = intel_pt_free; - pt->auxtrace.evsel_is_auxtrace = intel_pt_evsel_is_auxtrace; session->auxtrace = &pt->auxtrace; if (dump_trace) diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c index 6fe478b0b61b..a9b0dea199d5 100644 --- a/tools/perf/util/s390-cpumsf.c +++ b/tools/perf/util/s390-cpumsf.c @@ -1048,14 +1048,6 @@ static void s390_cpumsf_free(struct perf_session *session) free(sf); } -static bool -s390_cpumsf_evsel_is_auxtrace(struct perf_session *session __maybe_unused, - struct evsel *evsel) -{ - return evsel->core.attr.type == PERF_TYPE_RAW && - evsel->core.attr.config == PERF_EVENT_CPUM_SF_DIAG; -} - static int s390_cpumsf_get_type(const char *cpuid) { int ret, family = 0; @@ -1152,7 +1144,6 @@ int s390_cpumsf_process_auxtrace_info(union perf_event *event, sf->auxtrace.flush_events = s390_cpumsf_flush; sf->auxtrace.free_events = s390_cpumsf_free_events; sf->auxtrace.free = s390_cpumsf_free; - sf->auxtrace.evsel_is_auxtrace = s390_cpumsf_evsel_is_auxtrace; session->auxtrace = &sf->auxtrace; if (dump_trace) From patchwork Tue Aug 6 20:41:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755296 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 E3E22C52D70 for ; Tue, 6 Aug 2024 20:44:06 +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=2BgKdvNXDP4lQQZyQts5G43tm5wBPhgvkm+gCwj4COw=; b=4Eeo5S4E4cOoxBWaSnj4DE2YUV ZBLRrlUAE1ekXAF9IyVkpJbCltI0G23F2Ju1Sy3sLKgU/CptlqTfy2G0ST0nz81s8e6jn/DuW06SW /aOFh8s+NImGbvOA6eN+1ZmLlCyEvsIkjjoklWiIFVY5bkcbuYbUJ2hOE5nSgXVZ0tUsAOohvDPBN Fj+8rIvGzp0vsyxIa5JLGfXDNSd69OobpEX+e5dJeULtVF3l+jX8EeTDvb8FDUFHoh2L6o+vCuS1t 4i4zJfCM1NvLoR3rtGPASJW3UY7aUA+5HhHfCZ/T8BEi8q14iYHRRzx8JQJ93YnvG38ld5lpBbnAs dKXGneSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR2D-00000002qzb-2nXJ; Tue, 06 Aug 2024 20:43:57 +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 1sbR0E-00000002qNv-3X6Q for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:41:56 +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 CAC01113E; Tue, 6 Aug 2024 13:42:19 -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 39BB73F766; Tue, 6 Aug 2024 13:41:52 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 4/9] perf arm-spe: Remove the 'pmu_type' field Date: Tue, 6 Aug 2024 21:41:25 +0100 Message-Id: <20240806204130.720977-5-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134154_960236_C4BDC53D X-CRM114-Status: GOOD ( 12.69 ) 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 Use the evsel__is_aux_event() function in the Arm SPE layer to detected the enabled AUX events. It is safe for this change as it is no chance for mixing AUX events and only the same kind of AUX events are enabled during the initialization. After the refactoring, the 'pmu_type' field is not used, so remove it. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 27e393a0beec..213320cfcea7 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -45,7 +45,6 @@ struct arm_spe { u32 auxtrace_type; struct perf_session *session; struct machine *machine; - u32 pmu_type; u64 midr; struct perf_tsc_conversion tc; @@ -1120,7 +1119,7 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf_session *session) int err; evlist__for_each_entry(evlist, evsel) { - if (evsel->core.attr.type == spe->pmu_type) { + if (evsel__is_aux_event(evsel)) { found = true; break; } @@ -1305,7 +1304,6 @@ int arm_spe_process_auxtrace_info(union perf_event *event, spe->session = session; spe->machine = &session->machines.host; /* No kvm support */ spe->auxtrace_type = auxtrace_info->type; - spe->pmu_type = auxtrace_info->priv[ARM_SPE_PMU_TYPE]; spe->midr = midr; spe->timeless_decoding = arm_spe__is_timeless_decoding(spe); From patchwork Tue Aug 6 20:41:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755298 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 344D2C52D6F for ; Tue, 6 Aug 2024 20:45:09 +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=ElYhfHR9a3d/ZCm8Flr7djHQQjL4kFXwCGAU4To9tL4=; b=i6GdjTnoNiobIKxYacIXJCaUiK slWuD/kPKlMle7Oyn3mGfBF3BuRSIUBe0CRxreQaDG+sb60WObjUWP9jKvppp3BO80Yp1jpCAYUHR ldEQHTzMBYnIYgJwYaox5P68Ww+YrkaRbBaaX87b4BCV2Kx7BG6JEOhnxZ7xkcmGAYu44fSaYZfsV s+e12EoMYOMXRFQbbyWZF3r+hrCunfMWUoLsnmUpRwVWOrSWbe5zxoGBXjOx5nTwGX38bxIq/WaM8 8YIMGZrcSRigYKkhwAWJEUKgyXY7Gr0NaieOIn4VCbqnS4Ig2LF7caf89IcsRwBPSo7ZxwEGow+zQ ZsVbixWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR3E-00000002rJZ-0zK1; Tue, 06 Aug 2024 20:45:00 +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 1sbR0G-00000002qNv-1dEq for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:41:57 +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 EF52C113E; Tue, 6 Aug 2024 13:42:21 -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 552213F766; Tue, 6 Aug 2024 13:41:54 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 5/9] perf cs-etm: Remove the 'pmu_type' field Date: Tue, 6 Aug 2024 21:41:26 +0100 Message-Id: <20240806204130.720977-6-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134156_502181_E9240900 X-CRM114-Status: GOOD ( 11.60 ) 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 Use the evsel__is_aux_event() function in the Arm CoreSight layer to detect the enabled AUX events. So the 'pmu_type' field is not used, remove it. Signed-off-by: Leo Yan --- tools/perf/util/cs-etm.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c index dac0f7c7e44d..13050b1919c8 100644 --- a/tools/perf/util/cs-etm.c +++ b/tools/perf/util/cs-etm.c @@ -77,7 +77,6 @@ struct cs_etm_auxtrace { u64 instructions_sample_period; u64 instructions_id; u64 **metadata; - unsigned int pmu_type; enum cs_etm_pid_fmt pid_fmt; }; @@ -1629,7 +1628,7 @@ static int cs_etm__synth_events(struct cs_etm_auxtrace *etm, int err; evlist__for_each_entry(evlist, evsel) { - if (evsel->core.attr.type == etm->pmu_type) { + if (evsel__is_aux_event(evsel)) { found = true; break; } @@ -3338,7 +3337,6 @@ int cs_etm__process_auxtrace_info_full(union perf_event *event, etm->session = session; etm->num_cpu = num_cpu; - etm->pmu_type = (unsigned int) ((ptr[CS_PMU_TYPE_CPUS] >> 32) & 0xffffffff); etm->snapshot_mode = (ptr[CS_ETM_SNAPSHOT] != 0); etm->metadata = metadata; etm->auxtrace_type = auxtrace_info->type; From patchwork Tue Aug 6 20:41:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755299 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 9238CC52D6F for ; Tue, 6 Aug 2024 20:45: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: 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=HZI59yH5y7v2uLivd8kK9hVx4zfqvhMZyAB1MMeY6L8=; b=DmI14xUahCOPqGs0RQbleo7ceb JmoepTa6/eA2iG5F0Q6e8qgkq9iExNBc3HhM4RACvAMB7tGtiBHR8SSSgYGImLGTv9bvJuMApb1vo WgJho2Fip8McDKQCM0SzRBbS5I9MH20KhPunmi6qj2ZKvqghsdVmv0CzwOLqCv4MdPthYgWfLeIv1 CV0FTf9VDgC9NEp8cshNwYWPIp5fMrWddDnX10op8esM6WdB8JrJUjipnQiodTolmfwzkZ/r7r/lm 4FHbZP3TncahYjxj9DjTVhDPGSwSEni/Z5CVT5BKeSegKn32kxM2jMzZVfd7IdI0huL6kGM5UTUfL sXX2U+Tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR3j-00000002rTs-3hhy; Tue, 06 Aug 2024 20:45:31 +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 1sbR0J-00000002qPJ-0XQJ for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:42:00 +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 204571063; Tue, 6 Aug 2024 13:42:24 -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 79AFD3F766; Tue, 6 Aug 2024 13:41:56 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 6/9] perf hisi-ptt: Remove the unused 'pmu_type' field Date: Tue, 6 Aug 2024 21:41:27 +0100 Message-Id: <20240806204130.720977-7-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134159_234342_DFA53214 X-CRM114-Status: UNSURE ( 9.11 ) X-CRM114-Notice: Please train this message. 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 The 'pmu_type' field is not used, remove it. Signed-off-by: Leo Yan --- tools/perf/util/hisi-ptt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/util/hisi-ptt.c b/tools/perf/util/hisi-ptt.c index 57dd98afb0d2..859e1bc38e12 100644 --- a/tools/perf/util/hisi-ptt.c +++ b/tools/perf/util/hisi-ptt.c @@ -32,7 +32,6 @@ struct hisi_ptt { u32 auxtrace_type; struct perf_session *session; struct machine *machine; - u32 pmu_type; }; static enum hisi_ptt_pkt_type hisi_ptt_check_packet_type(unsigned char *buf) @@ -166,7 +165,6 @@ int hisi_ptt_process_auxtrace_info(union perf_event *event, ptt->session = session; ptt->machine = &session->machines.host; /* No kvm support */ ptt->auxtrace_type = auxtrace_info->type; - ptt->pmu_type = auxtrace_info->priv[0]; ptt->auxtrace.process_event = hisi_ptt_process_event; ptt->auxtrace.process_auxtrace_event = hisi_ptt_process_auxtrace_event; From patchwork Tue Aug 6 20:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755300 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 55F32C52D70 for ; Tue, 6 Aug 2024 20:46:15 +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=y3j4qLdj6Tm3qPWaRLKXb4nhv+7I0vB+JXyacOwdm7c=; b=0iRufoJhOs0S1dEagr9YJctQrs J8laG4e+y5oNMJBGy2kw0lIqIeGuBUbuO/Twuxf3ehnC114hAUZAkFde7naBImm9kHPBYIzEW/XE9 0MmzReiiY2NmPvh8fcD4ID6A6cYaE3PM4HkkZCbrSnGoX0JnGHfPC6uTUIHbmfr3cUOKvXINkXn5i rF4dFIuUE0tge863zhr0HFwt3iWS+AD/yNLqqgvlgo6OPjI7eDFZk49oa15Sqdu9qzwnQLznZowud RRAhDPSkOlN3RCZsAFW1MXficijG6D4Z4wrXnhChABlZBezP3UJ7dCBvfQKijpEDATjNQQ+NgojO6 btTGbDDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR4I-00000002rjG-0b95; Tue, 06 Aug 2024 20:46:06 +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 1sbR0L-00000002qQB-17AK for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:42:03 +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 3C1BC113E; Tue, 6 Aug 2024 13:42:26 -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 9F1C33F766; Tue, 6 Aug 2024 13:41:58 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 7/9] perf intel-bts: Remove the 'pmu_type' field Date: Tue, 6 Aug 2024 21:41:28 +0100 Message-Id: <20240806204130.720977-8-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134201_364670_530F16FE X-CRM114-Status: GOOD ( 11.51 ) 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 Use the evsel__is_aux_event() function to detect the enabled AUX events. The 'pmu_type' field is not used, remove it. Signed-off-by: Leo Yan --- tools/perf/util/intel-bts.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index 2b571e56f9c9..93f3452f8220 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c @@ -51,7 +51,6 @@ struct intel_bts { bool sampling_mode; bool snapshot_mode; bool data_queued; - u32 pmu_type; struct perf_tsc_conversion tc; bool cap_user_time_zero; struct itrace_synth_opts synth_opts; @@ -768,7 +767,7 @@ static int intel_bts_synth_events(struct intel_bts *bts, int err; evlist__for_each_entry(evlist, evsel) { - if (evsel->core.attr.type == bts->pmu_type && evsel->core.ids) { + if (evsel__is_aux_event(evsel) && evsel->core.ids) { found = true; break; } @@ -868,7 +867,6 @@ int intel_bts_process_auxtrace_info(union perf_event *event, bts->session = session; bts->machine = &session->machines.host; /* No kvm support */ bts->auxtrace_type = auxtrace_info->type; - bts->pmu_type = auxtrace_info->priv[INTEL_BTS_PMU_TYPE]; bts->tc.time_shift = auxtrace_info->priv[INTEL_BTS_TIME_SHIFT]; bts->tc.time_mult = auxtrace_info->priv[INTEL_BTS_TIME_MULT]; bts->tc.time_zero = auxtrace_info->priv[INTEL_BTS_TIME_ZERO]; From patchwork Tue Aug 6 20:41:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755301 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 321B0C52D71 for ; Tue, 6 Aug 2024 20:46:50 +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=4Ur9ffgtS293kHeqWh95GzK+LVZaaw/JPRsyPh7Ult4=; b=zyZ/i2zmQGqSC1yu0WTbg+I0xo YtGZ4tYVA3cmetFac4DgnFjGw7hnproVnYjzPY1lcHyYFLLduGvfhqjNk1IqGe9JnH6VPtvKhzAsC RvWucruiXpSNiWULk4gQrA7gDpK2r3TpdXCI+qgU+w7AFKYoi/wNpPEzei62gAGvujpr2lKthH3OI 2HACufqgtsoSR5j8n6laHC2g0gxyMRMp6nt9q75yywanhw7oJYdKmaOUaL010vaY5exuCa+Fi22DS cAP7mA1ZVhbdJgAqNnM4DvmvJcNPkYo/W4gpX5yIxeoAtvRlVv6U6fdebNNs33oTYdeQZ7KP5/1Ha BWYap2Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR4o-00000002rud-3uZe; Tue, 06 Aug 2024 20:46:38 +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 1sbR0N-00000002qQs-1dHU for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:42:04 +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 57FAAFEC; Tue, 6 Aug 2024 13:42:28 -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 BACDD3F766; Tue, 6 Aug 2024 13:42:00 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 8/9] perf intel-pt: Remove the 'pmu_type' field Date: Tue, 6 Aug 2024 21:41:29 +0100 Message-Id: <20240806204130.720977-9-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134203_546160_2265C60B X-CRM114-Status: GOOD ( 13.74 ) 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 Use the evsel__is_aux_event() function to detect the enabled AUX events. The 'pmu_type' field is not used, remove it. Signed-off-by: Leo Yan --- tools/perf/util/intel-pt.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index 1608d0e38679..69b664059c2d 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -84,7 +84,6 @@ struct intel_pt { unsigned int br_stack_sz; unsigned int br_stack_sz_plus; int have_sched_switch; - u32 pmu_type; u64 kernel_start; u64 switch_ip; u64 ptss_ip; @@ -1020,10 +1019,11 @@ static bool intel_pt_pgd_ip(uint64_t ip, void *data) return __intel_pt_pgd_ip(ip, data) > 0; } -static bool intel_pt_get_config(struct intel_pt *pt, - struct perf_event_attr *attr, u64 *config) +static bool intel_pt_get_config(struct evsel *evsel, u64 *config) { - if (attr->type == pt->pmu_type) { + struct perf_event_attr *attr = &evsel->core.attr; + + if (evsel__is_aux_event(evsel)) { if (config) *config = attr->config; return true; @@ -1037,7 +1037,7 @@ static bool intel_pt_exclude_kernel(struct intel_pt *pt) struct evsel *evsel; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, NULL) && + if (intel_pt_get_config(evsel, NULL) && !evsel->core.attr.exclude_kernel) return false; } @@ -1053,7 +1053,7 @@ static bool intel_pt_return_compression(struct intel_pt *pt) return true; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, &config) && + if (intel_pt_get_config(evsel, &config) && (config & pt->noretcomp_bit)) return false; } @@ -1066,7 +1066,7 @@ static bool intel_pt_branch_enable(struct intel_pt *pt) u64 config; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, &config) && + if (intel_pt_get_config(evsel, &config) && (config & INTEL_PT_CFG_PASS_THRU) && !(config & INTEL_PT_CFG_BRANCH_EN)) return false; @@ -1080,7 +1080,7 @@ static bool intel_pt_disabled_tnt(struct intel_pt *pt) u64 config; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, &config) && + if (intel_pt_get_config(evsel, &config) && config & INTEL_PT_CFG_TNT_DIS) return true; } @@ -1100,7 +1100,7 @@ static unsigned int intel_pt_mtc_period(struct intel_pt *pt) config >>= 1; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, &config)) + if (intel_pt_get_config(evsel, &config)) return (config & pt->mtc_freq_bits) >> shift; } return 0; @@ -1118,7 +1118,7 @@ static bool intel_pt_timeless_decoding(struct intel_pt *pt) evlist__for_each_entry(pt->session->evlist, evsel) { if (!(evsel->core.attr.sample_type & PERF_SAMPLE_TIME)) return true; - if (intel_pt_get_config(pt, &evsel->core.attr, &config)) { + if (intel_pt_get_config(evsel, &config)) { if (config & pt->tsc_bit) timeless_decoding = false; else @@ -1133,7 +1133,7 @@ static bool intel_pt_tracing_kernel(struct intel_pt *pt) struct evsel *evsel; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, NULL) && + if (intel_pt_get_config(evsel, NULL) && !evsel->core.attr.exclude_kernel) return true; } @@ -1150,7 +1150,7 @@ static bool intel_pt_have_tsc(struct intel_pt *pt) return false; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, &config)) { + if (intel_pt_get_config(evsel, &config)) { if (config & pt->tsc_bit) have_tsc = true; else @@ -1166,7 +1166,7 @@ static bool intel_pt_have_mtc(struct intel_pt *pt) u64 config; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, &config) && + if (intel_pt_get_config(evsel, &config) && (config & pt->mtc_bit)) return true; } @@ -1191,7 +1191,7 @@ static u64 intel_pt_ctl(struct intel_pt *pt) u64 config; evlist__for_each_entry(pt->session->evlist, evsel) { - if (intel_pt_get_config(pt, &evsel->core.attr, &config)) + if (intel_pt_get_config(evsel, &config)) return config; } return 0; @@ -3703,13 +3703,12 @@ static void intel_pt_set_event_name(struct evlist *evlist, u64 id, } } -static struct evsel *intel_pt_evsel(struct intel_pt *pt, - struct evlist *evlist) +static struct evsel *intel_pt_evsel(struct evlist *evlist) { struct evsel *evsel; evlist__for_each_entry(evlist, evsel) { - if (evsel->core.attr.type == pt->pmu_type && evsel->core.ids) + if (evsel__is_aux_event(evsel) && evsel->core.ids) return evsel; } @@ -3720,7 +3719,7 @@ static int intel_pt_synth_events(struct intel_pt *pt, struct perf_session *session) { struct evlist *evlist = session->evlist; - struct evsel *evsel = intel_pt_evsel(pt, evlist); + struct evsel *evsel = intel_pt_evsel(evlist); struct perf_event_attr attr; u64 id; int err; @@ -4219,7 +4218,6 @@ int intel_pt_process_auxtrace_info(union perf_event *event, pt->session = session; pt->machine = &session->machines.host; /* No kvm support */ pt->auxtrace_type = auxtrace_info->type; - pt->pmu_type = auxtrace_info->priv[INTEL_PT_PMU_TYPE]; pt->tc.time_shift = auxtrace_info->priv[INTEL_PT_TIME_SHIFT]; pt->tc.time_mult = auxtrace_info->priv[INTEL_PT_TIME_MULT]; pt->tc.time_zero = auxtrace_info->priv[INTEL_PT_TIME_ZERO]; From patchwork Tue Aug 6 20:41:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13755306 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 3E013C52D6F for ; Tue, 6 Aug 2024 20:47:18 +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=3LmEyCBQaVeqhfW4ph4jdHladaLdiMNUPO/YDDM5guM=; b=i9fqUr5DxFzcHtRmds8FcLHvWe Vo9PYtopMw7xkJIfwJjYUIo0T5MYBmtpAlSrpyKuXMwnXenK4rSszJT4sWfh7zcTDqXOPYyrMh5Hx a/NyCvjUJnuC2dASpAa8RmWRiwGC9KibCW91fMe712s441EbMW3H9Tqe64cgYa7OF7uH2tNM/Q8wc hf/PZzYp6u9lsFaJdDtqqgVWoRnaVLx3bJCIb/cgzZsCWq7G/Bzu068mCWS0fAeL72yveyWE/uPtv LzW2awCwv0/W7a253EDznwW0Kyrl98zr2p2slpGzo2Tlq3QmjW5iSQrW6P5P+Z4KD2Ltzs8Jx3f7A xG8oi7Zw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sbR5J-00000002s0F-2g7B; Tue, 06 Aug 2024 20:47:09 +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 1sbR0Q-00000002qSD-26C6 for linux-arm-kernel@lists.infradead.org; Tue, 06 Aug 2024 20:42:07 +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 7D0981063; Tue, 6 Aug 2024 13:42:30 -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 D66583F766; Tue, 6 Aug 2024 13:42:02 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , Adrian Hunter , James Clark , Suzuki K Poulose , Mike Leach , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Liang, Kan" Cc: Leo Yan Subject: [PATCH v1 9/9] perf s390-cpumsf: Remove the unused 'pmu_type' field Date: Tue, 6 Aug 2024 21:41:30 +0100 Message-Id: <20240806204130.720977-10-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240806204130.720977-1-leo.yan@arm.com> References: <20240806204130.720977-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-20240806_134206_611715_B4530A54 X-CRM114-Status: UNSURE ( 8.84 ) X-CRM114-Notice: Please train this message. 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 The 'pmu_type' field is not used, remove it. Signed-off-by: Leo Yan --- tools/perf/util/s390-cpumsf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tools/perf/util/s390-cpumsf.c b/tools/perf/util/s390-cpumsf.c index a9b0dea199d5..3d6253a4c5cf 100644 --- a/tools/perf/util/s390-cpumsf.c +++ b/tools/perf/util/s390-cpumsf.c @@ -172,7 +172,6 @@ struct s390_cpumsf { struct perf_session *session; struct machine *machine; u32 auxtrace_type; - u32 pmu_type; u16 machine_type; bool data_queued; bool use_logfile; @@ -1136,7 +1135,6 @@ int s390_cpumsf_process_auxtrace_info(union perf_event *event, sf->session = session; sf->machine = &session->machines.host; /* No kvm support */ sf->auxtrace_type = auxtrace_info->type; - sf->pmu_type = PERF_TYPE_RAW; sf->machine_type = s390_cpumsf_get_type(session->evlist->env->cpuid); sf->auxtrace.process_event = s390_cpumsf_process_event;