[PATCH] Adding systemtap probe points in pthread library (slightly revised again)

Tom Tromey tromey@redhat.com
Thu Feb 10 15:35:00 GMT 2011


>>>>> "Rayson" == Rayson Ho <rho@redhat.com> writes:

Rayson> +mutex_acquired - probe for pthread_mutex_lock
Rayson> +               arg1 = address of mutex lock
Rayson> +mutex_block   - probe for resume from _possible_ mutex block event
Rayson> +              arg1 = address of mutex lock
Rayson> +mutex_entry   - probe for entry to the pthread_mutex_lock function
Rayson> +              arg1 = address of mutex lock

mutex_block seems misnamed to me.  I would suggest something like
mutex_unblock or mutex_unblocked instead.

Also, mutex_block and mutex_acquired seem fairly close in semantics --
almost redundant.  So another approach would be to just drop
mutex_block.

The piece that is missing for my scenario is a probe that fires just
before glibc blocks on a mutex.  I couldn't think of a way to get this
information with the current set of probes.

The rationale for such a probe is to make it possible to implement a
deadlock detector in gdb.  Maybe this could be done with the current
probes, assuming that debuginfo is available.  But it seems like it
would be simpler with an "about to block" probe.

Tom



More information about the Libc-alpha mailing list