perf_sched_timehist
Generate a timestamped scheduler timeline from perf.data to analyze context switches, runtime, and scheduling delays, revealing when and why tasks were descheduled.
Instructions
Timestamped scheduler timeline showing every context switch with runtime and scheduling delay.
Use this for detailed scheduling analysis -- find when and why tasks were descheduled.
Key parameters:
summary: true to show only summary stats (no per-event detail).
wakeups: show wakeup events between switches.
migrations: show CPU migration events.
idle_hist: show idle-time analysis.
state: show task state (R/S/D/T) at each switch.
call_graph: 'fp' or 'dwarf' for callchain at each switch.
with_summary: show both detail and summary.
comms: filter to specific task names.
time: restrict to time range.
Output: per-event table with timestamp, task, runtime, wait-time, scheduling delay. Requires: perf sched record.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ns | No | Show times in nanoseconds | |
| cpu | No | CPUs to filter | |
| pid | No | Analyze only these PIDs | |
| tid | No | Analyze only these TIDs | |
| next | No | Show next task | |
| time | No | Time span to analyze | |
| comms | No | Only show these comms | |
| force | No | Don't complain, do it | |
| input | Yes | Path to perf.data file | |
| state | No | Show task state at switch | |
| symfs | No | Symbol filesystem root | |
| summary | No | Show summary statistics only | |
| verbose | No | Verbosity level (0-2) | |
| vmlinux | No | vmlinux pathname | |
| wakeups | No | Show wakeup events | |
| kallsyms | No | kallsyms pathname | |
| idle_hist | No | Show idle-related events | |
| max_stack | No | Maximum stack depth | |
| show_prio | No | Show task priority | |
| call_graph | No | Call graph options | |
| cpu_visual | No | Show CPU visualization | |
| migrations | No | Show migration events | |
| with_summary | No | Show summary with detailed output | |
| dump_raw_trace | No | Dump raw trace in ASCII | |
| pre_migrations | No | Show pre-migration events |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |