blktrace conversion to GTSC
RFC PATCH 3/3 blktrace conversion to GTSC
This patch converts blktrace to use the Generic Trace Setup and Control (GTSC) interface. Also attached is a small patch to the blktrace user code, needed for the ioctl change.
Signed-off-by Tom Zanussi <[email protected]>
Signed-off-by David Wilder <[email protected]>
--- block/Kconfig | 2 block/blktrace.c | 188 +++++-------------------------------------- include/linux/blktrace_api.h | 30 +++--- 3 files changed, 40 insertions(+), 180 deletions(-)
block/Kconfig +1 -1
@@ -30,7 +30,7 @@ config LBD config BLK_DEV_IO_TRACE bool "Support for tracing block io actions" depends on SYSFS - select RELAY + select GTSC select DEBUG_FS help Say Y here, if you want to be able to trace the block layer actions
block/blktrace.c +24 -164
285 lines not on this page · raw message
include/linux/blktrace_api.h +15 -15
@@ -2,7 +2,7 @@#define BLKTRACE_H #include <linux/blkdev.h> -#include <linux/relay.h> +#include <linux/gtsc.h> /* * Trace categories
@@ -109,34 +109,34 @@ struct blk_io_trace_remap {__be64 sector; }; -enum { - Blktrace_setup =1 , - Blktrace_running, - Blktrace_stopped, -}; -struct blk_trace { -int trace_state; -struct rchan *rchan; +struct trace_info *trace;unsigned long *sequence;u16 act_mask;u64 start_lba;u64 end_lba;u32 pid;u32 dev; -struct dentry *dir; -struct dentry *dropped_file; -atomic_t dropped; +}; + +/* +* User setup structure +*/ +struct gtsc_trace_setup +{ +char root[TRACE_ROOT_NAME_SIZE ]; +char name[TRACE_NAME_SIZE ]; +u32 buf_size; +u32 buf_nr; +u32 flags; };/* * User setup structure passed with BLKTRACESTART */ struct blk_user_trace_setup { -char name[BDEVNAME_SIZE ];/* output */ +struct gtsc_trace_setup gts;/* input */ u16 act_mask;/* input */ -u32 buf_size;/* input */ -u32 buf_nr;/* input */ u64 start_lba;u64 end_lba;u32 pid;