From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B441C37D11C for ; Thu, 29 Jan 2026 07:31:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769671898; cv=none; b=B3MA3NJT3O/KyBrTNHvGH1yICj3ec/eOpiQ2EfwsvcDGOPZq1qRZutqdlH71SoQWcrmD58FQQ/PhmUZZP+3PHrPGygSqkYGC8C3tiCiyukvJkzvqgYdBjDu6z+SuenR0DreKE4SOeO+pfNF/XW+Kyxi+i7HO6kVy/tsHfKv409s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769671898; c=relaxed/simple; bh=Y6op64SH3HVRwLLGtoxME3mldm3/W0c1FqQmgPaP16k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KtHQGjaCd8H6WLUp2+SlrHQ4W3kryk9HMcUgkpZD8HGioVrDvAVBzDfFxnu1QZj8evnNjZW0WHxelhYQjkylEuZfLB/R5pTpd71VpPXHowxspdw7DvD93jtECtcwvjQGfdfLSenfIYgBK1e84T4gebdOnj4huaIXg88zW9AhPd4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JqlKmiu4; arc=none smtp.client-ip=209.85.160.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JqlKmiu4" Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-404263bd58fso1085372fac.1 for ; Wed, 28 Jan 2026 23:31:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769671895; x=1770276695; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M3hNaVpAB+vi7bZ5p4r2BEr0xFTlYHYJVlfyEjZdNd0=; b=JqlKmiu42rjPUESJkCQLR0nL1cfkRQZxEWu8YU9SnBmhGtGtxpWO9sG50N/Fs8JdlL bHK+Muh4OQA6UFUYwmEt7sTrqbGlPQZrYmSBhsW0PrV2om8wBy4vr/KjX5+JnaXE76yL nNQq7xVS5RHvk00X6v9auGJ3IletGgRAGHXiCzNEJ87uKhm37GYygRKR7Q7CX1kVJN6c umgPZIIlK33OrWGFHQfAQAAM8fVjzbdHFS7LIwQ56oS9PEj8KELOgR7n9Ll6AAVAWZJv 02RCgQB0/RX7c7eIAgz8MoDWYBNEL6gycEnByJzGIawSHp7U7zbIPS83PfHQ7MXznXJW CqRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769671895; x=1770276695; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=M3hNaVpAB+vi7bZ5p4r2BEr0xFTlYHYJVlfyEjZdNd0=; b=Qgc9Ga9/ID/GVMd3EyHeJh8af55sXAqaTbP5Ajwvg+EK/GsMojGt00HYMbzHlmlP1V 6yVfDP4agpELTDHh4fVPp4qROS8nRenXyGxuaEdCiN3skgwtWQL1vw4uxWry/EJYu53u ANJmkNBp3iXdLKecSOFVfye+RfIhTuTJNjKtWtT3uwpbMFuSJi4H/4nT91R9e8czXyr3 w3/vgLFDR/D4pFywNaTaxzDdsszzhbFk3kPeBehsBCrF7VmHESbhhYzL3ICtNHQVXaaD uEPZ7019Wp4fJBOJR6y1mWMSjESfRQKphr2RoA1we7YiF4aG/ugqPsKUw4uIL9USbF3P Qf8w== X-Forwarded-Encrypted: i=1; AJvYcCUyqTHRabczheoJIunujn6rVaax69wxJdDkH5jxZlPc5ck/tDdV4udnPinPLNGkjmeMZndNh1zR6E/5EME=@vger.kernel.org X-Gm-Message-State: AOJu0YxS1+s7dEjS1pQege9tbxipOao9zGitPYo+CbQp6h7TNK5JQG2e 67haDunEKz6B+DZRf6rqs9BmqjW44f2IWdyOmX/sIDeY0t8H/lQsgSae X-Gm-Gg: AZuq6aLfas9Q9Hi9nyJ9j+attoKp/O7VNqC1WOhfBF60vz49F55S6dxRa5ythIxcK6B G+N+CqHYBS1QtBfTPEqOfL6wFzWSUpiVZd2/WgLsgOJ7lcLkP5UIgpmaDxL1U/G0qDJKNc+OnPS woUX3UZi+IxccgfAhwXLOuAKBh1LJfkdl+vgoJWdQsgTpfpo0u8VUsQ93AtuUvJyQdIafyYyP3K F0bgZ+3dGxUFCD8wNDTmQWE2jq/DnkNh6GVdsEBHJMSqBpIWIg2j/4UdaZuvT4M6Jik3NbdNk08 FArZCgqpbfnEt+2wWn6myKZss/RHuzt8qAm23tLUIr1LLQ0op0jhdF5GQVV38eIQuSdyGAj/XjN LY+b+66e+UQ0zgutUh1gRbZmdxYWYnwVf39KTUwT52sjiOonP3Yz3Gqu3SjgcLxmZKE2VpjEoSo To09eQJNO5eZSYJ8fpBR8PT6GTLAhe7M2Q1p28yGBssW6cOV5M5Q0= X-Received: by 2002:a05:6871:b10:b0:409:6148:e23e with SMTP id 586e51a60fabf-4097fb7cc1dmr1086285fac.10.1769671895554; Wed, 28 Jan 2026 23:31:35 -0800 (PST) Received: from godzilla (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-409570f1413sm3442581fac.2.2026.01.28.23.31.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jan 2026 23:31:35 -0800 (PST) From: Jim Cromie To: gregkh@linuxfoundation.org Cc: Jim Cromie , Jason Baron , =?UTF-8?q?=C5=81ukasz=20Bartosik?= , Louis Chauvet , Bagas Sanjaya , Dave Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, Petr Mladek , Shuah Khan , linux-doc@vger.kernel.org, Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v9 29/32] selftests-dyndbg: add test_mod_submod Date: Thu, 29 Jan 2026 00:29:15 -0700 Message-ID: <20260129072932.2190803-30-jim.cromie@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260129072932.2190803-1-jim.cromie@gmail.com> References: <20260129072932.2190803-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg= modprobe arg, and the test-module's classmap-params to manipulate the test-mod*'s pr_debugs. In all cases, the current flag-settings are counted and tested vs expectations. The 3rd scenario recapitulates the DRM_USE_DYNAMIC_DEBUG=y failure. 1. 2 modprobes (super then sub), with separate dyndbg=class-settings check module specific flag settings 2. modprobe submod, supermod is auto-loaded set supermod class-params check expected enablements in super & submod 3. modprobe super, with param=setting (like drm.debug=0x1ef) modprobe submod validate submod's class'd pr_debugs get properly enabled The test uses multi-queries, with both commas and percents (to avoid spaces and quoting). This is the main reason the test wasn't earlier in the patchset, closer to the classmap patches its validating. With some tedium, the tests could be refactored to split out early tests which avoid multi-cmds, and test only the class-params. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 513f6cb1db1d..09937dca3056 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -279,10 +279,83 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP - test requires test-dynamic-debug.ko" + return + fi + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =_ + + # modprobe with class enablements + modprobe test_dynamic_debug \ + dyndbg=class,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 1 + + modprobe test_dynamic_debug_submod + check_match_ct test_dynamic_debug_submod 23 -r + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct test_dynamic_debug 46 -r + + # no enablements propagate here + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 1 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add some prefixes" + check_match_ct =pmf 1 + check_match_ct =plt 1 + check_match_ct =pml 1 + # submod changed too + check_match_ct =mf 1 + check_match_ct =lt 1 + check_match_ct =ml 1 + + # now work the classmap-params + # fresh start, to clear all above flags (test-fn limits) + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + modprobe test_dynamic_debug_submod # get supermod too + + echo 1 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 4 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( V1-3 + D2_CORE ) + check_match_ct =p 8 + echo 3 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_CORE, D2_DRIVER ) + check_match_ct =p 4 + echo 0x16 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_DRIVER, D2_KMS, D2_ATOMIC ) + check_match_ct =p 6 + + # recap DRM_USE_DYNAMIC_DEBUG regression + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + # set super-mod params + modprobe test_dynamic_debug p_disjoint_bits=0x16 p_level_num=5 + check_match_ct =p 7 + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =p 14 + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug +} + tests_list=( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) # Run tests -- 2.52.0