Cyclictest(8)
π CYCLICTEST π
okay so bestie, welcome to cyclictest(8), straight out of the System Manager's Manual β¨ β and ngl, this one is a high resolution test program, which is giving serious main-character energy. It measures latency. It does it in microseconds. It will absolutely humble your system. Let's get into it π
πΈ NAME πΈ
cyclictest β the High resolution test program π
π SYNOPSIS π
cyclictest [-mMNqrRsSuvx] [--default-system] [--latency pm-c-state]
[--deepest-idle-state idle-state-num] [-c clock-type]
[-d distance-usec] [-i interval-usec]
[--secaligned wakeup-usec] [-A alignment-usec]
[-t num-threads] [--mainaffinity proc-set] [-a proc-set]
[--policy threads-sched-policy] [-p thread-prio]
[--priospread] [-b break-usec] [--tracemark]
[-D duration-mhd] [-l num-loops] [--dbg_cyclictest]
[-o oscope-red] [-f fifo-path] [-h max-latency-usec]
[-H max-latency-usec] [--spike trigger-point-usec]
[--spike-nodes num-nodes] [--histfile file-path]
[--json file-path] [--smi]
cyclictest --help
π OPTIONS π
--helpβ show a usage message and dip out. bye bestie π
β¨ System-altering options β¨
careful, these ones touch your actual system.
--default-systemβ stopscyclictestfrom force-tuning your system. Without this,cyclictestwrites a value of0to/dev/cpu_dma_latency, which stops the CPU from going into deep sleep states. And likeβ¦ sure, force-tuning might make your latency numbers look cuter, but it's lowkey lying to you β it hides the fact that the system might need extra tuning fr fr.--latency=PM_Q0Sβ the power management latency target value. This value gets written to/dev/cpu_dma_latencyand it affects c-states. Default is0.--deepest-idle-state=nβ reduces exit-from-idle latency by limiting the idle state up tonon the cpus that are actually used (-1disables all idle states). Heads up though: power management is not suppressed on the other cpus. π--laptopβ obsolete, bestie. It's giving 2010. Please use--default-systeminstead. π«Ά
π¦ Sleep-mechanism clock options π¦
-c,--clock=CLOCKβ pick which system clock gets used to calculate the measuring thread's latency. The allowedCLOCKvalues are:
0 = CLOCK_MONOTONIC (default)
1 = CLOCK_REALTIME
aux0 - aux7
Wanna know more about how Linux does these clocks? Go check clock_getres(2) π
-x,--posix_timersβ use POSIX timers instead ofclock_nanosleep.-s,--systemβ usesys_nanosleepandsys_setitimerinstead of posix timers. Real talk:-scan only be used with one thread, because itimers are per process and not per thread. That said,-suses thenanosleepsyscall and that part isn't restricted to one thread. slay.-r,--relativeβ use relative timers instead of absolute ones. Default behaviour of the tests is absolute timers. This option is here purely for completeness and honestly should not be used for reproducible tests. π©-R,--resolutionβ check the clock resolution by callingclock_gettime()many, many times. The list oflock_gettime()values gets reported with-X. β¨
π Thread-waekup timing options π
-d,--distance=DISTβ distance of thread intervals in us. default =500.-i,--interval=INTVβ set the base interval of the thread(s) in microseconds (default is1000us). This sets the interval of the first thread. See also-d. π--secaligned [USEC]β align thread wakeups to the next full second and apply the optional offset.-A,--align=USECβ align thread wakeups to a specific offset in microseconds.
π§ SMP-related options π§
-S,--smpβ sets options for standard testing on SMP systems. Equivalent to using the options-t -a, plus it keeps any specified priority equal across all threads. one setting, whole squad aligned π-t,--threads[=NUM]β set the number of test threads (default is1). CreatesNUMtest threads. IfNUMisn't specified,NUMis set to the number of available CPUs. See-d,-iand-pfor more info. π₯--mainaffinity=CPUSETβ run the main thread on CPU #N. This only affects the main thread and not the measurement threads.-a,--affinity[=PROC-SET]β run threads on the set of processors given byPROC-SET. IfPROC-SETisn't specified, all processors get used. Threads get assigned to the processors in the set in numeric order, round-robin style. π- The set of processors can be specified as
A,B,C, orA-C, orA-B,D-F, and so on*. - The
!character can be used to negate a set. For example,!B-Dmeans use all available CPUs except B through D. - The cpu numbers are the same as shown in the processor field in
/proc/cpuinfo. - See
numa(3)for more information on specifying CPU sets. - * Support for CPU sets requires libnuma version >=
2. For libnuma v1,PROC-SET, if specified, must be a single CPU number.
- The set of processors can be specified as
πΈ Memory options πΈ
-m,--mlockallβ lock current and future memory allocations so they don't get paged out. no eviction, no drama π«Ά
β Tracing options β
-b,--breaktrace=USECβ send break trace command when latency >USEC.--tracemarkβ write a trace mark when the-blatency is exceeded.
π Test-duration options π
-D,--duration=TIMEβ specify a length for the test run. Append'm','h', or'd'to specify minutes, hours or days.-l,--loops=LOOPSβ set the number of loops. Default is0(endless π). This option is useful for automated tests with a given number of test cycles.cyclicteststops once the number of timer intervals has been reached.
π Output options π
--dbg_cyclictestβ print info useful for debuggingcyclictest.-o,--oscope=REDβ oscilloscope mode: reduce verbose output byRED.-F,--fifo=<path>β create a named pipe atpathand write stats to it.-h,--histogram=USβ dump the latency histogram to stdout after the run.USis the max latency time to be tracked, in microseconds. This option runs all threads at the same priority.-H,--histofall=MAXLATENCYINUSβ same as-h, except an extra histogram column shows up on the right with summary data of all thread histograms. Ifcyclictestruns a single thread only,-His equivalent to-h. π--spike=<trigger>β record all spikes >trigger.--spike-nodes=[num of nodes]β the maximum number of spikes we can record. The default is1024if not specified.--histfile=<path>β dump the latency histogram to<path>instead of stdout. π--json=FILENAMEβ write final results intoFILENAME, JSON formatted.-M,--refresh_on_maxβ delay updating the screen until a new max latency is hit. (useful for runningcyclicteston low-bandwidth connections π)-N,--nsecsβ show results in nanoseconds instead of microseconds, which is the default unit.-q,--quietβ print a summary only on exit. Useful for automated tests, where only the summary output needs to be captured. π€«-u,--unbufferedβ force unbuffered output for live processing.-v,--verboseβ output values on stdout for statistics. This option is used to gather statistical information about the latency distribution. The output goes to stdout. The output format is:"n:c:v", wherenis the task number,cis the count, andvis the latency value in microseconds.
π₯οΈ X86 options π₯οΈ
--smiβ enable SMI count/detection on processors with SMI count support.
π EXAMPLE INVOCATION π
Testing a realtime system is hardware and workload dependent. With that in mind, the invocation below is a genuinely good place to start β¨:
cyclictest
--default-system
--secaligned
--interval=250
--distance=0
--mlockall
--smp
--priority=98
--histogram=1000
--histfile=output.txt
π¦ SEE ALSO π¦
numa(3), numactl(8), rtla-timerlat(1)
π AUTHORS π
cyclictest was written by Thomas Gleixner <tlgx@linuxtronix.de>.
This manual page was written by Alessio Igor Bogani <abogani@texware.it>, for the Debian project (but may be used by others).
Updated by John Kacur <jkacur@redhat.com>.
and that's the whole page bestie π it lives in the System Manager's Manual, dated April 22, 2016, and it ate. no cap. πβ¨π¦
π¦ where this page comes from
- arch rolling: rt-tests 2.11-1 Β· GPL-2.0-or-later
- centos-stream 10: realtime-tests 2.11-1.el10 Β· GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.1-or-later
- centos-stream 9: realtime-tests 2.11-1.el9 Β· GPLv2
- fedora 43: realtime-tests 2.11-1.fc43 Β· GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.1-or-later
- fedora 44: realtime-tests 2.11-1.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.1-or-later
- nixpkgs unstable: rt-tests 2.11
- π the page's license: GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms