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=1796327431; b=gBvp0BHsVZnbiaCpvYVz3c7LJL2eLKtUIp9EubjrGWnDcR6lPHYDIxtDNp/5H3XH3RWj 6r2beojeyRuXckghQI3jx6nzLipDcpvpY3RpKFBBbQzVst1FEW97557TAfQR3Ns6LFYPY TBhNL8xO6vIfEiLM5Jsc2Z/LATCdTfSs8olVPTIzbg4LuZbrg8wnBViebykQI7DmTG8ti 8OG4faEVDoQZVZ9upN/LDdM1jcoLKWVjHYawwKfiLchhl+ee/T0XXya0uF9k2cqsx9yLm pkn7fh/PVccfEXAMB5oO5qM1c5J0MSFmH4V1pF5m2csth++V8IHMnC+i2l41LlBAR/g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796327431; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=YHT4LRCSRTaRNv48zNC0F4vavpjhsjHXmAC/xTvqBS8=; b=Y8bgUzMaCfoJoESzhOoNpYvBkTFXWyJaB8d4RyXm+iR3hEW521P7v+Z6KAmClD05jUvu NKrXR75HA0cVhcF7uxsb3lJMMSVTnvDTZowKJu0bFKbclzgGOnF1Mfg/TpsEQ0HHAciBg 233yJdmQna207BLuBXLeL1K4SH5E9elPILysT6uI4cfmh0B85KQDV/qFthZZI3/a08ioH WrZ/2zNedva1r7G3WzdzXQD6Ghj4YslyecDAHhK95ISczWZ8TgOIuOEONJdgg5rxQ0Scq cYQ0Xthul7zo6gKvueAYy+FV5UFu5PshW9L9d1MLNmDrmWCs9H3p8UY8pze91YZg4ug== 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=Cxhw8as9; 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 2DA44606A32C for ; Thu, 3 Dec 2026 19:50:30 +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=Cxhw8as9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB9201F000CE; Thu, 3 Dec 2026 19:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796327430; bh=YHT4LRCSRTaRNv48zNC0F4vavpjhsjHXmAC/xTvqBS8=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=Cxhw8as9xaSiIifFYNUJXrhtCYWYlppUCS42uXhi+rF5ZglHM9NjNYKvLs8HOzTQj qX9z/vUrWjU+BIWE3g4WGYujiuFlsOuvGYkwwg++has3SraBDYgKjD4Jn5gMbxLICs zUNujJ3VSwfU+xUkBX364OgMIcg6DZ86eTLSoytI9rdHgHwXJrX2t2iZvrkPMHpwtq RfQB2Weu/0zHAfnhGkVs2M3tgARxRzgyxfoy4K/7nOvAdvOmxCudv3gS9IqDZlySZG UFYQ5OG638gV3UJw66ur7kMV3GhwZLvA1Sftn746SqpE2DCqruXB5Bu7z5k+ghUdGU /Q+529O76lBbg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v10 15/19] tracing/remotes: selftests: Add a test for the dump_on_panic tracefs file Reply-To: sashiko-reviews@lists.linux.dev To: "Vincent Donnefort" , linux-trace-kernel@vger.kernel.org In-Reply-To: <20261203190007.2431041-16-vdonnefort@google.com> References: <20261203190007.2431041-1-vdonnefort@google.com> <20261203190007.2431041-16-vdonnefort@google.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 19:50:30 +0000 X-Mailing-List: linux-trace-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 3 potential issues to consider: - [Medium] tracing/remotes: test_dump_on_panic() omits readback and load/unload checks - [Low] tracing/remotes: test_dump_on_panic() leaves dump_on_panic enabled on return - [Low] tracing/remotes: TRIGGER_PANIC check panics host on falsy values like 0 -- commit 94782c0ade367057f5036a4435f84d17bb625ebc Author: Vincent Donnefort tracing/remotes: selftests: Add a test for the dump_on_panic tracefs file This commit adds ftrace selftests for the trace remote dump_on_panic tracefs file (for both the test remote and the hypervisor remote) and resets dump_on_panic in setup_remote(). > 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 0000000000000..ff5ca29fb1b57 > --- /dev/null > +++ b/tools/testing/selftests/ftrace/test.d/remotes/dump_on_panic.tc > @@ -0,0 +1,50 @@ [ ... ] > +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 [Severity: Medium] Should test_dump_on_panic() read back dump_on_panic and check the buffer load state after these transitions? None of the writes to dump_on_panic are read back, unlike dmesg.tc, so dump_on_panic_show() is never exercised and an ignored write or broken readback would pass silently. The unloaded-toggle block also does not call assert_unloaded after enabling dump_on_panic. In the third block, the leading echo 0 > tracing_on and assert_unloaded repeat the previous block while dump_on_panic is still 0, and the subsequent tracing_on toggle omits assert_loaded and assert_unloaded. Because trace_remote_try_unload() returns void when remote->nr_readers is non-zero rather than failing the write, a regression that pins a reader and blocks unloading while dump_on_panic is enabled would silently pass. > + > + [ -z "$TRIGGER_PANIC" ] && return [Severity: Low] Does this early return leave dump_on_panic enabled on the remote after the test finishes? Neither finish_system() nor the hypervisor wrapper resets dump_on_panic, and disabling tracing_on leaves remote->panic_on set to true. Any later trace_remote_load() on that remote will allocate panic_iter and register panic_notifier unless dump_on_panic is reset to 0 before returning. > + > + echo 1 > tracing_on > + > + for i in $(seq 1 32); do > + echo $i > write_event > + done > + > + echo c > /proc/sysrq-trigger [Severity: Low] Can setting TRIGGER_PANIC=3D0 (or another non-empty falsy value like false or no) accidentally crash the host kernel here? Because -z only tests for an empty string, any non-empty value bypasses the return and runs echo c > /proc/sysrq-trigger. Checking for an explicit opt-in such as [ "$TRIGGER_PANIC" !=3D "1" ] (as ftracetest does for KTAP) would avoid accidental panics. The commit message also does not mention the TRIGGER_PANIC environment variable or this sysrq-trigger path. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203190007.2431= 041-1-vdonnefort@google.com?part=3D15