[PATCH] Print io_submit() offsets in decimal.

Zev Weiss zev at bewilderbeest.net
Fri Mar 29 20:37:00 UTC 2013


Hello,

Current strace prints the offset members of iocb structs passed to io_submit() in hex, which I can't see any particular reason for (it mismatches the normal pread/pwrite format, for one thing), and the additional lack of a leading "0x" prefix makes it unnecessarily difficult to parse.  Could the below patch be applied to instead print them in decimal?

Thanks,
Zev Weiss


diff --git a/desc.c b/desc.c
index 69d9e43..f585b91 100644
--- a/desc.c
+++ b/desc.c
@@ -913,13 +913,13 @@ sys_io_submit(struct tcb *tcp)
 					} else
 #endif
 						tprintf(", buf:%p", iocb.u.c.buf);
-					tprintf(", nbytes:%lu, offset:%llx",
+					tprintf(", nbytes:%lu, offset:%lli",
 						iocb.u.c.nbytes,
 						iocb.u.c.offset);
 					print_common_flags(&iocb);
 					break;
 				case SUB_VECTOR:
-					tprintf(", %llx", iocb.u.v.offset);
+					tprintf(", %lli", iocb.u.v.offset);
 					print_common_flags(&iocb);
 					tprints(", ");
 					tprint_iov(tcp, iocb.u.v.nr,
-- 
1.7.10.4






More information about the Strace-devel mailing list