Re: [PATCH] rt-tests: pip_stress: Add option --usleep

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxx>") 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






[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux