[LTP] [PATCH v13] thermal: add new test group
Kubaj, Piotr
piotr.kubaj@intel.com
Wed Mar 25 11:55:14 CET 2026
2026-03-24 (火) の 13:05 +0000 に Andrea Cervesato さんは書きました:
> Hi Piotr,
>
> > + ptr = endptr;
> > + tst_res(TDEBUG, "interrupts[%d]:
> > %ld", i, interrupts[i]);
>
> `interrupts` is uint64_t*, so we should use %ul instead.
That causes:
In file included from thermal_interrupt_events.c:19:
thermal_interrupt_events.c: In function ‘read_interrupts’:
../../../include/tst_test.h:74:55: warning: format ‘%u’ expects
argument of type ‘unsigned int’, but argument 6 has type ‘uint64_t’
{aka ‘long unsigned int’} [-Wformat=]
74 | tst_res_(__FILE__, __LINE__, (ttype),
(arg_fmt), ##__VA_ARGS__);\
| ^~~~~~~~~
thermal_interrupt_events.c:58:33: note: in expansion of macro ‘tst_res’
58 | tst_res(TDEBUG,
"interrupts[%d]: %ul", i, interrupts[i]);
| ^~~~~~~
>
> > +static void run(void)
> > +{
> > + for (int i = 0; i < tz_counter; i++) {
> > + if (x86_pkg_temp_tz[i])
> > + test_zone(i);
> > + }
> > + read_interrupts(interrupt_later, nproc);
> > +
> > + for (int i = 0; i < nproc; i++) {
> > + if (interrupt_later[i] < interrupt_init[i])
> > + tst_res(TFAIL, "CPU %d interrupt counter:
> > %ld (previous: %ld)",
> > + i, interrupt_later[i],
> > interrupt_init[i]);
>
> We always consider TFAIL when counter decreases, but we never
> consider when
> it increases. Is there a reason for that?
Yes, increasing is expected.
>
> > + }
> > +
> > + if (temp <= temp_high)
> > + tst_res(TFAIL, "Zone temperature is not rising as
> > expected");
> > + else
> > + tst_res(TPASS, "x86 package thermal interrupt
> > triggered");
> > +}
>
> I also have other questions in here. Why are we considering only the
> last zone temperature? Is there a reason for it, or we should save
> all
> temperature for all zones and eventually verify temperature increased
> specifically for each one of them?
>
> Because in a single socket system (I guess) we have one single
> temperature for all the zones, but on i.e. dual socket server, this
> test would verify that only the last zone has increased temperature
> above the higher level. And this is wrong, according to the goal of
> this test. We want to verify that kernel is correctly working for all
> systems, correctly increasing the thermal counter for each thermal
> zone. If this is correct, `temp` and `temp_high` should be an array,
> where each item is associated to a zone, and it should be processed
> only at the end for TPASS/TFAIL.
You're right, all the zones should be checked. I opted for a simpler
solution, checking after testing each zone whether temperature rose
since it's possible that only one of the zones has an issue. Because
interrupts also need to be checked after each zone test, I moved
reading initial interrupts array to the run() function as well.
cleanup() also needed a fix to restore previous values for all the
tested zones.
>
>
> Kind Regards,
> --
> Andrea Cervesato
> SUSE QE Automation Engineer Linux
> andrea.cervesato@suse.com
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
More information about the ltp
mailing list