On Mon, Jul 13, 2026 at 04:48:07AM -0700, Breno Leitao wrote:
> Add a functional test for the min_unref_scans kmemleak module parameter.
> Using samples/kmemleak's helper module it checks that min_unref_scans=1
> reports an orphan on the first scan, min_unref_scans=2 reports nothing on
> the first scan but does on the second, and that the parameter reads back
> what was written.
> 
> It counts only the helper module's own orphans (matched by their
> [kmemleak_test] backtrace, with the module kept loaded so the symbols
> resolve) so unrelated leaks already present on the system do not perturb
> the result. The test skips when run as non-root, without
> CONFIG_DEBUG_KMEMLEAK / CONFIG_SAMPLE_KMEMLEAK, on a kernel without the
> parameter, or when the helper yields no detectable orphan.
> 
> Signed-off-by: Breno Leitao <[email protected]>

Reviewed-by: Catalin Marinas <[email protected]>

Reply via email to