PERF-KWORK(1)

πŸ’… perf-kwork πŸ’…

okay bestie, so this page is from the perf Manual β€” it's the perf-kwork page and it's literally about tracing/measuring kernel work properties (latencies). stay with me, it's actually so good 🫢


✨ NAME ✨

perf-kwork β€” the tool to trace/measure kernel work properties (latencies). periodt. that's the whole vibe.


🌸 SYNOPSIS 🌸

perf kwork {record|report|latency|timehist|top}

like, pick one of those five. that's the moment.


πŸ¦‹ DESCRIPTION πŸ¦‹

so there are several variants of perf kwork, and each one is kind of iconic in its own way:

  • 'perf kwork record <command>' β€” records the kernel work of an arbitrary workload.
  • 'perf kwork report' β€” reports the per kwork runtime.
  • 'perf kwork latency' β€” reports the per kwork latencies.
  • 'perf kwork timehist' β€” provides an analysis of kernel work events.
  • 'perf kwork top' β€” reports the task cpu usage.

Example usage, bestie, copy these vibes:

perf kwork record -- sleep 1
perf kwork report
perf kwork report -b
perf kwork latency
perf kwork latency -b
perf kwork timehist
perf kwork top
perf kwork top -b

by default it shows the individual work events such as irq, workqueue, including the run time and delay (time between raise and actually entry) β€” and honestly, look at it:

   Runtime start      Runtime end        Cpu     Kwork name                 Runtime     Delaytime
                                                     (TYPE)NAME:NUM             (msec)      (msec)
-----------------  -----------------  ------  -------------------------  ----------  ----------
   1811186.976062     1811186.976327  [0000]  (s)RCU:9                        0.266       0.114
   1811186.978452     1811186.978547  [0000]  (s)SCHED:7                      0.095       0.171
   1811186.980327     1811186.980490  [0000]  (s)SCHED:7                      0.162       0.083
   1811186.981221     1811186.981271  [0000]  (s)SCHED:7                      0.050       0.077
   1811186.984267     1811186.984318  [0000]  (s)SCHED:7                      0.051       0.075
   1811186.987252     1811186.987315  [0000]  (s)SCHED:7                      0.063       0.081
   1811186.987785     1811186.987843  [0006]  (s)RCU:9                        0.058       0.645
   1811186.988319     1811186.988383  [0000]  (s)SCHED:7                      0.064       0.143
   1811186.989404     1811186.989607  [0002]  (s)TIMER:1                      0.203       0.111
   1811186.989660     1811186.989732  [0002]  (s)SCHED:7                      0.072       0.310
   1811186.991295     1811186.991407  [0002]  eth0:10                         0.112
   1811186.991639     1811186.991734  [0002]  (s)NET_RX:3                     0.095       0.277
   1811186.989860     1811186.991826  [0002]  (w)vmstat_shepherd              1.966       0.345
...
times are in msec.usec. don't forget, iykyk πŸ’–

πŸ’… OPTIONS πŸ’…

the universal ones, the main character options:

  • -D, --dump-raw-trace= β€” display verbose dump of the sched data. yes the = is there, it's giving detail-oriented.
  • -f, --force β€” don't complain, do it. literally the most gen z flag ever πŸ’€
  • -k, --kwork β€” list of kwork to profile (irq, softirq, workqueue, sched, etc)
  • -v, --verbose β€” be more verbose. (show symbol address, etc)

πŸŽ€ OPTIONS for perf kwork report πŸŽ€

  • -b, --use-bpf β€” use BPF to measure kwork runtime
  • -C, --cpu β€” only show events for the given CPU(s) (comma separated list).
  • -i, --input β€” input file name. (default: perf.data unless stdin is a fifo)
  • -n, --name β€” only show events for the given name.
  • -s, --sort β€” sort by key(s): runtime, max, count
  • -S, --with-summary β€” show summary with statistics
  • --time β€” 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.

🌈 OPTIONS for 'perf kwork latency' 🌈

  • -b, --use-bpf β€” use BPF to measure kwork latency
  • -C, --cpu β€” only show events for the given CPU(s) (comma separated list).
  • -i, --input β€” input file name. (default: perf.data unless stdin is a fifo)
  • -n, --name β€” only show events for the given name.
  • -s, --sort β€” sort by key(s): avg, max, count
  • --time β€” 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.

🌟 OPTIONS FOR PERF KWORK TIMEHIST 🌟

  • -C, --cpu β€” only show events for the given CPU(s) (comma separated list).
  • -g, --call-graph β€” display call chains if present (default off).
  • -i, --input β€” input file name. (default: perf.data unless stdin is a fifo)
  • -k, --vmlinux=<file> β€” vmlinux pathname
  • -n, --name β€” only show events for the given name.
  • --kallsyms=<file> β€” kallsyms pathname
  • --max-stack β€” maximum number of functions to display in backtrace, default 5.
  • --symfs=<directory[,layout]> β€” look for files with symbols relative to this directory. The optional layout can be hierarchy (default, matches full path) or flat (only matches base name). This is useful when debug files are stored in a flat directory structure.
  • --time β€” 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.

πŸ‘‘ OPTIONS for perf kwork top πŸ‘‘

  • -b, --use-bpf β€” use BPF to measure task cpu usage.
  • -C, --cpu β€” only show events for the given CPU(s) (comma separated list).
  • -i, --input β€” input file name. (default: perf.data unless stdin is a fifo)
  • -n, --name β€” only show events for the given name.
  • -s, --sort β€” sort by key(s): rate, runtime, tid
  • --time β€” 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.

πŸ”₯ SEE ALSO πŸ”₯

go off, bestie, that's the only one you need πŸ’œ


okay that's the whole page, no cap. this masterpiece is from perf, version/date 10/31/2026, and it's the PERF-KWORK(1) page β€” slay, bye! πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from