[Skiboot] [PATCH v2 08/16] core/trace: Change trace buffer size

Jordan Niethe jniethe5 at gmail.com
Tue Apr 2 10:43:19 AEDT 2019

We want to be able to mmap the trace buffers to be used by the
dump_trace tool. As mmaping is done in terms of pages it makes sense
that the size of the trace buffers should be page aligned.  This is
slightly complicated by the space taken up by the header at the
beginning of the trace and the room left for an extra trace entry at the
end of the buffer. Change the size of the buffer itself so that the
entire trace buffer size will be page aligned.

v2: Don't significantly change the size of the buffer.

Signed-off-by: Jordan Niethe <jniethe5 at gmail.com>
 include/trace.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/trace.h b/include/trace.h
index 2b65e9075591..665817ab3c67 100644
--- a/include/trace.h
+++ b/include/trace.h
@@ -21,7 +21,6 @@
 #include <lock.h>
 #include <trace_types.h>
-#define TBUF_SZ (1024 * 1024)
 struct cpu_thread;
@@ -35,6 +34,8 @@ struct trace_info {
 	struct tracebuf tb;
+#define TBUF_SZ ((1024 * 1024) - sizeof(struct trace_info) - sizeof(union trace))
 /* Allocate trace buffers once we know memory topology */
 void init_trace_buffers(void);

More information about the Skiboot mailing list