From nobody Tue Feb 10 03:45:03 2026 Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (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 1CFF321422C for ; Sat, 25 Jan 2025 06:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787638; cv=none; b=h6vDxQLiRRrSODszccgKQUjCLgeT0/ai2HtfKilJJXbQ7G2d1VQA5/4oyEbUb7eRJxy8K63eoOFpYQQOLm/0zc4/Ttfwc5DNbUIdw749pW30f2buI32mhy2BS/owoQpdFmtwPNgs1wEdVJzx5YUYaddQ0JcqhwenE+n6Q/G9urQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737787638; c=relaxed/simple; bh=RN3Vjgo9aW4H3xuplh0M5d9b71cmuQpX+4vQwTKrFuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O+IelzDPSAGRHy11ljbmcGSLRGabEV/9kUWaHZN90AFngFHnoEPw72a2enF3kkqqaoc1TxMFLxwNYIEG2Vc4Zr86UN66DESkZcgethEjAgOMBNWNHqg50wUl/kFXiVE7nFdYW+yJL2kpSU8vyuyA9VF7ZTBaMLxqj8M0YVvnni4= 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=jhEeS8XB; arc=none smtp.client-ip=209.85.166.178 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="jhEeS8XB" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3cf880d90bdso10175415ab.3 for ; Fri, 24 Jan 2025 22:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787635; x=1738392435; 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=I04a0kW+UR6r9NTRsDJJoUdmO3RA+TyzEWylVuR4B8w=; b=jhEeS8XBvdIiIBKXmM6j8qInzN7Fz25ObxoPDdWRTLbys314LC155nFWrCpezcY2Bw t1VAxoBvXhgCuFQsNozSL6PUDE8eqhzYDr9dwkj9M5w0T8exBOrPEzXW7krjPIvYnp/o 3jnMDz5x3MKd/l8NEXpzZlHMtjPze+vvjN6s1tmzgsBW19a0xjzeFXYuELY9riRtA55Q X56lQ26hB69oZu4FxuYDNXeaX3ck1DMtAcLbuTVlnLJy2pYwJJEOxTs4H/wDjmAv3cBJ yaDTPgEnT70BF1dqxshIGMAftndFvfzvLQ5b+r5pB+fhUdPspI6Pb4k5Xh3G82IjRb5N tC/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787635; x=1738392435; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I04a0kW+UR6r9NTRsDJJoUdmO3RA+TyzEWylVuR4B8w=; b=Hn7ysE4ezAbeCrp2ak2GMR3pYEpdConI6zMl2KBwSuNxxyCRc6U4fwhMr+HDdgnzgT GFEswZ9KBN8OIYv0tQfY2AP0NNiuYQcA4+bOlh4RyXxxW+/TV1S3Q7gB13jYlAKvDqP8 0++1UCS9Avuu9HSNdlZlvkrND1PtWj8ToxYonnDiT8bgm4U1FpVPVmQ6+uorzBAqs/2R zJYiX+aq7ldhb9W8suiNZUT6kY0iNZhML3SU532YxyN9f8sHwaYiynr25wdJC4DwX0I2 7o0VXjPaW0mWoBESjKHPRdL2gnod0v6vNXA9s8LQ9hUjM1RQ9srJDsYcOUpTS96b+exn 7DsA== X-Gm-Message-State: AOJu0YzVe7pbmxuaI5EnKnO/jIWeq9D5HVpTLeUjlO+Y0Y9DJJytCaGS gr2jRo+11pYVWUF6w4SevCFBTBUS1xF/elneqOKPAQ/TswO9ixu0rKG6Fw== X-Gm-Gg: ASbGncs34pNgYuE4lduzR7WMEcs3We9sUgnoOJWnlW4A/UsD9OMQYw0MD2v3WhFTHd7 hWERnD3gG84Q2/pIWxgXPG8tqoRjVbndKjuJdjdYxysqzNSWxrQ7m65236iBF1YLPLnFiFbvxI0 TTc11kQXkbEjro8pv9Z7zJ7QK+lbISpwdMgj3zcXJYdqdUSsgPO7z+5x8Yp213Gvz/Umx3N8NXM UHXfr03uZhAOAWm89Hu3IOvjOjAQFzAUW8Awxi42qxWIwV2wlnnBs0L2+YAmEywBCrFU3EiYHqz CWaEKaL0GK/fEivfOQzbXmlVGYTSAQk002ZpAA== X-Google-Smtp-Source: AGHT+IGIM5csLRgdDio0MZ1C+W8ZtXGP9ro0KKbKTmSNfS3XJ37G4loIhg3hRvpEN8PltJakl5OJ5g== X-Received: by 2002:a05:6602:6c11:b0:842:ef83:d3b2 with SMTP id ca18e2360f4ac-851b6522640mr2688351539f.12.1737787634956; Fri, 24 Jan 2025 22:47:14 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:14 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 35/63] selftests-dyndbg: add test_mod_submod Date: Fri, 24 Jan 2025 23:45:49 -0700 Message-ID: <20250125064619.8305-36-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-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 --- - drop -v used in test_mod_submod(). V=3D1 does it for whole test - ifrmmod at test end (Lukasz) --- .../dynamic_debug/dyndbg_selftest.sh | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index c97c9391d0f4..cfed79b34996 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -275,10 +275,79 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } =20 +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + 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.48.1