Sometimes some applications block, and strace show something like that:
which means that the kernel blocks during that ioctl.
we will take the same example than before,with mplayer blocking.:
there are two important information in it: 6 is the file descriptor,the corresponding file can be found with:
ls -l /proc/$(pidof mplayer)/fd/6
That correspond to alsa. Then we have the 0x400c4150 the important part is the last part: 41 is 0x41 which is often represented as a letter and can be decoded like this:
$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import binascii >>> binascii.a2b_hex("41") 'A'
Or verified like this:
$ python Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import binascii >>> binascii.b2a_hex("A") '41'
Then 0x50 remains. we don't need to decode it,it's fine like it is.
so with A and 50 and /dev/snd/pcmC0D0p file we can go to grep in include/sound of the kernel sources:
include/sound$ grep "0x50" * ac97_codec.h:#define AC97_GPIO_STICKY 0x50 /* GPIO Pin Sticky, 0=not, 1=sticky */ ad1816a.h:#define AD1816A_SRC_MIC 0x50 ad1816a.h:#define AD1816A_SRC_MONO 0x50 asequencer.h:#define SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION _IOWR('S', 0x50, struct snd_seq_port_subscribe) asoundef.h:#define MIDI_CTL_GENERAL_PURPOSE5 0x50 asound.h:#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi) cs46xx.h:#define HDCR_SMS_256_DWORDS 0x50000000 cs46xx.h:#define DMA_RQ_C1_SOURCE_MOD256 0x50000000 emu10k1.h:#define CDCS 0x50 /* CD-ROM digital channel status register */ emu10k1.h:#define C_ffffffff 0x50 emu10k1.h:#define A_P16VIN(x) (0x50 + (x)) /* x = 0x00 - 0x0f p16v ins (A2 only) "EMU32 inputs" */ gus.h:#define SNDRV_GF1_GB_DRAM_DMA_HIGH 0x50 sb.h:#define SB_ALS4000_3D_SND_FX 0x50 trident.h:#define SI_ASR0 0x50
here we see:
asound.h:#define SNDRV_PCM_IOCTL_WRITEI_FRAMES _IOW('A', 0x50, struct snd_xferi)
which is our ioctl.
The next step is to look where this ioctl is called: