From: "Thomas Weißschuh (Schneider Electric)" <thomas.weissschuh@linutronix.de>
To: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Cc: linux-rt-users@vger.kernel.org,
"Thomas Weißschuh (Schneider Electric)"
<thomas.weissschuh@linutronix.de>
Subject: [PATCH 5/6] cyclictest: Allow symbolic clock names
Date: Tue, 07 Apr 2026 08:48:45 +0200 [thread overview]
Message-ID: <20260407-auxclocks-v1-5-1ef80d14eb0a@linutronix.de> (raw)
In-Reply-To: <20260407-auxclocks-v1-0-1ef80d14eb0a@linutronix.de>
The numeric values are not self-explanatory. New clocks are about to be
added, exarcerbating the issue.
Allow users to specify symbolic clock names and document those.
The old numbers are still handled for backwards compatibility.
Signed-off-by: Thomas Weißschuh (Schneider Electric) <thomas.weissschuh@linutronix.de>
---
src/cyclictest/cyclictest.8 | 4 ++--
src/cyclictest/cyclictest.c | 8 ++++++--
2 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/cyclictest/cyclictest.8 b/src/cyclictest/cyclictest.8
index ff2cb968fc01..1a59d3b29048 100644
--- a/src/cyclictest/cyclictest.8
+++ b/src/cyclictest/cyclictest.8
@@ -56,9 +56,9 @@ Send break trace command when latency > USEC
.B \-c, \-\-clock=CLOCK
select clock
.br
-0 = CLOCK_MONOTONIC (default)
+monotonic (default)
.br
-1 = CLOCK_REALTIME
+realtime
.TP
.B \-\-deepest\-idle\-state=n
Reduce exit from idle latency by limiting idle state up to n on used cpus (-1 disables all idle states). Power management is not suppresed on other cpus.
diff --git a/src/cyclictest/cyclictest.c b/src/cyclictest/cyclictest.c
index 40da2cc4119d..2d1ff968f8aa 100644
--- a/src/cyclictest/cyclictest.c
+++ b/src/cyclictest/cyclictest.c
@@ -950,8 +950,8 @@ static void display_help(int error)
"-A USEC --aligned=USEC align thread wakeups to a specific offset\n"
"-b USEC --breaktrace=USEC send break trace command when latency > USEC\n"
"-c CLOCK --clock=CLOCK select clock\n"
- " 0 = CLOCK_MONOTONIC (default)\n"
- " 1 = CLOCK_REALTIME\n"
+ " monotonic (default)\n"
+ " realtime\n"
" --deepest-idle-state=n\n"
" Reduce exit from idle latency by limiting idle state\n"
" up to n on used cpus (-1 disables all idle states).\n"
@@ -1043,8 +1043,12 @@ static int handleclock(const char *clockarg)
{
if (strcmp(clockarg, "0") == 0)
used_clock = CLOCK_MONOTONIC;
+ else if (strcmp(clockarg, "monotonic") == 0)
+ used_clock = CLOCK_MONOTONIC;
else if (strcmp(clockarg, "1") == 0)
used_clock = CLOCK_REALTIME;
+ else if (strcmp(clockarg, "realtime") == 0)
+ used_clock = CLOCK_REALTIME;
else
return 1;
--
2.53.0
next prev parent reply other threads:[~2026-04-07 6:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-07 6:48 [PATCH 0/6] cyclictest: Add support for auxiliary clocks Thomas Weißschuh (Schneider Electric)
2026-04-07 6:48 ` [PATCH 1/6] cyclictest: Centralize clock option parsing Thomas Weißschuh (Schneider Electric)
2026-04-07 8:27 ` Florian Bezdeka
2026-04-07 8:45 ` Thomas Weißschuh (Schneider Electric)
2026-04-15 14:46 ` John Kacur
2026-04-07 6:48 ` [PATCH 2/6] cyclictest: Test the return value of timer_create() Thomas Weißschuh (Schneider Electric)
2026-04-15 14:47 ` John Kacur
2026-04-07 6:48 ` [PATCH 3/6] cyclictest: Fix error error returns for uclibc clock_nanosleep() fallback Thomas Weißschuh (Schneider Electric)
2026-04-07 8:16 ` Florian Bezdeka
2026-04-07 8:50 ` Thomas Weißschuh (Schneider Electric)
2026-04-07 8:59 ` Florian Bezdeka
2026-04-15 14:47 ` John Kacur
2026-04-07 6:48 ` [PATCH 4/6] cyclictest: Correctly print clock_nanosleep() errors Thomas Weißschuh (Schneider Electric)
2026-04-15 14:47 ` John Kacur
2026-04-07 6:48 ` Thomas Weißschuh (Schneider Electric) [this message]
2026-04-15 14:48 ` [PATCH 5/6] cyclictest: Allow symbolic clock names John Kacur
2026-04-07 6:48 ` [PATCH 6/6] cyclictest: Add support for auxiliary clocks Thomas Weißschuh (Schneider Electric)
2026-04-15 14:48 ` John Kacur
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260407-auxclocks-v1-5-1ef80d14eb0a@linutronix.de \
--to=thomas.weissschuh@linutronix.de \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=williams@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox