commands
perf — Count selected performance events
Collect selected event counts subject to hardware and kernel policy; do not weaken permissions. Use a fresh private workspace; No production workload is required.
Formal Syntax & Structure
linux syntaxlinux
perf stat -e EVENT -- COMMANDParameters & Attributes
| Name | Type | Description |
|---|---|---|
| stat | operand | Aggregate counts |
| -e | option | Event selector |
| EVENT | operand | Event name |
| COMMAND | operand | Authorized child command |
Return Value
exit status and output
The stat operation reports selected performance counters, typically on stderr. Inspect unsupported or permission-denied counters and the workload outcome; successful tool invocation is not evidence that every event was measured.
Working Example
Example Snippetlinux
perf stat -e task-clock -- /bin/true