aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-05-25 13:35:08 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-25 13:41:03 -0700
commit5acf7263d52992ce4144e0a3b3644985b9e792b4 (patch)
treec128be190c1c3fb5a1987710033c016d5b881b70 /nptl/sysdeps
parent8422c9a560e6e3c854739c8a13ecb1c6714f930f (diff)
downloadglibc-5acf7263d52992ce4144e0a3b3644985b9e792b4.tar
glibc-5acf7263d52992ce4144e0a3b3644985b9e792b4.tar.gz
glibc-5acf7263d52992ce4144e0a3b3644985b9e792b4.tar.bz2
glibc-5acf7263d52992ce4144e0a3b3644985b9e792b4.zip
Add systemtap static probe points in generic and x86_64 pthread code.
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S10
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S7
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S27
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S7
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S7
8 files changed, 49 insertions, 27 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index b7bfc3706d..dc95421023 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2009, 2010, 2011 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
@@ -86,7 +88,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, %rdi)
+ movl $SYS_futex, %eax
syscall
2: movl %edx, %eax
@@ -125,7 +128,8 @@ __lll_lock_wait:
cmpl %edx, %eax /* NB: %edx == 2 */
jne 2f
-1: movl $SYS_futex, %eax
+1: LIBC_PROBE (lll_lock_wait, 2, %rdi, %rsi)
+ movl $SYS_futex, %eax
syscall
2: movl %edx, %eax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index ad14185d1b..3686970f08 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002-2004, 2006-2008, 2009, 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.
@@ -20,6 +19,8 @@
#ifndef _LOWLEVELLOCK_H
#define _LOWLEVELLOCK_H 1
+#include <stap-probe.h>
+
#ifndef __ASSEMBLER__
# include <time.h>
# include <sys/param.h>
@@ -227,6 +228,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 ("syscall" \
: "=a" (__ignore) \
: "0" (SYS_futex), "D" (futex), \
@@ -286,7 +288,7 @@ LLL_STUB_UNWIND_INFO_END
"je 0f\n\t" \
"lock; cmpxchgl %4, %2\n\t" \
"jnz 1f\n\t" \
- "jmp 24f\n" \
+ "jmp 24f\n" \
"0:\tcmpxchgl %4, %2\n\t" \
"jnz 1f\n\t"
#endif
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
index 7b0eec10e0..67ff5fc4cd 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_broadcast.S
@@ -1,5 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004, 2005, 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.
@@ -24,7 +23,7 @@
#include <kernel-features.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
-
+#include <stap-probe.h>
.text
@@ -34,6 +33,8 @@
.align 16
__pthread_cond_broadcast:
+ LIBC_PROBE (cond_broadcast, 1, %rdi)
+
/* Get internal lock. */
movl $1, %esi
xorl %eax, %eax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
index a77b7d5965..3bff19bd12 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_signal.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 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 <pthread-pi-defines.h>
#include <kernel-features.h>
#include <pthread-errnos.h>
+#include <stap-probe.h>
.text
@@ -33,6 +34,8 @@
.align 16
__pthread_cond_signal:
+ LIBC_PROBE (cond_signal, 1, %rdi)
+
/* Get internal lock. */
movq %rdi, %r8
movl $1, %esi
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 79bfecdbf2..50e1ffd551 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005,2007,2009,2010,2011 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 <lowlevelcond.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
+#include <stap-probe.h>
#include <kernel-features.h>
@@ -67,6 +68,8 @@ __pthread_cond_timedwait:
cfi_adjust_cfa_offset(FRAME_SIZE)
cfi_remember_state
+ LIBC_PROBE (cond_timedwait, 3, %rdi, %rsi, %rdx)
+
cmpq $1000000000, 8(%rdx)
movl $EINVAL, %eax
jae 48f
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
index 6c1031ee05..61948523a6 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2007, 2009, 2011 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 <tcb-offsets.h>
#include <pthread-pi-defines.h>
#include <pthread-errnos.h>
+#include <stap-probe.h>
#include <kernel-features.h>
@@ -54,20 +55,22 @@ __pthread_cond_wait:
rsp + 32
+--------------------------+
rsp + 24 | old wake_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 16 | mutex pointer |
- +--------------------------+
+ +--------------------------+
rsp + 8 | condvar pointer |
- +--------------------------+
+ +--------------------------+
rsp + 4 | old broadcast_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 0 | old cancellation mode |
- +--------------------------+
+ +--------------------------+
*/
+ LIBC_PROBE (cond_wait, 2, %rdi, %rsi)
+
LP_OP(cmp) $-1, dep_mutex(%rdi)
- /* Prepare structure passed to cancellation handler. */
+ /* Prepare structure passed to cancellation handler. */
movq %rdi, 8(%rsp)
movq %rsi, 16(%rsp)
@@ -406,15 +409,15 @@ __condvar_cleanup1:
rsp + 32
+--------------------------+
rsp + 24 | unused |
- +--------------------------+
+ +--------------------------+
rsp + 16 | mutex pointer |
- +--------------------------+
+ +--------------------------+
rsp + 8 | condvar pointer |
- +--------------------------+
+ +--------------------------+
rsp + 4 | old broadcast_seq value |
- +--------------------------+
+ +--------------------------+
rsp + 0 | old cancellation mode |
- +--------------------------+
+ +--------------------------+
*/
movq %rax, 24(%rsp)
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
index c0761850d6..abb305791c 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 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.
@@ -21,7 +21,7 @@
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#include <kernel-features.h>
-
+#include <stap-probe.h>
.text
@@ -30,6 +30,9 @@
.align 16
__pthread_rwlock_rdlock:
cfi_startproc
+
+ LIBC_PROBE (rdlock_entry, 1, %rdi)
+
xorq %r10, %r10
/* Get the lock. */
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
index b349554eda..f6a6bff091 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 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.
@@ -21,7 +21,7 @@
#include <lowlevelrwlock.h>
#include <pthread-errnos.h>
#include <kernel-features.h>
-
+#include <stap-probe.h>
.text
@@ -30,6 +30,9 @@
.align 16
__pthread_rwlock_wrlock:
cfi_startproc
+
+ LIBC_PROBE (wrlock_entry, 1, %rdi)
+
xorq %r10, %r10
/* Get the lock. */