[PATCH v1 02/10] kconfig-checker: Introduce PREEMPT_RT configuration rules

From: Ahmed S. Darwish

Date: Fri Nov 06 2026 - 04:24:44 EST


Introduce a kconfig-checker PREEMPT_RT rules file, matching what is at
Documentation/core-api/real-time/kernel-configuration.rst.

This will allow the tool to mechanically check the kernel's .config at a
later step.

Signed-off-by: Ahmed S. Darwish <darwi@xxxxxxxxxxxxx>
---
tools/kconfig-checker/rules/preempt_rt.yml | 169 +++++++++++++++++++++
1 file changed, 169 insertions(+)
create mode 100644 tools/kconfig-checker/rules/preempt_rt.yml

diff --git a/tools/kconfig-checker/rules/preempt_rt.yml b/tools/kconfig-checker/rules/preempt_rt.yml
new file mode 100644
index 000000000000..5c1b80adc846
--- /dev/null
+++ b/tools/kconfig-checker/rules/preempt_rt.yml
@@ -0,0 +1,169 @@
+# PREEMPT_RT .config sanitization
+#
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# List all config options in alphabetic order, per group
+---
+
+docs_url: https://docs.kernel.org/core-api/real-time/kernel-configuration.html
+rules:
+ - name: CONFIG_CPU_FREQ
+ expected: y
+ severity: high
+ docs_hint: config
+
+ - name: CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE
+ expected: y
+ severity: high
+ docs_hint: config
+
+ - name_pattern: CONFIG_CPU_FREQ_GOV_(CONSERVATIVE|ONDEMAND|POWERSAVE|USERSPACE)
+ expected: n
+ severity: medium
+ docs_hint: non-performance-cpu-frequency-governors
+
+ - name: CONFIG_CPU_FREQ_GOV_SCHEDUTIL
+ expected: n
+ severity: medium
+ docs_hint: non-performance-cpu-frequency-governors
+
+ - name: CONFIG_CPU_IDLE
+ expected: y
+ severity: info
+ docs_hint: config
+
+ - name: CONFIG_DRM
+ expected: n
+ severity: info
+ docs_hint: config
+
+ - name: CONFIG_EFI_DISABLE_RUNTIME
+ expected: y
+ severity: medium
+ docs_hint: config
+
+ - name: CONFIG_NO_HZ
+ expected: n
+ severity: medium
+ docs_hint: config-no-hz-config-no-hz-full
+
+ - name: CONFIG_NO_HZ_FULL
+ expected: n
+ severity: medium
+ docs_hint: config-no-hz-config-no-hz-full
+
+ - name: CONFIG_PREEMPT_RT
+ expected: y
+ severity: fatal
+ docs_hint: config
+
+ #
+ # Tracing
+ #
+
+ - name: CONFIG_DYNAMIC_FTRACE
+ expected: y
+ severity: info
+ docs_hint: config-tracing-and-tracing-options
+
+ - name: CONFIG_FUNCTION_GRAPH_TRACER
+ expected: y
+ severity: info
+ docs_hint: config-tracing-and-tracing-options
+
+ - name: CONFIG_HWLAT_TRACER
+ expected: y
+ severity: info
+ docs_hint: config-tracing-and-tracing-options
+
+ - name: CONFIG_IRQSOFF_TRACER
+ expected: n
+ severity: high
+ docs_hint: config-irqsoff-tracer-and-config-preempt-tracer
+
+ - name: CONFIG_KPROBE_EVENTS
+ expected: y
+ severity: info
+ docs_hint: config-tracing-and-tracing-options
+
+ - name: CONFIG_PREEMPT_TRACER
+ expected: n
+ severity: high
+ docs_hint: config-irqsoff-tracer-and-config-preempt-tracer
+
+ - name: CONFIG_SCHED_TRACER
+ expected: y
+ severity: info
+ docs_hint: config-tracing-and-tracing-options
+
+ - name: CONFIG_TRACING
+ expected: y
+ severity: info
+ docs_hint: config-tracing-and-tracing-options
+
+ - name: CONFIG_UPROBE_EVENTS
+ expected: y
+ severity: info
+ docs_hint: config-tracing-and-tracing-options
+
+ #
+ # Debugging
+ #
+
+ - name_pattern: CONFIG_DEBUG_.*
+ expected: n
+ severity: medium
+ docs_hint: kernel-debug-options
+
+ - name: CONFIG_DEBUG_ATOMIC_SLEEP
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_BOOT_PARAMS
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_BUGVERBOSE
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_FS
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_FS_ALLOW_ALL
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_INFO
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_INFO_NONE
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_KERNEL
+ expected: allowed
+ severity: low
+
+ - name: CONFIG_DEBUG_MISC
+ expected: allowed
+ severity: low
+ rationale:
+ A menu option which enables the display of other debug symbols.
+
+ - name: CONFIG_LOCKUP_DETECTOR
+ expected: n
+ severity: high
+ docs_hint: config
+
+ - name: CONFIG_PROVE_LOCKING
+ expected: n
+ severity: high
+ docs_hint: config
+
+ - name_pattern: CONFIG_SLUB_DEBUG.*
+ expected: n
+ severity: high
+ docs_hint: kernel-debug-options
--
2.56.0