On Wed, Mar 04, 2015 at 08:31:13AM +0100, Gabriel Laskar wrote:
> On Wed, 4 Mar 2015 02:44:19 +0300, Dmitry V. Levin wrote:
> > On Tue, Mar 03, 2015 at 07:23:28PM +0100, Gabriel Laskar wrote:
> > > There is still an issue with ioctl request names when using strace
> > > on Binder calls. Some binder calls have 2 possible sizes, depending
> > > of being with the 32-bit api or the 64-bit one.
> > > 
> > > In <linux/android/binder.h>, there is a #ifdef BINDER_IPC_32BIT that
> > > control the size of pointer values in the structures.
> > > 
> > > In 64bit mode, we have only :
> > > 
> > > ioctl(-1, BC_REQUEST_DEATH_NOTIFICATION, 0);
> > > ioctl(-1, BC_CLEAR_DEATH_NOTIFICATION, 0);
> > > 
> > > that respond :
> > > 
> > > ioctl(-1, _IOC(_IOC_WRITE, 0x63, 0x0e, 0x10), 0) = -1 EBADF (Bad
> > > file descriptor) ioctl(-1, _IOC(_IOC_WRITE, 0x63, 0x0f, 0x10), 0) =
> > > -1 EBADF (Bad file descriptor)
> > > 
> > > and when asking for 32bit binder (BINDER_IPC_32BIT), lots of ioctls
> > > are failing :
> > 
> > Unfortunately, <linux/android/binder.h> doesn't say which of binder
> > ioctls are BINDER_IPC_32BIT.  How could one automatically distinguish
> > them?
> 
> For BC_REQUEST_DEATH_NOTIFICATION and BC_CLEAR_DEATH_NOTIFICATION, it
> is just that the ioctl is defined on 2 lines.
> 
> As for which binder ioctl are configured by BINDER_IPC_32BIT, it is all
> the ioctl that take an argument that depend on it, so:

Looks like the kernel module can be compiled either with or without
BINDER_IPC_32BIT defined, and the only way to tell what is the case is to
actually issue an ioctl command.  This means that both sets of binder
ioctl commands (with and without BINDER_IPC_32BIT defined) are equally
valid, but strace currently includes only one of them (without
BINDER_IPC_32BIT defined).

If this is the case, then we have two problems with binder ioctls:
- how to generate both sets automatically;
- how to give them distinguishable names.


-- 
ldv

Attachment: pgpR6yaGa0iC4.pgp
Description: PGP signature

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to