From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (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 148A74D9914 for ; Tue, 21 Jul 2026 10:36:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784630199; cv=none; b=VOxspRSaZzG9wgH3m0hX95TOQ6LbUKZft0MT7scXeN48Fm5KlPyhScdwcla6CfKgiddQzyAEnDiQsxmSREh5yF9knYAvdOyNIFhZkVY9Yydb6X+OwUX1Tmzw4iCOpktN9uxbMBReJb4LKbbELP+yMLOAhxE3fQqGTvGdn3Ddm5Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784630199; c=relaxed/simple; bh=79quW77+eG9KGNP0rUUQZKxOiZkjCWVWnD8P7UfGD9k=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=d91L9M2TEh/f+GThQ4Yq9dxDHgGc2imNgum1Sd8em7wFfIrEXds/Chp3WGQ+xtZcDPUMd/h7Y8meXTXrV3hVhgEj4pXdfuGmvOPIHAtW6lXAdLuxerXfR58dB3wqtHZINaEfPwAuxg/FYiplnyhOXvVDYHyXrKxGuGBSE6D9lVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--vdonnefort.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mlMmAKZs; arc=none smtp.client-ip=209.85.128.69 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.b="mlMmAKZs" Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-495495ad5ddso27821475e9.3 for ; Tue, 21 Jul 2026 03:36:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1784630196; x=1785234996; 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=FWMQfKAdLeahyO0e1rMDF6QLENVkX2iH4YUwGfH7khE=; b=mlMmAKZsz0OYCZJyB8zLrXeA6jFbv+gFJTEqnA4KthNEiUQAPFAUB9Nc8ooQ1WtSpV sNOcydkol4d2g30RzhWdud7sl1IXMtz2lGBab21v4NA/Ibgt+KuFbbnF4IdLkDP+NJOU Oj0pRiyjLKb84xMdcM4ebVROK1Mtt2MY7r6PMZtS8lYJAkh2R6lWwJWZwrZ9YKv9XYJO 2dXOL+ocm6oddpgfuST3jjuB8Ngn47z5fcdXmS1ligOgQ3I+bP8wJL/ILFQ0u5eKjQEM 0MocCB0OKTFBmzoKNImuV+GHjEDSKWcRwvvXhShaFwjCvT5T0HPW52JD1Gc3V5NF+8Uh 7AvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784630196; x=1785234996; 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=FWMQfKAdLeahyO0e1rMDF6QLENVkX2iH4YUwGfH7khE=; b=Vj2xXcqWSuk9Dfz3NvLF3CmR3ZHnTC3W6ijXuAkCv5NfcSIl3z3c4jt7/wZ4c/uvZj 7m3YS+TkMRzBO+/Qn8MI4J4FO15C5ReHgOnU+LDqT4Qd5DBM7//8Mzzz1pgFEepn9gkt 1enDg0XbGXgAYWJhsuZSgmcoDKT2Zjo78xzle5z0ueZusGExwEpE8jSBfraYSotCoO4S R0FfVYAdtp7S1H2/9aYNdG84lNyONXMuxpxiGiXmvHBGQ2JbUxZm6JcqPVWiiabULHlF PdcFlerbTZMdk2PkYM9l9LdMgBjdCRqFsmTaKQmg+6Ppr9h/ePfnt09j6HWYgARW2GgF j65A== X-Forwarded-Encrypted: i=1; AHgh+Ro8LzXtmHQw3GVTlPAQKtEXWXOY3+gNtYh4Fk97uA27yEdm1QDSOjAwZ5xa4dmjtJVwEAaSuwXTLw/w/LY=@vger.kernel.org X-Gm-Message-State: AOJu0YzNOK5/Qk79l4R93jtUk0QYCb0I1z9/aMGdQS9uOhgLXr+U2hFM snm3c+lHqz612A68Wknt/mpmoe3FgzYxg7X08+shk88MMhVZ58eonUsFeR0lVLkXxeW/RnhNKlq R/zpEDykCtqvd1RSbPzwwPA== X-Received: from wmej5.prod.google.com ([2002:a05:600c:42c5:b0:493:f781:b52f]) (user=vdonnefort job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4e94:b0:495:571e:e5d3 with SMTP id 5b1f17b1804b1-495571ee75fmr126799165e9.36.1784630196081; Tue, 21 Jul 2026 03:36:36 -0700 (PDT) Date: Tue, 21 Jul 2026 11:35:59 +0100 In-Reply-To: <20260721103603.342266-1-vdonnefort@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260721103603.342266-1-vdonnefort@google.com> X-Mailer: git-send-email 2.55.0.229.g6434b31f56-goog Message-ID: <20260721103603.342266-15-vdonnefort@google.com> Subject: [PATCH v3 14/18] 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 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..5e3d3c412ecd --- /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 + +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..cb9b4c6dc86c --- /dev/null +++ b/tools/testing/selftests/ftrace/test.d/remotes/dump_on_panic.tc @@ -0,0 +1,51 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Test trace remote dump_on_panic +# requires: remotes/test + +. $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 + + # REMOVE ME FOR A PROPER OOPS TEST + 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 4a14aa72fdf0..bdd28b5b8596 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 echo 0 > dmesg + echo 0 > dump_on_panic clear_trace echo 7 > buffer_size_kb echo 0 > events/enable -- 2.55.0.229.g6434b31f56-goog