162306a36Sopenharmony_ciperf-sched(1)
262306a36Sopenharmony_ci=============
362306a36Sopenharmony_ci
462306a36Sopenharmony_ciNAME
562306a36Sopenharmony_ci----
662306a36Sopenharmony_ciperf-sched - Tool to trace/measure scheduler properties (latencies)
762306a36Sopenharmony_ci
862306a36Sopenharmony_ciSYNOPSIS
962306a36Sopenharmony_ci--------
1062306a36Sopenharmony_ci[verse]
1162306a36Sopenharmony_ci'perf sched' {record|latency|map|replay|script|timehist}
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ciDESCRIPTION
1462306a36Sopenharmony_ci-----------
1562306a36Sopenharmony_ciThere are several variants of 'perf sched':
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci  'perf sched record <command>' to record the scheduling events
1862306a36Sopenharmony_ci  of an arbitrary workload.
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ci  'perf sched latency' to report the per task scheduling latencies
2162306a36Sopenharmony_ci  and other scheduling properties of the workload.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ci  'perf sched script' to see a detailed trace of the workload that
2462306a36Sopenharmony_ci   was recorded (aliased to 'perf script' for now).
2562306a36Sopenharmony_ci
2662306a36Sopenharmony_ci  'perf sched replay' to simulate the workload that was recorded
2762306a36Sopenharmony_ci  via perf sched record. (this is done by starting up mockup threads
2862306a36Sopenharmony_ci  that mimic the workload based on the events in the trace. These
2962306a36Sopenharmony_ci  threads can then replay the timings (CPU runtime and sleep patterns)
3062306a36Sopenharmony_ci  of the workload as it occurred when it was recorded - and can repeat
3162306a36Sopenharmony_ci  it a number of times, measuring its performance.)
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci  'perf sched map' to print a textual context-switching outline of
3462306a36Sopenharmony_ci  workload captured via perf sched record.  Columns stand for
3562306a36Sopenharmony_ci  individual CPUs, and the two-letter shortcuts stand for tasks that
3662306a36Sopenharmony_ci  are running on a CPU. A '*' denotes the CPU that had the event, and
3762306a36Sopenharmony_ci  a dot signals an idle CPU.
3862306a36Sopenharmony_ci
3962306a36Sopenharmony_ci  'perf sched timehist' provides an analysis of scheduling events.
4062306a36Sopenharmony_ci    
4162306a36Sopenharmony_ci    Example usage:
4262306a36Sopenharmony_ci        perf sched record -- sleep 1
4362306a36Sopenharmony_ci        perf sched timehist
4462306a36Sopenharmony_ci    
4562306a36Sopenharmony_ci   By default it shows the individual schedule events, including the wait
4662306a36Sopenharmony_ci   time (time between sched-out and next sched-in events for the task), the
4762306a36Sopenharmony_ci   task scheduling delay (time between wakeup and actually running) and run
4862306a36Sopenharmony_ci   time for the task:
4962306a36Sopenharmony_ci    
5062306a36Sopenharmony_ci                time    cpu  task name             wait time  sch delay   run time
5162306a36Sopenharmony_ci                             [tid/pid]                (msec)     (msec)     (msec)
5262306a36Sopenharmony_ci      -------------- ------  --------------------  ---------  ---------  ---------
5362306a36Sopenharmony_ci        79371.874569 [0011]  gcc[31949]                0.014      0.000      1.148
5462306a36Sopenharmony_ci        79371.874591 [0010]  gcc[31951]                0.000      0.000      0.024
5562306a36Sopenharmony_ci        79371.874603 [0010]  migration/10[59]          3.350      0.004      0.011
5662306a36Sopenharmony_ci        79371.874604 [0011]  <idle>                    1.148      0.000      0.035
5762306a36Sopenharmony_ci        79371.874723 [0005]  <idle>                    0.016      0.000      1.383
5862306a36Sopenharmony_ci        79371.874746 [0005]  gcc[31949]                0.153      0.078      0.022
5962306a36Sopenharmony_ci    ...
6062306a36Sopenharmony_ci    
6162306a36Sopenharmony_ci   Times are in msec.usec.
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ciOPTIONS
6462306a36Sopenharmony_ci-------
6562306a36Sopenharmony_ci-i::
6662306a36Sopenharmony_ci--input=<file>::
6762306a36Sopenharmony_ci        Input file name. (default: perf.data unless stdin is a fifo)
6862306a36Sopenharmony_ci
6962306a36Sopenharmony_ci-v::
7062306a36Sopenharmony_ci--verbose::
7162306a36Sopenharmony_ci        Be more verbose. (show symbol address, etc)
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci-D::
7462306a36Sopenharmony_ci--dump-raw-trace=::
7562306a36Sopenharmony_ci        Display verbose dump of the sched data.
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci-f::
7862306a36Sopenharmony_ci--force::
7962306a36Sopenharmony_ci	Don't complain, do it.
8062306a36Sopenharmony_ci
8162306a36Sopenharmony_ciOPTIONS for 'perf sched map'
8262306a36Sopenharmony_ci----------------------------
8362306a36Sopenharmony_ci
8462306a36Sopenharmony_ci--compact::
8562306a36Sopenharmony_ci	Show only CPUs with activity. Helps visualizing on high core
8662306a36Sopenharmony_ci	count systems.
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci--cpus::
8962306a36Sopenharmony_ci	Show just entries with activities for the given CPUs.
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci--color-cpus::
9262306a36Sopenharmony_ci	Highlight the given cpus.
9362306a36Sopenharmony_ci
9462306a36Sopenharmony_ci--color-pids::
9562306a36Sopenharmony_ci	Highlight the given pids.
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ciOPTIONS for 'perf sched timehist'
9862306a36Sopenharmony_ci---------------------------------
9962306a36Sopenharmony_ci-k::
10062306a36Sopenharmony_ci--vmlinux=<file>::
10162306a36Sopenharmony_ci    vmlinux pathname
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci--kallsyms=<file>::
10462306a36Sopenharmony_ci    kallsyms pathname
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci-g::
10762306a36Sopenharmony_ci--call-graph::
10862306a36Sopenharmony_ci	Display call chains if present (default on).
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci--max-stack::
11162306a36Sopenharmony_ci	Maximum number of functions to display in backtrace, default 5.
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci-C=::
11462306a36Sopenharmony_ci--cpu=::
11562306a36Sopenharmony_ci	Only show events for the given CPU(s) (comma separated list).
11662306a36Sopenharmony_ci
11762306a36Sopenharmony_ci-p=::
11862306a36Sopenharmony_ci--pid=::
11962306a36Sopenharmony_ci	Only show events for given process ID (comma separated list).
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci-t=::
12262306a36Sopenharmony_ci--tid=::
12362306a36Sopenharmony_ci	Only show events for given thread ID (comma separated list).
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci-s::
12662306a36Sopenharmony_ci--summary::
12762306a36Sopenharmony_ci    Show only a summary of scheduling by thread with min, max, and average
12862306a36Sopenharmony_ci    run times (in sec) and relative stddev.
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci-S::
13162306a36Sopenharmony_ci--with-summary::
13262306a36Sopenharmony_ci    Show all scheduling events followed by a summary by thread with min,
13362306a36Sopenharmony_ci    max, and average run times (in sec) and relative stddev.
13462306a36Sopenharmony_ci
13562306a36Sopenharmony_ci--symfs=<directory>::
13662306a36Sopenharmony_ci    Look for files with symbols relative to this directory.
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_ci-V::
13962306a36Sopenharmony_ci--cpu-visual::
14062306a36Sopenharmony_ci	Show visual aid for sched switches by CPU: 'i' marks idle time,
14162306a36Sopenharmony_ci	's' are scheduler events.
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci-w::
14462306a36Sopenharmony_ci--wakeups::
14562306a36Sopenharmony_ci	Show wakeup events.
14662306a36Sopenharmony_ci
14762306a36Sopenharmony_ci-M::
14862306a36Sopenharmony_ci--migrations::
14962306a36Sopenharmony_ci	Show migration events.
15062306a36Sopenharmony_ci
15162306a36Sopenharmony_ci-n::
15262306a36Sopenharmony_ci--next::
15362306a36Sopenharmony_ci	Show next task.
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci-I::
15662306a36Sopenharmony_ci--idle-hist::
15762306a36Sopenharmony_ci	Show idle-related events only.
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ci--time::
16062306a36Sopenharmony_ci	Only analyze samples within given time window: <start>,<stop>. Times
16162306a36Sopenharmony_ci	have the format seconds.microseconds. If start is not given (i.e., time
16262306a36Sopenharmony_ci	string is ',x.y') then analysis starts at the beginning of the file. If
16362306a36Sopenharmony_ci	stop time is not given (i.e, time string is 'x.y,') then analysis goes
16462306a36Sopenharmony_ci	to end of file.
16562306a36Sopenharmony_ci
16662306a36Sopenharmony_ci--state::
16762306a36Sopenharmony_ci	Show task state when it switched out.
16862306a36Sopenharmony_ci
16962306a36Sopenharmony_ciSEE ALSO
17062306a36Sopenharmony_ci--------
17162306a36Sopenharmony_cilinkperf:perf-record[1]
172