[PATCH] Print io_submit() offsets in decimal.

Zev Weiss zev at bewilderbeest.net
Sun Mar 31 00:19:50 UTC 2013


On Mar 30, 2013, at 6:17 PM, "Dmitry V. Levin" <ldv at altlinux.org> wrote:

> Hi,
> 
> On Fri, Mar 29, 2013 at 03:37:00PM -0500, Zev Weiss wrote:
>> 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?
> 
> Yes, let's change it to match the pread/pwrite output format.
> Would you like to write a commit message?
> 

Sure, hopefully the version below is formatted appropriately...

Also, I noticed that the rest of the strace codebase uses %d for decimal integers, so I changed the patch to match (I had initially used %i).


Zev

-- >8 --
Subject: [PATCH] Print io_submit() offsets in decimal.

This makes output formatting more consistent with pread()/pwrite(), which
print their offset parameters in decimal.

* desc.c (sys_io_submit): Change "%llx" to "%lld".

Signed-off-by: Zev Weiss <zev at bewilderbeest.net>
---
 desc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/desc.c b/desc.c
index 69d9e43..cd2c857 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:%lld",
 						iocb.u.c.nbytes,
 						iocb.u.c.offset);
 					print_common_flags(&iocb);
 					break;
 				case SUB_VECTOR:
-					tprintf(", %llx", iocb.u.v.offset);
+					tprintf(", %lld", 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