Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx> --- kernel/trace/blktrace.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 5103b79bce2a..b27981bb9c89 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c @@ -1077,21 +1077,32 @@ blk_trace_request_get_cgid(struct request_queue *q, struct request *rq) * **/ static void blk_add_trace_rq(struct request *rq, int error, - unsigned int nr_bytes, u32 what, + unsigned int nr_bytes, u64 what, union kernfs_node_id *cgid) { struct blk_trace *bt = rq->q->blk_trace; + struct blk_trace_ext *bte = rq->q->blk_trace_ext; if (likely(!bt)) return; - if (blk_rq_is_passthrough(rq)) - what |= BLK_TC_ACT(BLK_TC_PC); - else - what |= BLK_TC_ACT(BLK_TC_FS); - - __blk_add_trace(bt, blk_rq_trace_sector(rq), nr_bytes, req_op(rq), - rq->cmd_flags, what, error, 0, NULL, cgid); + if (rq->q->blk_trace) { + if (blk_rq_is_passthrough(rq)) + what |= BLK_TC_ACT(BLK_TC_PC); + else + what |= BLK_TC_ACT(BLK_TC_FS); + __blk_add_trace(bt, blk_rq_trace_sector(rq), nr_bytes, + req_op(rq), rq->cmd_flags, (u32)what, error, 0, + NULL, cgid); + } else if (rq->q->blk_trace_ext) { + if (blk_rq_is_passthrough(rq)) + what |= BLK_TC_ACT_EXT(BLK_TC_PC); + else + what |= BLK_TC_ACT_EXT(BLK_TC_FS); + __blk_add_trace_ext(bte, blk_rq_trace_sector(rq), nr_bytes, + req_op(rq), rq->cmd_flags, what, error, 0, + NULL, cgid, req_get_ioprio(rq)); + } } static void blk_add_trace_rq_insert(void *ignore, -- 2.19.1