From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6815FC3DA49 for ; Tue, 16 Jul 2024 19:09:34 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.97.1) (envelope-from ) id 1sTnYI-000000001vk-3Pu6; Tue, 16 Jul 2024 15:09:30 -0400 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.97.1) (envelope-from ) id 1sTnOR-000000000ic-3akc for kernelnewbies@kernelnewbies.org; Tue, 16 Jul 2024 14:59:19 -0400 Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5220339f.2 for ; Tue, 16 Jul 2024 11:59:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156339; x=1721761139; darn=kernelnewbies.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=Gt92vv+l+QrwNWjlUzQRBip24zXOkaNnGwWlphVTLFQ=; b=C+ryTsXg4OJUPrnAT2vetwwxWPUamvh5oXJtDQ/qB0Fi7+Ab00wboMz1XIzbGmDcDx 0XdscfEMZRFMCmzsVUuk2jUt8buCRW4Z2XSbjP+rvefA82wbSnrj/n9SPbYKtHKi5eLL 4C9pTGoPTDQ8ulZa4+MiI6A4R1zo1EbsWozKAH08MBUDLFZJzDtJYFBkwBk4a9AFqVK4 Ogst/n+YbhhkZ7YwIAzrWYISOq+VCkiF3UqlTkwIeaAQsIt1mOQXW0JY1BTLGifCzoBV G8yMX5x9eHIczEo6dS7i1rjfoueTzzRQkuLlmP41TsZdWrPjWMnBr+FEnwXnivmobJfj kUSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156339; x=1721761139; 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=Gt92vv+l+QrwNWjlUzQRBip24zXOkaNnGwWlphVTLFQ=; b=S3TBwf/pKj7sPe8cshmjjFxMTLG1CyDyZWI1/EBD8or61Sv4JU8yxdqmknUJr5x51d 7h0/aC/ll9LsQbiL5EbcE3tVEx70axjAz9sbECza1eECL35Xk1cL6kQWhVXJQW0ZmNYo Wzra0fBXDk+MRlMx914G71G8a8C2K6FdZNYNwgpJ9TXplZLzftDl83CocsgGn+EFitS4 DVbgfqAh9vJEe2qEWAXohKHIiZslgcoETmOyJj58KLQKdkq8AGoov0PKP7pv2KeymNs1 jVBbEKBVV9/vLzc/RtrCMDDRR2Sro7klC0ARwoUmdR9+j6rgUxnn578qxMYSeuyEgq9r 0a/w== X-Forwarded-Encrypted: i=1; AJvYcCWqTgTZvLMnTZSpW12xoBwrTRaS+Ay9pSA5uJ+o18IEzjGx05tqAVkK+QKN7hklsa7uJ+BZVZcxur2rv9MNdXRktkoxaaLPNoZAMxcEARHj X-Gm-Message-State: AOJu0Yz0ETRG/8qa4ql42blNfgSr6Jpk6r9TZhtXjZzdXA04S8jARXGO ySpwQjDiyvVsjYNejULJXzxbUQGZcYI0Qgru1dNSq5KYpwsjmm9m X-Google-Smtp-Source: AGHT+IESuQloCkkuiShxJ11MDx3bp9+KgwgbKFyqWB/fqDDPxPeZjdAkYWwkkPnxEDOpSZ924Swh/g== X-Received: by 2002:a05:6602:26c1:b0:7fa:8178:d672 with SMTP id ca18e2360f4ac-816c2a1fd63mr53177739f.4.1721156339610; Tue, 16 Jul 2024 11:58:59 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4c210f23f1csm75301173.102.2024.07.16.11.58.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:59 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v9-resend 27/54] selftests-dyndbg: check KCONFIG_CONFIG to avoid silly fails Date: Tue, 16 Jul 2024 12:57:39 -0600 Message-ID: <20240716185806.1572048-28-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240716185806.1572048-1-jim.cromie@gmail.com> References: <20240716185806.1572048-1-jim.cromie@gmail.com> MIME-Version: 1.0 Cc: groeck@google.com, linux-doc@vger.kernel.org, Jim Cromie , yanivt@google.com, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, linux@rasmusvillemoes.dk, robdclark@gmail.com, dri-devel@lists.freedesktop.org, mcgrof@kernel.org, seanpaul@chromium.org, amd-gfx@lists.freedesktop.org, joe@perches.com, bleung@google.com, intel-gvt-dev@lists.freedesktop.org, ukaszb@chromium.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org Several tests are dependent upon config choices. Lets avoid failing where that is noise. The KCONFIG_CONFIG var exists to convey the config-file around. If the var names a file, read it and extract the relevant CONFIG items, and use them to skip the dependent tests, thus avoiding the fails that would follow, and the disruption to whatever CI is running these selftests. If the envar doesn't name a config-file, ".config" is assumed. CONFIG_DYNAMIC_DEBUG=y: basic-tests() and comma-terminator-tests() test for the presence of the builtin pr_debugs in module/main.c, which I deemed stable and therefore safe to count. That said, the test fails if only CONFIG_DYNAMIC_DEBUG_CORE=y is set. It could be rewritten to test against test-dynamic-debug.ko, but that just trades one config dependence for another. CONFIG_TEST_DYNAMIC_DEBUG=m As written, test_percent_splitting() modprobes test_dynamic_debug, enables several classes, and count them. It could be re-written to work for the builtin module also, but builtin test modules are not a common or desirable build/config. CONFIG_TEST_DYNAMIC_DEBUG=m && CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m test_mod_submod() recaps the bug found in DRM-CI where drivers werent enabled by drm.debug=. It modprobes both test_dynamic_debug & test_dynamic_debug_submod, so it depends on a loadable modules config. It could be rewritten to work in a builtin parent config; DRM=y is common enough to be pertinent, but testing that config also wouldn't really test anything more fully than all-loadable modules, since they default together. Signed-off-by: Jim Cromie fixup-kconfig --- .../dynamic_debug/dyndbg_selftest.sh | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index fccd2012b548..d09ef26b2308 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -11,6 +11,30 @@ CYAN="\033[0;36m" NC="\033[0;0m" error_msg="" +[ -e /proc/dynamic_debug/control ] || { + echo -e "${RED}: this test requires CONFIG_DYNAMIC_DEBUG=y ${NC}" + exit 0 # nothing to test here, no good reason to fail. +} + +# need info to avoid failures due to untestable configs + +[ -f "$KCONFIG_CONFIG" ] || KCONFIG_CONFIG=".config" +if [ -f "$KCONFIG_CONFIG" ]; then + echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG" + grep -q "CONFIG_DYNAMIC_DEBUG=y" $KCONFIG_CONFIG ; LACK_DD_BUILTIN=$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG=m" $KCONFIG_CONFIG ; LACK_TMOD=$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m" $KCONFIG_CONFIG ; LACK_TMOD_SUBMOD=$? + if [ $V -eq 1 ]; then + echo LACK_DD_BUILTIN: $LACK_DD_BUILTIN + echo LACK_TMOD: $LACK_TMOD + echo LACK_TMOD_SUBMOD: $LACK_TMOD_SUBMOD + fi +else + LACK_DD_BUILTIN=0 + LACK_TMOD=0 + LACK_TMOD_SUBMOD=0 +fi + function vx () { echo $1 > /sys/module/dynamic_debug/parameters/verbose } @@ -192,6 +216,10 @@ function check_err_msg() { function basic_tests { echo -e "${GREEN}# BASIC_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi ddcmd =_ # zero everything (except class'd sites) check_match_ct =p 0 # there are several main's :-/ @@ -214,6 +242,10 @@ EOF function comma_terminator_tests { echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi # try combos of spaces & commas check_match_ct '\[params\]' 4 -r ddcmd module,params,=_ # commas as spaces @@ -226,9 +258,12 @@ function comma_terminator_tests { ddcmd =_ } - function test_percent_splitting { echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on % ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP" + return + fi ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug ddcmd =_ @@ -248,6 +283,14 @@ function test_percent_splitting { function test_mod_submod { echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP" + return + fi + if [ $LACK_TMOD_SUBMOD -eq 1 ]; then + echo "SKIP" + return + fi ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug ddcmd =_ -- 2.45.2 _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies