include/uapi/linux/blktrace_api.h

Source file repositories/reference/linux-study-clean/include/uapi/linux/blktrace_api.h

File Facts

System
Linux kernel
Corpus path
include/uapi/linux/blktrace_api.h
Extension
.h
Size
6430 bytes
Lines
198
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct blk_io_trace {
	__u32 magic;		/* MAGIC << 8 | version */
	__u32 sequence;		/* event number */
	__u64 time;		/* in nanoseconds */
	__u64 sector;		/* disk offset */
	__u32 bytes;		/* transfer length */
	__u32 action;		/* what happened */
	__u32 pid;		/* who did it */
	__u32 device;		/* device number */
	__u32 cpu;		/* on what cpu did it happen */
	__u16 error;		/* completion error */
	__u16 pdu_len;		/* length of data after this trace */
	/* cgroup id will be stored here if exists */
};

struct blk_io_trace2 {
	__u32 magic;		/* MAGIC << 8 | BLK_IO_TRACE2_VERSION */
	__u32 sequence;		/* event number */
	__u64 time;		/* in nanoseconds */
	__u64 sector;		/* disk offset */
	__u32 bytes;		/* transfer length */
	__u32 pid;		/* who did it */
	__u64 action;		/* what happened */
	__u32 device;		/* device number */
	__u32 cpu;		/* on what cpu did it happen */
	__u16 error;		/* completion error */
	__u16 pdu_len;		/* length of data after this trace */
	__u8 pad[12];
	/* cgroup id will be stored here if it exists */
};
/*
 * The remap event
 */
struct blk_io_trace_remap {
	__be32 device_from;
	__be32 device_to;
	__be64 sector_from;
};

enum {
	Blktrace_setup = 1,
	Blktrace_running,
	Blktrace_stopped,
};

#define BLKTRACE_BDEV_SIZE	32
#define BLKTRACE_BDEV_SIZE2	64

/*
 * User setup structure passed with BLKTRACESETUP
 */
struct blk_user_trace_setup {
	char name[BLKTRACE_BDEV_SIZE];	/* output */
	__u16 act_mask;			/* input */
	__u32 buf_size;			/* input */
	__u32 buf_nr;			/* input */
	__u64 start_lba;
	__u64 end_lba;
	__u32 pid;
};

/*
 * User setup structure passed with BLKTRACESETUP2
 */
struct blk_user_trace_setup2 {
	char name[BLKTRACE_BDEV_SIZE2];		/* output */
	__u64 act_mask;				/* input */
	__u32 buf_size;				/* input */
	__u32 buf_nr;				/* input */
	__u64 start_lba;
	__u64 end_lba;
	__u32 pid;
	__u32 flags;		/* currently unused */
	__u64 reserved[11];
};

#endif /* _UAPIBLKTRACE_H */

Annotation

Implementation Notes