From: Crystal Wood <crwood@redhat.com>
To: Shizhao Chen <shichen@redhat.com>, linux-rt-users@vger.kernel.org
Cc: John Kacur <jkacur@redhat.com>, Clark Williams <williams@redhat.com>
Subject: Re: [PATCH] rt-tests: pip_stress: Add option --usleep
Date: Thu, 23 Jan 2025 19:05:54 -0600 [thread overview]
Message-ID: <f26e28d358931624986dc304c5cb0bfce2dfd498.camel@redhat.com> (raw)
In-Reply-To: <20250123060443.31371-1-shichen@redhat.com>
On Thu, 2025-01-23 at 14:04 +0800, Shizhao Chen wrote:
> Different hardwares have different threasholds for usleep_val to
> reliably trigger an prio inversion, add option --usleep to allow
> specifying it at runtime, to facilitate testing of prio inheritance
> on different platforms.
>
> Signed-off-by: Shizhao Chen <shichen@redhat.com>
> ---
> src/pi_tests/pip_stress.8 | 6 +++++-
> src/pi_tests/pip_stress.c | 10 ++++++++--
> 2 files changed, 13 insertions(+), 3 deletions(-)
Hmm, looks like there was an earlier attempt (53956b6712fef1,
"pip_stress: parameterize usleep value to work-around platform issues")
that was missing the actual call to getopt... and then another commit
(1325cb7e9e3af08e, "Daniel Wagner <dwagner@suse.de>") that added getopt
but removed usleep -- while also adding a "-s" option that does nothing.
:-P
Some minor nits:
> @@ -41,6 +42,9 @@ merely increase the time that the low priority process sleeps while
> holding the lock. (usleep);
> Also note that you have to run as a user with permission to change
> scheduling priorities.
> +.SH OPTIONS
> +.IP "\-u TIME,\-\-usleep=TIME"
> +Specify the sleep time of the low priority process. Defaults to 500(us).
The unit should be part of the description, not the default:
Specify the sleep time in usec of the low priority process. Defaults to
500.
> - "-h --help Show this help menu.\n"
> + "-h --help Show this help menu.\n"\
> + "-u TIME --usleep=TIME Specify the sleep time of the low priority process.\n"\
> + " Defaults to 500(us).\n"
> );
Likewise here
> + case 'u':
> + usleep_val = (useconds_t)strtoul(optarg, NULL, 10);
> + break;
Why is this cast needed?
-Crystal
next prev parent reply other threads:[~2025-01-24 1:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-23 6:04 [PATCH] rt-tests: pip_stress: Add option --usleep Shizhao Chen
2025-01-24 1:05 ` Crystal Wood [this message]
2025-01-24 7:30 ` Shizhao Chen
2025-01-24 7:51 ` [PATCH v2] " Shizhao Chen
2025-01-29 21:57 ` 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=f26e28d358931624986dc304c5cb0bfce2dfd498.camel@redhat.com \
--to=crwood@redhat.com \
--cc=jkacur@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=shichen@redhat.com \
--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