i386 port of the pthread SystemTap probes
authorRayson Ho <rho@redhat.com>
Wed, 23 Feb 2011 19:30:55 +0000 (11:30 -0800)
committerRoland McGrath <roland@hack.frob.com>
Fri, 25 May 2012 20:41:04 +0000 (13:41 -0700)
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S
nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S
nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S
nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S
nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S
nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S
nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h

index 9b63c53..a488ccb 100644 (file)
@@ -1,4 +1,17 @@
 2012-05-25  Rayson Ho  <rho@redhat.com>
+
+       * sysdeps/unix/sysv/linux/i386/lowlevellock.h: Low-level SystemTap
+       probes for i386.
+       * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_broadcast.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_signal.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
+       * sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
+
+2012-05-25  Rayson Ho  <rho@redhat.com>
            Roland McGrath  <roland@hack.frob.com>
 
        * DESIGN-systemtap-probes.txt: New file.
index fe6d4b6..7c3212c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004,2006,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -21,6 +21,8 @@
 #include <kernel-features.h>
 #include <lowlevellock.h>
 
+#include <stap-probe.h>
+
        .text
 
 #ifdef __ASSUME_PRIVATE_FUTEX
@@ -90,7 +92,8 @@ __lll_lock_wait_private:
        cmpl    %edx, %eax      /* NB:   %edx == 2 */
        jne 2f
 
-1:     movl    $SYS_futex, %eax
+1:     LIBC_PROBE (lll_lock_wait_private, 1, %ebx)
+       movl    $SYS_futex, %eax
        ENTER_KERNEL
 
 2:     movl    %edx, %eax
index 71a6686..99f9bc9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -23,6 +23,7 @@
 #include <kernel-features.h>
 #include <pthread-pi-defines.h>
 #include <pthread-errnos.h>
+#include <stap-probe.h>
 
        .text
 
@@ -48,6 +49,8 @@ __pthread_cond_broadcast:
 
        movl    20(%esp), %ebx
 
+       LIBC_PROBE (cond_broadcast, 1, %edx)
+
        /* Get internal lock.  */
        movl    $1, %edx
        xorl    %eax, %eax
index 2af611a..e204805 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -23,7 +23,7 @@
 #include <kernel-features.h>
 #include <pthread-pi-defines.h>
 #include <pthread-errnos.h>
-
+#include <stap-probe.h>
 
        .text
 
@@ -44,6 +44,8 @@ __pthread_cond_signal:
 
        movl    12(%esp), %edi
 
+       LIBC_PROBE (cond_signal, 1, %edi)
+
        /* Get internal lock.  */
        movl    $1, %edx
        xorl    %eax, %eax
index ff3da37..8170ab3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004,2006-2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -23,7 +23,7 @@
 #include <pthread-errnos.h>
 #include <pthread-pi-defines.h>
 #include <kernel-features.h>
-
+#include <stap-probe.h>
 
        .text
 
@@ -60,6 +60,8 @@ __pthread_cond_timedwait:
        movl    20(%esp), %ebx
        movl    28(%esp), %ebp
 
+       LIBC_PROBE (cond_timedwait, 3, %ebx, 24(%esp), %ebp)
+
        cmpl    $1000000000, 4(%ebp)
        movl    $EINVAL, %eax
        jae     18f
index 1d7e751..2ae7af2 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002-2004,2006-2007,2009,2010,2012
-   Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -25,6 +24,7 @@
 #include <pthread-errnos.h>
 #include <pthread-pi-defines.h>
 #include <kernel-features.h>
+#include <stap-probe.h>
 
 
        .text
@@ -61,6 +61,8 @@ __pthread_cond_wait:
        xorl    %esi, %esi
        movl    20(%esp), %ebx
 
+       LIBC_PROBE (cond_wait, 2, 24(%esp), %ebx)
+
        /* Get internal lock.  */
        movl    $1, %edx
        xorl    %eax, %eax
index 156fce8..ebbe809 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -22,6 +22,7 @@
 #include <pthread-errnos.h>
 #include <kernel-features.h>
 
+#include <stap-probe.h>
 
        .text
 
@@ -40,6 +41,8 @@ __pthread_rwlock_rdlock:
        xorl    %esi, %esi
        movl    12(%esp), %ebx
 
+       LIBC_PROBE (rdlock_entry, 1, %ebx)
+
        /* Get the lock.  */
        movl    $1, %edx
        xorl    %eax, %eax
index 3994b06..d30e93a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -22,6 +22,7 @@
 #include <pthread-errnos.h>
 #include <kernel-features.h>
 
+#include <stap-probe.h>
 
        .text
 
@@ -40,6 +41,8 @@ __pthread_rwlock_wrlock:
        xorl    %esi, %esi
        movl    12(%esp), %ebx
 
+       LIBC_PROBE (wrlock_entry, 1, %ebx)
+
        /* Get the lock.  */
        movl    $1, %edx
        xorl    %eax, %eax
index 497d473..3d805ff 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2004, 2006-2008, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -19,6 +19,8 @@
 #ifndef _LOWLEVELLOCK_H
 #define _LOWLEVELLOCK_H        1
 
+#include <stap-probe.h>
+
 #ifndef __ASSEMBLER__
 # include <time.h>
 # include <sys/param.h>
@@ -225,6 +227,7 @@ LLL_STUB_UNWIND_INFO_END
   do {                                                                       \
     int __ignore;                                                            \
     register __typeof (nr) _nr asm ("edx") = (nr);                           \
+    LIBC_PROBE (lll_futex_wake, 3, futex, nr, private);                       \
     __asm __volatile (LLL_EBX_LOAD                                           \
                      LLL_ENTER_KERNEL                                        \
                      LLL_EBX_LOAD                                            \