[LTP] [PATCH v19] thermal: add new test group
Petr Vorel
pvorel@suse.cz
Wed May 13 12:54:17 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))
And other thing which is on my machine broken is to run with more iterations, it
randomly fails or get stuck after first iteration:
./thermal_interrupt_events -i3
thermal_interrupt_events.c:207: TINFO: CPU 23 interrupt counter: 23 (previous: 21)
thermal_interrupt_events.c:217: TPASS: x86 package thermal interrupt triggered
thermal_interrupt_events.c:142: TINFO: Testing /sys/class/thermal/thermal_zone9/temp
thermal_interrupt_events.c:213: TFAIL: No thermal interrupt increase detected
Kind regards,
Petr
More information about the ltp
mailing list