diff mbox series

[V4,4/5] block: update print_req_error()

Message ID 20190619171302.10146-5-chaitanya.kulkarni@wdc.com (mailing list archive)
State New, archived
Headers show
Series block: improve print_req_error | expand

Commit Message

Chaitanya Kulkarni June 19, 2019, 5:13 p.m. UTC
Improve the print_req_error with additional request fields which are
helpful for debugging. Use newly introduced blk_op_str() to print the
REQ_OP_XXX in the string format.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-core.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Chaitanya Kulkarni June 20, 2019, 5:07 a.m. UTC | #1
Rest of the patches in this series are reviewed by Bart and Chao.

Can someone please take a look at this patch and provide some feedback ?
On 6/19/19 10:14 AM, Chaitanya Kulkarni wrote:
> Improve the print_req_error with additional request fields which are
> helpful for debugging. Use newly introduced blk_op_str() to print the
> REQ_OP_XXX in the string format.
> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>   block/blk-core.c | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/block/blk-core.c b/block/blk-core.c
> index c92b5a16a27a..88a716c3dc56 100644
> --- a/block/blk-core.c
> +++ b/block/blk-core.c
> @@ -212,11 +212,14 @@ static void print_req_error(struct request *req, blk_status_t status,
>   		return;
>   
>   	printk_ratelimited(KERN_ERR
> -		"%s: %s error, dev %s, sector %llu op 0x%x flags 0x%x\n",
> +		"%s: %s error, dev %s, sector %llu op 0x%x:(%s) flags 0x%x "
> +		"phys_seg %u prio class %u\n",
>   		caller, blk_errors[idx].name,
> -		req->rq_disk ?  req->rq_disk->disk_name : "?",
> -		blk_rq_pos(req), req_op(req),
> -		req->cmd_flags & ~REQ_OP_MASK);
> +		req->rq_disk ? req->rq_disk->disk_name : "?",
> +		blk_rq_pos(req), req_op(req), blk_op_str(req_op(req)),
> +		req->cmd_flags & ~REQ_OP_MASK,
> +		req->nr_phys_segments,
> +		IOPRIO_PRIO_CLASS(req->ioprio));
>   }
>   
>   static void req_bio_endio(struct request *rq, struct bio *bio,
>
diff mbox series

Patch

diff --git a/block/blk-core.c b/block/blk-core.c
index c92b5a16a27a..88a716c3dc56 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -212,11 +212,14 @@  static void print_req_error(struct request *req, blk_status_t status,
 		return;
 
 	printk_ratelimited(KERN_ERR
-		"%s: %s error, dev %s, sector %llu op 0x%x flags 0x%x\n",
+		"%s: %s error, dev %s, sector %llu op 0x%x:(%s) flags 0x%x "
+		"phys_seg %u prio class %u\n",
 		caller, blk_errors[idx].name,
-		req->rq_disk ?  req->rq_disk->disk_name : "?",
-		blk_rq_pos(req), req_op(req),
-		req->cmd_flags & ~REQ_OP_MASK);
+		req->rq_disk ? req->rq_disk->disk_name : "?",
+		blk_rq_pos(req), req_op(req), blk_op_str(req_op(req)),
+		req->cmd_flags & ~REQ_OP_MASK,
+		req->nr_phys_segments,
+		IOPRIO_PRIO_CLASS(req->ioprio));
 }
 
 static void req_bio_endio(struct request *rq, struct bio *bio,