From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.69 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796324433; b=I58mYq4K3CVxgd3fvoTFdbo7WQea4mjVVPfYnBXRgWz54sTMhefdlVRz7Ql+UaPYRULI FsP2Unk9O17dWfLroDdCzcF94MvM1GkqsZDyOd6JgyDA5k1CHLMBT7ex/NLCwn5tBHG+I UVFjTA7CyPEZBilpn2VOwiB4+lLfJWbbPTHboctfIqEdlwKHar2mn0XaJL5yJa9i+2jtI mFmYimobV6XKgW4+cahC4ia/CTfcrlgSf8LC5Jgm2VFbxBx4I+vAxrLJwd88vT+NpoB4H ImWADFOKijcwdPUXRE5JjaqgdSiNqkjms1dIF2uBLyiD8o3v+bgMZLcKgSjjCRjtrxg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796324433; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Received:Date:In-Reply-To: Mime-Version:References:X-Mailer:Message-ID:Subject:From:To:Cc: Content-Type; bh=qeoH7FNDk8qlmZN+fcdlMtpcwqB335DyFR6EfJaJXkA=; b=3TiatDoZd2b1v6Mju+7cxFirtvVbOX6H81qTL2Xb5Zfj2g4aYpK97ESik7rICsTbh+oQ dMbg3oDysmvyAgPe9wBnhQuL2gMLZor4Z4qnBSmAowL/JHJVJe4twvzGy3qYZQGk4ef44 KL/Slyv3LOww5alg+g5OHAz5TTA6gvktsMP9dGEsSBKXRxUCWvw2Gp3D09l36sVMQy+3Z ic9a++A0KW/WQ0eWXzVsvonYonTXMmP3/83yhAxcCdFgtdro96lIX2mopa65R5dzsKl2G OQttVTdqRxOxZELGDP5hTEGTR1IrOTJZR7gNNoSj+2ftfri/ffxFVhFDQGCOfhP52IA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--vdonnefort.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=epq3fJhq; arc=none smtp.remote-ip=209.85.128.69 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A755E606A696 for ; Thu, 3 Dec 2026 19:00:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A755E606A696 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--vdonnefort.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=epq3fJhq Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-4bb818d8dcfso515435e9.3 for ; Thu, 03 Dec 2026 11:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796324431; x=1796929231; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=qeoH7FNDk8qlmZN+fcdlMtpcwqB335DyFR6EfJaJXkA=; b=epq3fJhqvW/zIbVnY/G7G8v0diiYEVgh0KsP2YRvCeRCFvldRfZ8Y4MrXy53vzwEB3 nV/Fjo7rd679aZ+VgXgJi9yJLZxeN19q3UaFmAGYQZab2Wk+AeHAfPCIjmicHJZ0LhEQ Hi1Y8gKsVDrkInlweqeyD+ypYyB3IvR2sIN1zJENaNmC7CeBeV59D7NKKD08gcsjcK8T niH70ph/PG21kefWdWIaf/1UE7megR6kW2The/9wCeAuM8Xn4Z14Z+PDkPPvbixD61Xf RobkwsUrqoEAurGOkAG/91w0BYr1VT65LvbToJfYPZw4tOT5a7vTgtBL9kb+TUZEfNbS PeFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796324431; x=1796929231; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=qeoH7FNDk8qlmZN+fcdlMtpcwqB335DyFR6EfJaJXkA=; b=d2J+Ubx66ap9RtRlnMiloRGm7H+nS/mJC9N/OuOJfN4ueR1XII4cwBxX98muclfvZT ieWLxM0Ub0y+EcPOs9PkBQDrJ89MTz6OgAlPcEe3hZwYmXzb/vfh1Jsmbqnr/jorMocc 2tgqj7JQKO5UENmH0WH4INWlXf/rVEnfFWVWHFGyUcoMat8fUCijNzwL1fR3XCLY3oyp Uj8VcOk6YedI42gOuMIkmxv1sjjo10Zs1AylC3m8uoF0txszC2k21LEKpIC+6kCns6+r WaIu7CVQ4XPMbSXvBFS7+gOEKGPy5xvHhF25LTk35/i/bdYV7lmqOAfwugukfP6BYszi GU4w== X-Forwarded-Encrypted: i=1; AL+hErGeYMZvZg9SdgvYViyVslzoaxUS1eqszlKfokHxjyH7ZQXY9OZiZjhquvuIpnraQ3vfZvKfzZoU4EdCPCU=@vger.kernel.org X-Gm-Message-State: APuU4Z+MaWL8oB9o/DYj7F07T9lxKYuPqQi/W9F6+XpJvygA7WIJ57W6 wnZa1u9NVfjC4Mt4FDyyyxr9CKM14vZGW/b/8njlZNBDMor1lvcOveXb2eWFULCwjm/XE/hstXY 7tWHO0u5j2JVdQjsOcYvyjQ== X-Received: from wmbd24.prod.google.com ([2002:a05:600c:58d8:b0:4bb:73d5:ab38]) (user=vdonnefort job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:a11:b0:4bb:69f2:87f7 with SMTP id 5b1f17b1804b1-4bb88812c92mr916483365e9.18.1796324431045; Thu, 03 Dec 2026 11:00:31 -0800 (PST) Date: Thu, 3 Dec 2026 19:00:03 +0000 In-Reply-To: <20261203190007.2431041-1-vdonnefort@google.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261203190007.2431041-1-vdonnefort@google.com> X-Mailer: git-send-email 2.56.1.915.g69d5ec7298-goog Message-ID: <20261203190007.2431041-16-vdonnefort@google.com> Subject: [PATCH v10 15/19] tracing/remotes: selftests: Add a test for the dump_on_panic tracefs file From: Vincent Donnefort To: rostedt@goodmis.org, mhiramat@kernel.org, linux-trace-kernel@vger.kernel.org Cc: mathieu.desnoyers@efficios.com, kernel-team@android.com, linux-kernel@vger.kernel.org, Vincent Donnefort Content-Type: text/plain; charset="UTF-8" Exercise the newly introduced dump_on_panic tracefs file that turns on or off the trace remote buffer dump on system panic. Signed-off-by: Vincent Donnefort --- .../remotes/00hypervisor/dump_on_panic.tc | 11 ++++ .../ftrace/test.d/remotes/dump_on_panic.tc | 50 +++++++++++++++++++ .../selftests/ftrace/test.d/remotes/functions | 1 + 3 files changed, 62 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/00hypervisor/dump_on_panic.tc create mode 100644 tools/testing/selftests/ftrace/test.d/remotes/dump_on_panic.tc diff --git a/tools/testing/selftests/ftrace/test.d/remotes/00hypervisor/dump_on_panic.tc b/tools/testing/selftests/ftrace/test.d/remotes/00hypervisor/dump_on_panic.tc new file mode 100644 index 000000000000..1b6bf21c5d9c --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/remotes/00hypervisor/dump_on_panic.tc @@ -0,0 +1,11 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Test hypervisor trace dump_on_panic +# requires: remotes/hypervisor/write_event remotes/hypervisor/dump_on_panic + +SOURCE_REMOTE_TEST=1 +. $TEST_DIR/remotes/dump_on_panic.tc + +set -e +setup_remote "hypervisor" +test_dump_on_panic diff --git a/tools/testing/selftests/ftrace/test.d/remotes/dump_on_panic.tc b/tools/testing/selftests/ftrace/test.d/remotes/dump_on_panic.tc new file mode 100644 index 000000000000..ff5ca29fb1b5 --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/remotes/dump_on_panic.tc @@ -0,0 +1,50 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Test trace remote dump_on_panic +# requires: remotes/test remotes/test/dump_on_panic + +. $TEST_DIR/remotes/functions + +test_dump_on_panic() +{ + # + # Toggle when the buffer is loaded + # + assert_loaded + echo 1 > dump_on_panic + echo 0 > dump_on_panic + + # + # Toggle when the buffer is unloaded + # + echo 0 > tracing_on + assert_unloaded + echo 1 > dump_on_panic + echo 0 > dump_on_panic + + # + # Load and unload buffer while dump_on_panic is enabled + # + echo 0 > tracing_on + assert_unloaded + + echo 1 > dump_on_panic + echo 1 > tracing_on + echo 0 > tracing_on + + [ -z "$TRIGGER_PANIC" ] && return + + echo 1 > tracing_on + + for i in $(seq 1 32); do + echo $i > write_event + done + + echo c > /proc/sysrq-trigger +} + +if [ -z "$SOURCE_REMOTE_TEST" ]; then + set -e + setup_remote_test + test_dump_on_panic +fi diff --git a/tools/testing/selftests/ftrace/test.d/remotes/functions b/tools/testing/selftests/ftrace/test.d/remotes/functions index c368dea2ac4e..f0225af23714 100644 --- a/tools/testing/selftests/ftrace/test.d/remotes/functions +++ b/tools/testing/selftests/ftrace/test.d/remotes/functions @@ -9,6 +9,7 @@ setup_remote() cd remotes/$name/ echo 0 > tracing_on [ -f dmesg ] && echo 0 > dmesg + [ -f dump_on_panic ] && echo 0 > dump_on_panic clear_trace echo 7 > buffer_size_kb echo 0 > events/enable -- 2.56.1.915.g69d5ec7298-goog