There are several variants of perf sched:
'perf sched record <command>' to record the scheduling events
of an arbitrary workload.
'perf sched latency' to report the per task scheduling latencies
and other scheduling properties of the workload.
'perf sched script' to see a detailed trace of the workload that
was recorded (aliased to 'perf script' for now).
'perf sched replay' to simulate the workload that was recorded
via perf sched record. (this is done by starting up mockup threads
that mimic the workload based on the events in the trace. These
threads can then replay the timings (CPU runtime and sleep patterns)
of the workload as it occurred when it was recorded - and can repeat
it a number of times, measuring its performance.)
'perf sched map' to print a textual context-switching outline of
workload captured via perf sched record. Columns stand for
individual CPUs, and the two-letter shortcuts stand for tasks that
are running on a CPU. A '*' denotes the CPU that had the event, and
a dot signals an idle CPU.
'perf sched timehist' provides an analysis of scheduling events.
perf sched record -- sleep 1
perf sched timehist
By default it shows the individual schedule events, including the wait
time (time between sched-out and next sched-in events for the task), the
task scheduling delay (time between wakeup and actually running) and run
time for the task:
time cpu task name wait time sch delay run time
[tid/pid] (msec) (msec) (msec)
-------------- ------ -------------------- --------- --------- ---------
79371.874569  gcc 0.014 0.000 1.148
79371.874591  gcc 0.000 0.000 0.024
79371.874603  migration/10 3.350 0.004 0.011
79371.874604  <idle> 1.148 0.000 0.035
79371.874723  <idle> 0.016 0.000 1.383
79371.874746  gcc 0.153 0.078 0.022
Times are in msec.usec.
Show only CPUs with activity. Helps visualizing on high core
Show just entries with activities for the given CPUs.
Highlight the given cpus.
Highlight the given pids.
Do not display call chains if present.
Maximum number of functions to display in backtrace, default 5.
Show only a summary of scheduling by thread with min, max, and
average run times (in sec) and relative stddev.
Show all scheduling events followed by a summary by thread with
min, max, and average run times (in sec) and relative stddev.
Look for files with symbols relative to this directory.
Show visual aid for sched switches by CPU: i marks idle time, s
are scheduler events.
Show wakeup events.
Show migration events.
Show idle-related events only.
Only analyze samples within given time window: <start>,<stop>.
Times have the format seconds.microseconds. If start is not given
(i.e., time string is ,x.y) then analysis starts at the beginning
of the file. If stop time is not given (i.e, time string is x.y,)
then analysis goes to end of file.
Show task state when it switched out.
This page is part of the perf (Performance analysis tools for Linux
(in Linux source tree)) project. Information about the project can
be found at ⟨https://perf.wiki.kernel.org/index.php/Main_Page⟩. If
you have a bug report for this manual page, send it to
email@example.com. This page was obtained from the
project's upstream Git repository
2017-03-13. If you discover any rendering problems in this HTML ver‐
sion of the page, or you believe there is a better or more up-to-date
source for the page, or you have corrections or improvements to the
information in this COLOPHON (which is not part of the original man‐
ual page), send a mail to firstname.lastname@example.org
perf 03/12/2017 PERF-SCHED(1)