Skip to contentSkip to conversation

selftests/tracing: Fix test_multiple_writes stall

PATCH Superseded Fushuai Wang 4 participants 8 messages Dec 27, 2025 – Jan 9

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 selftests/tracing: Fix test_multiple_writes stall

When /sys/kernel/tracing/buffer_size_kb is less than 12KB, the test_multiple_writes test will stall and wait for more input due to insufficient buffer space.

Check current buffer_size_kb value before the test. If it is less than 12KB, it temporarily increase the buffer to 12KB, and restore the original value after the tests are completed.

Fixes 37f46601383a ("selftests/tracing: Add basic test for trace_marker_raw file")

---
V1 -> V2: Restore buffer_size_kb outside of awk script.

 .../ftrace/test.d/00basic/trace_marker_raw.tc  | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
tools/testing/selftests/ftrace/test.d/00basic/trace_marker_raw.tc +17 -1
index 7daf7292209e..a2c42e13f614 100644
@@ -89,6 +89,7 @@ test_buffer() {
 	# The id must be four bytes, test that 3 bytes fails a write
 	if echo -n abc > ./trace_marker_raw ; then
 		echo "Too small of write expected to fail but did not"
+		echo ${ORIG} > buffer_size_kb
 		exit_fail
 	fi
 
@@ -99,9 +100,24 @@ test_buffer() {
 
 	if write_buffer 0xdeadbeef $size ; then
 		echo "Too big of write expected to fail but did not"
+		echo ${ORIG} > buffer_size_kb
 		exit_fail
 	fi
 }
 
+ORIG=`cat buffer_size_kb`
+
+# test_multiple_writes test needs at least 12KB buffer
+NEW_SIZE=12
+
+if [ ${ORIG} -lt ${NEW_SIZE} ]; then
+	echo ${NEW_SIZE} > buffer_size_kb
+fi
+
 test_buffer
-test_multiple_writes
+if ! test_multiple_writes; then
+	echo ${ORIG} > buffer_size_kb
+	exit_fail
+fi
+
+echo ${ORIG} > buffer_size_kb
Signature · 1 line
2.36.1
#1 lore raw
Quoted 11 lines

When /sys/kernel/tracing/buffer_size_kb is less than 12KB, the test_multiple_writes test will stall and wait for more input due to insufficient buffer space.

Check current buffer_size_kb value before the test. If it is less than 12KB, it temporarily increase the buffer to 12KB, and restore the original value after the tests are completed.

Fixes 37f46601383a ("selftests/tracing: Add basic test for trace_marker_raw file")

Gentle ping.

---
Regards,
WANG

maintainer Acked-by
#2 lore raw
Quoted 8 lines · On Wed, 7 Jan 2026 11:49:14 +0800 Fushuai Wang <[email protected]> wrote:
Quoted 8 lines

When /sys/kernel/tracing/buffer_size_kb is less than 12KB, the test_multiple_writes test will stall and wait for more input due to insufficient buffer space.

Check current buffer_size_kb value before the test. If it is less than 12KB, it temporarily increase the buffer to 12KB, and restore the original value after the tests are completed.

Quoted 6 lines
Quoted 3 lines
Fixes 37f46601383a ("selftests/tracing: Add basic test for trace_marker_raw file")

Gentle ping.

Shuah,

Care to take this through your tree? It does fix a bug so it likely should go into the rc releases and not wait for the next merge window.

Thanks,

-- Steve

maintainer
#3 lore raw
Quoted 18 lines · Steven Rostedt
Quoted 8 lines · On Wed, 7 Jan 2026 11:49:14 +0800 Fushuai Wang <[email protected]> wrote:
Quoted 8 lines

When /sys/kernel/tracing/buffer_size_kb is less than 12KB, the test_multiple_writes test will stall and wait for more input due to insufficient buffer space.

Check current buffer_size_kb value before the test. If it is less than 12KB, it temporarily increase the buffer to 12KB, and restore the original value after the tests are completed.

Quoted 6 lines
Quoted 3 lines
Fixes 37f46601383a ("selftests/tracing: Add basic test for trace_marker_raw file")

Gentle ping.

Quoted 7 lines

Shuah,

Care to take this through your tree? It does fix a bug so it likely should go into the rc releases and not wait for the next merge window.

Yes I can take this through and send this for rc5 or rc6. But first the following warning needs fixing before I can apply the patch

WARNING: From:/Signed-off-by: email address mismatch: 'From: Fushuai Wang <[email protected]>' != 'Signed-off-by: Fushuai Wang <[email protected]>'

Fushuai, please send me v3

thanks,
-- Shuah

maintainer
#4 lore raw
Quoted 5 lines · On Thu, 8 Jan 2026 11:27:26 -0700 Shuah <[email protected]> wrote:

Yes I can take this through and send this for rc5 or rc6. But first the following warning needs fixing before I can apply the patch

WARNING: From:/Signed-off-by: email address mismatch: 'From: Fushuai Wang <[email protected]>' != 'Signed-off-by: Fushuai Wang <[email protected]>'

Hmm, do emails have to match? There's times I used a different SoB than the From. The From is different than the SoB. The important part I found was to make sure the name is the same. But I didn't think the email address was important. And this will become more of an issue, as gmail blocks my goodmis.org account, so I send with my kernel.org account when my goodmis is the only one I sign off with. Thus this restriction will fail for me on my patches.

-- Steve

maintainer
#5 lore raw
Quoted 9 lines · Steven Rostedt
Quoted 5 lines · On Thu, 8 Jan 2026 11:27:26 -0700 Shuah <[email protected]> wrote:

Yes I can take this through and send this for rc5 or rc6. But first the following warning needs fixing before I can apply the patch

WARNING: From:/Signed-off-by: email address mismatch: 'From: Fushuai Wang <[email protected]>' != 'Signed-off-by: Fushuai Wang <[email protected]>'

Quoted 7 lines

Hmm, do emails have to match? There's times I used a different SoB than the From. The From is different than the SoB. The important part I found was to make sure the name is the same. But I didn't think the email address was important. And this will become more of an issue, as gmail blocks my goodmis.org account, so I send with my kernel.org account when my goodmis is the only one I sign off with. Thus this restriction will fail for me on my patches.

I go by the warning - I don't take patches unless From address matches the SoB.

thanks,
-- Shuah

maintainer
#6 lore raw
Quoted 18 lines · On Thu, 8 Jan 2026 14:03:31 -0700 Shuah Khan <[email protected]> wrote:
Quoted 9 lines · Steven Rostedt
Quoted 5 lines · On Thu, 8 Jan 2026 11:27:26 -0700 Shuah <[email protected]> wrote:

Yes I can take this through and send this for rc5 or rc6. But first the following warning needs fixing before I can apply the patch

WARNING: From:/Signed-off-by: email address mismatch: 'From: Fushuai Wang <[email protected]>' != 'Signed-off-by: Fushuai Wang <[email protected]>'

Quoted 7 lines

Hmm, do emails have to match? There's times I used a different SoB than the From. The From is different than the SoB. The important part I found was to make sure the name is the same. But I didn't think the email address was important. And this will become more of an issue, as gmail blocks my goodmis.org account, so I send with my kernel.org account when my goodmis is the only one I sign off with. Thus this restriction will fail for me on my patches.

Quoted 2 lines

I go by the warning - I don't take patches unless From address matches the SoB.

I guess my patches would then fail your requirements ;-)

Anyway, Fushuai, you can add to the top of your commit:

From: Fushuai Wang <[email protected]>

and that will make the From and SoB match without having to change your mail client. I usually have that. Because Linus doesn't like my patches having my company name in it for the "author" but I have it in the SoB to give credit to the one paying me to do the work.

-- Steve

#7 lore raw
Quoted 8 lines

Anyway, Fushuai, you can add to the top of your commit:

From: Fushuai Wang <[email protected]>

and that will make the From and SoB match without having to change your mail client. I usually have that. Because Linus doesn't like my patches having my company name in it for the "author" but I have it in the SoB to give credit to the one paying me to do the work.

Thanks!
I will send a v3 shortly.

---
Regards,
WANG