From patchwork Fri Apr 8 14:40:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Clark X-Patchwork-Id: 12806838 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 E0B66C433EF for ; Fri, 8 Apr 2022 14:42:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=H1TwTYlNNFdtgpS9fEASQt37NggVeXKbza+MCpV8mOc=; b=3TZKjaQ8YhdkgM LepL3jYNRh3KpPM4uIKIgq3vteO2coIgiKyVgdT/1ZzAZWQCSFUr4zd/TDqH3MW+kw0N6S7tg91jV 9qRRD9OVbNc1dtbQngYFLvrT8MQR/+BwyvZ/R2LGLsf1P9IjArxM7PcZo6ivMYOqfjtZZw/Q7C+YO vuW/gK5ZxO2+R6W+ulQVaNF1xqK5pp5j6LUCDvWsCGcIBrnZ12nJcZfcPDv5/8Ca/SgHvA9zG+dv6 33mPWG9JyH5TEzo6pq9EiSekWJwLoW5LPzeEr3/CtTgByQEZ20ktjMAIbNVBI3kaGceGpN1qcZK9Y tKhSBwHV5nOssSGmSe6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncpnV-0002F6-2S; Fri, 08 Apr 2022 14:41:13 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ncpnR-0002Dc-HN for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 14:41:11 +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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_074109_659151_037510F5 X-CRM114-Status: GOOD ( 14.84 ) 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 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 available") 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/util/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_record *itr, arm_spe_set_timestamp(itr, arm_spe_evsel); } + /* + * 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 = parse_events(evlist, "dummy:u", NULL); if (err) @@ -523,6 +529,5 @@ struct perf_event_attr arm_spe_pmu->selectable = true; arm_spe_pmu->is_uncore = false; - return attr; }