1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Add systemtap static probe points in generic and x86_64 pthread code.

This commit is contained in:
Roland McGrath
2012-05-25 13:35:08 -07:00
parent 8422c9a560
commit 5acf7263d5
26 changed files with 266 additions and 53 deletions

View File

@ -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 <drepper@redhat.com>, 2002.
@ -23,6 +23,7 @@
#include <not-cancel.h>
#include "pthreadP.h"
#include <lowlevellock.h>
#include <stap-probe.h>
#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