From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.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 BD89D46D57C for ; Tue, 4 Aug 2026 14:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785852252; cv=none; b=TYtcMjKtAKFzvwO/1wyX3XCQ2+gsNFtdjONbVFdYRjyQbl03MJaMzQ5hrJ5d6ycDak8hG/onycL/XbdHEiitjRXdqAKN3A6O2geGv3si2aLy/z/7u7KBNEeMYKB34IG3wvtpdVa5g/iTc2Atj21+QO1DaJPavoe4YGzjK0SnmNU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785852252; c=relaxed/simple; bh=vj5uLsBMqRHXFMgjRkaf/XFnATcyEcGhbnXMqaQWOKM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=YfEfQJ3tVE2TU9B1niBVSwZSLCbteEj7GMN+3PPgfLPmmllAVdGV4TsVjmXu/jkxGhOQFOTDjpuzEFaoXfTP0ji58pn7qkBzqKuueVxhHu9Ug+WHDUkTLrofy/oIb0giF2clhjB5G0oL1vx6BrM+0y2+ZFIEVmaQhun4PXyMVeQ= 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=PdNqhc1y; arc=none smtp.client-ip=209.85.208.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="PdNqhc1y" Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-6983e9c028dso4004505a12.3 for ; Tue, 04 Aug 2026 07:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1785852249; x=1786457049; 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=9NUN+nKFEkHGltjdVncDINIABRGoCRu+BUGz2DcN36I=; b=PdNqhc1yUA/Mf6hjDrxI25Rq5JMMyZN3v3SR6hK5aIQKuM9+KcmQUHnS4Te6zdvkoX rRmV7KAct6cIJICD/8AhYZvJAQ1OvTzMs0fVqPTK9R4JoaFWS7u/SshwdPSiJaIUaCxA NKT/Dw/81yqKUE02zajqQ23A4Dy3RRcWWpmVn6d0qO2A1YIHwsPvcvyuOuidhQzhKxW8 ZjVdoHr90WsEQpqwuSmGhOzX7D1G+l+dRVSZqXNlJsObNTqy88JL1+Yx0QF9sAXIdzXi eEz7o2DyGVz58gfrrkJ2mxt90TViAdVSEqFwkaemhBEH9rcwn50nsYDJ+eMtCAzK2AKM qhoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785852249; x=1786457049; 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=9NUN+nKFEkHGltjdVncDINIABRGoCRu+BUGz2DcN36I=; b=S0v4x/QizaUxgtzmH1bN1cMpsTdS6gvs2ZU2mPLlEhW5uXlDU+I3DNJQ+ooGxYJuhh vry0pIzzJe6Y+a6rQBODeC+MoM8e6J3slNqCn13ORsSsFA0GRgN42HbnhIJlLf3xptYn GsOk9aisjJBjo84+aGyLOcNvFmqPGIekKOH/w5MwKR1fD58r7iRybuRp9sRvKXA70NdL oZRRDe4tecSAq5zqms0LkLBTRBMcvDqTmp7lTZxL/AEDbLg1AdcYXDw9ECtAUdlcvhT7 OAca9fNb7Z3mVNbUMrVS2B4yhuPsw5E2CuEmlO1a2zHs4npmjo7n2XcJTwvWd4biEU52 Ba2w== X-Forwarded-Encrypted: i=1; AHgh+RquXfg9xMSPf9CTbYk27UuX9HFfQOH4R5u/vinu2jN8KNUHEuaDpYNXk7FkHSJ5zSWWnnnarHHlBsSYaeo=@vger.kernel.org X-Gm-Message-State: AOJu0YyQhqRp/Z7Wseltad7LV+GPVxAiLTiii6YOkqQY1vfJYKKJ1mtv 7NLmMfNQPXwrTe3Su8FKSx0TMsyc4QkE3LC5LfWa0m+QtW41cZTb8yo3WNUD5OkYVbS9u8hKX6U GfVoQz//w3pFKrkhA32L6ZQ== X-Received: from edbbc16.prod.google.com ([2002:a05:6402:2050:b0:6a0:c325:d6e6]) (user=vdonnefort job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6402:44d5:b0:698:3ce6:767f with SMTP id 4fb4d7f45d1cf-6a0a7c9ee09mr10916777a12.12.1785852247727; Tue, 04 Aug 2026 07:04:07 -0700 (PDT) Date: Tue, 4 Aug 2026 15:03:29 +0100 In-Reply-To: <20260804140333.797210-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: <20260804140333.797210-1-vdonnefort@google.com> X-Mailer: git-send-email 2.55.0.571.g244d577d93-goog Message-ID: <20260804140333.797210-15-vdonnefort@google.com> Subject: [PATCH v4 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.571.g244d577d93-goog