[LTP] lib: add tst_test.needs_debugfs flag
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Wed Oct 21 15:39:30 CEST 2026
Hi Piotr,
On 21 October 2026, Piotr Kubaj wrote:
> lib: add tst_test.needs_debugfs flag
--- [PATCH 1/3] ---
> diff --git a/metadata/metaparse.c b/metadata/metaparse.c
> + {.id = "needs_debugfs", .type = DATA_BOOL},
Medium: Add needs_debugfs -> needs_root to implies[] and cover it with a
metadata fixture. Parsing tst_needs_debugfs.c currently emits
needs_debugfs:true without needs_root:true, although the same executable
rejects non-root execution, so metadata consumers miss its root requirement.
--- [PATCH 2/3] ---
> diff --git a/testcases/kernel/power_management/pkgc_ltr_blocker_show.c b/testcases/kernel/power_management/pkgc_ltr_blocker_show.c
> + * arbitrary u32 read out of the wrong offset averages 2^31, orders of
> + * magnitude past what the bound allows.
Low: This concerns the absolute value, not the difference between reads
from the same wrong offset. Replaying 3735928559 -> 3735928560 passes the
actual delta check, as does an unchanged arbitrary value. Narrow the
description and commit-message coverage claim to format/rate validation,
or provide an independent oracle for the offset regression.
--- [PATCH 3/3] ---
> diff --git a/testcases/kernel/power_management/ltr_counter.c b/testcases/kernel/power_management/ltr_counter.c
> + if (tst_timespec_diff_ms(now, last_change) >= QUIET_WINDOW * 1000) {
> + tst_res(TPASS,
> + "%d counters held still over %ds with every CPU busy",
> + cnt, QUIET_WINDOW);
> + return;
Medium: Replaying a counter that updates every 6.5 seconds satisfies the
idle-advance prerequisite, then passes after six seconds of load before
the next update; LOAD_WINDOW never protects this path. Establish a
conservative refresh bound with margin before declaring the counters
quiet. Reconcile the timing assumptions across the series: patch 2 calls
four seconds several refresh periods, while this patch reports roughly
six seconds per refresh.
> + if (sched_setaffinity(0, sizeof(one), &one)) {
> + tst_brk(TBROK | TERRNO,
> + "sched_setaffinity(CPU %d) failed", cpu);
> + }
> +
> + spin();
Medium: Affinity does not establish continuous load when a CPU-bandwidth
cgroup quota throttles all spinners together. During those idle gaps,
correct counters can advance and be reported as failures after the load
window. Detect throttling, including inherited limits, and report the
configuration as unsupported rather than blaming the counters.
> + cpu_set_t mask;
> + int nr_cpus;
> + int cpu = 0;
> +
> + if (sched_getaffinity(0, sizeof(mask), &mask))
> + tst_brk(TBROK | TERRNO, "sched_getaffinity() failed");
Medium: Both glibc and musl cpu_set_t hold only 1024 CPUs, so this call
fails with EINVAL when the kernel's possible-CPU mask is larger, even with
few CPUs online. Use CPU_ALLOC(tst_ncpus_max()), CPU_ALLOC_SIZE(), and the
*_S macros for both masks, with cleanup, following lib/tst_cpu.c.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list