diff options
author | Namhyung Kim <namhyung@gmail.com> | 2011-08-11 04:36:05 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2011-08-11 04:36:05 -0400 |
commit | c09c47caedc9854d59378d6e34c989e51cfdd2b4 (patch) | |
tree | ad7de20c08092cdf1cbbb83625a76acab3b0e2ce /include | |
parent | 8e4bf84474960e832b56293c9b0674c88b5b05ce (diff) |
blktrace: add FLUSH/FUA support
Add FLUSH/FUA support to blktrace. As FLUSH precedes WRITE and/or
FUA follows WRITE, use the same 'F' flag for both cases and
distinguish them by their (relative) position. The end results
look like (other flags might be shown also):
- WRITE: W
- WRITE_FLUSH: FW
- WRITE_FUA: WF
- WRITE_FLUSH_FUA: FWF
Note that we reuse TC_BARRIER due to lack of bit space of act_mask
so that the older versions of blktrace tools will report flush
requests as barriers from now on.
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/blktrace_api.h | 5 | ||||
-rw-r--r-- | include/trace/events/block.h | 20 |
2 files changed, 14 insertions, 11 deletions
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 8c7c2de7631a..8e9e4bc6d73b 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -14,7 +14,7 @@ | |||
14 | enum blktrace_cat { | 14 | enum blktrace_cat { |
15 | BLK_TC_READ = 1 << 0, /* reads */ | 15 | BLK_TC_READ = 1 << 0, /* reads */ |
16 | BLK_TC_WRITE = 1 << 1, /* writes */ | 16 | BLK_TC_WRITE = 1 << 1, /* writes */ |
17 | BLK_TC_BARRIER = 1 << 2, /* barrier */ | 17 | BLK_TC_FLUSH = 1 << 2, /* flush */ |
18 | BLK_TC_SYNC = 1 << 3, /* sync IO */ | 18 | BLK_TC_SYNC = 1 << 3, /* sync IO */ |
19 | BLK_TC_SYNCIO = BLK_TC_SYNC, | 19 | BLK_TC_SYNCIO = BLK_TC_SYNC, |
20 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ | 20 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ |
@@ -28,8 +28,9 @@ enum blktrace_cat { | |||
28 | BLK_TC_META = 1 << 12, /* metadata */ | 28 | BLK_TC_META = 1 << 12, /* metadata */ |
29 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ | 29 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ |
30 | BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ | 30 | BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ |
31 | BLK_TC_FUA = 1 << 15, /* fua requests */ | ||
31 | 32 | ||
32 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 33 | BLK_TC_END = 1 << 15, /* we've run out of bits! */ |
33 | }; | 34 | }; |
34 | 35 | ||
35 | #define BLK_TC_SHIFT (16) | 36 | #define BLK_TC_SHIFT (16) |
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index bf366547da25..05c5e61f0a7c 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
10 | 10 | ||
11 | #define RWBS_LEN 8 | ||
12 | |||
11 | DECLARE_EVENT_CLASS(block_rq_with_error, | 13 | DECLARE_EVENT_CLASS(block_rq_with_error, |
12 | 14 | ||
13 | TP_PROTO(struct request_queue *q, struct request *rq), | 15 | TP_PROTO(struct request_queue *q, struct request *rq), |
@@ -19,7 +21,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error, | |||
19 | __field( sector_t, sector ) | 21 | __field( sector_t, sector ) |
20 | __field( unsigned int, nr_sector ) | 22 | __field( unsigned int, nr_sector ) |
21 | __field( int, errors ) | 23 | __field( int, errors ) |
22 | __array( char, rwbs, 6 ) | 24 | __array( char, rwbs, RWBS_LEN ) |
23 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | 25 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) |
24 | ), | 26 | ), |
25 | 27 | ||
@@ -104,7 +106,7 @@ DECLARE_EVENT_CLASS(block_rq, | |||
104 | __field( sector_t, sector ) | 106 | __field( sector_t, sector ) |
105 | __field( unsigned int, nr_sector ) | 107 | __field( unsigned int, nr_sector ) |
106 | __field( unsigned int, bytes ) | 108 | __field( unsigned int, bytes ) |
107 | __array( char, rwbs, 6 ) | 109 | __array( char, rwbs, RWBS_LEN ) |
108 | __array( char, comm, TASK_COMM_LEN ) | 110 | __array( char, comm, TASK_COMM_LEN ) |
109 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | 111 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) |
110 | ), | 112 | ), |
@@ -183,7 +185,7 @@ TRACE_EVENT(block_bio_bounce, | |||
183 | __field( dev_t, dev ) | 185 | __field( dev_t, dev ) |
184 | __field( sector_t, sector ) | 186 | __field( sector_t, sector ) |
185 | __field( unsigned int, nr_sector ) | 187 | __field( unsigned int, nr_sector ) |
186 | __array( char, rwbs, 6 ) | 188 | __array( char, rwbs, RWBS_LEN ) |
187 | __array( char, comm, TASK_COMM_LEN ) | 189 | __array( char, comm, TASK_COMM_LEN ) |
188 | ), | 190 | ), |
189 | 191 | ||
@@ -222,7 +224,7 @@ TRACE_EVENT(block_bio_complete, | |||
222 | __field( sector_t, sector ) | 224 | __field( sector_t, sector ) |
223 | __field( unsigned, nr_sector ) | 225 | __field( unsigned, nr_sector ) |
224 | __field( int, error ) | 226 | __field( int, error ) |
225 | __array( char, rwbs, 6 ) | 227 | __array( char, rwbs, RWBS_LEN) |
226 | ), | 228 | ), |
227 | 229 | ||
228 | TP_fast_assign( | 230 | TP_fast_assign( |
@@ -249,7 +251,7 @@ DECLARE_EVENT_CLASS(block_bio, | |||
249 | __field( dev_t, dev ) | 251 | __field( dev_t, dev ) |
250 | __field( sector_t, sector ) | 252 | __field( sector_t, sector ) |
251 | __field( unsigned int, nr_sector ) | 253 | __field( unsigned int, nr_sector ) |
252 | __array( char, rwbs, 6 ) | 254 | __array( char, rwbs, RWBS_LEN ) |
253 | __array( char, comm, TASK_COMM_LEN ) | 255 | __array( char, comm, TASK_COMM_LEN ) |
254 | ), | 256 | ), |
255 | 257 | ||
@@ -321,7 +323,7 @@ DECLARE_EVENT_CLASS(block_get_rq, | |||
321 | __field( dev_t, dev ) | 323 | __field( dev_t, dev ) |
322 | __field( sector_t, sector ) | 324 | __field( sector_t, sector ) |
323 | __field( unsigned int, nr_sector ) | 325 | __field( unsigned int, nr_sector ) |
324 | __array( char, rwbs, 6 ) | 326 | __array( char, rwbs, RWBS_LEN ) |
325 | __array( char, comm, TASK_COMM_LEN ) | 327 | __array( char, comm, TASK_COMM_LEN ) |
326 | ), | 328 | ), |
327 | 329 | ||
@@ -456,7 +458,7 @@ TRACE_EVENT(block_split, | |||
456 | __field( dev_t, dev ) | 458 | __field( dev_t, dev ) |
457 | __field( sector_t, sector ) | 459 | __field( sector_t, sector ) |
458 | __field( sector_t, new_sector ) | 460 | __field( sector_t, new_sector ) |
459 | __array( char, rwbs, 6 ) | 461 | __array( char, rwbs, RWBS_LEN ) |
460 | __array( char, comm, TASK_COMM_LEN ) | 462 | __array( char, comm, TASK_COMM_LEN ) |
461 | ), | 463 | ), |
462 | 464 | ||
@@ -498,7 +500,7 @@ TRACE_EVENT(block_bio_remap, | |||
498 | __field( unsigned int, nr_sector ) | 500 | __field( unsigned int, nr_sector ) |
499 | __field( dev_t, old_dev ) | 501 | __field( dev_t, old_dev ) |
500 | __field( sector_t, old_sector ) | 502 | __field( sector_t, old_sector ) |
501 | __array( char, rwbs, 6 ) | 503 | __array( char, rwbs, RWBS_LEN) |
502 | ), | 504 | ), |
503 | 505 | ||
504 | TP_fast_assign( | 506 | TP_fast_assign( |
@@ -542,7 +544,7 @@ TRACE_EVENT(block_rq_remap, | |||
542 | __field( unsigned int, nr_sector ) | 544 | __field( unsigned int, nr_sector ) |
543 | __field( dev_t, old_dev ) | 545 | __field( dev_t, old_dev ) |
544 | __field( sector_t, old_sector ) | 546 | __field( sector_t, old_sector ) |
545 | __array( char, rwbs, 6 ) | 547 | __array( char, rwbs, RWBS_LEN) |
546 | ), | 548 | ), |
547 | 549 | ||
548 | TP_fast_assign( | 550 | TP_fast_assign( |