X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=probes%2Fblock-trace.c;h=a01b6f450c6bce44a7aa796a69e0e71715ab8bc1;hb=refs%2Fheads%2Fv0.19-stable;hp=51ae2cdd2c57d11435dd498c288e43758b7c80b1;hpb=1c8284ebdbd119314b8f01e442e64cf5fd4b9fe6;p=lttng-modules.git diff --git a/probes/block-trace.c b/probes/block-trace.c index 51ae2cdd..a01b6f45 100644 --- a/probes/block-trace.c +++ b/probes/block-trace.c @@ -19,10 +19,10 @@ void probe_block_rq_abort(void *data, struct request_queue *q, struct request *r { int rw = rq->cmd_flags & 0x03; - if (blk_discard_rq(rq)) - rw |= (1 << BIO_RW_DISCARD); + if (rq->cmd_flags & REQ_DISCARD) + rw |= REQ_DISCARD; - if (blk_pc_request(rq)) { + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { trace_mark_tp(block, rq_abort_pc, block_rq_abort, probe_block_rq_abort, "data_len %u rw %d errors %d", @@ -46,10 +46,10 @@ void probe_block_rq_insert(void *data, struct request_queue *q, struct request * { int rw = rq->cmd_flags & 0x03; - if (blk_discard_rq(rq)) - rw |= (1 << BIO_RW_DISCARD); + if (rq->cmd_flags & REQ_DISCARD) + rw |= REQ_DISCARD; - if (blk_pc_request(rq)) { + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { trace_mark_tp(block, rq_insert_pc, block_rq_insert, probe_block_rq_insert, "data_len %u rw %d errors %d", @@ -73,10 +73,10 @@ void probe_block_rq_issue(void *data, struct request_queue *q, struct request *r { int rw = rq->cmd_flags & 0x03; - if (blk_discard_rq(rq)) - rw |= (1 << BIO_RW_DISCARD); + if (rq->cmd_flags & REQ_DISCARD) + rw |= REQ_DISCARD; - if (blk_pc_request(rq)) { + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { trace_mark_tp(block, rq_issue_pc, block_rq_issue, probe_block_rq_issue, "data_len %u rw %d errors %d", @@ -100,10 +100,10 @@ void probe_block_rq_requeue(void *data, struct request_queue *q, struct request { int rw = rq->cmd_flags & 0x03; - if (blk_discard_rq(rq)) - rw |= (1 << BIO_RW_DISCARD); + if (rq->cmd_flags & REQ_DISCARD) + rw |= REQ_DISCARD; - if (blk_pc_request(rq)) { + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { trace_mark_tp(block, rq_requeue_pc, block_rq_requeue, probe_block_rq_requeue, "data_len %u rw %d errors %d", @@ -128,10 +128,10 @@ void probe_block_rq_complete(void *data, struct request_queue *q, struct request { int rw = rq->cmd_flags & 0x03; - if (blk_discard_rq(rq)) - rw |= (1 << BIO_RW_DISCARD); + if (rq->cmd_flags & REQ_DISCARD) + rw |= REQ_DISCARD; - if (blk_pc_request(rq)) { + if (rq->cmd_type == REQ_TYPE_BLOCK_PC) { trace_mark_tp(block, rq_complete_pc, block_rq_complete, probe_block_rq_complete, "data_len %u rw %d errors %d", @@ -163,15 +163,15 @@ void probe_block_bio_bounce(void *data, struct request_queue *q, struct bio *bio bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE)); } -void probe_block_bio_complete(void *data, struct request_queue *q, struct bio *bio) +void probe_block_bio_complete(void *data, struct request_queue *q, struct bio *bio, int error) { trace_mark_tp(block, bio_complete, block_bio_complete, probe_block_bio_complete, "sector %llu size %u rw(FAILFAST_DRIVER,FAILFAST_TRANSPORT," "FAILFAST_DEV,DISCARD,META,SYNC,BARRIER,AHEAD,RW) %lX " - "not_uptodate #1u%d", + "not_uptodate #1u%d error %d", (unsigned long long)bio->bi_sector, bio->bi_size, - bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE)); + bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE), error); } void probe_block_bio_backmerge(void *data, struct request_queue *q, struct bio *bio) @@ -288,22 +288,40 @@ void probe_block_split(void *data, struct request_queue *q, struct bio *bio, bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE), pdu); } -void probe_block_remap(void *data, struct request_queue *q, struct bio *bio, - dev_t dev, sector_t from) +void probe_block_bio_remap(void *data, struct request_queue *q, struct bio *bio, + dev_t dev, sector_t from) { - trace_mark_tp(block, remap, block_remap, - probe_block_remap, - "device_from %lu sector_from %llu device_to %lu " - "size %u rw(FAILFAST_DRIVER,FAILFAST_TRANSPORT," + trace_mark_tp(block, bio_remap, block_bio_remap, + probe_block_bio_remap, + "device_from %lu sector_from %llu nr_sector %llu device_to %lu " + "sector_to %llu size %u rw(FAILFAST_DRIVER,FAILFAST_TRANSPORT," "FAILFAST_DEV,DISCARD,META,SYNC,BARRIER,AHEAD,RW) %lX " "not_uptodate #1u%d", - (unsigned long)bio->bi_bdev->bd_dev, - (unsigned long long)from, (unsigned long)dev, + (unsigned long long)from, + (unsigned long long)bio->bi_size >> 9, + (unsigned long)bio->bi_bdev->bd_dev, + (unsigned long long)bio->bi_sector, bio->bi_size, bio->bi_rw, !bio_flagged(bio, BIO_UPTODATE)); } +void probe_block_rq_remap(void *data, struct request_queue *q, + struct request *rq, + dev_t dev, sector_t from) +{ + trace_mark_tp(block, rq_remap, block_rq_remap, + probe_block_rq_remap, + "device_from %lu sector_from %llu nr_sector %llu device_to %lu " + "sector_to %llu size %u", + (unsigned long)dev, + (unsigned long long)from, + (unsigned long long)blk_rq_sectors(rq), + (unsigned long)disk_devt(rq->rq_disk), + (unsigned long long)blk_rq_pos(rq), + blk_rq_bytes(rq)); +} + MODULE_LICENSE("GPL and additional rights"); MODULE_AUTHOR("Mathieu Desnoyers"); MODULE_DESCRIPTION("Block Tracepoint Probes");