Li Zefan | d0b6e04 | 2009-07-13 10:33:21 +0800 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM block |
| 3 | |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 4 | #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_BLOCK_H |
| 6 | |
| 7 | #include <linux/blktrace_api.h> |
| 8 | #include <linux/blkdev.h> |
| 9 | #include <linux/tracepoint.h> |
| 10 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 11 | DECLARE_EVENT_CLASS(block_rq_with_error, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 12 | |
| 13 | TP_PROTO(struct request_queue *q, struct request *rq), |
| 14 | |
| 15 | TP_ARGS(q, rq), |
| 16 | |
| 17 | TP_STRUCT__entry( |
| 18 | __field( dev_t, dev ) |
| 19 | __field( sector_t, sector ) |
| 20 | __field( unsigned int, nr_sector ) |
| 21 | __field( int, errors ) |
| 22 | __array( char, rwbs, 6 ) |
| 23 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) |
| 24 | ), |
| 25 | |
| 26 | TP_fast_assign( |
| 27 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
Linus Torvalds | c905959 | 2009-06-11 10:52:27 -0700 | [diff] [blame] | 28 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); |
| 29 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 30 | __entry->errors = rq->errors; |
| 31 | |
| 32 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
| 33 | blk_dump_cmd(__get_str(cmd), rq); |
| 34 | ), |
| 35 | |
| 36 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", |
| 37 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 38 | __entry->rwbs, __get_str(cmd), |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 39 | (unsigned long long)__entry->sector, |
| 40 | __entry->nr_sector, __entry->errors) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 41 | ); |
| 42 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 43 | DEFINE_EVENT(block_rq_with_error, block_rq_abort, |
| 44 | |
| 45 | TP_PROTO(struct request_queue *q, struct request *rq), |
| 46 | |
| 47 | TP_ARGS(q, rq) |
| 48 | ); |
| 49 | |
| 50 | DEFINE_EVENT(block_rq_with_error, block_rq_requeue, |
| 51 | |
| 52 | TP_PROTO(struct request_queue *q, struct request *rq), |
| 53 | |
| 54 | TP_ARGS(q, rq) |
| 55 | ); |
| 56 | |
| 57 | DEFINE_EVENT(block_rq_with_error, block_rq_complete, |
| 58 | |
| 59 | TP_PROTO(struct request_queue *q, struct request *rq), |
| 60 | |
| 61 | TP_ARGS(q, rq) |
| 62 | ); |
| 63 | |
| 64 | DECLARE_EVENT_CLASS(block_rq, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 65 | |
| 66 | TP_PROTO(struct request_queue *q, struct request *rq), |
| 67 | |
| 68 | TP_ARGS(q, rq), |
| 69 | |
| 70 | TP_STRUCT__entry( |
| 71 | __field( dev_t, dev ) |
| 72 | __field( sector_t, sector ) |
| 73 | __field( unsigned int, nr_sector ) |
| 74 | __field( unsigned int, bytes ) |
| 75 | __array( char, rwbs, 6 ) |
| 76 | __array( char, comm, TASK_COMM_LEN ) |
| 77 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) |
| 78 | ), |
| 79 | |
| 80 | TP_fast_assign( |
| 81 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; |
Linus Torvalds | c905959 | 2009-06-11 10:52:27 -0700 | [diff] [blame] | 82 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); |
| 83 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); |
| 84 | __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 85 | |
| 86 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
| 87 | blk_dump_cmd(__get_str(cmd), rq); |
| 88 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
| 89 | ), |
| 90 | |
| 91 | TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", |
| 92 | MAJOR(__entry->dev), MINOR(__entry->dev), |
| 93 | __entry->rwbs, __entry->bytes, __get_str(cmd), |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 94 | (unsigned long long)__entry->sector, |
| 95 | __entry->nr_sector, __entry->comm) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 96 | ); |
| 97 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 98 | DEFINE_EVENT(block_rq, block_rq_insert, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 99 | |
| 100 | TP_PROTO(struct request_queue *q, struct request *rq), |
| 101 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 102 | TP_ARGS(q, rq) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 103 | ); |
| 104 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 105 | DEFINE_EVENT(block_rq, block_rq_issue, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 106 | |
| 107 | TP_PROTO(struct request_queue *q, struct request *rq), |
| 108 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 109 | TP_ARGS(q, rq) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 110 | ); |
Carsten Emde | fe63b94 | 2009-09-12 00:05:37 +0200 | [diff] [blame] | 111 | |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 112 | TRACE_EVENT(block_bio_bounce, |
| 113 | |
| 114 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| 115 | |
| 116 | TP_ARGS(q, bio), |
| 117 | |
| 118 | TP_STRUCT__entry( |
| 119 | __field( dev_t, dev ) |
| 120 | __field( sector_t, sector ) |
| 121 | __field( unsigned int, nr_sector ) |
| 122 | __array( char, rwbs, 6 ) |
| 123 | __array( char, comm, TASK_COMM_LEN ) |
| 124 | ), |
| 125 | |
| 126 | TP_fast_assign( |
Carsten Emde | fe63b94 | 2009-09-12 00:05:37 +0200 | [diff] [blame] | 127 | __entry->dev = bio->bi_bdev ? |
| 128 | bio->bi_bdev->bd_dev : 0; |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 129 | __entry->sector = bio->bi_sector; |
| 130 | __entry->nr_sector = bio->bi_size >> 9; |
| 131 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); |
| 132 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
| 133 | ), |
| 134 | |
| 135 | TP_printk("%d,%d %s %llu + %u [%s]", |
| 136 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 137 | (unsigned long long)__entry->sector, |
| 138 | __entry->nr_sector, __entry->comm) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 139 | ); |
| 140 | |
| 141 | TRACE_EVENT(block_bio_complete, |
| 142 | |
| 143 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| 144 | |
| 145 | TP_ARGS(q, bio), |
| 146 | |
| 147 | TP_STRUCT__entry( |
| 148 | __field( dev_t, dev ) |
| 149 | __field( sector_t, sector ) |
| 150 | __field( unsigned, nr_sector ) |
| 151 | __field( int, error ) |
| 152 | __array( char, rwbs, 6 ) |
| 153 | ), |
| 154 | |
| 155 | TP_fast_assign( |
| 156 | __entry->dev = bio->bi_bdev->bd_dev; |
| 157 | __entry->sector = bio->bi_sector; |
| 158 | __entry->nr_sector = bio->bi_size >> 9; |
| 159 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); |
| 160 | ), |
| 161 | |
| 162 | TP_printk("%d,%d %s %llu + %u [%d]", |
| 163 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 164 | (unsigned long long)__entry->sector, |
| 165 | __entry->nr_sector, __entry->error) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 166 | ); |
| 167 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 168 | DECLARE_EVENT_CLASS(block_bio, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 169 | |
| 170 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| 171 | |
| 172 | TP_ARGS(q, bio), |
| 173 | |
| 174 | TP_STRUCT__entry( |
| 175 | __field( dev_t, dev ) |
| 176 | __field( sector_t, sector ) |
| 177 | __field( unsigned int, nr_sector ) |
| 178 | __array( char, rwbs, 6 ) |
| 179 | __array( char, comm, TASK_COMM_LEN ) |
| 180 | ), |
| 181 | |
| 182 | TP_fast_assign( |
| 183 | __entry->dev = bio->bi_bdev->bd_dev; |
| 184 | __entry->sector = bio->bi_sector; |
| 185 | __entry->nr_sector = bio->bi_size >> 9; |
| 186 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); |
| 187 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
| 188 | ), |
| 189 | |
| 190 | TP_printk("%d,%d %s %llu + %u [%s]", |
| 191 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 192 | (unsigned long long)__entry->sector, |
| 193 | __entry->nr_sector, __entry->comm) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 194 | ); |
| 195 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 196 | DEFINE_EVENT(block_bio, block_bio_backmerge, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 197 | |
| 198 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| 199 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 200 | TP_ARGS(q, bio) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 201 | ); |
| 202 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 203 | DEFINE_EVENT(block_bio, block_bio_frontmerge, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 204 | |
| 205 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| 206 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 207 | TP_ARGS(q, bio) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 208 | ); |
| 209 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 210 | DEFINE_EVENT(block_bio, block_bio_queue, |
| 211 | |
| 212 | TP_PROTO(struct request_queue *q, struct bio *bio), |
| 213 | |
| 214 | TP_ARGS(q, bio) |
| 215 | ); |
| 216 | |
| 217 | DECLARE_EVENT_CLASS(block_get_rq, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 218 | |
| 219 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
| 220 | |
| 221 | TP_ARGS(q, bio, rw), |
| 222 | |
| 223 | TP_STRUCT__entry( |
| 224 | __field( dev_t, dev ) |
| 225 | __field( sector_t, sector ) |
| 226 | __field( unsigned int, nr_sector ) |
| 227 | __array( char, rwbs, 6 ) |
| 228 | __array( char, comm, TASK_COMM_LEN ) |
| 229 | ), |
| 230 | |
| 231 | TP_fast_assign( |
| 232 | __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; |
| 233 | __entry->sector = bio ? bio->bi_sector : 0; |
| 234 | __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; |
| 235 | blk_fill_rwbs(__entry->rwbs, |
| 236 | bio ? bio->bi_rw : 0, __entry->nr_sector); |
| 237 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
| 238 | ), |
| 239 | |
| 240 | TP_printk("%d,%d %s %llu + %u [%s]", |
| 241 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 242 | (unsigned long long)__entry->sector, |
| 243 | __entry->nr_sector, __entry->comm) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 244 | ); |
| 245 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 246 | DEFINE_EVENT(block_get_rq, block_getrq, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 247 | |
| 248 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
| 249 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 250 | TP_ARGS(q, bio, rw) |
| 251 | ); |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 252 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 253 | DEFINE_EVENT(block_get_rq, block_sleeprq, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 254 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 255 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 256 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 257 | TP_ARGS(q, bio, rw) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 258 | ); |
| 259 | |
| 260 | TRACE_EVENT(block_plug, |
| 261 | |
| 262 | TP_PROTO(struct request_queue *q), |
| 263 | |
| 264 | TP_ARGS(q), |
| 265 | |
| 266 | TP_STRUCT__entry( |
| 267 | __array( char, comm, TASK_COMM_LEN ) |
| 268 | ), |
| 269 | |
| 270 | TP_fast_assign( |
| 271 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
| 272 | ), |
| 273 | |
| 274 | TP_printk("[%s]", __entry->comm) |
| 275 | ); |
| 276 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 277 | DECLARE_EVENT_CLASS(block_unplug, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 278 | |
| 279 | TP_PROTO(struct request_queue *q), |
| 280 | |
| 281 | TP_ARGS(q), |
| 282 | |
| 283 | TP_STRUCT__entry( |
| 284 | __field( int, nr_rq ) |
| 285 | __array( char, comm, TASK_COMM_LEN ) |
| 286 | ), |
| 287 | |
| 288 | TP_fast_assign( |
| 289 | __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; |
| 290 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
| 291 | ), |
| 292 | |
| 293 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) |
| 294 | ); |
| 295 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 296 | DEFINE_EVENT(block_unplug, block_unplug_timer, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 297 | |
| 298 | TP_PROTO(struct request_queue *q), |
| 299 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 300 | TP_ARGS(q) |
| 301 | ); |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 302 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 303 | DEFINE_EVENT(block_unplug, block_unplug_io, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 304 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 305 | TP_PROTO(struct request_queue *q), |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 306 | |
Li Zefan | 77ca1e0 | 2009-11-26 15:06:14 +0800 | [diff] [blame^] | 307 | TP_ARGS(q) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 308 | ); |
| 309 | |
| 310 | TRACE_EVENT(block_split, |
| 311 | |
| 312 | TP_PROTO(struct request_queue *q, struct bio *bio, |
| 313 | unsigned int new_sector), |
| 314 | |
| 315 | TP_ARGS(q, bio, new_sector), |
| 316 | |
| 317 | TP_STRUCT__entry( |
| 318 | __field( dev_t, dev ) |
| 319 | __field( sector_t, sector ) |
| 320 | __field( sector_t, new_sector ) |
| 321 | __array( char, rwbs, 6 ) |
| 322 | __array( char, comm, TASK_COMM_LEN ) |
| 323 | ), |
| 324 | |
| 325 | TP_fast_assign( |
| 326 | __entry->dev = bio->bi_bdev->bd_dev; |
| 327 | __entry->sector = bio->bi_sector; |
| 328 | __entry->new_sector = new_sector; |
| 329 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); |
| 330 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); |
| 331 | ), |
| 332 | |
| 333 | TP_printk("%d,%d %s %llu / %llu [%s]", |
| 334 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 335 | (unsigned long long)__entry->sector, |
| 336 | (unsigned long long)__entry->new_sector, |
| 337 | __entry->comm) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 338 | ); |
| 339 | |
| 340 | TRACE_EVENT(block_remap, |
| 341 | |
| 342 | TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, |
| 343 | sector_t from), |
| 344 | |
| 345 | TP_ARGS(q, bio, dev, from), |
| 346 | |
| 347 | TP_STRUCT__entry( |
| 348 | __field( dev_t, dev ) |
| 349 | __field( sector_t, sector ) |
| 350 | __field( unsigned int, nr_sector ) |
| 351 | __field( dev_t, old_dev ) |
| 352 | __field( sector_t, old_sector ) |
| 353 | __array( char, rwbs, 6 ) |
| 354 | ), |
| 355 | |
| 356 | TP_fast_assign( |
| 357 | __entry->dev = bio->bi_bdev->bd_dev; |
| 358 | __entry->sector = bio->bi_sector; |
| 359 | __entry->nr_sector = bio->bi_size >> 9; |
| 360 | __entry->old_dev = dev; |
| 361 | __entry->old_sector = from; |
| 362 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); |
| 363 | ), |
| 364 | |
| 365 | TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", |
| 366 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 367 | (unsigned long long)__entry->sector, |
| 368 | __entry->nr_sector, |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 369 | MAJOR(__entry->old_dev), MINOR(__entry->old_dev), |
Steven Rostedt | 6556d1d | 2009-06-09 14:04:26 -0400 | [diff] [blame] | 370 | (unsigned long long)__entry->old_sector) |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 371 | ); |
| 372 | |
Jun'ichi Nomura | b0da3f0 | 2009-10-01 21:16:13 +0200 | [diff] [blame] | 373 | TRACE_EVENT(block_rq_remap, |
| 374 | |
| 375 | TP_PROTO(struct request_queue *q, struct request *rq, dev_t dev, |
| 376 | sector_t from), |
| 377 | |
| 378 | TP_ARGS(q, rq, dev, from), |
| 379 | |
| 380 | TP_STRUCT__entry( |
| 381 | __field( dev_t, dev ) |
| 382 | __field( sector_t, sector ) |
| 383 | __field( unsigned int, nr_sector ) |
| 384 | __field( dev_t, old_dev ) |
| 385 | __field( sector_t, old_sector ) |
| 386 | __array( char, rwbs, 6 ) |
| 387 | ), |
| 388 | |
| 389 | TP_fast_assign( |
| 390 | __entry->dev = disk_devt(rq->rq_disk); |
| 391 | __entry->sector = blk_rq_pos(rq); |
| 392 | __entry->nr_sector = blk_rq_sectors(rq); |
| 393 | __entry->old_dev = dev; |
| 394 | __entry->old_sector = from; |
| 395 | blk_fill_rwbs_rq(__entry->rwbs, rq); |
| 396 | ), |
| 397 | |
| 398 | TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", |
| 399 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, |
| 400 | (unsigned long long)__entry->sector, |
| 401 | __entry->nr_sector, |
| 402 | MAJOR(__entry->old_dev), MINOR(__entry->old_dev), |
| 403 | (unsigned long long)__entry->old_sector) |
| 404 | ); |
| 405 | |
Li Zefan | 5578213 | 2009-06-09 13:43:05 +0800 | [diff] [blame] | 406 | #endif /* _TRACE_BLOCK_H */ |
| 407 | |
| 408 | /* This part must be outside protection */ |
| 409 | #include <trace/define_trace.h> |
| 410 | |