summaryrefslogtreecommitdiff
path: root/blkparse_fmt.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-09-26 19:05:40 +0200
committerJens Axboe <axboe@suse.de>2005-09-26 19:05:40 +0200
commit1c8ca7b5a1016d63caa1248e4a62d22600234f93 (patch)
tree857db954654489d1ee2d9aba981e2f8e0558e22c /blkparse_fmt.c
parenta795e5fae97e14d77c3c3c7d0f6543e6c5f8c850 (diff)
downloadblktrace-1c8ca7b5a1016d63caa1248e4a62d22600234f93.tar.gz
blktrace-1c8ca7b5a1016d63caa1248e4a62d22600234f93.tar.bz2
[PATCH] blkparse: add %N format for bytes
We need this for PC requests, they are not multiples of 512 like the FS requests. At the same time change the default for PC requests to dump in bytes.
Diffstat (limited to 'blkparse_fmt.c')
-rw-r--r--blkparse_fmt.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/blkparse_fmt.c b/blkparse_fmt.c
index 242dc13..ebf97c6 100644
--- a/blkparse_fmt.c
+++ b/blkparse_fmt.c
@@ -151,6 +151,9 @@ static void print_field(char *act, struct per_cpu_info *pci,
case 'n':
fprintf(ofp, strcat(format, "u"), t->bytes >> 9);
break;
+ case 'N':
+ fprintf(ofp, strcat(format, "u"), t->bytes);
+ break;
case 'p':
fprintf(ofp, strcat(format, "u"), t->pid);
break;
@@ -259,7 +262,7 @@ static void process_default(char *act, struct per_cpu_info *pci,
case 'W': /* Bounce */
if (t->action & BLK_TC_ACT(BLK_TC_PC)) {
char *p;
- fprintf(ofp, "%u ", t->bytes >> 9);
+ fprintf(ofp, "%u ", t->bytes);
p = dump_pdu(pdu_buf, pdu_len);
if (p)
fprintf(ofp, "(%s) ", p);