diff options
author | Sven Schuetz <sven@linux.vnet.ibm.com> | 2008-09-26 04:58:02 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-09 02:56:19 -0400 |
commit | c0ddffa84a7d12da9943a94d04dadbfb1883b904 (patch) | |
tree | 3598e05a07650383a5949debb977b2c0ad5cb522 /include/linux/blktrace_api.h | |
parent | e3ba9ae58a5599226e3976b29c8093041ae7c332 (diff) |
include blktrace_api.h in headers_install
This header file is of interest for user space programming, i.e.
for tools that process blktrace data.
We would like to use it for a tool on-top of blktrace which processes
data provided by blktrace. For this purpose, it would be helpful
if the blktrace API would make it to /usr/include/linux.
The git tree for the blktrace tools comes with its own copy of this header
file. I didn't manage to replace that copy with the file generated
by the patch below yet. A few more cleanups would be needed.
For example, the blktrace ioctl numbers, which are currently defined in
usr/include/fs.h, might need to be moved. Should be feasible, though.
Signed-off-by: Sven Schuetz <sven@linux.vnet.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'include/linux/blktrace_api.h')
-rw-r--r-- | include/linux/blktrace_api.h | 58 |
1 files changed, 32 insertions, 26 deletions
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index dcaf2452ed1f..a2a7d0ca2758 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -1,8 +1,10 @@ | |||
1 | #ifndef BLKTRACE_H | 1 | #ifndef BLKTRACE_H |
2 | #define BLKTRACE_H | 2 | #define BLKTRACE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
4 | #include <linux/blkdev.h> | 5 | #include <linux/blkdev.h> |
5 | #include <linux/relay.h> | 6 | #include <linux/relay.h> |
7 | #endif | ||
6 | 8 | ||
7 | /* | 9 | /* |
8 | * Trace categories | 10 | * Trace categories |
@@ -92,17 +94,17 @@ enum blktrace_notify { | |||
92 | * The trace itself | 94 | * The trace itself |
93 | */ | 95 | */ |
94 | struct blk_io_trace { | 96 | struct blk_io_trace { |
95 | u32 magic; /* MAGIC << 8 | version */ | 97 | __u32 magic; /* MAGIC << 8 | version */ |
96 | u32 sequence; /* event number */ | 98 | __u32 sequence; /* event number */ |
97 | u64 time; /* in microseconds */ | 99 | __u64 time; /* in microseconds */ |
98 | u64 sector; /* disk offset */ | 100 | __u64 sector; /* disk offset */ |
99 | u32 bytes; /* transfer length */ | 101 | __u32 bytes; /* transfer length */ |
100 | u32 action; /* what happened */ | 102 | __u32 action; /* what happened */ |
101 | u32 pid; /* who did it */ | 103 | __u32 pid; /* who did it */ |
102 | u32 device; /* device number */ | 104 | __u32 device; /* device number */ |
103 | u32 cpu; /* on what cpu did it happen */ | 105 | __u32 cpu; /* on what cpu did it happen */ |
104 | u16 error; /* completion error */ | 106 | __u16 error; /* completion error */ |
105 | u16 pdu_len; /* length of data after this trace */ | 107 | __u16 pdu_len; /* length of data after this trace */ |
106 | }; | 108 | }; |
107 | 109 | ||
108 | /* | 110 | /* |
@@ -120,6 +122,25 @@ enum { | |||
120 | Blktrace_stopped, | 122 | Blktrace_stopped, |
121 | }; | 123 | }; |
122 | 124 | ||
125 | /* | ||
126 | * User setup structure passed with BLKTRACESTART | ||
127 | */ | ||
128 | struct blk_user_trace_setup { | ||
129 | #ifdef __KERNEL__ | ||
130 | char name[BDEVNAME_SIZE]; /* output */ | ||
131 | #else | ||
132 | char name[32]; /* output */ | ||
133 | #endif | ||
134 | __u16 act_mask; /* input */ | ||
135 | __u32 buf_size; /* input */ | ||
136 | __u32 buf_nr; /* input */ | ||
137 | __u64 start_lba; | ||
138 | __u64 end_lba; | ||
139 | __u32 pid; | ||
140 | }; | ||
141 | |||
142 | #ifdef __KERNEL__ | ||
143 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
123 | struct blk_trace { | 144 | struct blk_trace { |
124 | int trace_state; | 145 | int trace_state; |
125 | struct rchan *rchan; | 146 | struct rchan *rchan; |
@@ -136,21 +157,6 @@ struct blk_trace { | |||
136 | atomic_t dropped; | 157 | atomic_t dropped; |
137 | }; | 158 | }; |
138 | 159 | ||
139 | /* | ||
140 | * User setup structure passed with BLKTRACESTART | ||
141 | */ | ||
142 | struct blk_user_trace_setup { | ||
143 | char name[BDEVNAME_SIZE]; /* output */ | ||
144 | u16 act_mask; /* input */ | ||
145 | u32 buf_size; /* input */ | ||
146 | u32 buf_nr; /* input */ | ||
147 | u64 start_lba; | ||
148 | u64 end_lba; | ||
149 | u32 pid; | ||
150 | }; | ||
151 | |||
152 | #ifdef __KERNEL__ | ||
153 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
154 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | 160 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); |
155 | extern void blk_trace_shutdown(struct request_queue *); | 161 | extern void blk_trace_shutdown(struct request_queue *); |
156 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | 162 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); |