From 0e8da31f2d4312fc3ad5c1e2e221075831885e0e Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Thu, 12 Jun 2025 14:22:58 +0200 Subject: tools/syz-kconfig: suggest reasons for wrongly selected configs The most frustrating part of updating syzbot configs is figuring out what config options (possibly transivitely) selected the configs we wanted to stay disabled. For each "X is present in the final config" message, auto-generate a small list of enabled config options that may have transitively "select"ed X. --- tools/syz-kconf/kconf.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/syz-kconf/kconf.go b/tools/syz-kconf/kconf.go index 5a8808a11..ac9392e8e 100644 --- a/tools/syz-kconf/kconf.go +++ b/tools/syz-kconf/kconf.go @@ -315,7 +315,17 @@ func (ctx *Context) verifyConfigs(cf *kconfig.ConfigFile) error { if act == kconfig.No { errs.push("%v:%v: %v is not present in the final config", cfg.File, cfg.Line, cfg.Name) } else if cfg.Value == kconfig.No { - errs.push("%v:%v: %v is present in the final config", cfg.File, cfg.Line, cfg.Name) + var selectedBy []string + for name := range ctx.Kconf.SelectedBy(cfg.Name) { + if cf.Value(name) == kconfig.Yes { + selectedBy = append(selectedBy, name) + } + } + selectedByStr := "" + if len(selectedBy) > 0 { + selectedByStr = fmt.Sprintf(", possibly selected by %q", selectedBy) + } + errs.push("%v:%v: %v is present in the final config%s", cfg.File, cfg.Line, cfg.Name, selectedByStr) } else { errs.push("%v:%v: %v does not match final config %v vs %v", cfg.File, cfg.Line, cfg.Name, cfg.Value, act) -- cgit mrf-deployment