ptsematest(8)
π ptsematest(8) β like, the manual page but make it make sense
okay bestie, gather round π«Ά this is the manual page for ptsematest, and yes it's in section 8, and yes we're gonna get through it together. no cap.
fun legal moment first: this page carries the license tag SPDX-License-Identifier: GPL-2.0-or-later. iconic of it.
β¨ NAME β¨
ptsematest β start two threads and measure the latency of interprocess communication with POSIX mutex. π§΅π§΅
πΈ SYNOPSIS πΈ
ptsematest [-a|--affinity [PROC]] [-b|--breaktrace USEC] [-d|--distance
DIST] [-D|--duration TIME] [-h|--help] [-i|--interval INTV] [--json
FILENAME] [-l|--loops LOOPS] [-p|--prio PRIO] [-q|--quiet] [-S|--smp]
[-t|--threads [NUM]]
that's the whole vibe right there β read it like a spell you're casting.
π¦ DESCRIPTION π¦
so here's the tea β β ptsematest starts two threads, and those two threads are synced up via pthread_mutex_unlock()/pthread_mutex_lock(). then it measures the latency between releasing the lock and getting it back. that's it. that's the whole program. obsessed.
π OPTIONS π
-a,--affinity[=PROC]β run on processor number PROC. if you don't say which PROC, it just runs on whatever the current processor is. letting the scheduler choose, we love a chill queen.-b,--breaktrace=USECβ send the break trace command when latency goes over USEC. this is a debugging option, for controlling the latency tracer in the realtime preemption patch. it's genuinely useful for tracking down unexpected large latencies on a system. π-d,--distance=DISTβ sets the distance between thread intervals in microseconds (default is500 us). heads up: whencyclictestis called with the-toption and more than one thread gets created, this distance value gets added to the interval of the threads, like so:Interval(thread N) = Interval(thread N-1) + DIST-D,--duration=TIMEβ specify how long the test run lasts. tack on'm','h', or'd'to say minutes, hours or days. β°-h,--helpβ print the help message. the classic.-i,--interval=INTVβ set the base interval of the thread(s) in microseconds (default is1000 us). this sets the interval of the first thread. also go look at-d. π--json=FILENAMEβ write the final results into FILENAME, JSON formatted. for the data girlies π-l,--loops=LOOPSβ set the number of loops. default is0, which means endless. this option is the move for automated tests that want a given number of test cycles.ptsematestgets stopped once the number of timer intervals has been reached.-p,--prio=PRIOβ set the priority of the process. π-q,--quietβ print a summary only on exit. useful for automated tests where you only need to capture the summary output. shhh π€«-S,--smpβ SMP testing: that's options-a -tand same priority.-t,--threads[=NUM]β set the number of test threads (default is1if you don't pass this option at all). if NUM is specified, create NUM test threads. if NUM is not specified, NUM gets set to the number of available CPUs. infinite threads glitch, but make it legal
π₯ EXAMPLES π₯
the following example was running on a 4-way processor:
# ptsematest -a -t -p99 -i100 -d25 -l1000000
#0: ID8672, P99, CPU0, I100; #1: ID8673, P99, CPU0, Cycles 1000000
#2: ID8674, P98, CPU1, I125; #3: ID8675, P98, CPU1, Cycles 811035
#4: ID8676, P97, CPU2, I150; #5: ID8677, P97, CPU2, Cycles 668130
#6: ID8678, P96, CPU3, I175; #7: ID8679, P96, CPU3, Cycles 589423
#1 -> #0, Min 1, Cur 1, Avg 2, Max 11
#3 -> #2, Min 1, Cur 2, Avg 2, Max 13
#5 -> #4, Min 1, Cur 4, Avg 3, Max 12
#7 -> #6, Min 1, Cur 4, Avg 2, Max 12
look at those numbers go. absolutely ate. π
π AUTHORS π
Carsten Emde <C.Emde@osadl.org> β thank you for your service, legend π«‘
β SEE ALSO β
pthread_mutex_lock(3p)pthread_mutex_unlock(3p)
and that's the page, bestie. version 0.1, and yeah it lives in section 8 of the manual like all the cool system admin stuff does. go forth and measure your latencies β¨ππ¦
π¦ 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 43: realtime-tests 2.8-6.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
- fedora 44: realtime-tests 2.8-7.fc44 Β· GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-only AND LGPL-2.1-or-later
- nixos 26.05: rt-tests 2.10
- nixpkgs unstable: rt-tests 2.11
- opensuse-leap 16.0: rt-tests 2.8-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: rt-tests 2.8-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: rt-tests 2.8-160000.2.2 Β· GPL-2.0-only
- opensuse-leap 16.0: rt-tests 2.8-160000.2.2 Β· GPL-2.0-only
- ubuntu resolute: rt-tests 2.9-1ubuntu1 Β· GPL-2.0-only
- ubuntu stonking: rt-tests 2.10-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms