tracing: document buffer_size_kb more precisely
Subsystems (3)
PATCH 1/1 tracing: document buffer_size_kb more precisely
buffer_size_kb no longer shows the requested amount, but the one that is actually used internally for the ring buffer.
commit 6d98a0f2ac3c ("tracing: Set actual size after ring buffer resize") changed the sysfs behavior such that value read will always show the actual size, while previously it showed the size that was requested through the sysfs interface, even if it was rounded up to fulfill the request.
So the documentation can state that more precisely now.
--- Documentation/trace/ftrace.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/trace/ftrace.rst +1 -1
@@ -191,7 +191,7 @@ of ftrace. Here is a list of some of the key files: A few extra pages may be allocated to accommodate buffer management meta-data. If the last page allocated has room for more bytes than requested, the rest of the page will be used, - making the actual allocation bigger than requested or shown. + making the actual allocation bigger than requested. ( Note, the size may not be a multiple of the page size due to buffer management meta-data. )
Signature · 1 line
2.34.1
Quoted 20 lines · Christian Loehle
buffer_size_kbno longer shows the requested amount, but the one that is actually used internally for the ring buffer.commit
6d98a0f2ac3c("tracing: Set actual size after ring buffer resize") changed the sysfs behavior such that value read will always show the actual size, while previously it showed the size that was requested through the sysfs interface, even if it was rounded up to fulfill the request.
So the documentation can state that more precisely now.Signed-off-by Christian Loehle <[email protected]>--- Documentation/trace/ftrace.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Documentation/trace/ftrace.rst +0
-0
Documentation/trace/ftrace.rst of ftrace. Here is a list of some of the key files: · line 194
Quoted 5 lines
Documentation/trace/ftrace.rst +1
-1@@ -191,7 +191,7 @@ of ftrace. Here is a list of some of the key files: A few extra pages may be allocated to accommodate buffer management meta-data. If the last page allocated has room for more bytes than requested, the rest of the page will be used, - making the actual allocation bigger than requested or shown. + making the actual allocation bigger than requested.
Hi, the actual allocation should still be bigger than shown due to the loss of accuracy when doing unit conversion from bytes to kilobytes (see tracing_entries_read()).
--
Thanks,
Zheng Yejian
Quoted 3 lines
Documentation/trace/ftrace.rst +0
-0( Note, the size may not be a multiple of the page size due to buffer management meta-data. )
Quoted 16 lines · Zheng Yejian
Quoted 15 lines · Christian Loehle
buffer_size_kbno longer shows the requested amount, but the one that is actually used internally for the ring buffer.commit
6d98a0f2ac3c("tracing: Set actual size after ring buffer resize") changed the sysfs behavior such that value read will always show the actual size, while previously it showed the size that was requested through the sysfs interface, even if it was rounded up to fulfill the request.
So the documentation can state that more precisely now.Signed-off-by Christian Loehle <[email protected]>---
Documentation/trace/ftrace.rst| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
Quoted 10 lines
Documentation/trace/ftrace.rst +0
-0@@ -191,7 +191,7 @@ of ftrace. Here is a list of some of the key files:A few extra pages may be allocated to accommodate buffer management meta-data. If the last page allocated has room for more bytes than requested, the rest of the page will be used,
- making the actual allocation bigger than requested or shown. + making the actual allocation bigger than requested.Hi, the actual allocation should still be bigger than shown due to the loss of accuracy when doing unit conversion from bytes to kilobytes (see
tracing_entries_read()).
Right, the sysfs obviously only allows for KB aligned setting, but you're right. If set on the cmdline non-KB multiples are possible and accuracy is lost. Nevermind then.
Quoted 9 lines
Signature · 2 lines
Thanks, Zheng YejianQuoted 3 lines
( Note, the size may not be a multiple of the page size due to buffer management meta-data. )
Steven Rostedt
maintainerQuoted 11 lines · On Tue, 26 Sep 2023 11:38:14 +0100 Christian Loehle <[email protected]>…
Quoted 11 lines
Quoted 6 lines
(quoted diff) +0
-0@@ -191,7 +191,7 @@ of ftrace. Here is a list of some of the key files:A few extra pages may be allocated to accommodate buffer management meta-data. If the last page allocated has room for more bytes than requested, the rest of the page will be used,
- making the actual allocation bigger than requested or shown. + making the actual allocation bigger than requested.Hi, the actual allocation should still be bigger than shown due to the loss of accuracy when doing unit conversion from bytes to kilobytes (see
tracing_entries_read()).
Quoted 3 lines
Right, the sysfs obviously only allows for KB aligned setting, but you're right. If set on the cmdline non-KB multiples are possible and accuracy is lost. Nevermind then.
I'm assuming this patch can be dropped?
-- Steve
Quoted 14 lines · Steven Rostedt
Quoted 11 lines · On Tue, 26 Sep 2023 11:38:14 +0100 Christian Loehle <[email protected]>…
Quoted 11 lines
Quoted 6 lines
(quoted diff) +0
-0@@ -191,7 +191,7 @@ of ftrace. Here is a list of some of the key files:A few extra pages may be allocated to accommodate buffer management meta-data. If the last page allocated has room for more bytes than requested, the rest of the page will be used,
- making the actual allocation bigger than requested or shown. + making the actual allocation bigger than requested.Hi, the actual allocation should still be bigger than shown due to the loss of accuracy when doing unit conversion from bytes to kilobytes (see
tracing_entries_read()).
Quoted 7 lines
Quoted 3 lines
Right, the sysfs obviously only allows for KB aligned setting, but you're right. If set on the cmdline non-KB multiples are possible and accuracy is lost. Nevermind then.
I'm assuming this patch can be dropped?
-- Steve
Yes please drop it, there's probably still some room for improvement for clarity, but this patch is not correct.