From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796213693; b=EfgUFX6sfSyTDqdTjlR0N8P49JgWnHjLjF/lYJ2bx5Sg99xELCR42L/UsoXk4B8CVsXy dArmaibVsYjWeQ8meeQMphtGlyRjZXiaQijxMc8TrbGsI3BIikxemC1Et+gJNTL2BMQsG XpB3i9ZbBuJicaJqAjBHHDshOJ0nueiUjFEQ9RqVqDq/J3S6cpHbgZtUGmIqMgGp7rNbn ALKWeAuPSEyHbNQfCK/In2I61S+Mw27xmU/PIH1gGLXwr957W138quK1au6Mwcbbhfyzu GHWe/PVP9TxLxYGQuXnYEX9uK6FwuCMGbBIcu20Sp27Iq3tpgaukj/Op6Lcbyn/W+4A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796213693; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:Content-Transfer-Encoding; bh=HnyuiuLAGlAcIeyPAKAxQUlodYGHfsm8CVEdMJoFsKk=; b=OLaXgXxjt9+uOBH1vrVtakG+egyX5EtaER1zd3J4/+xne4NFzXRKzU79kf6i74ySMRAb rVQFZwzyaGRWRna+n371OvuYAmGacAhNs0JaDZt1/5xdSVsXESoowOy9HOvgbeXYOeGaO BjIvVqdOUFvTpJOUDW5L+sNmRw7uPhN7bHvV47ZDOT1IXtCC6D4m6mfjFRxeyYRkTMLPf kcLQSX8zUVivizceXWWLU4X/6kfONdeWsCb//Fn2QreYFYEhPpdfGcmwOF5TNv9etDeql /hUXtgl20SG7rcNxMoNtbm0+GfOimzQBTdMGJefLKcRDCJDlgLkV0x/JDas4mWVnnLg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="k/0dov7/"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 560AE606A31A for ; Wed, 2 Dec 2026 12:14:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=k/0dov7/ Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91DBC1F00896; Wed, 2 Dec 2026 12:14:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796213693; bh=HnyuiuLAGlAcIeyPAKAxQUlodYGHfsm8CVEdMJoFsKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=k/0dov7/67vXX3PUb3kA3H2SgNxODJ4HeMn8Nxb1lUixVQcTBB2vQMI2rmD/+Rxyb AFwL0SY0n6T0EcA+lPzR8IYc7LSNGAiH2VfvPnzwh22zpJM590eNtYcCrlKm32OT1Z UaaPtfpexsfNn+sJWB1l3PGwcYZkgwR6F5rgaJ0azwrF8jvQklnenpo2UdjtFYs+nU dyps226qUVetuWEVwupOPgnl95QHBu5jfvAWSQClKBtQOgqneHIE+W6xX5EDIGNhUS 2oUwXEjW68iOpFklJEycwZAzxGuPxVMMURaDJpzGY+QG2qidNYA/I2jD6thV3vSIhE EuOvPxynOb48g== From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , James Clark , Jiri Olsa , Ian Rogers , Adrian Hunter , Clark Williams , linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Athira Rajeev Subject: [PATCH v3 02/18] perf tests top: Pin the ring buffer size Date: Wed, 2 Dec 2026 09:14:18 -0300 Message-ID: <20261202121434.2224-3-acme@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20261202121434.2224-1-acme@kernel.org> References: <20261202121434.2224-1-acme@kernel.org> X-Mailing-List: linux-perf-users@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnaldo Carvalho de Melo perf top sizes its default ring buffer from kernel.perf_event_mlock_kb, so a test host tuned with a large value makes the default mapping huge and perf top fails with ENOMEM. The BPF sideband evlist ignores -m and uses the same host setting. Pass -m 512K, a byte size that does not grow with the kernel page size, and --no-bpf-event to both invocations, so the test behaves the same whatever the host setting is. Reviewed-by: Athira Rajeev Tested-by: Athira Rajeev Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/shell/top.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/shell/top.sh b/tools/perf/tests/shell/top.sh index 3d52677ccb5fd309..deb0782e991e42fc 100755 --- a/tools/perf/tests/shell/top.sh +++ b/tools/perf/tests/shell/top.sh @@ -19,6 +19,11 @@ trap_cleanup() { } trap trap_cleanup EXIT TERM INT +# perf top sizes its default ring buffer from kernel.perf_event_mlock_kb, +# which a test host may have tuned large. Pin the data buffer to 512K, +# a byte size that does not grow with the kernel page size, and disable +# the BPF sideband evlist, which ignores -m and would still use the host +# setting. test_basic_perf_top() { echo "Basic perf top test" @@ -36,8 +41,8 @@ test_basic_perf_top() { # Use -e cpu-clock to ensure we get samples # Use sleep to keep stdin open but silent, preventing EOF loop or interactive spam retval=0 - sleep 10 | timeout 5s perf top --stdio -d 1 -e cpu-clock \ - -p $PID > "${log_file}" 2>&1 || retval=$? + sleep 10 | timeout 5s perf top --stdio -d 1 -m 512K --no-bpf-event \ + -e cpu-clock -p $PID > "${log_file}" 2>&1 || retval=$? if [ "${retval:-0}" -ne 124 ] && [ "${retval:-0}" -ne 0 ]; then echo "Basic perf top test [Failed: perf top failed to start or run (ret=$retval)]" head -n 50 "${log_file}" @@ -83,7 +88,7 @@ test_hybrid_merge_perf_top() { # environments can seamlessly fall back to cpu-clock while real # hybrid hardware will naturally cover the merge logic. retval=0 - sleep 10 | timeout 5s perf top \ + sleep 10 | timeout 5s perf top -m 512K --no-bpf-event \ --stdio --hybrid-merge -d 1 -p $PID > "${log_file}" 2>&1 || retval=$? if [ "${retval:-0}" -ne 124 ] && [ "${retval:-0}" -ne 0 ]; then echo "Perf top hybrid merge test [Failed: run err=$retval]" -- 2.56.0