lkml.org 
[lkml]   [2019]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[RFC 2/2] ** do not apply this patch ** Just for illustration purposes
Prints a message that will allow us to evaluate the number of pages
allocated by each CPU buffer as well the main values that participate
in its calculation.

$ echo 0 > /sys/kernel/debug/tracing/tracing_on
$ echo 4096 > /sys/kernel/debug/tracing/buffer_size_kb
.... e.g. of output:
PAGE_SIZE: 4096, BUF_PAGE_HDR_SIZE: 16, size: 4194304, nr_pages: 1029

Signed-off-by: Frank A. Cancio Bello <frank@generalsoftwareinc.com>
---
kernel/trace/ring_buffer.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 66358d66c933..c10b6bcb29b9 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1730,6 +1730,8 @@ int ring_buffer_resize(struct ring_buffer *buffer, unsigned long size,
return size;

nr_pages = DIV_ROUND_UP(size, BUF_PAGE_SIZE);
+ printk(KERN_ALERT "PAGE_SIZE: %lu, BUF_PAGE_HDR_SIZE: %lu, size: %lu, nr_pages: %ld",
+ PAGE_SIZE, BUF_PAGE_HDR_SIZE, size, nr_pages);

/* we need a minimum of two pages */
if (nr_pages < 2)
--
2.17.1
\
 
 \ /
  Last update: 2019-11-13 17:34    [W:0.069 / U:22.424 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site