1*d0b6e04aSLi Zefan #undef TRACE_SYSTEM 2*d0b6e04aSLi Zefan #define TRACE_SYSTEM block 3*d0b6e04aSLi Zefan 455782138SLi Zefan #if !defined(_TRACE_BLOCK_H) || defined(TRACE_HEADER_MULTI_READ) 555782138SLi Zefan #define _TRACE_BLOCK_H 655782138SLi Zefan 755782138SLi Zefan #include <linux/blktrace_api.h> 855782138SLi Zefan #include <linux/blkdev.h> 955782138SLi Zefan #include <linux/tracepoint.h> 1055782138SLi Zefan 1155782138SLi Zefan TRACE_EVENT(block_rq_abort, 1255782138SLi Zefan 1355782138SLi Zefan TP_PROTO(struct request_queue *q, struct request *rq), 1455782138SLi Zefan 1555782138SLi Zefan TP_ARGS(q, rq), 1655782138SLi Zefan 1755782138SLi Zefan TP_STRUCT__entry( 1855782138SLi Zefan __field( dev_t, dev ) 1955782138SLi Zefan __field( sector_t, sector ) 2055782138SLi Zefan __field( unsigned int, nr_sector ) 2155782138SLi Zefan __field( int, errors ) 2255782138SLi Zefan __array( char, rwbs, 6 ) 2355782138SLi Zefan __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 2455782138SLi Zefan ), 2555782138SLi Zefan 2655782138SLi Zefan TP_fast_assign( 2755782138SLi Zefan __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; 28c9059598SLinus Torvalds __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); 29c9059598SLinus Torvalds __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); 3055782138SLi Zefan __entry->errors = rq->errors; 3155782138SLi Zefan 3255782138SLi Zefan blk_fill_rwbs_rq(__entry->rwbs, rq); 3355782138SLi Zefan blk_dump_cmd(__get_str(cmd), rq); 3455782138SLi Zefan ), 3555782138SLi Zefan 3655782138SLi Zefan TP_printk("%d,%d %s (%s) %llu + %u [%d]", 3755782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), 3855782138SLi Zefan __entry->rwbs, __get_str(cmd), 396556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 406556d1dfSSteven Rostedt __entry->nr_sector, __entry->errors) 4155782138SLi Zefan ); 4255782138SLi Zefan 4355782138SLi Zefan TRACE_EVENT(block_rq_insert, 4455782138SLi Zefan 4555782138SLi Zefan TP_PROTO(struct request_queue *q, struct request *rq), 4655782138SLi Zefan 4755782138SLi Zefan TP_ARGS(q, rq), 4855782138SLi Zefan 4955782138SLi Zefan TP_STRUCT__entry( 5055782138SLi Zefan __field( dev_t, dev ) 5155782138SLi Zefan __field( sector_t, sector ) 5255782138SLi Zefan __field( unsigned int, nr_sector ) 5355782138SLi Zefan __field( unsigned int, bytes ) 5455782138SLi Zefan __array( char, rwbs, 6 ) 5555782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 5655782138SLi Zefan __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 5755782138SLi Zefan ), 5855782138SLi Zefan 5955782138SLi Zefan TP_fast_assign( 6055782138SLi Zefan __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; 61c9059598SLinus Torvalds __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); 62c9059598SLinus Torvalds __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); 63c9059598SLinus Torvalds __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; 6455782138SLi Zefan 6555782138SLi Zefan blk_fill_rwbs_rq(__entry->rwbs, rq); 6655782138SLi Zefan blk_dump_cmd(__get_str(cmd), rq); 6755782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 6855782138SLi Zefan ), 6955782138SLi Zefan 7055782138SLi Zefan TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", 7155782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), 7255782138SLi Zefan __entry->rwbs, __entry->bytes, __get_str(cmd), 736556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 746556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 7555782138SLi Zefan ); 7655782138SLi Zefan 7755782138SLi Zefan TRACE_EVENT(block_rq_issue, 7855782138SLi Zefan 7955782138SLi Zefan TP_PROTO(struct request_queue *q, struct request *rq), 8055782138SLi Zefan 8155782138SLi Zefan TP_ARGS(q, rq), 8255782138SLi Zefan 8355782138SLi Zefan TP_STRUCT__entry( 8455782138SLi Zefan __field( dev_t, dev ) 8555782138SLi Zefan __field( sector_t, sector ) 8655782138SLi Zefan __field( unsigned int, nr_sector ) 8755782138SLi Zefan __field( unsigned int, bytes ) 8855782138SLi Zefan __array( char, rwbs, 6 ) 8955782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 9055782138SLi Zefan __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 9155782138SLi Zefan ), 9255782138SLi Zefan 9355782138SLi Zefan TP_fast_assign( 9455782138SLi Zefan __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; 95c9059598SLinus Torvalds __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); 96c9059598SLinus Torvalds __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); 97c9059598SLinus Torvalds __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; 9855782138SLi Zefan 9955782138SLi Zefan blk_fill_rwbs_rq(__entry->rwbs, rq); 10055782138SLi Zefan blk_dump_cmd(__get_str(cmd), rq); 10155782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 10255782138SLi Zefan ), 10355782138SLi Zefan 10455782138SLi Zefan TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", 10555782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), 10655782138SLi Zefan __entry->rwbs, __entry->bytes, __get_str(cmd), 1076556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 1086556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 10955782138SLi Zefan ); 11055782138SLi Zefan 11155782138SLi Zefan TRACE_EVENT(block_rq_requeue, 11255782138SLi Zefan 11355782138SLi Zefan TP_PROTO(struct request_queue *q, struct request *rq), 11455782138SLi Zefan 11555782138SLi Zefan TP_ARGS(q, rq), 11655782138SLi Zefan 11755782138SLi Zefan TP_STRUCT__entry( 11855782138SLi Zefan __field( dev_t, dev ) 11955782138SLi Zefan __field( sector_t, sector ) 12055782138SLi Zefan __field( unsigned int, nr_sector ) 12155782138SLi Zefan __field( int, errors ) 12255782138SLi Zefan __array( char, rwbs, 6 ) 12355782138SLi Zefan __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 12455782138SLi Zefan ), 12555782138SLi Zefan 12655782138SLi Zefan TP_fast_assign( 12755782138SLi Zefan __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; 128c9059598SLinus Torvalds __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); 129c9059598SLinus Torvalds __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); 13055782138SLi Zefan __entry->errors = rq->errors; 13155782138SLi Zefan 13255782138SLi Zefan blk_fill_rwbs_rq(__entry->rwbs, rq); 13355782138SLi Zefan blk_dump_cmd(__get_str(cmd), rq); 13455782138SLi Zefan ), 13555782138SLi Zefan 13655782138SLi Zefan TP_printk("%d,%d %s (%s) %llu + %u [%d]", 13755782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), 13855782138SLi Zefan __entry->rwbs, __get_str(cmd), 1396556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 1406556d1dfSSteven Rostedt __entry->nr_sector, __entry->errors) 14155782138SLi Zefan ); 14255782138SLi Zefan 14355782138SLi Zefan TRACE_EVENT(block_rq_complete, 14455782138SLi Zefan 14555782138SLi Zefan TP_PROTO(struct request_queue *q, struct request *rq), 14655782138SLi Zefan 14755782138SLi Zefan TP_ARGS(q, rq), 14855782138SLi Zefan 14955782138SLi Zefan TP_STRUCT__entry( 15055782138SLi Zefan __field( dev_t, dev ) 15155782138SLi Zefan __field( sector_t, sector ) 15255782138SLi Zefan __field( unsigned int, nr_sector ) 15355782138SLi Zefan __field( int, errors ) 15455782138SLi Zefan __array( char, rwbs, 6 ) 15555782138SLi Zefan __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 15655782138SLi Zefan ), 15755782138SLi Zefan 15855782138SLi Zefan TP_fast_assign( 15955782138SLi Zefan __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; 160c9059598SLinus Torvalds __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); 161c9059598SLinus Torvalds __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); 16255782138SLi Zefan __entry->errors = rq->errors; 16355782138SLi Zefan 16455782138SLi Zefan blk_fill_rwbs_rq(__entry->rwbs, rq); 16555782138SLi Zefan blk_dump_cmd(__get_str(cmd), rq); 16655782138SLi Zefan ), 16755782138SLi Zefan 16855782138SLi Zefan TP_printk("%d,%d %s (%s) %llu + %u [%d]", 16955782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), 17055782138SLi Zefan __entry->rwbs, __get_str(cmd), 1716556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 1726556d1dfSSteven Rostedt __entry->nr_sector, __entry->errors) 17355782138SLi Zefan ); 17455782138SLi Zefan TRACE_EVENT(block_bio_bounce, 17555782138SLi Zefan 17655782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio), 17755782138SLi Zefan 17855782138SLi Zefan TP_ARGS(q, bio), 17955782138SLi Zefan 18055782138SLi Zefan TP_STRUCT__entry( 18155782138SLi Zefan __field( dev_t, dev ) 18255782138SLi Zefan __field( sector_t, sector ) 18355782138SLi Zefan __field( unsigned int, nr_sector ) 18455782138SLi Zefan __array( char, rwbs, 6 ) 18555782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 18655782138SLi Zefan ), 18755782138SLi Zefan 18855782138SLi Zefan TP_fast_assign( 18955782138SLi Zefan __entry->dev = bio->bi_bdev->bd_dev; 19055782138SLi Zefan __entry->sector = bio->bi_sector; 19155782138SLi Zefan __entry->nr_sector = bio->bi_size >> 9; 19255782138SLi Zefan blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 19355782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 19455782138SLi Zefan ), 19555782138SLi Zefan 19655782138SLi Zefan TP_printk("%d,%d %s %llu + %u [%s]", 19755782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 1986556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 1996556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 20055782138SLi Zefan ); 20155782138SLi Zefan 20255782138SLi Zefan TRACE_EVENT(block_bio_complete, 20355782138SLi Zefan 20455782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio), 20555782138SLi Zefan 20655782138SLi Zefan TP_ARGS(q, bio), 20755782138SLi Zefan 20855782138SLi Zefan TP_STRUCT__entry( 20955782138SLi Zefan __field( dev_t, dev ) 21055782138SLi Zefan __field( sector_t, sector ) 21155782138SLi Zefan __field( unsigned, nr_sector ) 21255782138SLi Zefan __field( int, error ) 21355782138SLi Zefan __array( char, rwbs, 6 ) 21455782138SLi Zefan ), 21555782138SLi Zefan 21655782138SLi Zefan TP_fast_assign( 21755782138SLi Zefan __entry->dev = bio->bi_bdev->bd_dev; 21855782138SLi Zefan __entry->sector = bio->bi_sector; 21955782138SLi Zefan __entry->nr_sector = bio->bi_size >> 9; 22055782138SLi Zefan blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 22155782138SLi Zefan ), 22255782138SLi Zefan 22355782138SLi Zefan TP_printk("%d,%d %s %llu + %u [%d]", 22455782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 2256556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 2266556d1dfSSteven Rostedt __entry->nr_sector, __entry->error) 22755782138SLi Zefan ); 22855782138SLi Zefan 22955782138SLi Zefan TRACE_EVENT(block_bio_backmerge, 23055782138SLi Zefan 23155782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio), 23255782138SLi Zefan 23355782138SLi Zefan TP_ARGS(q, bio), 23455782138SLi Zefan 23555782138SLi Zefan TP_STRUCT__entry( 23655782138SLi Zefan __field( dev_t, dev ) 23755782138SLi Zefan __field( sector_t, sector ) 23855782138SLi Zefan __field( unsigned int, nr_sector ) 23955782138SLi Zefan __array( char, rwbs, 6 ) 24055782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 24155782138SLi Zefan ), 24255782138SLi Zefan 24355782138SLi Zefan TP_fast_assign( 24455782138SLi Zefan __entry->dev = bio->bi_bdev->bd_dev; 24555782138SLi Zefan __entry->sector = bio->bi_sector; 24655782138SLi Zefan __entry->nr_sector = bio->bi_size >> 9; 24755782138SLi Zefan blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 24855782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 24955782138SLi Zefan ), 25055782138SLi Zefan 25155782138SLi Zefan TP_printk("%d,%d %s %llu + %u [%s]", 25255782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 2536556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 2546556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 25555782138SLi Zefan ); 25655782138SLi Zefan 25755782138SLi Zefan TRACE_EVENT(block_bio_frontmerge, 25855782138SLi Zefan 25955782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio), 26055782138SLi Zefan 26155782138SLi Zefan TP_ARGS(q, bio), 26255782138SLi Zefan 26355782138SLi Zefan TP_STRUCT__entry( 26455782138SLi Zefan __field( dev_t, dev ) 26555782138SLi Zefan __field( sector_t, sector ) 26655782138SLi Zefan __field( unsigned, nr_sector ) 26755782138SLi Zefan __array( char, rwbs, 6 ) 26855782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 26955782138SLi Zefan ), 27055782138SLi Zefan 27155782138SLi Zefan TP_fast_assign( 27255782138SLi Zefan __entry->dev = bio->bi_bdev->bd_dev; 27355782138SLi Zefan __entry->sector = bio->bi_sector; 27455782138SLi Zefan __entry->nr_sector = bio->bi_size >> 9; 27555782138SLi Zefan blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 27655782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 27755782138SLi Zefan ), 27855782138SLi Zefan 27955782138SLi Zefan TP_printk("%d,%d %s %llu + %u [%s]", 28055782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 2816556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 2826556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 28355782138SLi Zefan ); 28455782138SLi Zefan 28555782138SLi Zefan TRACE_EVENT(block_bio_queue, 28655782138SLi Zefan 28755782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio), 28855782138SLi Zefan 28955782138SLi Zefan TP_ARGS(q, bio), 29055782138SLi Zefan 29155782138SLi Zefan TP_STRUCT__entry( 29255782138SLi Zefan __field( dev_t, dev ) 29355782138SLi Zefan __field( sector_t, sector ) 29455782138SLi Zefan __field( unsigned int, nr_sector ) 29555782138SLi Zefan __array( char, rwbs, 6 ) 29655782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 29755782138SLi Zefan ), 29855782138SLi Zefan 29955782138SLi Zefan TP_fast_assign( 30055782138SLi Zefan __entry->dev = bio->bi_bdev->bd_dev; 30155782138SLi Zefan __entry->sector = bio->bi_sector; 30255782138SLi Zefan __entry->nr_sector = bio->bi_size >> 9; 30355782138SLi Zefan blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 30455782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 30555782138SLi Zefan ), 30655782138SLi Zefan 30755782138SLi Zefan TP_printk("%d,%d %s %llu + %u [%s]", 30855782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 3096556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 3106556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 31155782138SLi Zefan ); 31255782138SLi Zefan 31355782138SLi Zefan TRACE_EVENT(block_getrq, 31455782138SLi Zefan 31555782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio, int rw), 31655782138SLi Zefan 31755782138SLi Zefan TP_ARGS(q, bio, rw), 31855782138SLi Zefan 31955782138SLi Zefan TP_STRUCT__entry( 32055782138SLi Zefan __field( dev_t, dev ) 32155782138SLi Zefan __field( sector_t, sector ) 32255782138SLi Zefan __field( unsigned int, nr_sector ) 32355782138SLi Zefan __array( char, rwbs, 6 ) 32455782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 32555782138SLi Zefan ), 32655782138SLi Zefan 32755782138SLi Zefan TP_fast_assign( 32855782138SLi Zefan __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; 32955782138SLi Zefan __entry->sector = bio ? bio->bi_sector : 0; 33055782138SLi Zefan __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; 33155782138SLi Zefan blk_fill_rwbs(__entry->rwbs, 33255782138SLi Zefan bio ? bio->bi_rw : 0, __entry->nr_sector); 33355782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 33455782138SLi Zefan ), 33555782138SLi Zefan 33655782138SLi Zefan TP_printk("%d,%d %s %llu + %u [%s]", 33755782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 3386556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 3396556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 34055782138SLi Zefan ); 34155782138SLi Zefan 34255782138SLi Zefan TRACE_EVENT(block_sleeprq, 34355782138SLi Zefan 34455782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio, int rw), 34555782138SLi Zefan 34655782138SLi Zefan TP_ARGS(q, bio, rw), 34755782138SLi Zefan 34855782138SLi Zefan TP_STRUCT__entry( 34955782138SLi Zefan __field( dev_t, dev ) 35055782138SLi Zefan __field( sector_t, sector ) 35155782138SLi Zefan __field( unsigned int, nr_sector ) 35255782138SLi Zefan __array( char, rwbs, 6 ) 35355782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 35455782138SLi Zefan ), 35555782138SLi Zefan 35655782138SLi Zefan TP_fast_assign( 35755782138SLi Zefan __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; 35855782138SLi Zefan __entry->sector = bio ? bio->bi_sector : 0; 35955782138SLi Zefan __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; 36055782138SLi Zefan blk_fill_rwbs(__entry->rwbs, 36155782138SLi Zefan bio ? bio->bi_rw : 0, __entry->nr_sector); 36255782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 36355782138SLi Zefan ), 36455782138SLi Zefan 36555782138SLi Zefan TP_printk("%d,%d %s %llu + %u [%s]", 36655782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 3676556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 3686556d1dfSSteven Rostedt __entry->nr_sector, __entry->comm) 36955782138SLi Zefan ); 37055782138SLi Zefan 37155782138SLi Zefan TRACE_EVENT(block_plug, 37255782138SLi Zefan 37355782138SLi Zefan TP_PROTO(struct request_queue *q), 37455782138SLi Zefan 37555782138SLi Zefan TP_ARGS(q), 37655782138SLi Zefan 37755782138SLi Zefan TP_STRUCT__entry( 37855782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 37955782138SLi Zefan ), 38055782138SLi Zefan 38155782138SLi Zefan TP_fast_assign( 38255782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 38355782138SLi Zefan ), 38455782138SLi Zefan 38555782138SLi Zefan TP_printk("[%s]", __entry->comm) 38655782138SLi Zefan ); 38755782138SLi Zefan 38855782138SLi Zefan TRACE_EVENT(block_unplug_timer, 38955782138SLi Zefan 39055782138SLi Zefan TP_PROTO(struct request_queue *q), 39155782138SLi Zefan 39255782138SLi Zefan TP_ARGS(q), 39355782138SLi Zefan 39455782138SLi Zefan TP_STRUCT__entry( 39555782138SLi Zefan __field( int, nr_rq ) 39655782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 39755782138SLi Zefan ), 39855782138SLi Zefan 39955782138SLi Zefan TP_fast_assign( 40055782138SLi Zefan __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; 40155782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 40255782138SLi Zefan ), 40355782138SLi Zefan 40455782138SLi Zefan TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) 40555782138SLi Zefan ); 40655782138SLi Zefan 40755782138SLi Zefan TRACE_EVENT(block_unplug_io, 40855782138SLi Zefan 40955782138SLi Zefan TP_PROTO(struct request_queue *q), 41055782138SLi Zefan 41155782138SLi Zefan TP_ARGS(q), 41255782138SLi Zefan 41355782138SLi Zefan TP_STRUCT__entry( 41455782138SLi Zefan __field( int, nr_rq ) 41555782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 41655782138SLi Zefan ), 41755782138SLi Zefan 41855782138SLi Zefan TP_fast_assign( 41955782138SLi Zefan __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; 42055782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 42155782138SLi Zefan ), 42255782138SLi Zefan 42355782138SLi Zefan TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) 42455782138SLi Zefan ); 42555782138SLi Zefan 42655782138SLi Zefan TRACE_EVENT(block_split, 42755782138SLi Zefan 42855782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio, 42955782138SLi Zefan unsigned int new_sector), 43055782138SLi Zefan 43155782138SLi Zefan TP_ARGS(q, bio, new_sector), 43255782138SLi Zefan 43355782138SLi Zefan TP_STRUCT__entry( 43455782138SLi Zefan __field( dev_t, dev ) 43555782138SLi Zefan __field( sector_t, sector ) 43655782138SLi Zefan __field( sector_t, new_sector ) 43755782138SLi Zefan __array( char, rwbs, 6 ) 43855782138SLi Zefan __array( char, comm, TASK_COMM_LEN ) 43955782138SLi Zefan ), 44055782138SLi Zefan 44155782138SLi Zefan TP_fast_assign( 44255782138SLi Zefan __entry->dev = bio->bi_bdev->bd_dev; 44355782138SLi Zefan __entry->sector = bio->bi_sector; 44455782138SLi Zefan __entry->new_sector = new_sector; 44555782138SLi Zefan blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 44655782138SLi Zefan memcpy(__entry->comm, current->comm, TASK_COMM_LEN); 44755782138SLi Zefan ), 44855782138SLi Zefan 44955782138SLi Zefan TP_printk("%d,%d %s %llu / %llu [%s]", 45055782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 4516556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 4526556d1dfSSteven Rostedt (unsigned long long)__entry->new_sector, 4536556d1dfSSteven Rostedt __entry->comm) 45455782138SLi Zefan ); 45555782138SLi Zefan 45655782138SLi Zefan TRACE_EVENT(block_remap, 45755782138SLi Zefan 45855782138SLi Zefan TP_PROTO(struct request_queue *q, struct bio *bio, dev_t dev, 45955782138SLi Zefan sector_t from), 46055782138SLi Zefan 46155782138SLi Zefan TP_ARGS(q, bio, dev, from), 46255782138SLi Zefan 46355782138SLi Zefan TP_STRUCT__entry( 46455782138SLi Zefan __field( dev_t, dev ) 46555782138SLi Zefan __field( sector_t, sector ) 46655782138SLi Zefan __field( unsigned int, nr_sector ) 46755782138SLi Zefan __field( dev_t, old_dev ) 46855782138SLi Zefan __field( sector_t, old_sector ) 46955782138SLi Zefan __array( char, rwbs, 6 ) 47055782138SLi Zefan ), 47155782138SLi Zefan 47255782138SLi Zefan TP_fast_assign( 47355782138SLi Zefan __entry->dev = bio->bi_bdev->bd_dev; 47455782138SLi Zefan __entry->sector = bio->bi_sector; 47555782138SLi Zefan __entry->nr_sector = bio->bi_size >> 9; 47655782138SLi Zefan __entry->old_dev = dev; 47755782138SLi Zefan __entry->old_sector = from; 47855782138SLi Zefan blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); 47955782138SLi Zefan ), 48055782138SLi Zefan 48155782138SLi Zefan TP_printk("%d,%d %s %llu + %u <- (%d,%d) %llu", 48255782138SLi Zefan MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, 4836556d1dfSSteven Rostedt (unsigned long long)__entry->sector, 4846556d1dfSSteven Rostedt __entry->nr_sector, 48555782138SLi Zefan MAJOR(__entry->old_dev), MINOR(__entry->old_dev), 4866556d1dfSSteven Rostedt (unsigned long long)__entry->old_sector) 48755782138SLi Zefan ); 48855782138SLi Zefan 48955782138SLi Zefan #endif /* _TRACE_BLOCK_H */ 49055782138SLi Zefan 49155782138SLi Zefan /* This part must be outside protection */ 49255782138SLi Zefan #include <trace/define_trace.h> 49355782138SLi Zefan 494