diff options
author | Tejun Heo <tj@kernel.org> | 2013-01-11 16:06:34 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-01-14 09:00:36 -0500 |
commit | 8c1cf6bb02fda79b0a4b9bd121f6be6d4ce7a15a (patch) | |
tree | e10008c7fb3c7b8cf832712dd6e7b55f149a49e6 /include/trace | |
parent | 3a366e614d0837d9fc23f78cdb1a1186ebc3387f (diff) |
block: add @req to bio_{front|back}_merge tracepoints
bio_{front|back}_merge tracepoints report a bio merging into an
existing request but didn't specify which request the bio is being
merged into. Add @req to it. This makes it impossible to share the
event template with block_bio_queue - split it out.
@req isn't used or exported to userland at this point and there is no
userland visible behavior change. Later changes will make use of the
extra parameter.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/block.h | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 8a168db9a645..b408f518a819 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -241,11 +241,11 @@ TRACE_EVENT(block_bio_complete, | |||
241 | __entry->nr_sector, __entry->error) | 241 | __entry->nr_sector, __entry->error) |
242 | ); | 242 | ); |
243 | 243 | ||
244 | DECLARE_EVENT_CLASS(block_bio, | 244 | DECLARE_EVENT_CLASS(block_bio_merge, |
245 | 245 | ||
246 | TP_PROTO(struct request_queue *q, struct bio *bio), | 246 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), |
247 | 247 | ||
248 | TP_ARGS(q, bio), | 248 | TP_ARGS(q, rq, bio), |
249 | 249 | ||
250 | TP_STRUCT__entry( | 250 | TP_STRUCT__entry( |
251 | __field( dev_t, dev ) | 251 | __field( dev_t, dev ) |
@@ -272,31 +272,33 @@ DECLARE_EVENT_CLASS(block_bio, | |||
272 | /** | 272 | /** |
273 | * block_bio_backmerge - merging block operation to the end of an existing operation | 273 | * block_bio_backmerge - merging block operation to the end of an existing operation |
274 | * @q: queue holding operation | 274 | * @q: queue holding operation |
275 | * @rq: request bio is being merged into | ||
275 | * @bio: new block operation to merge | 276 | * @bio: new block operation to merge |
276 | * | 277 | * |
277 | * Merging block request @bio to the end of an existing block request | 278 | * Merging block request @bio to the end of an existing block request |
278 | * in queue @q. | 279 | * in queue @q. |
279 | */ | 280 | */ |
280 | DEFINE_EVENT(block_bio, block_bio_backmerge, | 281 | DEFINE_EVENT(block_bio_merge, block_bio_backmerge, |
281 | 282 | ||
282 | TP_PROTO(struct request_queue *q, struct bio *bio), | 283 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), |
283 | 284 | ||
284 | TP_ARGS(q, bio) | 285 | TP_ARGS(q, rq, bio) |
285 | ); | 286 | ); |
286 | 287 | ||
287 | /** | 288 | /** |
288 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation | 289 | * block_bio_frontmerge - merging block operation to the beginning of an existing operation |
289 | * @q: queue holding operation | 290 | * @q: queue holding operation |
291 | * @rq: request bio is being merged into | ||
290 | * @bio: new block operation to merge | 292 | * @bio: new block operation to merge |
291 | * | 293 | * |
292 | * Merging block IO operation @bio to the beginning of an existing block | 294 | * Merging block IO operation @bio to the beginning of an existing block |
293 | * operation in queue @q. | 295 | * operation in queue @q. |
294 | */ | 296 | */ |
295 | DEFINE_EVENT(block_bio, block_bio_frontmerge, | 297 | DEFINE_EVENT(block_bio_merge, block_bio_frontmerge, |
296 | 298 | ||
297 | TP_PROTO(struct request_queue *q, struct bio *bio), | 299 | TP_PROTO(struct request_queue *q, struct request *rq, struct bio *bio), |
298 | 300 | ||
299 | TP_ARGS(q, bio) | 301 | TP_ARGS(q, rq, bio) |
300 | ); | 302 | ); |
301 | 303 | ||
302 | /** | 304 | /** |
@@ -306,11 +308,32 @@ DEFINE_EVENT(block_bio, block_bio_frontmerge, | |||
306 | * | 308 | * |
307 | * About to place the block IO operation @bio into queue @q. | 309 | * About to place the block IO operation @bio into queue @q. |
308 | */ | 310 | */ |
309 | DEFINE_EVENT(block_bio, block_bio_queue, | 311 | TRACE_EVENT(block_bio_queue, |
310 | 312 | ||
311 | TP_PROTO(struct request_queue *q, struct bio *bio), | 313 | TP_PROTO(struct request_queue *q, struct bio *bio), |
312 | 314 | ||
313 | TP_ARGS(q, bio) | 315 | TP_ARGS(q, bio), |
316 | |||
317 | TP_STRUCT__entry( | ||
318 | __field( dev_t, dev ) | ||
319 | __field( sector_t, sector ) | ||
320 | __field( unsigned int, nr_sector ) | ||
321 | __array( char, rwbs, RWBS_LEN ) | ||
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->nr_sector = bio->bi_size >> 9; | ||
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 + %u [%s]", | ||
334 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
335 | (unsigned long long)__entry->sector, | ||
336 | __entry->nr_sector, __entry->comm) | ||
314 | ); | 337 | ); |
315 | 338 | ||
316 | DECLARE_EVENT_CLASS(block_get_rq, | 339 | DECLARE_EVENT_CLASS(block_get_rq, |