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);