[PATCH] xtensa: always retrieve all syscall arguments

Mike Frysinger vapier at gentoo.org
Tue May 7 01:49:22 UTC 2013


On Monday 06 May 2013 19:49:01 Chris Zankel wrote:
> As you said, the n-args field in syscallent serves two purposes. In the
> case of readahead (int fd, off64_t offset, size_t count), for example,
> these two numbers would differ:
> 
> The syscall arguments are in a6 (fd), a3 (skipped),  a4/a5 (offset),
> a8(count)
> Number of arguments to readahead is 3,
> Number of registers used for arguments is 4,
> Number of actual registers used is 5,
> 
> Now, readahead, and possibly all other syscalls that take 64-bit
> arguments are handled by specific functions, so the problem doesn't
> really exist in those cases. However, looking at arm (5), powerpc (5),
> mips (5), tile (4), x86 (4), they seem to use the syscallent field as
> the number of registers that need to be fetched from the kernel rather
> than the number of arguments printed.

on arches that do alignment (like arm, ppc, and xtensa), the kernel does take 
5 args.  the fact that one of them is a dummy and thus ignored by the kernel 
doesn't matter.  you still have to do:
	syscall(__NR_readahead,
		1 /* arg1: fd */,
		0 /* arg2: pad */,
		0 /* arg3: off_hi */,
		0 /* arg4: off_lo */,
		0 /* arg5: count*/);
so i think the current definition is OK.

i think you do point out though that the value is wrong for 64bit arches -- it 
should be 3:
	syscall(__NR_readahead,
		1 /* arg1: fd */,
		0 /* arg2: off */,
		0 /* arg3: count*/);

when Dmitry talked about printargs, he's referring to the the func literally 
named "printargs" that dumps every syscall arg.  so it's not dual definition.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20130506/ec0e48c5/attachment.bin>


More information about the Strace-devel mailing list