From nobody Tue Dec 2 02:41:48 2025 Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) (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 8B453393DE9 for ; Tue, 18 Nov 2025 20:19:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763497177; cv=none; b=uQeq4YXRt1HsadGHNV5CtmVHL/XHi9ypPPAjvDApEFeDUdpmCPQZRBAJ2NdrLVkexMl4maiHIThdWuY3zRYzWQVE7GLEipZW8rTcDD1wyLHhPZ8Gc5AmqvTAwGF1/ITM/GecRZl4jGV6CMig2RjRs3M0h3kz3kW1xwFDYn8pnjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763497177; c=relaxed/simple; bh=xlIsHnoTxZ28jgj1HBRw7gqVD6xjdXEs58DpB9g7Tvc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p878uPVLYvNAAnr7XGRqRT6rCOTgREd8yPb5I+i+VPqfPO9MU6ppoeJVa6Fjk14lVpIhVHJpF1ibaq6X+9qW/bD6g0pfvWs2Ekmwn7snF5v4CZ54PTspgS4Q/O6t9eVllyRPJy1xLr9YtaV0uXWVF3HrnyMYmT5wZG99FjYTsPA= 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=OGcsaqr/; arc=none smtp.client-ip=209.85.166.176 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="OGcsaqr/" Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-4336f8e97c3so42512765ab.3 for ; Tue, 18 Nov 2025 12:19:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763497172; x=1764101972; 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=6twf2/xpLjcZPEmlJlQUkGBg342LRmA2abBTvniHwsI=; b=OGcsaqr/zoW328wDnBhSxAyJBHI+GNZaFaJCy2lEtgxP8yOo4A0taR1w3Kn4ctKeHi +ntba1+gxGg91agafNoPqI4vmJabd6WUNHiN37fHWoqw1e9bL5a8J1nfOWkj2jKWNcNW XUZCXDgE7V/t+nd58+jdZkihB/AYSP1Yj/OA6w7NgSK2wAVGyWQK3VGikNW696E9V6F/ upz852yz3M63ZhNxOUaJ1TCMA7btgSxeuMh2So2wmcNfn8yUM+mgVDBelKH16nN9+6nd sevP0rG2WE4DMm38xfX1Y+mUBb0Z9cEQjECFFP5lUdpSzexGsUXOzMTni2xsOC1YXTtt IHzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763497172; x=1764101972; 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=6twf2/xpLjcZPEmlJlQUkGBg342LRmA2abBTvniHwsI=; b=hcvYkQY9+VohPBfHud+wTX2os74TEqLs6DqR5e1jByEkfsZ2hy1i10XFbrKGZKuuWO JbZfTFWuDAKZs6Vll1a+BGmcq+2vJ85fogR3+lccChFuxQk4EQ8YOCcxX22OWLnVCILb q/6FiMIg9QxfNx7rz+utgbz8G0r2Ln9TN4XDDZdKSmRYERwzvbAG/dibmTTtn2rFSMeH dzbl5k+apfvxNWJ2vQeLUlT4HDidep3JGLv7vX1kXVKnQ1FRaDaAq0mZTMtTachSyhs9 WrCrMBsF/udm1N6BHoSU+JvsOYt9vhKbFhNlNqfNATXyErJAhMUbxXLLAzCejoC0/kj7 mOsQ== X-Gm-Message-State: AOJu0YxXXc7f70R0GyKxUWdifA20Y6PEJUDFoctlXWeVp85uBCiqWOCo N2VltxLi3ZPQ4dvbn/9v6SqZh9Tstf65pzbeRqKgZOusCMXtMyT8lY6Z1J5O1MFh X-Gm-Gg: ASbGncvrxnC2kLFvuPADtJ2ZE5pBMuVlZsMKy2jWRJ91xIyJyiNSdd40oSlOqmCo/v2 BhnLpzPbUd/qrfuBHmULSSfiQQpSuOiO2tQ1bKg15Bp7tAKE9XkWQhxdFqp9SOzCk5ZRe8eAfoE z9JLXiYilSiAHDjZ5oZvIkdpYte3O9WGRPZknWQfcVdmSF6vqs71WW/Y6nN0pYj7qBkyIFqqIm3 sExgHcwLA0iv8h4g7ofPTx7i1FdYuiih4vJF5JJkwAWo3OZbCUvAIZykqRlSO7m2FoiOBHReBtG UaxCFHePndHoTPRMEypuoXfrj0SdxTXwW6ZPWvveBaqEYMxTAlkc8yddO8pYcm51zABDa4cby6b ci45j5qFMBxkb604GCHipP8+1mnfHOQRwDv4EELASY8Z/2IqFX2x0xl0eca28P9Y7Eu+isuC1i9 r1c2HhUvIYLWmDUUv3QFVyiu1Hq3H0d8QDRVytAK6Ch6f4CFzbprcrPXiQsGSIM8dcnMA= X-Google-Smtp-Source: AGHT+IFkYXoGTAt3RUYgUsveyerauYsUeZyuGCuESFN5PjmKiqmJ3J3pTqwdApcoCmHPHik0qX6Eqw== X-Received: by 2002:a05:6e02:e:b0:425:7534:ab09 with SMTP id e9e14a558f8ab-4348c88fff8mr219681895ab.7.1763497172358; Tue, 18 Nov 2025 12:19:32 -0800 (PST) Received: from godzilla.raven-morpho.ts.net (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-948fd4c273bsm419823939f.18.2025.11.18.12.19.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 12:19:31 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, gregkh@linuxfoundation.org, jbaron@akamai.com Cc: ukaszb@chromium.org, louis.chauvet@bootlin.com, Jim Cromie Subject: [PATCH v6 28/31] selftests-dyndbg: add test_mod_submod Date: Tue, 18 Nov 2025 13:18:38 -0700 Message-ID: <20251118201842.1447666-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251118201842.1447666-1-jim.cromie@gmail.com> References: <20251118201842.1447666-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. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- r3 - skip test if LACK_TMOD older drop -v used in test_mod_submod(). V=3D1 does it for whole test ifrmmod at test end (Lukasz) test-mod-tmod --- .../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.51.1