diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-06-16 05:24:43 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-16 05:24:43 -0400 |
commit | 8bbd54d69e9c66adbf544e21d8dcfb15fb9198f7 (patch) | |
tree | 95f30814fc759c2cb523dbea95bc531c7f8f3231 /include/linux/blktrace_api.h | |
parent | 8c2238eaaf0f774ca0f8d9daad7a616429bbb7f1 (diff) | |
parent | 066519068ad2fbe98c7f45552b1f592903a9c8c8 (diff) |
Merge branch 'linus' into core/softlockup
Diffstat (limited to 'include/linux/blktrace_api.h')
-rw-r--r-- | include/linux/blktrace_api.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index cfc3147e5cf9..e3ef903aae88 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -55,6 +55,7 @@ enum blktrace_act { | |||
55 | enum blktrace_notify { | 55 | enum blktrace_notify { |
56 | __BLK_TN_PROCESS = 0, /* establish pid/name mapping */ | 56 | __BLK_TN_PROCESS = 0, /* establish pid/name mapping */ |
57 | __BLK_TN_TIMESTAMP, /* include system clock */ | 57 | __BLK_TN_TIMESTAMP, /* include system clock */ |
58 | __BLK_TN_MESSAGE, /* Character string message */ | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | 61 | ||
@@ -79,6 +80,7 @@ enum blktrace_notify { | |||
79 | 80 | ||
80 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) | 81 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) |
81 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) | 82 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) |
83 | #define BLK_TN_MESSAGE (__BLK_TN_MESSAGE | BLK_TC_ACT(BLK_TC_NOTIFY)) | ||
82 | 84 | ||
83 | #define BLK_IO_TRACE_MAGIC 0x65617400 | 85 | #define BLK_IO_TRACE_MAGIC 0x65617400 |
84 | #define BLK_IO_TRACE_VERSION 0x07 | 86 | #define BLK_IO_TRACE_VERSION 0x07 |
@@ -119,6 +121,7 @@ struct blk_trace { | |||
119 | int trace_state; | 121 | int trace_state; |
120 | struct rchan *rchan; | 122 | struct rchan *rchan; |
121 | unsigned long *sequence; | 123 | unsigned long *sequence; |
124 | unsigned char *msg_data; | ||
122 | u16 act_mask; | 125 | u16 act_mask; |
123 | u64 start_lba; | 126 | u64 start_lba; |
124 | u64 end_lba; | 127 | u64 end_lba; |
@@ -149,7 +152,28 @@ extern void blk_trace_shutdown(struct request_queue *); | |||
149 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | 152 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); |
150 | extern int do_blk_trace_setup(struct request_queue *q, | 153 | extern int do_blk_trace_setup(struct request_queue *q, |
151 | char *name, dev_t dev, struct blk_user_trace_setup *buts); | 154 | char *name, dev_t dev, struct blk_user_trace_setup *buts); |
155 | extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); | ||
152 | 156 | ||
157 | /** | ||
158 | * blk_add_trace_msg - Add a (simple) message to the blktrace stream | ||
159 | * @q: queue the io is for | ||
160 | * @fmt: format to print message in | ||
161 | * args... Variable argument list for format | ||
162 | * | ||
163 | * Description: | ||
164 | * Records a (simple) message onto the blktrace stream. | ||
165 | * | ||
166 | * NOTE: BLK_TN_MAX_MSG characters are output at most. | ||
167 | * NOTE: Can not use 'static inline' due to presence of var args... | ||
168 | * | ||
169 | **/ | ||
170 | #define blk_add_trace_msg(q, fmt, ...) \ | ||
171 | do { \ | ||
172 | struct blk_trace *bt = (q)->blk_trace; \ | ||
173 | if (unlikely(bt)) \ | ||
174 | __trace_note_message(bt, fmt, ##__VA_ARGS__); \ | ||
175 | } while (0) | ||
176 | #define BLK_TN_MAX_MSG 128 | ||
153 | 177 | ||
154 | /** | 178 | /** |
155 | * blk_add_trace_rq - Add a trace for a request oriented action | 179 | * blk_add_trace_rq - Add a trace for a request oriented action |
@@ -299,6 +323,8 @@ extern int blk_trace_remove(struct request_queue *q); | |||
299 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) | 323 | #define blk_trace_setup(q, name, dev, arg) (-ENOTTY) |
300 | #define blk_trace_startstop(q, start) (-ENOTTY) | 324 | #define blk_trace_startstop(q, start) (-ENOTTY) |
301 | #define blk_trace_remove(q) (-ENOTTY) | 325 | #define blk_trace_remove(q) (-ENOTTY) |
326 | #define blk_add_trace_msg(q, fmt, ...) do { } while (0) | ||
327 | |||
302 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ | 328 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ |
303 | #endif /* __KERNEL__ */ | 329 | #endif /* __KERNEL__ */ |
304 | #endif | 330 | #endif |