[LTP] [PATCH v5 0/3] pmc_core: cover the PkgC LTR blocker counters

Piotr Kubaj piotr.kubaj@intel.com
Wed Oct 21 10:59:29 CEST 2026


The intel_pmc_core driver gained a pkgc_ltr_blocker_show debugfs file in
kernel commit 38c79dd63b72 ("platform/x86/intel/pmc: Enable PkgC LTR
blocking counter"), released in v7.2. It reports, per source, how many
times an LTR posted by that source blocked a package C-state entry.

1/3 adds tst_test.needs_debugfs: the library mounts debugfs for the test
    if needed, unmounts it afterwards if it did, and the flag implies
    needs_root.
2/3 checks the file's format and that no counter advances faster than
    the package could have attempted entries over the interval.
3/3 checks that the counters stop while every CPU is kept busy.

Both tests bound what they accept in time rather than against a
hardcoded counter list, because the counter set is platform specific.

v4 was tested on Nova Lake running 7.3.0-rc1 and 7.3.0-rc3. v5 was run on
7.3.0-rc7 on a system where intel_pmc_core does not bind: the self-test
with debugfs mounted, unmounted and unprivileged, both tests on their
TCONF path, and their TPASS and TFAIL paths against fake counter files.
Not yet re-run against the real counter file.

v4 -> v5:
- lib: needs_debugfs implies needs_root; kernel-doc comment for
  TST_DEBUGFS_PATH.
- tst_needs_debugfs.c: drop .needs_kconfigs, which TBROKs in the CI
  containers where no kernel config is readable, and the implied
  .needs_root.
- pkgc_ltr_blocker_show.c: a malformed first sample ends the test with
  one TFAIL summary instead of re-reporting every line on each retry and
  still finishing with TPASS. Fix the TST_RETRY_FN_EXP_BACKOFF() comment.
  Drop .needs_root.
- ltr_counter.c: when the load window runs out, report only counters that
  changed within the final quiet window. Document that the windows are
  sized for the Nova Lake refresh cadence. Drop .needs_root.
- Found by the LTP AI reviewer's v4 run. Rebased onto current master.

v3 -> v4:
- ltr_counter.c: count a spinner only once its fork() succeeded, so a
  failing fork() does not leave the cleanup signalling pid 0. Found by
  the LTP AI reviewer's v2 run, whose mail did not reach the list.
- Rebased onto current master.

v2 -> v3:
- Rebased; the .needs_debugfs row moved next to .needs_cpu_vendor in the
  API table.
- ltr_counter.c: dropped <sched.h> and <signal.h>, the API headers pull
  both in.

Piotr Kubaj (3):
  lib: add tst_test.needs_debugfs flag
  pmc_core: add test for pkgc_ltr_blocker_show
  pmc_core: add ltr_counter test

 doc/developers/writing_tests.rst              |   3 +
 include/tst_fs.h                              |   6 +
 include/tst_test.h                            |   8 +
 lib/newlib_tests/.gitignore                   |   1 +
 lib/newlib_tests/runtest.sh                   |   1 +
 lib/newlib_tests/tst_needs_debugfs.c          |  32 ++
 lib/tst_test.c                                |  38 ++
 metadata/metaparse.c                          |   1 +
 runtest/power_management_tests                |   2 +
 testcases/kernel/power_management/.gitignore  |   2 +
 .../kernel/power_management/ltr_counter.c     | 377 ++++++++++++++++++
 .../power_management/pkgc_ltr_blocker_show.c  | 311 +++++++++++++++
 12 files changed, 782 insertions(+)
 create mode 100644 lib/newlib_tests/tst_needs_debugfs.c
 create mode 100644 testcases/kernel/power_management/ltr_counter.c
 create mode 100644 testcases/kernel/power_management/pkgc_ltr_blocker_show.c


base-commit: 121876b3da3ff59b0dd17b4798b2e4699ba431d1
-- 
2.47.3

---------------------------------------------------------------------
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