All of lore.kernel.org
 help / color / mirror / Atom feed
* strace and ALSA ioctls
@ 2006-05-18 15:41 Lee Revell
  2006-05-18 15:47 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Revell @ 2006-05-18 15:41 UTC (permalink / raw)
  To: alsa-devel

I have never seen strace correctly identify a single ALSA ioctl.  This
makes debugging a serious PITA.  Is it fixable?

ioctl(3, USBDEVFS_CONTROL, 0xbfe13958)  = 0
ioctl(3, UI_DEV_CREATE, 0xbfe13a70)     = 0
close(3)                                = 0
stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644,
st_size=7501, ...}) = 0
open("/dev/snd/controlC0", O_RDONLY)    = 3
close(3)                                = 0
open("/dev/snd/controlC0", O_RDWR)      = 3
ioctl(3, USBDEVFS_CONTROL, 0xbfe138f8)  = 0
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0
ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13250)    = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13250)    = 0

etc

Lee



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: strace and ALSA ioctls
  2006-05-18 15:41 strace and ALSA ioctls Lee Revell
@ 2006-05-18 15:47 ` Takashi Iwai
  2006-05-18 16:12   ` Lee Revell
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2006-05-18 15:47 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Thu, 18 May 2006 11:41:48 -0400,
Lee Revell wrote:
> 
> I have never seen strace correctly identify a single ALSA ioctl.  This
> makes debugging a serious PITA.  Is it fixable?

Quite unlikely.  Some ioctl commands are indeed identical with these
USBDEVFS_*.  This happened since we didn't care about the collision
and found it too late.

In the kernel side this is no problem because the ioctl cmd is bound
to each driver's ioctl op.  But, from user-space, there is no way to
distinguish properly.


Takashi

> 
> ioctl(3, USBDEVFS_CONTROL, 0xbfe13958)  = 0
> ioctl(3, UI_DEV_CREATE, 0xbfe13a70)     = 0
> close(3)                                = 0
> stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644,
> st_size=7501, ...}) = 0
> open("/dev/snd/controlC0", O_RDONLY)    = 3
> close(3)                                = 0
> open("/dev/snd/controlC0", O_RDWR)      = 3
> ioctl(3, USBDEVFS_CONTROL, 0xbfe138f8)  = 0
> fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
> fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
> ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0
> ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0
> ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
> ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
> ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
> ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
> ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
> ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
> ioctl(3, USBDEVFS_IOCTL, 0xbfe13250)    = 0
> ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
> ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
> ioctl(3, USBDEVFS_IOCTL, 0xbfe13230)    = 0
> ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
> ioctl(3, USBDEVFS_IOCTL, 0xbfe13250)    = 0
> 
> etc
> 
> Lee
> 
> 
> 
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: strace and ALSA ioctls
  2006-05-18 15:47 ` Takashi Iwai
@ 2006-05-18 16:12   ` Lee Revell
  2006-05-18 16:32     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Lee Revell @ 2006-05-18 16:12 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Thu, 2006-05-18 at 17:47 +0200, Takashi Iwai wrote:
> At Thu, 18 May 2006 11:41:48 -0400,
> Lee Revell wrote:
> > 
> > I have never seen strace correctly identify a single ALSA ioctl.  This
> > makes debugging a serious PITA.  Is it fixable?
> 
> Quite unlikely.  Some ioctl commands are indeed identical with these
> USBDEVFS_*.  This happened since we didn't care about the collision
> and found it too late.
> 
> In the kernel side this is no problem because the ioctl cmd is bound
> to each driver's ioctl op.  But, from user-space, there is no way to
> distinguish properly.
> 

But for some ioctls it says:

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon
echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon
echo ...}) = 0

So it seems that strace is aware of some of the collisions but not
others?

Lee



-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: strace and ALSA ioctls
  2006-05-18 16:12   ` Lee Revell
@ 2006-05-18 16:32     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2006-05-18 16:32 UTC (permalink / raw)
  To: Lee Revell; +Cc: alsa-devel

At Thu, 18 May 2006 12:12:06 -0400,
Lee Revell wrote:
> 
> On Thu, 2006-05-18 at 17:47 +0200, Takashi Iwai wrote:
> > At Thu, 18 May 2006 11:41:48 -0400,
> > Lee Revell wrote:
> > > 
> > > I have never seen strace correctly identify a single ALSA ioctl.  This
> > > makes debugging a serious PITA.  Is it fixable?
> > 
> > Quite unlikely.  Some ioctl commands are indeed identical with these
> > USBDEVFS_*.  This happened since we didn't care about the collision
> > and found it too late.
> > 
> > In the kernel side this is no problem because the ioctl cmd is bound
> > to each driver's ioctl op.  But, from user-space, there is no way to
> > distinguish properly.
> > 
> 
> But for some ioctls it says:
> 
> ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon
> echo ...}) = 0
> ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon
> echo ...}) = 0
> 
> So it seems that strace is aware of some of the collisions but not
> others?

Maybe depends on the strace version.  strace has a string table for
each ioctl entry.

Hm, looking at the source, the script included there doesn't handle
ioctls defined via enum correctly.  Too bad.


Takashi


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-05-18 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-18 15:41 strace and ALSA ioctls Lee Revell
2006-05-18 15:47 ` Takashi Iwai
2006-05-18 16:12   ` Lee Revell
2006-05-18 16:32     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.