From 182f2fccd5aaf89200c3f784460d2689ed50d0d0 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 22 Sep 2005 10:56:05 +0200 Subject: [PATCH] [PATCH] blkparse: more PC fixes Add size of request as well, kill space at the end of pdu dump. --- blkparse.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/blkparse.c b/blkparse.c index 4a37c05..152fb24 100644 --- a/blkparse.c +++ b/blkparse.c @@ -828,8 +828,12 @@ static void print_field(char *act, struct per_cpu_info *pci, if ((pdu_len > 0) && (pdu_buf != NULL)) { int i; unsigned char *p = pdu_buf; - for (i = 0; i < pdu_len; i++) - fprintf(ofp, "%02x ", *p++); + for (i = 0; i < pdu_len; i++) { + if (i) + fprintf(ofp, " "); + + fprintf(ofp, "%02x", *p++); + } } break; case 's': @@ -904,7 +908,7 @@ static char *fmt_select(int fmt_spec, struct blk_io_trace *t, case 'C': /* Complete */ if (t->action & BLK_TC_ACT(BLK_TC_PC)) { strcpy(scratch_format, HEADER); - strcat(scratch_format, "%P"); + strcat(scratch_format, "(%P) "); } else { strcpy(scratch_format, HEADER "%S + %n "); if (elapsed != -1ULL) @@ -917,7 +921,7 @@ static char *fmt_select(int fmt_spec, struct blk_io_trace *t, case 'D': /* Issue */ if (t->action & BLK_TC_ACT(BLK_TC_PC)) { strcpy(scratch_format, HEADER); - strcat(scratch_format, "%P"); + strcat(scratch_format, "%n (%P) "); } else { strcpy(scratch_format, HEADER "%S + %n "); if (elapsed != -1ULL) @@ -930,7 +934,7 @@ static char *fmt_select(int fmt_spec, struct blk_io_trace *t, case 'I': /* Insert */ if (t->action & BLK_TC_ACT(BLK_TC_PC)) { strcpy(scratch_format, HEADER); - strcat(scratch_format, "%P"); + strcat(scratch_format, "%n (%P) "); } else { strcpy(scratch_format, HEADER "%S + %n "); if (elapsed != -1ULL) -- 2.25.1