diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-12-19 21:54:29 +0300 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2023-12-21 19:04:15 +0300 |
commit | 2f84b39f48476615186af5b3220ad5a2c756679b (patch) | |
tree | 8006b5c599719b990807281a82233eb1c2d91f5b /tools/testing/selftests/ftrace | |
parent | 1acce70374caabc2945aa07a862f834fb7c2914f (diff) | |
download | linux-2f84b39f48476615186af5b3220ad5a2c756679b.tar.xz |
tracing: Update subbuffer with kilobytes not page order
Using page order for deciding what the size of the ring buffer sub buffers
are is exposing a bit too much of the implementation. Although the sub
buffers are only allocated in orders of pages, allow the user to specify
the minimum size of each sub-buffer via kilobytes like they can with the
buffer size itself.
If the user specifies 3 via:
echo 3 > buffer_subbuf_size_kb
Then the sub-buffer size will round up to 4kb (on a 4kb page size system).
If they specify:
echo 6 > buffer_subbuf_size_kb
The sub-buffer size will become 8kb.
and so on.
Link: https://lore.kernel.org/linux-trace-kernel/20231219185631.809766769@goodmis.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Tzvetomir Stoyanov <tz.stoyanov@gmail.com>
Cc: Vincent Donnefort <vdonnefort@google.com>
Cc: Kent Overstreet <kent.overstreet@gmail.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/selftests/ftrace')
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_subbuf_size.tc (renamed from tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_order.tc) | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_order.tc b/tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_subbuf_size.tc index ecbcc810e6c1..d44d09a33a74 100644 --- a/tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_order.tc +++ b/tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_subbuf_size.tc @@ -1,7 +1,7 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -# description: Change the ringbuffer sub-buffer order -# requires: buffer_subbuf_order +# description: Change the ringbuffer sub-buffer size +# requires: buffer_subbuf_size_kb # flags: instance get_buffer_data_size() { @@ -52,8 +52,8 @@ write_buffer() { } test_buffer() { - orde=$1 - page_size=$((4096<<order)) + size_kb=$1 + page_size=$((size_kb*1024)) size=`get_buffer_data_size` @@ -82,14 +82,14 @@ test_buffer() { fi } -ORIG=`cat buffer_subbuf_order` +ORIG=`cat buffer_subbuf_size_kb` -# Could test bigger orders than 3, but then creating the string +# Could test bigger sizes than 32K, but then creating the string # to write into the ring buffer takes too long -for a in 0 1 2 3 ; do - echo $a > buffer_subbuf_order +for a in 4 8 16 32 ; do + echo $a > buffer_subbuf_size_kb test_buffer $a done -echo $ORIG > buffer_subbuf_order +echo $ORIG > buffer_subbuf_size_kb |