RFC userfaultfd ioctl decode

Dmitry V. Levin ldv at altlinux.org
Sat Apr 23 00:27:24 UTC 2016


On Fri, Apr 22, 2016 at 03:49:32PM +0100, Dr. David Alan Gilbert wrote:
[...]
> > The preferred method is to print uc.copy as a part of structure:
> > 
> > 	if (entering(tcp)) {

BTW, there needs to be a tprints(", ")
otherwise the structure is being printed right after the name of constant,
without any delimiter.

> > 		if (umove_or_printaddr(tcp, arg, &uc))
> > 			return RVAL_DECODED | 1;
> > 		tprintf("{dst=%" PRI__x64 ", src=%" PRI__x64
> > 			", len=%" PRI__u64 ", mode=%" PRI__u64
> > 			", copy=",
> > 			uc.dst, uc.src, uc.len, uc.mode);
> > 			return 1;
> > 	} else {
> > 		if (!umove_or_printaddr(tcp, arg, &uc.copy))
> > 			tprintf("%" PRI__d64, uc.copy);
> > 		tprints("}");
> > 		return 1;
> > 	}
> 
> OK, thanks, taken that.
> strace seems to have PRI__s64 rather than PRId64 that would have matched
> the C library;

Oh, this must have slipped under my radar when these macros were
introduced.  They are quite new, no code is using them yet, so I think
it's safe to rename PRI__s64 to PRI__d64.

> I've also changed those to %# for the hex.,

That's correct.

> and that
> second umove is still &uc - it's still part of the full structure.

Yes, of course it has to be &uc.copy.


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20160423/4f8b7db8/attachment.bin>


More information about the Strace-devel mailing list