From nobody Tue Feb 10 01:59:14 2026 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55F161D90DC for ; Tue, 24 Dec 2024 10:44:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735037096; cv=none; b=QamJ7EebFZZd8H04Gj8o13y6lyzKoLEqdJ640krJEZQmAEDOL975WYOIYvh8YhFZ9i+BkH2wGF9gjHf1mlOG0LzaKoJ6sTrYaXPYz38x4ie3SxP+BQll2DWUW4yj2losCWV9KRjso5a32akQgrIRX4GmnTbXMawqlot3CPNmWBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735037096; c=relaxed/simple; bh=RerMUU2iJNRvAH+P/WRIzJRF2OXWh6S/x0SNAoX8N2I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mJn2xgdu6vfauHOiuy9AabmU34DauypV+DmIvNzIAKfQAi7l7AmvU+UIE8GPu1ZN0FEvIQUkPlhS82DYMVy6IO1+fnvucdUQAIvjMEXxBf4B96sLqUpIf37I9rTfb3wnUvjlZ1gESyGrKZS8C41LyCAbI9fb90zDvR3L562LTqM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=JoVoOiWU; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JoVoOiWU" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-3862a921123so3434467f8f.3 for ; Tue, 24 Dec 2024 02:44:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735037093; x=1735641893; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BwyNoR0SnuVGySQmrh3vEyVb1ET66P1aG6x3YnivKGw=; b=JoVoOiWU+LTn+LzaphtbuB4Uy4oRwIAX12TYoxTIyc99OcRv0k1xpgCYbeGRUQukqO 9BC0T/W69NXtBNB8oxSdTsUYaMqVBU/eIwjInM/SutQGRFGmEYuO0/Pn00AisA5/bna9 b8hz7lX+wYeObujE3ZP2+HMLlLXlaNzqVk5MKhsUTSVXm8B+ilfBmX3M6ZO9N8nrxAdz MW6B+BwJCdndxPaFQ3Q1hYTc6nrxeKtIssYKApNQGxpN6mB9rQfojH1X7grvoEeh7EkF tpKo4esC7tqLroFw4E13Dz26NWZQ7MmKiwa7hJ94zkun6Iq7mzP3Hxlw0VKKUrSVIBRx h6HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735037093; x=1735641893; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BwyNoR0SnuVGySQmrh3vEyVb1ET66P1aG6x3YnivKGw=; b=ElKqa3e6D1UyDZygU2d5auoQK4uRUjmfojYfoupHSL4rxSaMNAKy0k9LGIxCSORP1t gf5BcOfW6Q728/oazEFOqME7EzE5uJDsgsbAczuOveLygWZ+rET+kALeyvc1aUQd5Hyh j5j7zCHXlheCVlvYR9ZPbVJ1Bf1BUAwG6t3+9dsiMdF1fT/ZR44r96VS3P4mn4C/X4Rw iuzv4IxYZZnpm8/B4CXXrwu4xZhiK1GcSvic295e7UaNz2oOJCpZJEyLg58c76DztkWU u6ms9D3Ecz/thTZ61CI5GEi8tDFjSuwq3gKCli9DxcAMFkZRua1+NPlKczxmEGSMaTQL jd/g== X-Forwarded-Encrypted: i=1; AJvYcCW1696+ExJ62b/MvKEmkg0WuXQSY5oYv3IXX/JEQDX9wCj1M2d07mnNJE75UA7sZ87A8LoazWMAmxCisgQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyjVxbBJz8pBV56DyylMZKUreXe0AHaCX9MlN3PRRHGW1iQe3yK gYIwB2HO86cDXZbYUxfK6t/PjLKcKO5oVlip57Iz74Q7Y+/cZcdXyU/OQ+6Ifcc= X-Gm-Gg: ASbGncuQBO3FOjWYV9SEQBf+2+ECSRig7V0vDfJlK9gQqRiPPxSNlGOU2gRMrglV7ht CpP15apfMehY8O0txXKqcVpAcJoeXJDZ+tH5IljpUzN2LAZPtnGSX1cd92QmMFqzyujFESCNN8E TgE2qe4NjdtWvSbMeLG2oODsXQ6EfT6VwE5I2zWIeRA16GZWlxoVLlpC8VqcXVbQp34VfKzphnt /DWurUfjI0YJJvALzhbBFw++Fc2YW9q7BAEZq3Nu4Yk/aHhBDzF8fY= X-Google-Smtp-Source: AGHT+IEHX62hM4cRXueG3YQu6eg84405e7WqgYcT9lFPGrHLB17v7HhSKT3GSKfbXrWS+gmH7kk2Dw== X-Received: by 2002:a05:6000:794:b0:385:e013:b842 with SMTP id ffacd0b85a97d-38a221ea331mr12569563f8f.14.1735037092689; Tue, 24 Dec 2024 02:44:52 -0800 (PST) Received: from pop-os.. ([145.224.66.70]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a1c847714sm13938184f8f.54.2024.12.24.02.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 02:44:52 -0800 (PST) From: James Clark To: linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, irogers@google.com, yeoreum.yun@arm.com, will@kernel.org, mark.rutland@arm.com Cc: robh@kernel.org, James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , John Garry , Mike Leach , Leo Yan , Graham Woodward , linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v2 5/5] perf docs: arm_spe: Document new discard mode Date: Tue, 24 Dec 2024 10:44:12 +0000 Message-Id: <20241224104414.179365-6-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241224104414.179365-1-james.clark@linaro.org> References: <20241224104414.179365-1-james.clark@linaro.org> 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" Document the flag along with PMU events to hint what it's used for and give an example with other useful options to get minimal output. Reviewed-by: Yeoreum Yun Signed-off-by: James Clark --- tools/perf/Documentation/perf-arm-spe.txt | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/perf/Documentation/perf-arm-spe.txt b/tools/perf/Documen= tation/perf-arm-spe.txt index de2b0b479249..37afade4f1b2 100644 --- a/tools/perf/Documentation/perf-arm-spe.txt +++ b/tools/perf/Documentation/perf-arm-spe.txt @@ -150,6 +150,7 @@ arm_spe/load_filter=3D1,min_latency=3D10/' pct_enable=3D1 - collect physical timestamp instead of virtual ti= mestamp (PMSCR.PCT) - requires privilege store_filter=3D1 - collect stores only (PMSFCR.ST) ts_enable=3D1 - enable timestamping with value of generic timer = (PMSCR.TS) + discard=3D1 - enable SPE PMU events but don't collect sample d= ata - see 'Discard mode' (PMBLIMITR.FM =3D DISCARD) =20 +++*+++ Latency is the total latency from the point at which sampling star= ted on that instruction, rather than only the execution latency. @@ -220,6 +221,31 @@ Common errors =20 Increase sampling interval (see above) =20 +PMU events +~~~~~~~~~~ + +SPE has events that can be counted on core PMUs. These are prefixed with +SAMPLE_, for example SAMPLE_POP, SAMPLE_FEED, SAMPLE_COLLISION and +SAMPLE_FEED_BR. + +These events will only count when an SPE event is running on the same core= that +the PMU event is opened on, otherwise they read as 0. There are various wa= ys to +ensure that the PMU event and SPE event are scheduled together depending o= n the +way the event is opened. For example opening both events as per-process ev= ents +on the same process, although it's not guaranteed that the PMU event is en= abled +first when context switching. For that reason it may be better to open the= PMU +event as a systemwide event and then open SPE on the process of interest. + +Discard mode +~~~~~~~~~~~~ + +SPE related (SAMPLE_* etc) core PMU events can be used without the overhea= d of +collecting sample data if discard mode is supported (optional from Armv8.6= ). +First run a system wide SPE session (or on the core of interest) using opt= ions +to minimize output. Then run perf stat: + + perf record -e arm_spe/discard/ -a -N -B --no-bpf-event -o - > /dev/null= & + perf stat -e SAMPLE_FEED_LD =20 SEE ALSO -------- --=20 2.34.1