Calls like semop() weren't getting traced correctly.

The number of arguments for the calls in linux/arm/syscallent.h doesn't
match the kernel.  And arm was set to use "indirect syscalls" for ipc. 
Which at least for the EABI it doesn't do.  I don't know if the old ABI did
or not.

There's another set of semaphore syscalls in the 400 range in the
syscallent.h, but I don't see where these are defined in the kernel.  I've
got no idea why they are there.

Here is a patch that makes semop traces work on arm.

commit cf7babf7234ae0711701d4113c5115f85f232fd4
Author: Trent Piepho <[email protected]>
Date:   Fri May 13 20:44:14 2011 -0400

     Adjust argument count for semaphore ipc calls on ARM to match kernel.
     Turn off indirect_ipccall() on ARM, as at least the EABI does not use
     it.

diff --git a/ipc.c b/ipc.c
index 4c902bf..55c9426 100644
--- a/ipc.c
+++ b/ipc.c
@@ -193,7 +193,7 @@ struct tcb *tcp;
  #if defined IA64
        return tcp->scno < 1024; /* ia32 emulation syscalls are low */
  #endif
-#if !defined MIPS && !defined HPPA
+#if !defined MIPS && !defined HPPA && !defined ARM
        return 1;
  #endif
  #endif        /* LINUX */
diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h
index b914ca0..4495ac2 100644
--- a/linux/arm/syscallent.h
+++ b/linux/arm/syscallent.h
@@ -328,8 +328,8 @@
        { 5,    TN,     sys_getsockopt,         "getsockopt"    }, /* 295 */
        { 3,    TN,     sys_sendmsg,            "sendmsg"       }, /* 296 */
        { 3,    TN,     sys_recvmsg,            "recvmsg"       }, /* 297 */
-       { 4,    TI,     sys_semop,              "semop"         }, /* 298 */
-       { 4,    TI,     sys_semget,             "semget"        }, /* 299 */
+       { 3,    TI,     sys_semop,              "semop"         }, /* 298 */
+       { 3,    TI,     sys_semget,             "semget"        }, /* 299 */
        { 4,    TI,     sys_semctl,             "semctl"        }, /* 300 */
        { 4,    TI,     sys_msgsnd,             "msgsnd"        }, /* 301 */
        { 4,    TI,     sys_msgrcv,             "msgrcv"        }, /* 302 */
@@ -342,7 +342,7 @@
        { 5,    0,      printargs,              "add_key"       }, /* 309 */
        { 4,    0,      printargs,              "request_key"   }, /* 310 */
        { 5,    0,      printargs,              "keyctl"        }, /* 311 */
-       { 5,    TI,     sys_semtimedop,         "semtimedop"    }, /* 312 */
+       { 4,    TI,     sys_semtimedop,         "semtimedop"    }, /* 312 */
        { 5,    0,      printargs,              "vserver"       }, /* 313 */
        { 3,    0,      printargs,              "ioprio_set"    }, /* 314 */
        { 2,    0,      printargs,              "ioprio_get"    }, /* 315 */

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Strace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to