From 5acf7263d52992ce4144e0a3b3644985b9e792b4 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 25 May 2012 13:35:08 -0700 Subject: Add systemtap static probe points in generic and x86_64 pthread code. --- nptl/pthread_mutex_lock.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'nptl/pthread_mutex_lock.c') diff --git a/nptl/pthread_mutex_lock.c b/nptl/pthread_mutex_lock.c index c747355e49..2b30bad48d 100644 --- a/nptl/pthread_mutex_lock.c +++ b/nptl/pthread_mutex_lock.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002-2007, 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 , 2002. @@ -23,6 +23,7 @@ #include #include "pthreadP.h" #include +#include #ifndef LLL_MUTEX_LOCK @@ -47,6 +48,9 @@ __pthread_mutex_lock (mutex) assert (sizeof (mutex->__size) >= sizeof (mutex->__data)); unsigned int type = PTHREAD_MUTEX_TYPE (mutex); + + LIBC_PROBE (mutex_entry, 1, mutex); + if (__builtin_expect (type & ~PTHREAD_MUTEX_KIND_MASK_NP, 0)) return __pthread_mutex_lock_full (mutex); @@ -126,6 +130,8 @@ __pthread_mutex_lock (mutex) ++mutex->__data.__nusers; #endif + LIBC_PROBE (mutex_acquired, 1, mutex); + return 0; } @@ -466,6 +472,8 @@ __pthread_mutex_lock_full (pthread_mutex_t *mutex) ++mutex->__data.__nusers; #endif + LIBC_PROBE (mutex_acquired, 1, mutex); + return 0; } #ifndef __pthread_mutex_lock -- cgit 1.4.1