From nobody Thu May 14 09:25:56 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C053C433EF for ; Fri, 8 Apr 2022 14:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237109AbiDHOnM (ORCPT ); Fri, 8 Apr 2022 10:43:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237060AbiDHOnJ (ORCPT ); Fri, 8 Apr 2022 10:43:09 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B7927ED9F5; Fri, 8 Apr 2022 07:41:05 -0700 (PDT) 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 5D9BD113E; Fri, 8 Apr 2022 07:41:05 -0700 (PDT) Received: from e121896.arm.com (unknown [10.57.11.88]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6204A3F73B; Fri, 8 Apr 2022 07:41:02 -0700 (PDT) From: James Clark To: acme@kernel.org, linux-perf-users@vger.kernel.org, leo.yan@linaro.com Cc: German.Gomez@arm.com, James Clark , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Arnaldo Carvalho de Melo , Ravi Bangoria , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] perf: arm-spe: Fix perf report --mem-mode Date: Fri, 8 Apr 2022 15:40:56 +0100 Message-Id: <20220408144056.1955535-1-james.clark@arm.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Since commit bb30acae4c4d ("perf report: Bail out --mem-mode if mem info is not available") "perf mem report" and "perf report --mem-mode" don't allow opening the file unless one of the events has PERF_SAMPLE_DATA_SRC set. SPE doesn't have this set even though synthetic memory data is generated after it is decoded. Fix this issue by setting DATA_SRC on SPE events. This has no effect on the data collected because the SPE driver doesn't do anything with that flag and doesn't generate samples. Fixes: bb30acae4c4d ("perf report: Bail out --mem-mode if mem info is not a= vailable") Signed-off-by: James Clark Acked-by: Namhyung Kim Tested-by: Leo Yan --- tools/perf/arch/arm64/util/arm-spe.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/perf/arch/arm64/util/arm-spe.c b/tools/perf/arch/arm64/u= til/arm-spe.c index 86e2e926aa0e..a1419e6341c0 100644 --- a/tools/perf/arch/arm64/util/arm-spe.c +++ b/tools/perf/arch/arm64/util/arm-spe.c @@ -239,6 +239,12 @@ static int arm_spe_recording_options(struct auxtrace_r= ecord *itr, arm_spe_set_timestamp(itr, arm_spe_evsel); } =20 + /* + * Set this only so that perf report knows that SPE generates memory info= . It has no effect + * on the opening of the event or the SPE data produced. + */ + evsel__set_sample_bit(arm_spe_evsel, DATA_SRC); + /* Add dummy event to keep tracking */ err =3D parse_events(evlist, "dummy:u", NULL); if (err) @@ -523,6 +529,5 @@ struct perf_event_attr =20 arm_spe_pmu->selectable =3D true; arm_spe_pmu->is_uncore =3D false; - return attr; } --=20 2.28.0