From nobody Thu Apr 2 20:28:13 2026 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.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 2FD16423A7A for ; Thu, 26 Mar 2026 18:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551320; cv=none; b=oCkDUseOn4+VHK19TeoTnqv3+RJns+ExC9BcQXwzEpemCyjBxqRz+YOUo0X4PfVmLshBB4L2DdTk20SwmLIKjC32REOhsU8yaXhWSI1JgbfT2p7ZrXIiv/bEPhAXDb0dNo4GFVBus/8hi4tERMcc2MRIwtrSVmmypA4kJEjMTdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551320; c=relaxed/simple; bh=o9XAvjSs/yDZQc7WmR2T+j5cz0yKThRjVBgsLtPQWN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ICcUJPwaysumEAxyKHzEc/bsfuNPtfowgYIHBpDH6Q7Bz1LmK1FsanuALN9U6Ln4g143gShPQn7bR3ToB2BlvGZkOV24Sa5JiTCvT//pvjZ8ZMgdr9sBJ3x+UcDLgSYjJuG8A09YCReWDdgkS6s9o19Nc+6kic3D0XC3I+Hui+U= 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=b1/uBh0m; arc=none smtp.client-ip=209.85.160.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="b1/uBh0m" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-415c8a4d2e6so561651fac.0 for ; Thu, 26 Mar 2026 11:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551318; x=1775156118; 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=b1/uBh0mUaBoFkERYSJbe/00zPtSU9WD1USpCD43yxOZp6G/qoJHH2N0Vw+Aczae8B LOK4mc9InTitvjad9leNFkN7BaWR5UzXW6oFbZHURExchVItcDeeCo2TWq6+w1UiJD4P MLu1kB/tX3fu+HxQGIhsSP7W6Xuv8s2rtT5RhjU/kcisDuVSoKV7iS/XRe6Ien6jC3w+ VJgC1tuZ90I4N0yD7TmbkjIKN0ZH0o7lw0+s+u1rzHtc8EYmM7NmE+aaeNKYQ3Y55Gyp RDJO8vtcHDGHerxhvd9awjCfKZzeMJBVYxZBiO6qoz9o4wrrGqlLvyKoget3r7cs/KkX RLUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551318; x=1775156118; 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=Xf32U0bkRYDb97J+cyb+KAVFctsvqaF3TVf9CuyJTg8SdxozBEv6MOk8lN26asSxZ6 1dIgFbP8kawvH856mD3+Hp27Yyxsejncyuo9PMI2EODIDi1LYaqcpj/OxfD7o1QRXvYD /laIOPiwSgOCQDxxXVTuM72wV234ZjOe8e9Z7oUfdzI8zcb4bMq1GDYI9ChLfv37Hnnn co3R6WLqG0RIsJYEnO+s5vsOlXm47vHOKUbVeGKFwPhoXKoGhkNFi16Xks4VAMGbwYAs ZCjvWUVBn2g6wTa//dwrfCi/xn44D5CKf5UA3dB7OCgR5dPfkDI8a2tHO4Erw0aQxO7d 1d4w== X-Gm-Message-State: AOJu0YwYRfsiFmguL0A2AACapp/9AL0KIU2Ww054WfyU55wTpUzjbXp0 8mmBEJA1I/8jcKFepYMVCKnoPrL6qoh7YOHfekZfCjI3GRegTHuembjhBR9XPg== X-Gm-Gg: ATEYQzz0yPZq15poHJl0c7kGPHWiyu7SMsQv5lYDP9nC3k1M3V1NIyO4IHzkubtBsoD M0X2rOWQAuvrcYMvGLqML3LBqYZujx9o5TvvfQbK+jD32IObchdVU0QTIQ+UxaJJp8kTXVFhN3n d+mp56A/cTdryHI1gPjoF9XT4Av+jCdttU/qiOSGQY9ujnGEeqh2P2u/T9OwxKkOohsjwklhSHz Bb6OpHHBvxrHwei8dH3OqYdTT3CBIA5BITCECIueXX4SvbQ9yhEn1HxUoQI9pwKxH29rlBg5dNj Sm7CGCYNw9wuf+tUtGteU4ZL/xT3KtMKh5EtqzhJ+yYfVg9qiPhrHqm3TwEElejC8K/18M6K4Pj j+jEWhHusCqFLWc7vktXRWo0EvHlznmCpWqWNZDjz1bvPVXpnGvcOPoP1sVnOkDt7OXRvvq7JoE Hv/OF0aPPGNO/BnkH1KLm30GMaSCh0FJhR5eCNobH0DJSqXQbZ X-Received: by 2002:a05:6870:b0eb:b0:3eb:7a2e:34a4 with SMTP id 586e51a60fabf-41ca6ff26a6mr4833606fac.28.1774551317851; Thu, 26 Mar 2026 11:55:17 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:17 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 32/69] selftests-dyndbg: add test_mod_submod Date: Thu, 26 Mar 2026 12:53:36 -0600 Message-ID: <20260326185413.1205870-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-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: quoted-printable Content-Type: text/plain; charset="utf-8" This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg=3D 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=3Dy failure. 1. 2 modprobes (super then sub), with separate dyndbg=3Dclass-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=3Dsetting (like drm.debug=3D0x1ef) 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/too= ls/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 } =20 +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 =3D_ + + # modprobe with class enablements + modprobe test_dynamic_debug \ + dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 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 =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add so= me prefixes" + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + # submod changed too + check_match_ct =3Dmf 1 + check_match_ct =3Dlt 1 + check_match_ct =3Dml 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 =3Dp 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 =3Dp 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 =3Dp 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=3D0x16 p_level_num=3D5 + check_match_ct =3Dp 7 + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =3Dp 14 + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) =20 # Run tests --=20 2.53.0