trace-cmd stat: Add sub-buffer size
Subsystems (2)
PATCH v2 1/1 trace-cmd stat: Add sub-buffer size
From: "Steven Rostedt (Google)" <[email protected]>
Show the sub-buffer size if the file system supports it and it is different than the architecture page size.
This requires libtracefs 1.8, so update the Makefile with that requirement.
Signed-off-by Steven Rostedt (Google) <[email protected]>
---
Changes since v1: https://lore.kernel.org/linux-trace-devel/[email protected]
- Added requirement of libtracefs version 1.8 in Makefile and meson.build.
Makefile | 2 +- meson.build | 2 +- tracecmd/trace-stat.c | 7 +++++++ 3 files changed, 9 insertions(+), 2 deletions(-)
Makefile +1 -1
@@ -23,7 +23,7 @@ export LIBTRACECMD_VERSION VERSION_FILE = ltc_version.h LIBTRACEEVENT_MIN_VERSION = 1.5 -LIBTRACEFS_MIN_VERSION = 1.6 +LIBTRACEFS_MIN_VERSION = 1.8 MAKEFLAGS += --no-print-directory
meson.build +1 -1
@@ -25,7 +25,7 @@ htmldir = join_paths(prefixdir, get_option('htmldir')) conf = configuration_data() libtraceevent_dep = dependency('libtraceevent', version: '>= 1.5.0', required: true) -libtracefs_dep = dependency('libtracefs', version: '>= 1.6.0', required: true) +libtracefs_dep = dependency('libtracefs', version: '>= 1.8.0', required: true) threads_dep = dependency('threads', required: true) dl_dep = cc.find_library('dl', required : false)
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.43.0