How to exclude ipc calls

Dmitry V. Levin ldv at altlinux.org
Fri Nov 25 18:56:51 UTC 2011


On Fri, Nov 25, 2011 at 05:49:01PM +0100, Alexander Kriegisch wrote:
[...]
> > You can use
> > strace -e trace='!ipc'
> > to hide all IPC related syscalls (shm*, sem* and msg*).
> 
> Thank you very much, but have you read my original question? I want to
> specifically hide calls like these:
> 
> > ipc(0x1, 0x8001, 0x1, 0, 0x2abe55cc, 0x2aab25e0) = 0
> > ipc(0x1, 0, 0x1, 0, 0x2abe55c4, 0x2aab25e0) = 0
> > ipc(0x1, 0x10002, 0x1, 0, 0x2abe55cc, 0x2aab25e0) = 0
> > ipc(0x1, 0, 0x1, 0, 0x2abe55d4, 0x2aab25e0) = 0
> > ipc(0x1, 0x8001, 0x1, 0, 0x2abe55d4, 0x2aab25e0) = 0
> > ipc(0x1, 0, 0x1, 0, 0x2abe55c4, 0x2aab25e0) = 0
> > ipc(0x1, 0x10002, 0x1, 0, 0x2abe55d4, 0x2aab2820) = 0
> > ipc(0x1, 0, 0x1, 0, 0x2abe55d4, 0x2aab25e0) = 0
> 
> They keep cluttering my strace logs. If I try something like
> strace -e trace='!ipc' -p 17094 -q 2>&1 | grep ipc > ipc.log
> 
> they still occur in the log in the same order of magnitude as before.

This is not the way how it should be.  ipc() is not a normal syscall but
a syscall multiplexer which strace is usually capable to decode.
As I said, there is no visible ipc() on x86, x86-64 and arm.

> > This is not what I see on x86, x86-64 and arm.  What's the strace
> > version and architecture you are talking about?
> 
> > # uname -a; strace -V
> > Linux fritz.fonwlan.box 2.6.19.2 #1 Mon Nov 29 14:50:31 CET 2010 mips GNU/Linux
> > strace -- version 4.6
> 
> So we are talking about mipsel here.

There is something wrong with strace on your platform, otherwise you would
never see this ipc() syscall.  I'm not an expert with linux mips zoo, but
it looks like ipc() syscall multiplexer is actually in use in your system
while strace expects separate IPC syscalls.  I can suggest a workaround,
but it won't implement proper IPC subcall decoding on your platform unless
somebody with better knowledge about it will come up with a patch.

The workaround is to teach strace that ipc() is a IPC syscall:
$ sed -i '/"ipc"/ s/0,/TI,/' linux/mips/syscallent.h

With this change applied, strace -e trace='!ipc' will hide ipc() syscall.


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


More information about the Strace-devel mailing list