mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-30 14:31:14 +00:00
9d20e22e46
Add POSIX-proposed pthread_mutex_clocklock function that works like pthread_mutex_timedlock but takes a clockid parameter to measure the abstime parameter against. * sysdeps/nptl/pthread.h: Add pthread_mutex_clocklock. * nptl/DESIGN-systemtap-probes.txt: Likewise. * nptl/pthread_mutex_timedlock.c (__pthread_mutex_clocklock_common): Rename from __pthread_mutex_timedlock and add clockid parameter. Pass this parameter to lll_clocklock and lll_clocklock_elision in place of CLOCK_REALTIME. (__pthread_mutex_clocklock): New function to add LIBC_PROBE and validate clockid parameter before calling __pthread_mutex_clocklock_common. (__pthread_mutex_timedlock): New implementation to add LIBC_PROBE and calls __pthread_mutex_clocklock_common passing CLOCK_REALTIME as the clockid. * nptl/Makefile: Add tst-mutex11.c. * nptl/tst-abstime.c (th): Add tests for pthread_mutex_clocklock. * nptl/tst-mutex11.c: New tests for passing invalid and unsupported clockid parameters to pthread_mutex_clocklock. * nptl/tst-mutex5.c (do_test_clock): Rename from do_test and take clockid parameter to indicate which clock to be used. Call pthread_mutex_timedlock or pthread_mutex_clocklock as appropriate. (do_test): Call do_test_clock to separately test pthread_mutex_timedlock, pthread_mutex_clocklock(CLOCK_REALTIME) and pthread_mutex_clocklock(CLOCK_MONOTONIC). * nptl/tst-mutex9.c: Likewise. * nptl/Versions (GLIBC_2.30): Add pthread_mutex_clocklock. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/alpha/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/arm/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/csky/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/hppa/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/i386/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/ia64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/microblaze/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/nios2/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sh/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist (GLIBC_2.30): Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist (GLIBC_2.30): Likewise. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
77 lines
3.2 KiB
Plaintext
77 lines
3.2 KiB
Plaintext
Systemtap is a dynamic tracing/instrumenting tool available on Linux. Probes
|
|
that are not fired at run time have close to zero overhead.
|
|
|
|
The following probes are available for NPTL:
|
|
|
|
Thread creation & Join Probes
|
|
=============================
|
|
pthread_create - probe for pthread_create
|
|
arg1 = pointer (pthread_t*) to thread
|
|
arg2 = pointer (pthread_attr_t*) to attr
|
|
arg3 = pointer (void *) to start_routine
|
|
arg4 = arguments to start_routine
|
|
pthread_start - probe for actual thread creation
|
|
arg1 = struct pthread (members include thread ID, process ID)
|
|
arg2 = address of start_routine
|
|
arg3 = pointer to the list of arguments
|
|
pthread_join - probe for pthread_join
|
|
arg1 = thread ID
|
|
pthread_join_ret - probe for pthread_join return
|
|
arg1 = thread ID
|
|
arg2 = return value
|
|
|
|
Lock-related Probes
|
|
===================
|
|
mutex_init - probe for pthread_mutex_init
|
|
arg1 = address of mutex lock
|
|
mutex_acquired - probe for succ. return of pthread_mutex_lock
|
|
arg1 = address of mutex lock
|
|
mutex_timedlock_acquired - probe for succ. return of pthread_mutex_timedlock
|
|
arg1 = address of mutex lock
|
|
mutex_entry - probe for entry to the pthread_mutex_lock function
|
|
arg1 = address of mutex lock
|
|
mutex_timedlock_entry - probe for entry to the pthread_mutex_timedlock function
|
|
arg1 = address of mutex lock, arg2 = address of timespec
|
|
mutex_clocklock_entry - probe for entry to the pthread_mutex_clocklock function
|
|
arg1 = address of mutex lock, arg2 = clockid,
|
|
arg3 = address of timespec
|
|
mutex_release - probe for pthread_mutex_unlock after the successful release of a
|
|
mutex lock
|
|
arg1 = address of mutex lock
|
|
mutex_destroy - probe for pthread_mutex_destroy
|
|
arg1 = address of mutex lock
|
|
|
|
wrlock_entry - probe for entry to the pthread_rwlock_wrlock function
|
|
arg1 = address of rw lock
|
|
rdlock_entry - probe for entry to the pthread_rwlock_rdlock function
|
|
arg1 = address of rw lock
|
|
|
|
rwlock_destroy - probe for pthread_rwlock_destroy
|
|
arg1 = address of rw lock
|
|
wrlock_acquire_write - probe for pthread_rwlock_wrlock (after getting the lock)
|
|
arg1 = address of rw lock
|
|
rdlock_acquire_read - probe for pthread_rwlock_rdlock after successfully getting
|
|
the lock
|
|
arg1 = address of rw lock
|
|
rwlock_unlock - probe for pthread_rwlock_unlock
|
|
arg1 = address of rw lock
|
|
|
|
Condition variable Probes
|
|
=========================
|
|
cond_init - probe for pthread_cond_init
|
|
arg1 = condition
|
|
arg2 = attr
|
|
cond_destroy - probe for pthread_cond_destroy
|
|
arg1 = cond
|
|
cond_wait - probe for pthread_cond_wait
|
|
arg1 = condition
|
|
arg2 = mutex lock
|
|
cond_timedwait - probe for pthread_cond_timedwait
|
|
arg1 = condition
|
|
arg2 = mutex lock
|
|
arg3 = timespec
|
|
cond_signal - probe for pthread_cond_signal
|
|
arg1 = condition
|
|
cond_broadcast - probe for pthread_cond_broadcast
|
|
arg1 = condition
|