From nobody Wed Dec 17 01:31:18 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B27C7188A24; Fri, 23 Aug 2024 11:33:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724412831; cv=none; b=XzpoT9qh3G8HskqTkTupz8da+aXj88stfjn/P0fYQStnvRZxVtuqBEGBAgScuC75V1eQ315+dYQjoP3QJM3EqECW6CCCvXhhMLnvNIr8Yi/opHv5Z1ClrLAPgCuJx8I6TQrr8/0GTnnrD1Mq58QHLG6RbZapWQRT9zpJ2kQsIDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724412831; c=relaxed/simple; bh=cMHzfQ9hXRH0a2cw3aKhfnQcf1GD+TH3ZUYtvgpZyXE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=YN8y1V8Ju9q0GOWg8hTmY+VxerVhRnmKQQyyU2XbsW5AYpBuNwvF5Yd0kLk9p6cH6BSZuTgF+xm8EgcFijVDJ6C8BrYsNJN5xmUVQi/uc7sBi80hTGB0uio/zRV6G+1Vy90gifdaK+SDLDzEmeRXsWzDLm/X/DalP2uuG06jd/s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 2C0D5FEC; Fri, 23 Aug 2024 04:34: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 B5E7D3F58B; Fri, 23 Aug 2024 04:33:46 -0700 (PDT) From: Leo Yan To: Peter Zijlstra , Adrian Hunter , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Jiri Olsa , Ian Rogers , "Liang, Kan" , Suzuki K Poulose , Mike Leach , James Clark , John Garry , Will Deacon , Yicong Yang , Jonathan Cameron , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, coresight@lists.linaro.org Cc: Leo Yan Subject: [PATCH v6 8/8] perf arm-spe: Support multiple events in arm_spe_evsel_is_auxtrace() Date: Fri, 23 Aug 2024 12:33:06 +0100 Message-Id: <20240823113306.2310957-9-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240823113306.2310957-1-leo.yan@arm.com> References: <20240823113306.2310957-1-leo.yan@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The 'pmu_type' field is an unique value and cannot support multiple PMU events. The arm_spe_evsel_is_auxtrace() function changes to compare PMU name to decide if it is a Arm SPE event. This leads to the 'pmu_type' field is no longer used, remove it. Signed-off-by: Leo Yan --- tools/perf/util/arm-spe.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/perf/util/arm-spe.c b/tools/perf/util/arm-spe.c index 138ffc71b32d..27724711e763 100644 --- a/tools/perf/util/arm-spe.c +++ b/tools/perf/util/arm-spe.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,6 @@ struct arm_spe { u32 auxtrace_type; struct perf_session *session; struct machine *machine; - u32 pmu_type; u64 midr; =20 struct perf_tsc_conversion tc; @@ -1053,12 +1053,10 @@ static void arm_spe_free(struct perf_session *sessi= on) free(spe); } =20 -static bool arm_spe_evsel_is_auxtrace(struct perf_session *session, +static bool arm_spe_evsel_is_auxtrace(struct perf_session *session __maybe= _unused, struct evsel *evsel) { - struct arm_spe *spe =3D container_of(session->auxtrace, struct arm_spe, a= uxtrace); - - return evsel->core.attr.type =3D=3D spe->pmu_type; + return strstarts(evsel->name, "arm_spe"); } =20 static const char * const arm_spe_info_fmts[] =3D { @@ -1099,7 +1097,7 @@ arm_spe_synth_events(struct arm_spe *spe, struct perf= _session *session) int err; =20 evlist__for_each_entry(evlist, evsel) { - if (evsel->core.attr.type =3D=3D spe->pmu_type) { + if (arm_spe_evsel_is_auxtrace(session, evsel)) { found =3D true; break; } @@ -1284,7 +1282,6 @@ int arm_spe_process_auxtrace_info(union perf_event *e= vent, spe->session =3D session; spe->machine =3D &session->machines.host; /* No kvm support */ spe->auxtrace_type =3D auxtrace_info->type; - spe->pmu_type =3D auxtrace_info->priv[ARM_SPE_PMU_TYPE]; spe->midr =3D midr; =20 spe->timeless_decoding =3D arm_spe__is_timeless_decoding(spe); --=20 2.34.1