From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f47.google.com (mail-oo1-f47.google.com [209.85.161.47]) (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 C27CE392C50 for ; Wed, 8 Apr 2026 20:02:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775678570; cv=none; b=Xsgs9o0DqItIecxqVeagIeZmcgIeziu8eFTZXMp4++sDnDjKmiN3Ke1VTtoMfWf6z6YLCCkLyolhVIcYWHbviW6OFVmkK3HayWpLrW1EjyzxNSGpBUb4W0OS+HMDWDNo2xZvrmaJD5uU31kmO6EYbJRBYCWy30bA5FaIhZ2AuTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775678570; c=relaxed/simple; bh=o9XAvjSs/yDZQc7WmR2T+j5cz0yKThRjVBgsLtPQWN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=njOjyQ3RCw6qym+mC9KiMTVt9nrzCxjWOByokTYy8SEUkjiJxiNeBrQ0vsA1JI8zZoV4AlrEvDDSzlGxA3LX3gDknVBrnsxIT4csuarZ3ZCLDTCmSW2RtljCIyvKR8TN9LX9MsCjh1Q6XpP1mUykZRJ+4y83eH7oPV0c3cAwCok= 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=VLGj/ACf; arc=none smtp.client-ip=209.85.161.47 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="VLGj/ACf" Received: by mail-oo1-f47.google.com with SMTP id 006d021491bc7-688c2235cd4so93079eaf.0 for ; Wed, 08 Apr 2026 13:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775678567; x=1776283367; 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=ZxTkOltoVAiRQNIiLPEo11+229bHMC78x0TMXlU2wIM=; b=VLGj/ACfhoYhfAAVbMmL2R3aUboES3UESczpsSOBe4SlGUJJTc2gsHbn2Hu9C3ilOm p8xFszvla97jZ4pAn5LzPmJaAsdVDUmeQbf4FP67j2+43xzCC7ADg3c2nRJzZ4+WSEvr si3iCOfmH3Pa7H303AmcuDzIfSQhXfeijkkwc3Hl8PQMooohPzy+JXYnLTDVnOcCjKc8 UbyQ3i4OqpcqraA2QG9voYgIVA2a+kH527DjGR9V0pTusSWlaCsWKpwhv3sx0PhfBD7c FdH3Bgy+J3w/Z95RJIudwmV+SAyNURaz9ZyTnXsfXB/nxMv+1Hoxq0V4jsHNf7bR6Ol2 v2VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775678567; x=1776283367; 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=ZxTkOltoVAiRQNIiLPEo11+229bHMC78x0TMXlU2wIM=; b=aVEt1/Z0F2mf/8ABVIymCGovJZzVqoYjWQt4ZUUd130gihu/hEXgur1ebxh0J4KkDM gmo5xKwfv+RTz2JUfjH9j1W5Mn4sJzs+HSiYDnspIVy5sbcBd3JczLbN3k/cwTIgs6pa 3tf+4UN8R6aEQ2RhqhdTAAlA/Bif9+VmivK3PbLqyrvNnx4U173dbiPG9otlxGF8U2XL 7y4/jVYbIU0Bd5e1Zhegrbquayn0KsNajCOdDpKBWVux8QgcufRYnbv0WTUipg+akoEX VBzE7R31Vpnmm9tf4Af/+S0hKIdc7MwNonfHFcLaA3u5PqKtCVVyB34GBPryK9jthAlH 706g== X-Gm-Message-State: AOJu0YxH191SBmqrcy6EvSQ9dX7D8JEAvB6CsRzxGTLdxtu/J9LnBfHI 2VYmVufoizTstc9MgSq0aB25FC07/7duFk5MKfwEzkbDYVT1NIvWw08gwcQ8jw== X-Gm-Gg: AeBDiesEN2bqokHj4Yu+gobWVymhlUvpfm/7nZPs88mHcxcm4x8ZRV34yGZ+qOmIEyd PZnMVHRvCr/WJBsf9t2xuVuMpNnJqzGg+TOfwwoAalSxspDFYzlGxhR4NCEiidSkwqaVtXheZTq okylXf7GAsXVUvEBugjhnZgDVzoKZfKH86RdsOKtNsnk6RNOUjY0BVzS0XTkxYQ69pY6eN9/k2S r8n5MR+U2gHwoKBIyo+9R/skbuhz0OdgBCeL8ZiyGw9koVCYXr+w/Jr58FzSGK7TefaRdmx91iK Dw8lmatPJC5Nf72Rc6Pr9uO0Tfe87+QJeRbEsBrqAn0THi5jiud+YmZimPqVResmZlFKmK2yKeV OxnqVkOHVZ/gg/tdtB1EQMA2hmolk7SDcVIF2vqi3ZrQ7vWmnn4D463Z3Flj0r+ZLKv5jhsruaH pspCu1aOk1wyEJ1Nc2ADRPBhpklNLYfI0iv/51SICLWpMkE/n5REGYVPaX9FS26h6FqdvjIskss +o= X-Received: by 2002:a05:6820:1b09:b0:68a:8fc7:6444 with SMTP id 006d021491bc7-68a8fc767damr156418eaf.27.1775678567554; Wed, 08 Apr 2026 13:02:47 -0700 (PDT) Received: from frodo.raven-morpho.ts.net (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 006d021491bc7-680a63c7fd1sm12254208eaf.8.2026.04.08.13.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Apr 2026 13:02:47 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, jbaron@akamai.com, louis.chauvet@bootlin.com, Jim Cromie Subject: [PATCH v13 32/36] selftests-dyndbg: add test_mod_submod Date: Wed, 8 Apr 2026 14:02:07 -0600 Message-ID: <20260408200211.43821-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260408200211.43821-1-jim.cromie@gmail.com> References: <20260408200211.43821-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.53.0