From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 D4F431DB37B for ; Wed, 8 Jan 2025 14:28:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736346494; cv=none; b=Wkxq4UTJ3GsWTvlKt8Ow1H3yNJ/OjO9ut5eJEz2W4j03YZx+a+YuL+J9Nx3n7I2+jg38viZdZGIqTESraMcTL3t9/RD2HY+6/0r/GHD3mFot7zuDr5XfcxPpTqj+nKt3vP964kEo2jwHKw1k0/4vBlJktz9bblTbXdW9C02Zxic= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736346494; c=relaxed/simple; bh=EbaQIPivd3k12R9u+2jbA4uZjrTwxRKMILMWyBbew2I=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rNvgqGgkTr3XxQL+T7yapxFQDAb/6rPK4/zDNILQkQAZgkKCZ0oqYiUQjAvh1rgGMiW30/wjWnjTfNtTlf7/WaTm7SfxgA2yuK61r88s/SoMZE1077g4dqk7Uu3XExl4YUA6XPQXmokdkR+i4bOrWvbN3pfzwNc1W3Rqqve3V6g= 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=hnlLQYTA; arc=none smtp.client-ip=209.85.128.49 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="hnlLQYTA" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-436341f575fso172797895e9.1 for ; Wed, 08 Jan 2025 06:28:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736346491; x=1736951291; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=5DTjVFlw3a1BE3G1k/Oc0pCRnQoWK8WuT3gO6hdQWPM=; b=hnlLQYTAdsXICHCzSALVIWGTCGPfK3iT+bq6XprmbQosiylioVU0GpsSshmSD3aBS8 fxKoJ6IJn6a++l34pmWF/JfdUPWM+XjQO+ijaNhE9PcgCG2hPahbbiMqvEA8xMF5jtpv WYHFaIbJ8RutA0LgYVGB/6Yeff7G4eosb6O0bmDNXUgNg1uY+cLJMpoMPtGs7qyVWaBl f5vH1lP69fmxlEa5UOV7Wd3KA05Ph+/MqcVI7d9xBay6aitryEg16ERoSmlGBmdR0DOW YIHyJixCPVp+XdZcbAf9SKV6KvcqpblusPgmcJ26XEQ5g2BuJISOx+uWrVE/j9+F+JJY LuQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736346491; x=1736951291; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=5DTjVFlw3a1BE3G1k/Oc0pCRnQoWK8WuT3gO6hdQWPM=; b=YI2hoGSdMnB5dcOHQmLYUZZ2MaDDviK1GUhGRIDP8FQ6FM8KPr+D7UQpWjQqGZ8Y7x Z3Zcgw3G5J4IXoAkzfaIh+xe5Y/XT8KDU0u94tjlOszZyJOZg89jyVnnE4M5FIfi4W/z /OdEDqcBlNYOTRoyteKX5E7mmhNkcQAATVZ7xuzJA3uaj7v7OHPHGAsYdthUOHNDhWTa wFIEeL+9vKbEi+m+kK194nW7v5+QL4Jbj/59Zv5RiFuYDVfk28oS5/9bQLvhwYYF95Ud ziPZ0SpZXZw8hmuj4YyngrHOjEyKx1WRfrX8CyqCiGDVp2JhF46py8TA/mm//bjK2tA+ iGqQ== X-Forwarded-Encrypted: i=1; AJvYcCUaz/o/XU6jaBAMvwhPIq1T1qu0ZsF0yrMSnChuBbuBHZsbKSTdrTG5mi5/Z/Kr+jYUm/xHMxlbla4K7V4=@vger.kernel.org X-Gm-Message-State: AOJu0YxPZqYoYz5dXxA0VKN+ybUasebv5Y4PgU7qoqxAXEP6ECNcd4NI K6P+zRWKVJ7a3j46HN/u9/MwH+qTTclNrp0Dy0R07KUPA+GgVHXTd5DSIU04R20= X-Gm-Gg: ASbGncugrhVF7qXh9pbmeMQHWqDnRhmj5bVIbVrCNUiRxE2kDeG+ejwSUerg4RVUKFl 9Z8SFecjRZbVcVhSDwa503NKRWceKcVV0qqwdlZGAApvB3J1l4Y9nA07peMt8GSkiWBbYlAeP/R hbhd3xKFGueAmHWEBw0PatmXVKZeQwB2gjUh9NnLINN2VpZyvqs/NX2a/moDKUZZcM1uSoNB+gr yEoXxNnvqVLpmXALi4ITbsFZnNOmsqk3YIHZEXIRcTE+AxixGxFnx6u X-Google-Smtp-Source: AGHT+IHz31vPgvjsP1ktI6cDJs5dwXi6jyonWjrDKCklrI15yME8jN2ZsQTROIywKIjV9MjHGbUrWw== X-Received: by 2002:a5d:64a8:0:b0:386:3a8e:64bd with SMTP id ffacd0b85a97d-38a8730560emr2565669f8f.22.1736346491235; Wed, 08 Jan 2025 06:28:11 -0800 (PST) Received: from pop-os.. ([145.224.90.227]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38a28f17315sm47577178f8f.108.2025.01.08.06.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jan 2025 06:28:10 -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 , Michael Petlan , Veronika Molnarova , Athira Rajeev , Thomas Richter , linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH v3 0/5] perf: arm_spe: Add format option for discard mode Date: Wed, 8 Jan 2025 14:27:22 +0000 Message-Id: <20250108142731.400605-1-james.clark@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Discard mode (Armv8.6) is a way to enable SPE related PMU events without the overhead of recording any data. Add a format option, tests and docs for it. In theory we could make the driver drop calls to allocate the aux buffer when discard mode is enabled. This would give a small memory saving, but I think there is potential to interfere with any tools that don't expect this so I left the aux allocation untouched. Even old tools that don't know about discard mode will be able to use it because we publish the format option. Not allocating the aux buffer will have to be added to tools which I've done in Perf. Tested on the FVP with SAMPLE_FEED_OP (0x812D): $ perf stat -e armv8_pmuv3/event=0x812D/ -- true Performance counter stats for 'true': 0 armv8_pmuv3/event=0x812D/ $ perf record -e arm_spe/discard/ -a -N -B --no-bpf-event -o - > /dev/null & $ perf stat -e armv8_pmuv3/event=0x812D/ -- true Performance counter stats for 'true': 17350 armv8_pmuv3/event=0x812D/ Changes since v2: * Use existing SPE_PMU_FEAT_* mechanism (Will) Changes since v1: * Add a new section and some clarifications about the PMU events to the docs. (Ian) Applies to v6.13-rc6 James Clark (5): perf: arm_spe: Add format option for discard mode perf docs: arm_spe: Document new discard mode perf tool: arm-spe: Pull out functions for aux buffer and tracking setup perf tool: arm-spe: Don't allocate buffer or tracking event in discard mode perf test: arm_spe: Add test for discard mode drivers/perf/arm_spe_pmu.c | 22 ++++++ tools/perf/Documentation/perf-arm-spe.txt | 26 +++++++ tools/perf/arch/arm64/util/arm-spe.c | 90 +++++++++++++++-------- tools/perf/tests/shell/test_arm_spe.sh | 30 ++++++++ 4 files changed, 136 insertions(+), 32 deletions(-) -- 2.34.1