[LTP] [PATCH v19] thermal: add new test group
Cyril Hrubis
chrubis@suse.cz
Tue May 12 11:56:47 CEST 2026
Hi!
> +static void setup(void)
> +{
> + char line[8192];
> +
> + nproc = tst_ncpus();
> + tst_set_runtime(nproc * TEST_RUNTIME);
The last thing that I do not think is correct is this part. We are
setting the runtime here based on the number of CPUs and not based on
the number of actuall test iterations.
I guess that we need to:
Turn the x86_pkg_temp_tz_found into a counter and collect the number
of thermal zones found and set the runtime at the end of the setup
with the counter instead.
And at the same time the TEST_RUNTIME appears to be significantly
smaller than the actual runtime.
The upper bound for the runtime is a sum of all possible iterations,
if we simplify it a bit it would be roughly ((RUNTIME+SLEEPTIME) *
(SLEEPTIME/2))
As we are doing SLEEPTIME iterations with SLEEPTIME and RUNTIME
getting smaller in each of them so it will average out to SLEEPTIME/2
iterations with full (RUNTIME+SLEEPTIME)
So I guess that we need:
#define TEST_RUNTIME ((RUNTIME+SLEEPTIME) * (SLEEPTIME/2))
The rest looks good to me.
With the runtime calculation fixed:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list