trace-cmd stat: Add sub-buffer size
PATCH 1/1 trace-cmd stat: Add sub-buffer size
From: "Steven Rostedt (Google)" <[email protected]>
[
Note, this depends on libtracefs 1.8 and can not be added until that's released.
]
Show the sub-buffer size if the file system supports it and it is different than the architecture page size.
Signed-off-by Steven Rostedt (Google) <[email protected]>
--- tracecmd/trace-stat.c | 7 +++++++ 1 file changed, 7 insertions(+)
tracecmd/trace-stat.c +7 -0
@@ -633,6 +633,8 @@ static void report_buffers(struct buffer_instance *instance)char *str;char *cont;char file[FILE_SIZE ]; +int pagesize; +int bufsize;int cpu; str =tracefs_instance_file_read (instance->tracefs,"buffer_size_kb" ,NULL );
@@ -678,6 +680,11 @@ static void report_buffers(struct buffer_instance *instance)printf ("\nBuffer total size in kilobytes:\n" );printf (" %s\n" , str); + pagesize =getpagesize (); + bufsize =tracefs_instance_get_subbuf_size (instance->tracefs); +if (bufsize >0 && bufsize *1024 != pagesize) +printf ("\nSub-buffer size in kilobytes:\n %d\n" , bufsize); + out:free (str); }
Signature · 1 line
2.42.0