---
name: "plockstat"
section: "1"
platform: "macos"
package: "dtrace"
version: "413"
release: "macOS 26.5"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/plockstat"
---

# plockstat(1)

front-end to DTrace to print statistics about POSIX mutexes and read/write locks

## NAME

plockstat - front-end to DTrace to print statistics about POSIX mutexes and read/write locks

## SYNOPSIS

```
plockstat [-vACHV] [-n count] [-s depth] [-e secs] [-x opt[=val]]
command [arg...]
```

**plockstat** \[**-vACHV**\] \[**-n** *count*\] \[**-s** *depth*\] \[**-e** *secs*\] \[**-x** opt\[=val\]\] **-p** *pid*

## OVERVIEW

The *plockstat* command is a front-end to DTrace that can be used to print statistics about POSIX mutexes and read/write locks.\

Since OS X 10.11, in order to use this, your process must be run with DYLD\_LIBRARY\_PATH set to contain /usr/lib/system/introspection:

DYLD\_LIBRARY\_PATH=/usr/lib/system/introspection\

Which contains the necessary static DTrace probes.

## OPTIONS

- **-v**

  print a message when tracing starts

- **-A**

  trace contention and hold events (same as **-CH**)

- **-C**

  trace contention events for mutexes and rwlocks

- **-H**

  trace hold events for mutexes and rwlocks

- **-V**

  print the dtrace script to run

- **-n *count***

  display only '*count*' entries for each event type

- **-s *depth***

  show stack trace upto '*depth*' entries

- **-e *secs***

  exit after specified seconds

- **-x arg\[=val\]**

  enable a DTrace runtime option or a D compiler option

- **-p *pid***

  attach and trace the specified process id

## SEE ALSO

[**dtrace**(1)](/dtrace/1.md)
