[PATCH v5 4/4] Documentation: document trace_stats memory_usage_kb
From: Xiang Gao
Date: Thu Nov 05 2026 - 09:05:15 EST
Document the trace_stats/memory_usage_kb file, which reports the tracing
ring-buffer memory usage categorized by buffer type and memory source.
Signed-off-by: Xiang Gao <gaoxiang17@xxxxxxxxxx>
---
Documentation/trace/ftrace.rst | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/Documentation/trace/ftrace.rst b/Documentation/trace/ftrace.rst
index 9423722848c6..d7af1e37e6b1 100644
--- a/Documentation/trace/ftrace.rst
+++ b/Documentation/trace/ftrace.rst
@@ -218,6 +218,28 @@ of ftrace. Here is a list of some of the key files:
This displays the total combined size of all the trace buffers.
+ trace_stats/memory_usage_kb:
+
+ This reports the memory consumed by the ring buffers, as opposed to
+ the usable data capacity shown by buffer_size_kb. The value is
+ categorized by buffer type and memory source::
+
+ global:
+ instances:
+ snapshots:
+ persistents:
+ remotes:
+ total_system:
+ total_carveout:
+
+ global, instances, and snapshots come from the page allocator.
+ persistents use reserved memory. remotes are not yet reported and
+ are always zero. total_system is the page-allocator memory, while
+ total_carveout is reserved memory that was never in the free pool.
+
+ The same file is provided under trace_stats/per_cpu/cpuN/, reporting
+ only the buffers belonging to that CPU.
+
buffer_subbuf_size_kb:
This sets or displays the sub buffer size. The ring buffer is broken up
--
2.34.1