[PATCH v5 4/4] Documentation: document trace_stats memory_usage_kb

From
Xiang Gao <hidden>
Date
2026-11-05 14:03:23
Also in
lkml
Reply to
Xiang Gao, 2026-11-05
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 <redacted>
---
 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
Thread (7 messages) 7 messages, 3 authors, last reply 2d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help