kunit_is_suppressed_warning(9)
π kunit_is_suppressed_warning(9) π
okay so this little icon is from the Kernel API Manual, and she is here to answer one very specific question: are warnings being suppressed by the current KUnit test? bestie, letβs get into it π«Άβ¨
β¨ NAME β¨
kunit_is_suppressed_warning β check if warnings are being suppressed by the current KUnit test π
πΈ SYNOPSIS πΈ
bool kunit_is_suppressed_warning (bool count );
π ARGUMENTS π
countβ iftrue, increment the suppression counter on match. periodt π
π¦ DESCRIPTION π¦
Returns true if the current task has active warning suppression. It uses the kunit_running static branch for zero overhead when no tests are running. no cap, thatβs the whole vibe check β
A single WARN*() may traverse multiple call sites in the warning path (e.g., __warn_printk and __report_bug). So hereβs the tea: pass count = true at the primary suppression point to count each warning exactly once, and pass count = false at secondary points to suppress output without inflating the count. literally the main character energy of keeping the count correct ππ₯
π SEE ALSO π
- Kernel file
./include/kunit/test-bug.h kunit_get_current_test(9)kunit_fail_current_test(9)
mwah π β source/version: ./include/kunit, dated October 2026. bye bestie, go count those warnings correctly π§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms