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=UcXy5nhuqKzfwVgdrfSFg3Tjrpukk3QtbQ3hLduDnneAy1Hfj6HnHadDqGgvpzvsdGwX uiY6JG1ZU3Eq4YFz6KGnI2PJi/WRKjHZEc08x3H75mZADpiXwOYTSjdfTaMLlOhSp2ACb /5jzz6TnAprmoI03BpwITMuobo4ZIX/ZD/HHYjO3y2Ob0V3PeEElhp8l1HRmrhrcPzspT II46sdBD2sAp1YNgH0kUHacnZ+xda02A49J24t8HnDPtOmcyFLY4HzfwuMNfvBnWVOGbV J8xs0k2MB+4yxUY+dMJUkzWeIgHIVfGtHgowsEXY4XRM/AKfdWhoL5AhoL2pY53P9jg== 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=xLQ+DY2VSSnq/VKN5v6F/mB/W8RP4/LdS7xkX0sUVdKGtGczIOKiXHJzlLeFcAwE03vK h09QregjwlDH1Yy+d8ZbBKp9R7o4alHFSjwV97gcoPWn+tqJnvd7SgLF2+rFcKC5ogw96 DdHMqIEy7R8WN/60H/ozWOKcXwVfnxzHVM7+5Nf5Liggt5k7Izn2gBvUag8rOQWLZJH0h i/n70CAdt1E6m2FAAiIeagwbLDMbGavNf92ppxbNg7Aky+mcciAWvL8mq/VwkDVVAzKYX 6SnX7KZb6Mbjqm/mfJ/nx7fq4JYGkargL9Xlx0EBbZEJ0mIhvoKJ55JUu7tFr+Zj2jg== 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 CCEFB606A6A3 for ; Thu, 3 Dec 2026 19:00:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CCEFB606A6A3 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-4bba856092dso757665e9.1 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=EcsvdBmcoRLuYBRQEuc7hcFqMJDPcAz0tlMiBMReiL9A3uc2+KIpiEKre6XB2taux+ V4DtgTs6yyMaxLdGCJglD3mYODOEoc4s+ni0ZLP5ByHENDROteiZgOaSDuP/eri4DDxn H45g8wAypTDlofKPf6Dx2gTcBC+wV2ZBp85kAPi421XFKMpaq6XEXDrPiZQ01O6RzeOq nOO63zrJVEj3+W+cG27vsAR+lPn6kElygnI8cNzrvNKDAcp8pfR+0nl0dQCIbvIbYtkL mvwg2+K3RZ+mucAU8sEPXi4XlFw8+hZnNB6mBvovs/wT7UZVDMIkh+HpCKTgDBi8e0hO Nstw== X-Forwarded-Encrypted: i=1; AL+hErEWeXOxy8hnhlAFF9u+6aQ2LAvsU9qXKF/uXGEZVisXo3DPx6b+4Ir5Dq05wCefIGURhmHUmSYlpqE4KQRWtdeEJMQ=@vger.kernel.org X-Gm-Message-State: APuU4Z8ETXIlNWMow/q37Qve9YoU3TerizaI2ontlBsS/w8W2CgKJ9Xs wy4iIQAFhSo+MCPbRf9NGJIcUxrjaDsLS0N65NWb/i5ZiQOqK3NAVezetzlwEg0dQO0bjTKwV9U KQnumcIYbZ6SypAluJ7v1TA== 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-trace-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