sigwaittest(8)

πŸ“¦
version 2.11 Β· 2 versions
, in arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

πŸ’– sigwaittest(8) πŸ’–

okay bestie, gather round β€” this is sigwaittest, from the sigwaittest(8) manual. It's a tiny little latency-measuring icon and honestly? She ate. Let's get into it. πŸ¦‹


✨ NAME ✨

sigwaittest β€” spin up two threads (or fork two processes, your call) and measure the latency between sending a signal and receiving it.


🌸 SYNTAX 🌸

sigwaittest [-a|--affinity PROC] [-b|--breaktrace USEC] [-d|--distance
DIST] [-D|--duration TIME] [-f|--fork [OPT]] [-i|--interval INTV]
[--json FILENAME] [-l|--loops LOOPS] [-p|--prio PRIO] [-t|--threads
[NUM]]

🧚 DESCRIPTION 🧚

So here's the vibe: sigwaittest starts two threads, or β€” if you want β€” it forks two processes instead. Either way, those two lil guys are synchronized via signals, and the whole point of the program is measuring the latency between sending a signal and returning from sigwait(). That's it. That's the mission. No cap. πŸ’…


πŸŽ€ OPTIONS πŸŽ€

  • -a, --affinity[=PROC] β€” Run on processor number PROC. And if you don't bother specifying PROC? It just runs on the current processor. lowkey convenient 🫢
  • -b, --breaktrace=USEC β€” Send the break trace command when latency goes > USEC. This one's a debugging option β€” it controls the latency tracer in the realtime preemption patch. Super useful when you're trying to track down those unexpected, giant, lowkey terrifying latencies on a system. πŸ•΅οΈβ™€οΈ
  • -d, --distance=DIST β€” Sets the distance of the thread intervals, in microseconds. The default is 500 us. Here's the tea: when cyclictest is called with the -t option and more than one thread gets created, this distance value gets added to the interval of the threads:
Interval(thread N) = Interval(thread N-1) + DIST
  • -D, --duration=TIME β€” Specify a length for the test run. Append 'm', 'h', or 'd' to say minutes, hours, or days. ⏰
  • -f, --fork[=OPT] β€” Instead of creating threads (which is, like, the default behavior), fork new processes. processes > threads, apparently 😌
  • -i, --interval=INTV β€” Set the base interval of the thread(s) in microseconds. Default is 1000 us. This sets the interval of the first thread. And bestie, see also -d, because they're besties too. πŸ’ž
  • --json=FILENAME β€” Write the final results into FILENAME, JSON formatted. For the data girlies. πŸ“Š
  • -l, --loops=LOOPS β€” Set the number of loops. Default is 0, which means endless (iconic, honestly). This option is great for automated tests where you want a given number of test cycles β€” sigwaittest stops once the number of timer intervals has been reached. 🏁
  • -p, --prio=PRIO β€” Set the priority of the process. πŸ‘‘
  • -t, --threads[=NUM] β€” Set the number of test threads. Default is 1, if this option isn't given at all. If NUM is specified, it creates NUM test threads. And if NUM is not specified? Then NUM gets set to the number of available CPUs. go off, multithreading. πŸ”₯

🌈 EXAMPLES 🌈

This example was running on a 4-way CPU:

# sigwaittest -a -t -p99 -i100 -d25 -l1000000
#0: ID11510, P99, CPU0, I100; #1: ID11511, P99, CPU0, Cycles 1000000
#2: ID11512, P98, CPU1, I125; #3: ID11513, P98, CPU1, Cycles 817484
#4: ID11514, P97, CPU2, I150; #5: ID11515, P97, CPU2, Cycles 668213
#6: ID11516, P96, CPU3, I175; #7: ID11517, P96, CPU3, Cycles 597344
#1 -> #0, Min    1, Cur    2, Avg    3, Max   30
#3 -> #2, Min    1, Cur   26, Avg    3, Max   42
#5 -> #4, Min    1, Cur   46, Avg    4, Max   67
#7 -> #6, Min    1, Cur    2, Avg    3, Max   74

look at those Min/Cur/Avg/Max columns, we love a clean output πŸ₯Ή


πŸ‘‘ AUTHORS πŸ‘‘

Carsten Emde <C.Emde@osadl.org> β€” thank you for your service, king πŸ«‘πŸ’œ


πŸ¦‹ SEE ALSO πŸ¦‹


little housekeeping note bestie: the source file carries the license line # SPDX-License-Identifier: GPL-2.0-only β€” so that's the licensing vibe. ✨

and that's the whole page!! version 0.1 of sigwaittest(8), mwah πŸ’‹ stay low-latency, stay iconic, periodt πŸ’…πŸŽ€

πŸ“¦ where this page comes from