From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 916E119A86F; Tue, 16 Jul 2024 18:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156303; cv=none; b=R0J7AuMkuPjIYj+sG2kmyOJMI0V44VRP7UqHsRspFy5hd+6yUE+B5HiZqvgZQNQaQf/JDqJ72JzfjuLRqqDJWrqbNmSElvfZkCtiFjWA5TOSoXA055FBeq7TdIqXyLFkfRYEBhPreXnknSkghP5kUkQMSlgGXE9DMIqJqqqeBTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156303; c=relaxed/simple; bh=wKsffOuXjQz6csIEgiqYbyUo9lvjHQdEP0b/s+bAJ7A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rs0fGiKJz4/F88bcIKu4/ztym8ye1cE0KN1Ub2FRAwU6SRFFz+N5goRSjj7drCmb8DIkLxpev9hPPwfu61jDQXzAWCWIrH2ach5Ka9Wd+KJVOcbHTg+WT2J8qvWEFBzIdWqxGIx+EI4UutP9QPVmSIAbtkUDEW+GFaueWNjUpHs= 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=ji2sORLM; arc=none smtp.client-ip=209.85.166.42 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="ji2sORLM" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-8046f65536dso6038739f.1; Tue, 16 Jul 2024 11:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156300; x=1721761100; 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=5R1ZNEsygnLGTQO2NIWkjU0SF7pc6VSZuM8NRzidmQA=; b=ji2sORLMXfvOdCkS+9O1i31N5FCRzZNXGZyTA/PSBT+oBzdsGb1JlgkPUnKF1E7igf ifsB+xjdSoqTsEZ1jP1b3Jg2big90Q4jnjOdO2DUd96P2MJgZJxENLh+DejUwrjObNz0 u1ZbKtVGA/24Jhld/ywaT9SAfhRcrn5BLPlfTbGbFBET7nxinWo1X/m+AXYsxZqUN1VF ThjH0GUrVBsUqLzaCrCHkLSvIS89BpYi6m3C2yw3OD/JSVOYsANlqj1N2tTIcdZNZl2z 3VkbAPYbOF7lKam4LlCotDiQQiAMXx0ShpZesHWxY3mstNR0tL/ZGtHF+HN5yoR3LEJW PgMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156300; x=1721761100; 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=5R1ZNEsygnLGTQO2NIWkjU0SF7pc6VSZuM8NRzidmQA=; b=GSPSfEBxPV4S7OI+AW+YAAX1xvRLb1z7/i6iHkXiQgmmIrg8FK+sijmpKKE6Y4vYgd 2S5AfbxEP/7oZGM3AW0prFV/1+blvWYS4yDVLfcaXwxusxoTmf8tuijtFvklY6m6a6gD RO0t1xM18YS+JO0KKkd4Uz9AtWu4E0y224r9uQ6Vfz9YsMPF+awYXCgJzximovcR8Kek MSPJXDEkvrTVK3VooBCAmurgF3oSjrLKQ00HoogdbkYIGtkSLj55K7LDidwpSoI+/7EM ZJD+5GKJwOvAqb4GVKjz1u8nQea4KvrR3LUfvJdmVTepqL/yUwewor4Fp7Z8sO2V9SKT nGLw== X-Forwarded-Encrypted: i=1; AJvYcCWeB2HgYdIeJNySEgKBLeKioJwio+QPlCKAUuSVxkcvLP4OWMOYbsBKAZl7zrfpM7WvZEdd7vfPvnSFcfTloLHykM8ONbRtIoPV X-Gm-Message-State: AOJu0YzZ284oKWawULX/01/rkV9FL2GPUfQFcoa//uUmrdz3AiHLVKLp rmVN3hJncyE6SKDBoDGn5B/fUfMP8/tvsaK6Nxw1sYwbP/U9zAPlkYnUVldh X-Google-Smtp-Source: AGHT+IG/GWDlKRu5+OOMDNAMNMhtDFiwfQtpn8aBJzDUfIXJDuLqEafEhFwZW4oo9t/YHsJs9EPD5Q== X-Received: by 2002:a05:6602:1502:b0:803:980e:5b38 with SMTP id ca18e2360f4ac-816c2d03801mr41542239f.1.1721156300341; Tue, 16 Jul 2024 11:58:20 -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.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:19 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 01/54] docs/dyndbg: update examples \012 to \n Date: Tue, 16 Jul 2024 12:57:13 -0600 Message-ID: <20240716185806.1572048-2-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> 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" commit 47ea6f99d06e ("dyndbg: use ESCAPE_SPACE for cat control") changed the control-file to display format strings with "\n" rather than "\012". Update the docs to match the new reality. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 0e9b48daf690..6a8ce5a34382 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -52,12 +52,12 @@ query/commands to the control file. Example:: # grease the interface :#> alias ddcmd=3D'echo $* > /proc/dynamic_debug/control' =20 - :#> ddcmd '-p; module main func run* +p' + :#> ddcmd '-p; module main func run* +p' # disable all, then enable main :#> grep =3Dp /proc/dynamic_debug/control - init/main.c:1424 [main]run_init_process =3Dp " with arguments:\012" - init/main.c:1426 [main]run_init_process =3Dp " %s\012" - init/main.c:1427 [main]run_init_process =3Dp " with environment:\012" - init/main.c:1429 [main]run_init_process =3Dp " %s\012" + init/main.c:1424 [main]run_init_process =3Dp " with arguments:\n" + init/main.c:1426 [main]run_init_process =3Dp " %s\n" + init/main.c:1427 [main]run_init_process =3Dp " with environment:\n" + init/main.c:1429 [main]run_init_process =3Dp " %s\n" =20 Error messages go to console/syslog:: =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 DADB91A00C2; Tue, 16 Jul 2024 18:58:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156304; cv=none; b=q/+56ZQflxcdMIobcAkrCGCg2xWAsA4doEDtz1EZ/VSwWgd3cvJzg0ZKPY3JDw8IzxvOl7EWRJqCT26FDKIgI2o6bNn5UmYzSwWCTAnLkY8hK9qSkULKY5nrp7iwXYzKqKF0kJMWxw6ttSLPidvsXw/N6PY1DqlVJTgQQjAPJUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156304; c=relaxed/simple; bh=jMFJSvW8rwGwA9QU3Al6zitYRBQUQs9qdqLxCiJYGlM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W+nM7KGTo5hr5qoVFSQ5MlTnoGgyDRsyZb+aKrR2A2+GJ0he1ureVNPzq55MDbFARZV51nWkOkIIBAtDmsrZbGdMv48IDrmYaFt/B56eu9iSPckTAFA6Oq77XIetx5PW2PkjQFPnuqntsDNHsurbM0VLdMzGoiWaFXJbVdEG9Jw= 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=cSPkyWXL; arc=none smtp.client-ip=209.85.166.45 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="cSPkyWXL" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-816b627a7b6so5609939f.0; Tue, 16 Jul 2024 11:58:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156301; x=1721761101; 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=0jicnEuSikysNdrvNl4Iye9B1q1hn5wCOtgRQWjJh+Y=; b=cSPkyWXLLctUWEBC3p64Gnz6QSDKpPDc+SuxpMev8XySZ6PcFOMtyYTUFmp7EoRZaJ TdciZI6iF8bOmyDytUbP1ULZemskMGFcEHsOzQE094zjjwDSdoEgDxqvisvkcGSZ7f7g D2zjjShUXczr/eSuvnqaE/3Vah65dUlgVd+vdngq8S32LV98+L/vzWris2cQBct+AqwY pkeiuYb0srGNlNJXFFCnv3iJoM+v9chIigLlgBBV2cvNbt7y7n0KUwHnstbGzLWOkB6E xhfVZEhygEfWpQJQr1yWuK6IRbmJc5pASHNDjl1BPsXKvpcGlRYbqozs6SPSKogaqVzr fMHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156301; x=1721761101; 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=0jicnEuSikysNdrvNl4Iye9B1q1hn5wCOtgRQWjJh+Y=; b=cqgEd4EBMJ/9S3G5z15fImb6JB3haI+ZW4JL5GAS82sp7IRlDoXutBo/93GGoeMpzy MWQ5ylDQdcBFH7KW6p3pdTxQ1PI0dEiskqQfdbZLUQI/9mhdIU/31eQXMDxMfHIUq5a9 da45HTOft1BtLveSaZwoX4zYC2z6CGq5Ix+VYwqulZA50sOwc2QCyt6Ueo34HH9bOiCw Cdmgz+AnuaAIltIA/JCBx+j5Gf+h7/D2DygAzibEbLdnfbI3yQp/Pg5bDUgGvgTviEy1 RH5y3hkG3FPfXUOuZO3/Jf/Ih+TrXRLAH6tTaeIalqW4WL8PdXtxGda4oGDRaGXfkVz9 OKcw== X-Forwarded-Encrypted: i=1; AJvYcCWn0t1mAvkmtSMBXxDFYWTDwQ/iLnoEEJ9Ym4pY+87h0rrZb87jCJl3LbdUybd9Exh4s6K9J+ce9abcu9SGX0QFPw+JdmzybeK3 X-Gm-Message-State: AOJu0YyDeYrDrjcwO6iZ367Ko4rxr133bzRK+mRMSO7PhNtpftyaOwHz khN1r/+2koMnwlaVIakkaZ6GeeINIcZOp+ETdhy0FeWSRlm7yQU7wdCFdrBz X-Google-Smtp-Source: AGHT+IH/6GmZg205UsWXcwtXp+7UYuUNvdEOD8tXVXy+IqWVen8eLnzAm3KTq1H8aJb2I+6ZPRtN3Q== X-Received: by 2002:a05:6602:15d5:b0:7fa:a253:a1cc with SMTP id ca18e2360f4ac-816c3f7c4c7mr42921939f.3.1721156301543; Tue, 16 Jul 2024 11:58:21 -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.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:21 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 02/54] test-dyndbg: fixup CLASSMAP usage error Date: Tue, 16 Jul 2024 12:57:14 -0600 Message-ID: <20240716185806.1572048-3-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> 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" A more careful reading of logging output from test_dynamic_debug.ko reveals: lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =3Dpmf "doing cate= gories\n" lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =3Dp "LOW msg\n" c= lass:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =3Dp "MID msg\n" c= lass:HI lib/test_dynamic_debug.c:107 [test_dynamic_debug]do_cats =3D_ "HI msg\n" cl= ass unknown, _id:13 107 says: HI is unknown, 105,106 have LOW/MID and MID/HI skew. The enum's 1st val (explicitly initialized) was wrong; it must be _base, not _base+1 (a DECLARE_DYNDBG_CLASSMAP param). So the last enumeration exceeded the range of mapped class-id's, which triggered the "class unknown" report. I coded in an error, intending to verify err detection, then forgot, and missed that it was there. So this patch fixes a bad usage of DECLARE_DYNDBG_CLASSMAP(), showing that it is too error-prone. As noted in test-mod comments: * Using the CLASSMAP api: * - classmaps must have corresponding enum * - enum symbols must match/correlate with class-name strings in the map. * - base must equal enum's 1st value * - multiple maps must set their base to share the 0-62 class_id space !! Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/test_dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8dd250ad022b..a01f0193a419 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -75,7 +75,7 @@ DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); =20 /* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 11, MID, HI }; +enum cat_disjoint_names { LOW =3D 10, MID, HI }; DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, = 10, "LOW", "MID", "HI"); DD_SYS_WRAP(disjoint_names, p); --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (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 133721A01DB; Tue, 16 Jul 2024 18:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156305; cv=none; b=OTcPQlXbAIvgYV5TzkQeEjlnM3bHt7KmUBDxPp/AfkKWfIpwm9QwaxQos7YKEBxqZ9ovLw+TyIamiR36mWDZTTLt6aZNvvkngeRIYfXrm2ICBfIu78FG0rGrw6Lz75cZWlYm0QXoIW31+E4QIWv7SpiWyNvL2R37qih+1Kkjc6w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156305; c=relaxed/simple; bh=SicJpcI+BtX1T3osyqjgxwJrfmLN+824rrUnpMOe6aU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YhHcMYBFTYIs6kfWipyetb+fI27LwUFNZiXIMLUXxW9s0QsuhOZbvFD1e7SKFTAidufD0QuqDRqX0QN73DhIqZFA/WFBdZx/OChRnLc6CQH97tMvq8Wv+bbEHuMIeWEbgy24AtQtxudwwsonz2i/0J28hdrkEsMitAB07q04uLM= 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=lmXBzMm3; arc=none smtp.client-ip=209.85.166.52 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="lmXBzMm3" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-816d9285ebdso1218239f.0; Tue, 16 Jul 2024 11:58:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156303; x=1721761103; 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=4gHhZlZC9lRM4IBPTZ/FMwaYyy9pebB6jMENYSRc4Ds=; b=lmXBzMm3OGNA1rGYV17UfmfWwDQU3hwLYg6+DIi1BTxOEU2mh9YUC76TYZ11AeV5wY kxGoB5q71TsiExRO8JsFSOvbxz9hRnOA4VWslLp7f0IUBNIdOq33G961vtMqmTIEDghB 5Uf17ZBhZT+4WDh7F2jPBy43rJg8kUUBXf9LpDjaySLS6CkMA/kbiFnkZDRmi3zxnWN3 Sv2kjP84I5JxE/V34Tsx6iLMdgJM6ZR0uSwPni5uz0j7KFRimnkhv3mlBD+PfQhtxmMA GS4ZTGc59rdNtLe5HK/irwn7ApwgdTZMHMdnre2e8hHgCNZNi+WShg/UVkBstOGDJysk rUKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156303; x=1721761103; 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=4gHhZlZC9lRM4IBPTZ/FMwaYyy9pebB6jMENYSRc4Ds=; b=LOTg7bDwWfkUK02vZThSBj+3EeF6u41cO0AuiCsPOflTjQH2Lu1qfcREknH2mnrQcn VGzPpXhdi9xTl2L7p6dlpb64seXMwEeJhuvSkQnWTmjCzcis0DrzH62hxXEJ7rvHA7ci 7aAJHimy+1kbNRAM0ainABdFOyw7j62Sptmk4MeHMdOHSc0UPUN62zrBIRtLEsOTrhPE iH5NFGFoOKAxEaaOL6uwUcoM0D9ju0glcXf0J0rqVJEOf85aGHYzAKLQzCmnFYo5bK9R WTw/v543+/yefggH4i/zyVdVKyGi72C+rYPtUt1enUqFlF5EIGncs6iuaq7/38NHPdQd VDdA== X-Forwarded-Encrypted: i=1; AJvYcCXOJ7Y7NwYxzRgSfUoikpnLfVd4acDwCzfzwaoyXp1ZX6Xvno0votjn+99KaLE5A7zllMReOGrDa03zYXmXq4Fxua8IQaKpQZNm X-Gm-Message-State: AOJu0Yz7n/ac1jvPhr/rDPZ3TgCLW+MzsPLD0teD10JwdWlgRg6IGXFy cwgjrtKS9HAvKAqJE83hwBamcYXS9B+0KUm/gYrHuKorIIbnEOYeqb1f+bBc X-Google-Smtp-Source: AGHT+IFIRyDhcxDXmtmK1HLnwwi/E2q7SlYEHNYrBcbDILq7EAQB2veK147HqsG4fbMsp7Bh70n8xA== X-Received: by 2002:a05:6602:6408:b0:804:411a:16fa with SMTP id ca18e2360f4ac-816c34e606bmr41423339f.9.1721156302764; Tue, 16 Jul 2024 11:58:22 -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.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:22 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 03/54] dyndbg: reword "class unknown," to "class:_UNKNOWN_" Date: Tue, 16 Jul 2024 12:57:15 -0600 Message-ID: <20240716185806.1572048-4-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> 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" When a dyndbg classname is unknown to a kernel module (as before previous patch), the callsite is un-addressable via >control queries. The control-file displays this condition as "class unknown," currently. That spelling is sub-optimal/too-generic, so change it to "class:_UNKNOWN_" to loudly announce the erroneous situation, and to make it exceedingly greppable. NB: pr_debugs are only alterable via >control, and to protect class'd debug's from unintended alteration, "class name" must be given to change them. Classmaps map known classes to reserved .class_ids (the 1..64 val range per module). Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index f2c5e7910bb1..73ccf947d4aa 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1154,7 +1154,7 @@ static int ddebug_proc_show(struct seq_file *m, void = *p) if (class) seq_printf(m, " class:%s", class); else - seq_printf(m, " class unknown, _id:%d", dp->class_id); + seq_printf(m, " class:_UNKNOWN_ _id:%d", dp->class_id); } seq_puts(m, "\n"); =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 1E39D1A0734; Tue, 16 Jul 2024 18:58:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156306; cv=none; b=EVeZbnnNC3sY2O3x198FJz3OvQ2v5gTaWPwdR6AjSvBHeobhff6JGxUtsXo41doH5iAym1A3LFFiNQd/LflqvtkKYMZkjo+DN94t/IukEB077B0MLoJcSyH8Pr/TkurHHjICZ6vsKY1ymSD13xMVlFbotrZ4byqKphGcVMZtbGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156306; c=relaxed/simple; bh=2ejEZTfMnNkbjfcLpxvVrkW4M7/Fnzq1fAoZZKhXQWQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GPLGiaTSMZEzpCd+nNzM7Fg2kgGIrNeCygR4KTUjkGyRVd8P8ihOPMNrEDclT7Ie80OuIWvADvMrupbzE+lOLhP8zmevd4PFtHrm396ahoEfkdvzSK6aEQ4FZPQWKk9Eg2DlqJTPRbvmyWlEZ4lBSTsUrht0gQp88PJUom/gHdY= 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=Lyly81JK; arc=none smtp.client-ip=209.85.166.41 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="Lyly81JK" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5194139f.2; Tue, 16 Jul 2024 11:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156304; x=1721761104; 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=al8xZ+YlvhlhYR2QqHaR49xBruYIKMULtZOXYmr91IY=; b=Lyly81JK+fcjQCoovYDJWZd7KMbdadQxPWHfbrY1mbkxtWTMgUdvmx1gS6h9osD7g4 ktk7NTzNF5t2YSOwefsyrF/tk6EU9vblGn4UfhKVqGm1O8358+fetoZHluChSsd70BeS ZG1YouTrUSHD+2pjvb3ws4AYD+697hxcJs4RnLnodnE5ZHqgCFmMIvBpxOzkpT1YiOir LuInEQaSX/BpdTakVoZ793O45EcKiW9iJHEZFm5In7N1FSZq4RJATm3NAbE0z4cSNw7G lUGFa7elND8Q1BTwpxEPC4dy1M6OmJzYmFE50qSCR3yf0CxbG5DhOciU1u0W7EktaFW1 qHmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156304; x=1721761104; 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=al8xZ+YlvhlhYR2QqHaR49xBruYIKMULtZOXYmr91IY=; b=pUjRyYXM5RiVqvq0T6x2VFhx6qbaXCwo3RSMsYT2pcOZ8GsgoXodDHP2oyh9YG+LNV k/BUxHdJgCqJ5EJXKakUwQLGCIGyrgq9eW4+FiATLoKwRFf0P++b+tb+nbNT3K8pYZAT gv2bDN14GDcqPadCJgDO2qn+NdPv5ZtI2im2SC560lmRWasCB+e5z8QfUSrto7091gUb FRELJrEjbWm4uwAYzFG+Ws8ESJ//lIqN90kqquMVQW7XzEQCvMhxMBE29P2buC0SxEDK Ki3LL6IxdUNZYN/5s9hsRRdiDrBpLJReu1etiOMK8WloBbTKg/FSEsvBHX91Jela5ysp lkFQ== X-Forwarded-Encrypted: i=1; AJvYcCVp4/qPji44keNWjjj7FWJmULMK/Cc+Fj/aIhb5KG4W6MKiH/KZUvoWYzpXdeMIgPUrtyTQ6R4rMXP/7A8qC99t6lShnN9dHk8p X-Gm-Message-State: AOJu0YykqFELLvPb4aN2QdKjIA2sFSOPZ5agw+x0d2nOa5C4vtSzrpav 07PO91km4dQ6NG5fYQ1NIo55KNLBTyHo2//PQ2AM5NXxxTQsQSJ1oMRF02cX X-Google-Smtp-Source: AGHT+IEHXZgya8fxlhk9i3WpXa3f6xKgjLFbnVvzZUw1PQJh5tx0JX3MrDcdRp4L7TxET69MO77yeg== X-Received: by 2002:a05:6602:3fc7:b0:7f9:bef6:2068 with SMTP id ca18e2360f4ac-816c35dac54mr41417039f.10.1721156303915; Tue, 16 Jul 2024 11:58:23 -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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:23 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 04/54] dyndbg: make ddebug_class_param union members same size Date: Tue, 16 Jul 2024 12:57:16 -0600 Message-ID: <20240716185806.1572048-5-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> 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" struct ddebug_class_param keeps a ref to the state-storage of the param; make both class-types use the same unsigned long storage type. ISTM this is simpler and safer; it avoids an irrelevant difference, and if 2 users somehow get class-type mixed up (or refer to the wrong union member), at least they will both see the same value. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- include/linux/dynamic_debug.h | 2 +- lib/dynamic_debug.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index ff44ec346162..b9afc7731b7c 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -124,7 +124,7 @@ struct _ddebug_info { struct ddebug_class_param { union { unsigned long *bits; - unsigned int *lvl; + unsigned long *lvl; }; char flags[8]; const struct ddebug_class_map *map; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 73ccf947d4aa..152b04c05981 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -799,7 +799,7 @@ int param_get_dyndbg_classes(char *buffer, const struct= kernel_param *kp) =20 case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: - return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl); + return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: return -1; } --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 3A50B1A08C7; Tue, 16 Jul 2024 18:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156307; cv=none; b=sj/LjUahqJ0bbCgy7d4Qd1mL+R/ra1JFpzb7MrspVL5QggkWVhPon6yEF+xytlr3Xc5cde8AnM77WCR+z1PUKSog2HLW3w3lQ/kIFTiEzzk2sFCk05zUWJhj3aEcOSVo7wuNbn0rSTtiWh/iEns3flIRYXuDIRnXqm+vFTpIfcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156307; c=relaxed/simple; bh=WRKvWbkxGUPHTg3r/rCOmlP5kwS4UWL9Uc30R6F26cI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FZ7bwkUAz2GpHdnDjzeDgVFewaPHw5NSg1Jw58WRp4yrtxV5iHcHj3rlA8vWTbPzgToJ4AP0aopNSPvtZCnDBeSGM10//yXxIYRNqVndfxOkTIoB5HX7eY324yD5kEyXuTkcyJ0kBapZegCTA01RlovsHsxeuycMdUNSlOpG3FM= 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=W+KEd965; arc=none smtp.client-ip=209.85.166.54 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="W+KEd965" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7fb93b2e2a3so4660139f.1; Tue, 16 Jul 2024 11:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156305; x=1721761105; 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=o9eCfm0i8zR35eSeW4sl60NF7fntfywuDft6eLJjrNU=; b=W+KEd965sGaoAMgi52X4IuLCMpWTHkenZk/dKa+qe4cYlhWOSODsguvFKuD6FIgKiI BRVFhLK87jwUARpVzHqN1nzaQu9pPgLhWRDVVOeKQx4+HHsPTBVEWLT91fIyK2fjJbOf fYaC/U/pe4tqpQantC1RYyJZdUeKvP8g7Aae2gjPtFtGwF9rHkMWRaexiQVyGohPfYsI amCFtZkbXeRkjfom6voHPKH18tUvuWM7FBQJXwK08Nwh19P3QfS9GbzhXV1q7QCPSCHO fmsSyvkXWoyxNXaqW6lP+sZJn69WVxCYxzwU1Pm0llZGJDlp9N8H26xl7EobU5hZhbiX NS+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156305; x=1721761105; 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=o9eCfm0i8zR35eSeW4sl60NF7fntfywuDft6eLJjrNU=; b=pr3x8js+HKBdmOs3f5KiKtFB+fhFFOunxMWUWdAXcyATkqMfvGUsq5oIGQexUFbhcw dmaWF6vVyEtKuh8iizytPnCay/AWN4lTx5Yi1+Skplu82sdZ2AZAfLyLWkNgG9uS22uQ jfBklUxTgI4Yj2bpgnZd1xp+ETvtrmIs5R4ZpmVeN9YNlpAuJ11Lc+bzBaLPNRp9xo4x I/ghxwMqlWKrtZ+cWuVXW6fbCECB7rK2OtjirldgTO5B0VY6WVVPNaYIIPguLqT6yloZ K7fkJ6ySZx0TNBzs1FB1/B2RYCcU9BLnGaKomKbXHYMgHoN+tFoqD0lBCAvTFxXWnZFA Otcg== X-Forwarded-Encrypted: i=1; AJvYcCVVOmagIt0D6IX+6JwL/SS7U2IhGVqGA1SPSMtgdPV3MZurNqlglq7TA5sotZ4gtqV7mtadNhpy5t9m5xDouc28VBNtBiTu4/41 X-Gm-Message-State: AOJu0YzFls3nLuSsmOzRMjiY/lF3m5C+wazq1+09Of14TfIP93VPgT+G Myxt5MzdkIRXpDsBDOJ87508CtSH2NJOuLlieX/MGNOF3cJiOHaFeVXd5e8b X-Google-Smtp-Source: AGHT+IG4wAlI29P0shAMgDwMBD2dNXriK3cw5P7GmAIc5M2aOlT+OIn+5fDirb4FHh3WWIODpuyxtw== X-Received: by 2002:a05:6602:6018:b0:803:77b5:6cf6 with SMTP id ca18e2360f4ac-816bfdc580bmr51431239f.0.1721156305121; Tue, 16 Jul 2024 11:58:25 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:24 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 05/54] dyndbg: replace classmap list with a vector Date: Tue, 16 Jul 2024 12:57:17 -0600 Message-ID: <20240716185806.1572048-6-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> 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" Classmaps are stored in an elf section/array, but are individually list-linked onto dyndbg's per-module ddebug_table for operation. This is unnecessary; even when ddebug_attach_classmap() is handling the builtin section (with classmaps for multiple builtin modules), its contents are ordered, so a module's possibly multiple classmaps will be consecutive in the section, and could be treated as a vector/block, since both start-address and subrange length are in the ddebug_info arg. IOW, this treats classmaps similarly to _ddebugs, which are already kept as vector-refs (address+len). So this changes: struct ddebug_class_map drops list-head link. struct ddebug_table drops the list-head maps, and gets: classes & num_classes for the start-address and num_classes, placed to improve struct packing. The loading: in ddebug_attach_module_classes(), replace the for-the-modname list-add loop, with a forloop that finds the module's subrange (start,length) of matching classmaps within the possibly builtin classmaps vector, and saves those to the ddebug_table. The reading/using: change list-foreach loops in ddebug_class_name() & ddebug_find_valid_class() to walk the array from start to length. Also: Move #define __outvar up, above an added use in a fn-prototype. Simplify ddebug_attach_module_classes args, ref has both address & len. no functional changes Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- include/linux/dynamic_debug.h | 1 - lib/dynamic_debug.c | 61 ++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 30 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b9afc7731b7c..2b0057058ecf 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -83,7 +83,6 @@ enum class_map_type { }; =20 struct ddebug_class_map { - struct list_head link; struct module *mod; const char *mod_name; /* needed for builtins */ const char **class_names; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 152b04c05981..46e4cdd8e6be 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -45,10 +45,11 @@ extern struct ddebug_class_map __start___dyndbg_classes= []; extern struct ddebug_class_map __stop___dyndbg_classes[]; =20 struct ddebug_table { - struct list_head link, maps; + struct list_head link; const char *mod_name; - unsigned int num_ddebugs; struct _ddebug *ddebugs; + struct ddebug_class_map *classes; + unsigned int num_ddebugs, num_classes; }; =20 struct ddebug_query { @@ -147,13 +148,15 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 +#define __outvar /* filled by callee */ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e const *dt, - const char *class_string, int *class_id) + const char *class_string, + __outvar int *class_id) { struct ddebug_class_map *map; - int idx; + int i, idx; =20 - list_for_each_entry(map, &dt->maps, link) { + for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -164,7 +167,6 @@ static struct ddebug_class_map *ddebug_find_valid_class= (struct ddebug_table cons return NULL; } =20 -#define __outvar /* filled by callee */ /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -1114,9 +1116,10 @@ static void *ddebug_proc_next(struct seq_file *m, vo= id *p, loff_t *pos) =20 static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) { - struct ddebug_class_map *map; + struct ddebug_class_map *map =3D iter->table->classes; + int i, nc =3D iter->table->num_classes; =20 - list_for_each_entry(map, &iter->table->maps, link) + for (i =3D 0; i < nc; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1200,30 +1203,31 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 -static void ddebug_attach_module_classes(struct ddebug_table *dt, - struct ddebug_class_map *classes, - int num_classes) +static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { struct ddebug_class_map *cm; - int i, j, ct =3D 0; + int i, nc =3D 0; =20 - for (cm =3D classes, i =3D 0; i < num_classes; i++, cm++) { + /* + * Find this module's classmaps in a subrange/wholerange of + * the builtin/modular classmap vector/section. Save the start + * and length of the subrange at its edges. + */ + for (cm =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { =20 if (!strcmp(cm->mod_name, dt->mod_name)) { - - v2pr_info("class[%d]: module:%s base:%d len:%d ty:%d\n", i, - cm->mod_name, cm->base, cm->length, cm->map_type); - - for (j =3D 0; j < cm->length; j++) - v3pr_info(" %d: %d %s\n", j + cm->base, j, - cm->class_names[j]); - - list_add(&cm->link, &dt->maps); - ct++; + if (!nc) { + v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n= ", + i, cm->mod_name, cm->base, cm->length, cm->map_type); + dt->classes =3D cm; + } + nc++; } } - if (ct) - vpr_info("module:%s attached %d classes\n", dt->mod_name, ct); + if (nc) { + dt->num_classes =3D nc; + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + } } =20 /* @@ -1256,10 +1260,9 @@ static int ddebug_add_module(struct _ddebug_info *di= , const char *modname) dt->num_ddebugs =3D di->num_descs; =20 INIT_LIST_HEAD(&dt->link); - INIT_LIST_HEAD(&dt->maps); =20 if (di->classes && di->num_classes) - ddebug_attach_module_classes(dt, di->classes, di->num_classes); + ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); @@ -1372,8 +1375,8 @@ static void ddebug_remove_all_tables(void) mutex_lock(&ddebug_lock); while (!list_empty(&ddebug_tables)) { struct ddebug_table *dt =3D list_entry(ddebug_tables.next, - struct ddebug_table, - link); + struct ddebug_table, + link); ddebug_table_free(dt); } mutex_unlock(&ddebug_lock); --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.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 7BF3C1A0AF7; Tue, 16 Jul 2024 18:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156309; cv=none; b=oby9dnksb1TzPYOMwGeSWV9xjqAoRKicWibi4RqkXnIij1fLKhv3BJF9Ar0rCVgpBdK+4qKbUGqbgZQguOODWR9PbzLi2QZPn2vAiyNiq3dgEaSxtBAPpxzjf2WpoUaaIrliKEWjPETyFCXax7tazyuVbs0WEg9cYBvpcR+Gmlw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156309; c=relaxed/simple; bh=zmxGi1tH6sFd6Ybk1duPh2EblNtdPK14vDVZ+goc9v0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AJaGELWc1dVJGh3Oh3K6ahVxTSgfAwG3sdSAkeBQrXWaVAkdec5TrYMhc1e1xWibaMlsoXpvrwTJdOPVPZv5kfW9h44uQw5b7SvZohKs/pcvNdz5rUwKOqS3RuZu/+MXogH4rDHjafa5xXqnq4m+JeYiVK1rQrYUuXF2YuqBabE= 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=InPBS0Ec; arc=none smtp.client-ip=209.85.166.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="InPBS0Ec" Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7f97e794f34so4318439f.3; Tue, 16 Jul 2024 11:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156306; x=1721761106; 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=mgKlPNiKWVnT1pPVJRogWWF3tyIXWVHBmJ5ag9aE+c4=; b=InPBS0EcBPx6DZhqxBYr6lOm9vJaLUau66enQTPK+40ua0/nHDMZzLcrhaHc7S27xk piQCCQTs2oE7rinBAwuz9AY51JE94GUvYW0qA1vCCoA/DPcbHH9fvjIJvWjOVSRCDbZh Aba7BoUOD+i64N0vzyMyMYxff6xrgaLQ43jg8bm+Hz4oZPihLrBY0X4HwYsKFS30ZURF r92niye3xF8QjwYoMxzoQ5HWItnoNR+JoEjmAJsSONhy9bHYSKnApQyrVdXaYPHS0aQx k0QhwbvQ2OGTt6Ti18uhxaddI7zRc39B2+muSl6Shr9eShGA/EI7zgvbp+wcvB8s3Hmm M75w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156306; x=1721761106; 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=mgKlPNiKWVnT1pPVJRogWWF3tyIXWVHBmJ5ag9aE+c4=; b=QU9LUpMWtCu0xYvXDCJ5el+bJ3dMMbANgF7qv72VUv8mFaBVH2QfCg7Ny+oS27Lf6U m4kawYUh0IRGmyXdyouT7WBZUPzQPFrQWQeTRD1+EqdDA7a/J54VhnDm6Fw/CFw3zrww XAszIQs3j+dJQ4Iu8KmfEPOz8FsO/74NjQWc1PBruno79cevouF2b34WPl42x5m/5cYd ORyM1ALSRsU3J12XVXRtqwjB2+fYjodfOj0aCkXHyzotGOj7Eb96YpfJam3McODNUCbY SQlmgJn0stSQQ1Bms+/fIwj0tto5hZN4KEWjRp3iRx8S2LaQYNZ2H1SqAYY2aWbxZznt s18A== X-Forwarded-Encrypted: i=1; AJvYcCX4Qou/5zh9XbgzgKiXbqBOyQOrXR4IbRLD1Bj/sEwFxyZzI9NkS+9jlzExplr5jsDME35c5luuWo8oko8G653GMTHj95+8Mm74 X-Gm-Message-State: AOJu0YyvDlN6WCe2aNSG5Lafbg3p3H1w69yyZ+Ro3wRVYK9ZUEDFZua5 GIjt/EKK5W2CHqesZRIo8i4DG4pYaBDslNkQ4T/WXcimWPFlEb8BTdtcH0so X-Google-Smtp-Source: AGHT+IFRmNckkjQyPTVfVxjCsaJMm6za2ny8WaaVkqbSQmHgJS9XbrIwtq9t8iiqyHlZ74DkBNTv6Q== X-Received: by 2002:a05:6602:26c1:b0:7fa:8178:d672 with SMTP id ca18e2360f4ac-816c2a1fd63mr52960539f.4.1721156306300; Tue, 16 Jul 2024 11:58:26 -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.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:25 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 06/54] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it Date: Tue, 16 Jul 2024 12:57:18 -0600 Message-ID: <20240716185806.1572048-7-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> 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" Add param: query_module to ddebug_apply_class_bitmap(), and pass it thru to _ddebug_queries(), replacing NULL with query_module. This allows its caller to update just one module, or all (as currently). We'll use this later to propagate drm.debug to each USEr as they're modprobed. No functional change. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- after `modprobe i915`, heres the module dependencies, though not all on drm.debug. bash-5.2# lsmod Module Size Used by i915 3133440 0 drm_buddy 20480 1 i915 ttm 90112 1 i915 i2c_algo_bit 16384 1 i915 video 61440 1 i915 wmi 32768 1 video drm_display_helper 200704 1 i915 drm_kms_helper 208896 2 drm_display_helper,i915 drm 606208 5 drm_kms_helper,drm_display_helper,drm_buddy= ,i915,ttm cec 57344 2 drm_display_helper,i915 --- lib/dynamic_debug.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 46e4cdd8e6be..a1fd2e9dbafb 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -605,7 +605,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) =20 /* apply a new bitmap to the sys-knob's current bit-state */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits) + unsigned long *new_bits, unsigned long *old_bits, + const char *query_modname) { #define QUERY_SIZE 128 char query[QUERY_SIZE]; @@ -613,7 +614,8 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, int matches =3D 0; int bi, ct; =20 - v2pr_info("apply: 0x%lx to: 0x%lx\n", *new_bits, *old_bits); + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, + query_modname ?: ""); =20 for (bi =3D 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) @@ -622,12 +624,15 @@ static int ddebug_apply_class_bitmap(const struct dde= bug_class_param *dcp, snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], test_bit(bi, new_bits) ? '+' : '-', dcp->flags); =20 - ct =3D ddebug_exec_queries(query, NULL); + ct =3D ddebug_exec_queries(query, query_modname); matches +=3D ct; =20 v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bit= s, + query_modname ?: ""); + return matches; } =20 @@ -682,7 +687,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); *dcp->bits =3D curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -692,7 +697,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -755,7 +760,7 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) inrep &=3D CLASSMAP_BITMASK(map->length); } v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -768,7 +773,7 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); *dcp->lvl =3D inrep; break; default: --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 BF35A1A254C; Tue, 16 Jul 2024 18:58:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156310; cv=none; b=U/fZZAsKzsfidckTwdbupCVa7r6Qlqu/IbYFiFl+ZZ6ihWz3vtOSOqvP7PfxW2otRF5c7nEl1Nc8yhmG54GDt7+8rNSqmqKnZcVy/qsEbwOoNQzfDrtlsdNzzDMxGyy+Ka/qscTjRnHXJPjGG/ILWXN3AzvZ4pCKnssfqYaMpO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156310; c=relaxed/simple; bh=LfbPL0PeRvX6qcgfNwuiYcYLVX8gyNp/+Z0M/GkZpCE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dvlqvWYwwTeQCZg9KWOS9QhgLzLYgQXdZ5vv+wWDXs6KsYep69SUvsvIY5zoN/7U9KhO5Rbhpv0ltWO2dpDATUqVVDD8w0urAsWViOikuDjO67xCoy6ZWfr5+UZXKs2xHDYgPERiPAqmjq5TblyBewvz08G+ugUkPp3axzFBiuY= 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=ToOejOro; arc=none smtp.client-ip=209.85.166.43 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="ToOejOro" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7f684710ff5so2495839f.1; Tue, 16 Jul 2024 11:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156307; x=1721761107; 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=6xZzQ/E3vZK+E5MMlKfK/qTb5+sylxnNOul573hVp9Y=; b=ToOejOroRNr58AA0iTYO8Hp96VG/Zelm+iSpQgwY04eLcTy8AgIp7FC4iF2S8MludG 6pXNCWjwdC2DbqzShup9sGiAVf0EXNYHkDCej+QXJXA04rYL5wgYEylOJTG71dQKHabH qV1PeAFGiaaPTeSYOCZyf3fp4XULxYKwIbU/Rfx8PgGL2FQnWhstsWjO+SUIVX//6ZHb gkcJN6loqhgjtTW4WFjIS+ajmgaoir7e2T322NQUAGhdilGnX5sy+1vxL91LtTc3xIFk 62CWq9zAlXwGIffQYIMoILav9z25DwKlQkwrh2lO6a3UPYWWFs4T8lZ14cZxq7FX+79F +c8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156307; x=1721761107; 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=6xZzQ/E3vZK+E5MMlKfK/qTb5+sylxnNOul573hVp9Y=; b=ov5vHXSBAACuh32rUjzabtMP5oOYTKod3tAr1ogSoHD86+KTMKned47VykMph7cr6v FuNOb35V2ehfEd8YPHGBp7cT5/Fo8m8xRw440xQbrst19zGvyNEj8zD91MXilrcGDlip m/lLqvKFoZKpYRv1wgN1bMhGimrx5SKwunqnXzRZnj04fLhnSafWU0ry3yxMjjJB50P5 lW3OjQfKLo9fb5IpuUjfBbme7JXRkrztnLhtuC3RGUCSqk4xJVcahBrdjZ1fXSYHD3dn G16nCJG4VZYfcRk/461lx/X3kHnMCOe/pBFeriQJzSOO4MV6WY6+FzF2iSz+lh9vp/Ia ZMqA== X-Forwarded-Encrypted: i=1; AJvYcCVNw88wWCDumfVFeTz0//EfTGBdGI1JsQqFuBjmkt51sB2ebdRIc2nBHmWyIsh5/tN2lfe0Kuyw8SD8ME6Ig+rr4m+xQaBGn0h/ X-Gm-Message-State: AOJu0YwcpDQGU90UCVsWYASh8KQ/p1+PCv8nroVpJEetRc/f15TLRGIN 4Xh78oqYmT/VGEoDehr6t90BrNm4j6gInAOdJ6n/xM07WiJ8W0Xr4zB8X81j X-Google-Smtp-Source: AGHT+IFfuMTN+7knhkikS57P3DNV4ZeL623SZbQUXOKpXKyMTTpxm4y3uLOsfAj4qttEd3VwZMrCFQ== X-Received: by 2002:a05:6602:314e:b0:7f9:c925:24cc with SMTP id ca18e2360f4ac-816c2926c09mr24652139f.1.1721156307440; Tue, 16 Jul 2024 11:58:27 -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.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:27 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 07/54] dyndbg: split param_set_dyndbg_classes to _module & wrapper fns Date: Tue, 16 Jul 2024 12:57:19 -0600 Message-ID: <20240716185806.1572048-8-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> 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" Split api-fn: param_set_dyndbg_classes(), adding modname param and passing NULL in from api-fn. The new arg allows caller to specify that only one module is affected by a prdbgs update. This selectivity will be used later to narrow the scope of changes made. no functional change. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a1fd2e9dbafb..4a48f830507f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -711,18 +711,9 @@ static int param_set_dyndbg_classnames(const char *ins= tr, const struct kernel_pa return 0; } =20 -/** - * param_set_dyndbg_classes - class FOO >control - * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type - * - * Enable/disable prdbgs by their class, as given in the arguments to - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative - * levels by bitpos. - * - * Returns: 0 or <0 if error. - */ -int param_set_dyndbg_classes(const char *instr, const struct kernel_param = *kp) +static int param_set_dyndbg_module_classes(const char *instr, + const struct kernel_param *kp, + const char *modnm) { const struct ddebug_class_param *dcp =3D kp->arg; const struct ddebug_class_map *map =3D dcp->map; @@ -759,8 +750,8 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); inrep &=3D CLASSMAP_BITMASK(map->length); } - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); + v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -773,7 +764,7 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); *dcp->lvl =3D inrep; break; default: @@ -782,6 +773,22 @@ int param_set_dyndbg_classes(const char *instr, const = struct kernel_param *kp) vpr_info("%s: total matches: %d\n", KP_NAME(kp), totct); return 0; } + +/** + * param_set_dyndbg_classes - class FOO >control + * @instr: string echo>d to sysfs, input depends on map_type + * @kp: kp->arg has state: bits/lvl, map, map_type + * + * Enable/disable prdbgs by their class, as given in the arguments to + * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative + * levels by bitpos. + * + * Returns: 0 or <0 if error. + */ +int param_set_dyndbg_classes(const char *instr, const struct kernel_param = *kp) +{ + return param_set_dyndbg_module_classes(instr, kp, NULL); +} EXPORT_SYMBOL(param_set_dyndbg_classes); =20 /** --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (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 C2CA41A2567; Tue, 16 Jul 2024 18:58:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156311; cv=none; b=emidvmYBKTDTGVpf/VQ5QdTtftl93JfSrdnoZYiTIyQdJflm1Vl/wxKcTAhHTnwrzaUxks6WdqHDN5+b0rXG1v7lr096YT3yAksX4mdcVVjp8/xoLgmGcZ65f9oYm0R+tToqFfJpMemKz7OHUur6Eum2D1OTvFBNnTJZi+0iGPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156311; c=relaxed/simple; bh=kI4EzI2u5xgxLnrKNc14ybNZ+NpA9p/bYyR+h8Gfb1k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tauaahyb3CKbyZ91JbOTThUsKHlthbDJid28NXpwipL6OgZgFCtITAojamtiuaJvTdjpI14SN07LwNZ08nKpIK7dFpHJqmmN3OH+xoCzNi9pT4PvK8QTPWBj+ckoL86q5lyD+1OkMb3eg0gfiX8TlSa9mkNaD9/QNGzVVdPgNH0= 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=GaHnFdyS; arc=none smtp.client-ip=209.85.166.53 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="GaHnFdyS" Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-807687b6652so6194039f.0; Tue, 16 Jul 2024 11:58:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156309; x=1721761109; 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=GvLBNvSR6x2dFu6EXQC/pHFuGqsHWoHN3dOHeNiP27s=; b=GaHnFdySfT5gzDnGJ4ynduUBi3cFFYJbkaES7P5Zr4eleAXDPrv/Gp3rBFFKv2mYM9 zO3avIyzrAi13DYmni1CgwGAO+daer5oo5xECOH4a74SsQpPu+x/ph7FGNUzwih4pMVU BUrVMSmtIGGmWzw9PnuoH+dwxAEMQ8RcNOF9Qou3LpCDA1EmtKL7kPdBg3GpgKObmHXM A233NA3QzKSScvP1UFex/sTinJQcMtOC65xQxWBE/8X9Yb6MCeruFEFRVQ+fYJ5HpONf 2mSthZw0VOmNhR1GKb8s52JDkjum20rtt3Ke5ufoQbUtMHBZp8fw/5yw+j7rZAz0mS+C kuWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156309; x=1721761109; 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=GvLBNvSR6x2dFu6EXQC/pHFuGqsHWoHN3dOHeNiP27s=; b=iDf7cOij5Lb8MAInNZ91YSTnLW7phF4lOH+0uR5vGHoeabva/ZghjSKOG2nBV40s7s GHjaLAYePFX/pG/s5Q3iqfOXEES4Quby6hD4ikibqFBEJxNdD4BF8OfuTDDUsGd9hmnt 91vkVfQ0wmNUdOKW0Q5R4FemfHBsyxsE0o2rnwOebL1LPMpgir8pCapQtnKpsQERKK0c l1xw9X/TNDM7i7MPjylY9kMZNnJSxHPzypXNWRd7mYO2LGtXNpCox2E8z0jnkSweKMY7 Kw0MlTZmGBCTxpUWqRv9mVGy4FlC9UG62K0KmWO9jFO4J09aYa1xFt95jhjBRzMiqp0/ K07A== X-Forwarded-Encrypted: i=1; AJvYcCVQwFCw2txDuCR+zGiY6/oMFVH1NtZvSTrlBP4NpC2jUbhiHOiSuwbtCyCfagM4/5VFFjN4q3pAHkA0FaKWihSc5924r/dBgdhL X-Gm-Message-State: AOJu0YxYaJ6XsQMIdPgk6GqtshIjpzlGsmqc4KttR7k1Qwi02pRFBmPb pOQ5FQG/Azp+IcVahK1hIlkDZrC1cSVfqMkAHb/Chl2RYFomx9kswsxMOrzG X-Google-Smtp-Source: AGHT+IGpNXIDlFHBUcOjDfaz0mC3FKPHX1JcD+bIso8rqUAdibcBvxkqUwoIZnd4OgAitjHBItH6jA== X-Received: by 2002:a05:6602:6d0e:b0:7f6:83da:dd12 with SMTP id ca18e2360f4ac-816c52c0398mr41748139f.11.1721156308751; Tue, 16 Jul 2024 11:58:28 -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.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:28 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 08/54] dyndbg: drop NUM_TYPE_ARRAY Date: Tue, 16 Jul 2024 12:57:20 -0600 Message-ID: <20240716185806.1572048-9-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> 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" ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- include/linux/dynamic_debug.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 2b0057058ecf..e458d4b838ac 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -106,11 +106,9 @@ struct ddebug_class_map { .mod_name =3D KBUILD_MODNAME, \ .base =3D _base, \ .map_type =3D _maptype, \ - .length =3D NUM_TYPE_ARGS(char*, __VA_ARGS__), \ + .length =3D ARRAY_SIZE(_var##_classnames), \ .class_names =3D _var##_classnames, \ } -#define NUM_TYPE_ARGS(eltype, ...) \ - (sizeof((eltype[]){__VA_ARGS__}) / sizeof(eltype)) =20 /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 AA7DD1A2C12; Tue, 16 Jul 2024 18:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156313; cv=none; b=a7Cemv9KJsf4ITocnuUOweDRSc8W+qpzFJ7am9qTmZtESClZAkGjG7CYcvEKUjNVi45M/NFV68KPbtJysmPvdkgClMmJjCZTMn1jn8l1JNuBijiOrklwt9NscGo4X1EdYZsVHa1uHrOKH0+lW/RlH6akP3IPaxrlpx03OydwiX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156313; c=relaxed/simple; bh=2orYXb/DEjBbzyb8Caox8Abxcs9fSEtj7EsxKJLeFwI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iAoC4aEEVbA81mpswFMW3j1YGiSCqo6NF8gl8KlNMnSUVr44gfv7MqLXTFSKlR+WQMOO2HbNlxrnvlitEjxVgvKVKhnG2ecq8fI/Szn8tQodokN53rRxtZ3b2FcpRr6H87+oTUuTjdkPfLrFjGpPOzE5xg5v58ciUjLcvPM6zL8= 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=KUwS3mMa; arc=none smtp.client-ip=209.85.166.42 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="KUwS3mMa" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-8076ef91d8eso6243539f.1; Tue, 16 Jul 2024 11:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156310; x=1721761110; 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=z/963zG9LNPxu+BVNW7S/xeH6c8P5d5ieMeYbq4Ngms=; b=KUwS3mMaMXvkW5F3YhYQmQVsSckXJRpeJS12fwmUNBYxnJWTs1hmXrF6XJztz2+eNX I/d2usPy7/ay/VenIWOVBzR2JnMuLwr88Xp/wtUd8VIEqrzeMWTKe8jidXsevTCixn8L IHLtDj1eUs2PkWQozJ/hgMmbRSOOkxdapBmFKWoSKHzaIOKsGrnl/m7Y4CaXEsCIw6nk 0+8XlozmFp13syiT+gCznjCGX5OHgN6eidDubHR7S09mAR/8/O5lIuhUwBPfAdhl4bwX LWk3XbCVpzSTd+OyNWJ+QGVy3rHVFq5IxuNEpomVdPLCy7No+j2Zev2yPTPvXTBtOAXd HdiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156310; x=1721761110; 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=z/963zG9LNPxu+BVNW7S/xeH6c8P5d5ieMeYbq4Ngms=; b=jEtbTkkBnwTYdVz8CQuoIB838MA0TTUuX1v7C3Adu4ZP/T0kPnXkLiVoa68oiWNyyd ET822gjY0M7QUKmbxnPWwhAg4p0Mj4mMuv5hrpB4I1PgRK6bhgSILZMZu/svp5ZY/g66 aFosCv3suVd9+dIy0HfiNoGnR/NT+VVsPcVPRcvdy3/D/u4tlVOenP7lC36GzcITV9Hj rcDJ+tt84+YEon/+7fBn0jFqyHOBis0UNa01jOmyRs73p8tl3L1BER+jZCnm+IrJ00cx xGU4LDQLryXusqB7zbhin8qeNQHAphOiRJm9QTQ2a0Pm+dhVVcXoAm9AptNVXUDxO8CH I+hA== X-Forwarded-Encrypted: i=1; AJvYcCXpTBelma2mt0f9zN5kGjNGgjEvZmc7GhrQyVdca9M2KnbuC291hXA19S5RCqhfwF+8THdXYFSRHuv5fyLCijHARGBT1mqjnkMT X-Gm-Message-State: AOJu0YyNrTTDDSRVrgxhbGWGCkiYZ4+DWHgil3qTFfss+hnTPWbK7GRm c0oOMgBoDY6ApzWMrHoAbp0pwl8y06/AF/v/jHZ+Gnht8HEDMZwiNWB9r+Ks X-Google-Smtp-Source: AGHT+IGst7Pb1aOlwZJwZi1xRL71bE8jQTjJ2ODygIZkbSk9dKUSw1szwoP6NrksbYl2gFvzuix05A== X-Received: by 2002:a05:6602:1612:b0:80d:19e4:9d63 with SMTP id ca18e2360f4ac-816c2eef606mr48916939f.3.1721156309942; Tue, 16 Jul 2024 11:58:29 -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.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:29 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 09/54] dyndbg: reduce verbose/debug clutter Date: Tue, 16 Jul 2024 12:57:21 -0600 Message-ID: <20240716185806.1572048-10-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> 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" currently, for verbose=3D3, these are logged (blank lines for clarity): dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op=3D'+' dyndbg: flags=3D0x1 dyndbg: *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: parsed: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0 c= lass=3D... dyndbg: no matches for query dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... dyndbg: processed 1 queries, with 0 matches, 0 errs That is excessive, so this patch: - shrinks 3 lines of 2nd stanza to single line - drops 1st 2 lines of 3rd stanza 3rd line is like 1st, with result, not procedure. 2nd line is just status, retold in 4th, with more info. New output: dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op=3D'+' flags=3D0x1 *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... dyndbg: processed 1 queries, with 0 matches, 0 errs no functional change. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 4a48f830507f..368381dbd266 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -266,9 +266,6 @@ static int ddebug_change(const struct ddebug_query *que= ry, } mutex_unlock(&ddebug_lock); =20 - if (!nfound && verbose) - pr_info("no matches for query\n"); - return nfound; } =20 @@ -501,7 +498,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - v3pr_info("op=3D'%c'\n", op); =20 for (; *str ; ++str) { for (i =3D ARRAY_SIZE(opt_array) - 1; i >=3D 0; i--) { @@ -515,7 +511,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) return -EINVAL; } } - v3pr_info("flags=3D0x%x\n", modifiers->flags); =20 /* calculate final flags, mask based upon op */ switch (op) { @@ -531,7 +526,7 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) modifiers->flags =3D 0; break; } - v3pr_info("*flagsp=3D0x%x *maskp=3D0x%x\n", modifiers->flags, modifiers->= mask); + v3pr_info("op=3D'%c' flags=3D0x%x maskp=3D0x%x\n", op, modifiers->flags, = modifiers->mask); =20 return 0; } @@ -541,7 +536,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) struct flag_settings modifiers =3D {}; struct ddebug_query query =3D {}; #define MAXWORDS 9 - int nwords, nfound; + int nwords; char *words[MAXWORDS]; =20 nwords =3D ddebug_tokenize(query_string, words, MAXWORDS); @@ -559,10 +554,7 @@ static int ddebug_exec_query(char *query_string, const= char *modname) return -EINVAL; } /* actually go and implement the change */ - nfound =3D ddebug_change(&query, &modifiers); - vpr_info_dq(&query, nfound ? "applied" : "no-match"); - - return nfound; + return ddebug_change(&query, &modifiers); } =20 /* handle multiple queries in query string, continue on error, return --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 599011A2C28; Tue, 16 Jul 2024 18:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156313; cv=none; b=WdsXZGP1HXPiUnTneSxxqBHgVSIMXT9qeAmMGsNhc6NgBl+NdadEsgublztnQqEvgNgwKIkzJBWOYghEck/0VCcjsCvXsSLEjtpPHWyctyYKEg5pasSWZGg2RV+13uC3RkalzMVRpt0/Rcp9eSWzj4ksNmgfVw4mHjPsmTYL8vM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156313; c=relaxed/simple; bh=hDky0tcbjpEUJlBM4lJpM2oQBO65Ubzgv+qLWDk5NXo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z54Le4UnEtTIsvyhrriuHM1Dm6XNRnYqRvnBvFcBm+JrA6u1Fscx9ySWs4Hnud19RRJASoGM8UrGsgh65CC1Ee7rVF7Zp1bX/8cAQZ4Q3HTLCyN7ecnajoW9Ke0Uodj/0z24cKYxPRzbEfKOjBKNv+rZwLPc70VXpG56jrka6d0= 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=LjiyuybD; arc=none smtp.client-ip=209.85.166.51 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="LjiyuybD" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-8111f946f04so5130239f.3; Tue, 16 Jul 2024 11:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156311; x=1721761111; 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=Kihqcq8gEwvlFuKQVqVa3kRjj6JIPweX7rDvgcIT9h8=; b=LjiyuybDD2kZTBvYHa0Z3g1IbNy82JKNcU66RTT29gFNNNbBMhYQXvBH5W+0C2foc2 R+6IBy6ORmO9T5EfgwB+qyQnppySz1p09/uxe99jm7C2gSFianRiMBABMD11vqZF2xKx gpE9dsvEKdpMTnnVwickkmFPhRu83XUp1MHvC4yqqzY4gxy8Xin4ybecK4hcxrbhIKEs 3raqjf+ifLB/MLFLqDT6O9WDMONHB5cpxRrsJdmzl2iDLORejZ/jwTx1sNIG2nRPP7+z wJuOZu2MZuytorY8IY3OzvB4A/yAGf0/0DaQQC9EzqnvKfRDC6/KLTIuvTFe+s5q0Dx7 9HdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156311; x=1721761111; 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=Kihqcq8gEwvlFuKQVqVa3kRjj6JIPweX7rDvgcIT9h8=; b=OieMPhtDfgZ6DFajg6USpp6A+pQEmEAIpbXUEtmwOHL8oB+OnZj3bP4d1W0Cl8bj+h 8+nTUVWhbaq5altnJwdJYEhQlCkV5OdY4XQn1LkBqHIC+Z8PFNObVH/GkKDtvHl7Q9IX ngDoLMPuB1vspVd9ZNfITiJdxnv/LAbALVq4FEuGUKCJibxnMF81ePdyCa7MOIyR3djA WoRtrAVgMGhy7jcVgudHwzwEckj5scy7sHk8xU9Nsi3UDPOPdchZ4UGoGpFwxVa9lAqO Q7QZMcwVf/dK2kmhqoRzKeKJKdP7DNS4Xn/VI4E6QRQaM8g620HIXi9sy2maBq3OGCFF eDVg== X-Forwarded-Encrypted: i=1; AJvYcCUVdzb1iEz4Jw6AFU8dgXzTvzWM3q9P2UwrSsY/bgswLFtUJU0aPp27klO62RC/I3d8qB6m6ExCAj5XRXdAnJEDYwrQxtCpGR+h X-Gm-Message-State: AOJu0Yx5Vm4/Lu1FFYkH9Nbo4/etv/gn3dpEDL9DLQlMd+ZM6u6TzDoU DjHYmJfRxP5rbcaoruNXca8v0Jb0e3XVYSzEJ5G7TLmpq3Uyv3KtuQBkhA9d X-Google-Smtp-Source: AGHT+IG/+jo69dsHArTBqixhUoufA4QPx32dYcoWi4IHunj5MWvseDBGOvH7eIX5hx3svsuPZC331g== X-Received: by 2002:a05:6602:601b:b0:80b:8cb:e9a2 with SMTP id ca18e2360f4ac-816c39b5f53mr47969539f.9.1721156311067; Tue, 16 Jul 2024 11:58:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:30 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 10/54] dyndbg: silence debugs with no-change updates Date: Tue, 16 Jul 2024 12:57:22 -0600 Message-ID: <20240716185806.1572048-11-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> 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" In ddebug_apply_class_bitmap(), check for actual changes to the bits before announcing them, to declutter logs. no functional change. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 368381dbd266..8320cadeb251 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -595,7 +595,7 @@ static int ddebug_exec_queries(char *query, const char = *modname) return nfound; } =20 -/* apply a new bitmap to the sys-knob's current bit-state */ +/* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, unsigned long *new_bits, unsigned long *old_bits, const char *query_modname) @@ -606,8 +606,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, int matches =3D 0; int bi, ct; =20 - v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, - query_modname ?: ""); + if (*new_bits !=3D *old_bits) + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) @@ -622,8 +623,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } - v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bit= s, - query_modname ?: ""); + if (*new_bits !=3D *old_bits) + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); =20 return matches; } --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 5576D1A2FA6; Tue, 16 Jul 2024 18:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156314; cv=none; b=i8+HtZ+d9GNPTFD1rYZ/IXIjvL8PDUnmnrBqHZDlnOY23YDpo8+35NMSvHpuuNW72C2C2S4UU0dDUwfUB0bkpsVeQ4niJfO8oUnLu1fB54NI6Cwy3cLQc0/uEn03hmNEjx6iFEo3PTvjcv94Pwd3+ok3GKMXrU4up+3Pb04X7ug= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156314; c=relaxed/simple; bh=uMahtcUZExquPuJFLJnN2pPquWpAjSBlWHTcT3D1arI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gvc0OOoW9pzuw4UKvR0xvHXvpEogExO3ckPyoQCAMwOpBcnVdUhkg9duuIWzFvrGhv/2o0rjUmGu5x78fFSqhqlEWvMe52ZXynPmY2KG5A5PSrh4qajJnrC+w9wAvGk20/94X7zg2AZJE2FpKzZWHU3IGylqUDPV8d1NZOIQCxk= 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=j8MK/CXo; arc=none smtp.client-ip=209.85.166.54 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="j8MK/CXo" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7fd3dbc01deso6010139f.0; Tue, 16 Jul 2024 11:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156312; x=1721761112; 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=3rzL7Ai7iKqeKJnszxdFQBmj3pbR9EFBsW0IKIFtNrQ=; b=j8MK/CXoAMA50iOqJTgh8s6dgvTjFpIDTuQjnUUshdSILPto/miUrAqOtxFGnprmol HFux9FdzRZ+6/s8IARXLlrPhkzB//VeYYYu5g34f9pbX943jj9Th5QLVSCAiD/TfZMYO jn2pS+7JeiLci+s+d4zfiIS0/jX9kce5VHb81qOEdaMICG7JnUG7kP81vd8AkYXWmXO+ bilvuMfRc2jBQk54LYthib7uo3Ch7F/267pELld/uU2UMhKehFV0WuCh9xck3tnB4tSf Pvz33wB2WnG4N/TAdSF9B2uj0BAcXuzTaYpRce64uGVWWRdkp74iITyMD4CJ3cVUAHru sBbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156312; x=1721761112; 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=3rzL7Ai7iKqeKJnszxdFQBmj3pbR9EFBsW0IKIFtNrQ=; b=CDt6sfqJrrY1iVHDzydWinESjNoddBPUtWct5recZtT12GShDq+EfAcQXT5K6Ft2hF veO67WrBnWvqWtWqO6KDETOprD3Go2m1mtreN0uxCsd7RpRZCONkA7m9J/EILjbiMwiE otSjRVbCfoKcpzhHtqDks9e3Pm40/YiD62MmsjwSccsksqslvGOUtg2qyloZo+xHiCSJ 8v0ZLq/oaSK1bi6XZ+YiP5cZrcGaZ4S0/OdEgzbkUxcfbyfeHIOpKCS8PALIOWC/yUb2 foICxEqCtNcHaUZdESQ54UZkN2JGo/vFjBSdzetYp3PVAL2jaWWOlWXYC7kxinIiikO7 TjOA== X-Forwarded-Encrypted: i=1; AJvYcCUHmc3oY8RjOdaan1fqlI2Zzm4Wocw0AebhT3yIz86YVxCer3cpjNhYap9ZI2sY1H8dlTrf45aoaNY/nRjAhnFFbU8l9YZI0RHj X-Gm-Message-State: AOJu0Yx4xOCHkMa6HCQzuA4t5d5lSLi5g8sJba8mOdD/365KM5vVRPlK JxD7xjvEY/iM/P4nZ3nYPDp7UGeL/1gio0SgytMkJ/HG1AKACDwacJSTSK2o X-Google-Smtp-Source: AGHT+IFfR30H2Bdi7TX62v9owfKKB159Qxax+zs6sy+PqRoyxnj4KxOG5l42wZ7oJYL3T2Y94rH3hA== X-Received: by 2002:a5e:c00f:0:b0:803:8f26:e0c5 with SMTP id ca18e2360f4ac-816c39b599bmr36645439f.9.1721156312261; Tue, 16 Jul 2024 11:58:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:31 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 11/54] dyndbg: tighten ddebug_class_name() 1st arg type Date: Tue, 16 Jul 2024 12:57:23 -0600 Message-ID: <20240716185806.1572048-12-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> 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" Change function's 1st arg-type, and deref in the caller. The fn doesn't need any other fields in the struct. no functional change. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8320cadeb251..882354e1e78f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1120,12 +1120,12 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) #define class_in_range(class_id, map) \ (class_id >=3D map->base && class_id < map->base + map->length) =20 -static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) +static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) { - struct ddebug_class_map *map =3D iter->table->classes; - int i, nc =3D iter->table->num_classes; + struct ddebug_class_map *map =3D dt->classes; + int i; =20 - for (i =3D 0; i < nc; i++, map++) + for (i =3D 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1159,7 +1159,7 @@ static int ddebug_proc_show(struct seq_file *m, void = *p) seq_puts(m, "\""); =20 if (dp->class_id !=3D _DPRINTK_CLASS_DFLT) { - class =3D ddebug_class_name(iter, dp); + class =3D ddebug_class_name(iter->table, dp); if (class) seq_printf(m, " class:%s", class); else --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 A57951A2FCA; Tue, 16 Jul 2024 18:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156316; cv=none; b=FibONGtKKh/J0JPLKRBMnKGRWKdulDu93gnNzzbIJOWYT5puvgEZUEySMm+pzIKDjsOpMqmNV22c2HR3LRn/JFBsw6tE3dGzwNo9JBVSjE7MVw0wiq07aRiCyJJnFQb1LATYsSRix2GmyYN5mEeErD2iLD1bQACoDQ0SciFBwRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156316; c=relaxed/simple; bh=kQpImjRpf3lCUXFxXFVQ9RLQLbMtMWnnOYX/irJ8EJ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nSkGvpNGa9YA9c/pddWzrehIcpY0jPnC06BQ1U0/1ATcZXb/mzxAiw381cic1i78ZZiPooTKQr4qFVA7FZen5pRpHs/CBnIrUg1ERJC3SrrwjLe5heUU3mWkU2b7FotEHjT9vcIXQK7IZBjesZI7uWjrQYz4UuKIUulsS7M/JIM= 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=gwuJw1VF; arc=none smtp.client-ip=209.85.166.45 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="gwuJw1VF" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-8036ce660e5so6226039f.1; Tue, 16 Jul 2024 11:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156313; x=1721761113; 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=LLqcnZIYyHoDNxKwcA/NtHztZqWZ7lBC267I9FzlvwU=; b=gwuJw1VFmCt+bZSafp4K7WXvoaAVgOKhDZVSTZCjlJwdwk0Uj5cRBWTbbrlxp42bo3 j2IMxo5TBSgnb4+wY6yQAdU40md3KPa1qc5XoxrONeDCfSWH/0BHfriyeKOT5kR8glzg hUyDx8/cXWO9uT0h4+uX9OFO7+Bw0dW9GGlw8tCdsoEozx4M9pHUlPO1mg9y/+Ou9Giw toG/dDLKs314/AQmbtQOQX2bWSAyx2jbCfRT1ohaufwUvSQ+FoOrr4spWo9W/l7SOHgr VCi4WF4rddPVh1PTfPshKwy3KxqcylnNk/N+vcVPhdZ5MWDP/yFOI8GNhxJl1HAmlT0U VEfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156313; x=1721761113; 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=LLqcnZIYyHoDNxKwcA/NtHztZqWZ7lBC267I9FzlvwU=; b=lP4ZcX/toEFBGtkykTaoSUh8B8NYLGjoG0rMpG/LuCvB5Dkp3IyUxKfFsQOhYRomMc UT5wLlMyZM5MoSRNjLUKs2RWxmpYQ2q7bBJHn/FnJQYPuvciOY/MSovVrU9JLO4S69VK ejCpB2oRcwNbFSZ/oEkUctPyC9un4wvoQVHlp3ikPA/eynK87LoBX/K9gZpEk1Z0PRGE lzHM7ShAXF2imCGLYzRc3LgfS+S2owyL5ro2wRHIIbd/aX1GoPnPxkN6TJYMjbj0OeyH 7ORQprEdsQ6+0KQO0fEBX/hX0qDTM694UwqYYVlszhJaS70JPOtSMYwRPlUpD5jf3UBt AUUg== X-Forwarded-Encrypted: i=1; AJvYcCWOo9k9L21ykxNDENElF0Acir3HhjnR5sZTrgv5PnkSHvf6nQDj/e2OnqtwINRG5OQAeQVI5ScuAXpGOdkscWAo3NBDEbKGfO+C X-Gm-Message-State: AOJu0YxNhF2Rq1+rLv7rR+iuuwHhWF9p5DLN4c5dWoo7PBx0h6lyEVP2 ihqXGD157MHuaOLOZS1DwOmxE2tLO5ECE4oo87aadXwZ9ZZ/RYiuNHCx4cUQ X-Google-Smtp-Source: AGHT+IEBh1KUyAhIwH/3Q8vkZrwZOsSPNNB7tgksRdOxwZTOxanlH2I5x4mlC8tGhLUoFXR34R5rFQ== X-Received: by 2002:a05:6602:14cc:b0:7f3:d714:53d8 with SMTP id ca18e2360f4ac-816c642357cmr28222939f.14.1721156313441; Tue, 16 Jul 2024 11:58:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:33 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 12/54] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Date: Tue, 16 Jul 2024 12:57:24 -0600 Message-ID: <20240716185806.1572048-13-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> 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" old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 882354e1e78f..d4a0ae31d059 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -597,7 +597,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) =20 /* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits, + const unsigned long *new_bits, + const unsigned long old_bits, const char *query_modname) { #define QUERY_SIZE 128 @@ -606,12 +607,12 @@ static int ddebug_apply_class_bitmap(const struct dde= bug_class_param *dcp, int matches =3D 0; int bi, ct; =20 - if (*new_bits !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { - if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) + if (test_bit(bi, new_bits) =3D=3D test_bit(bi, &old_bits)) continue; =20 snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], @@ -623,9 +624,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } - if (*new_bits !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 return matches; } @@ -681,7 +682,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); *dcp->bits =3D curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -691,7 +692,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -745,7 +746,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, inrep &=3D CLASSMAP_BITMASK(map->length); } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -758,7 +759,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, old_bits, modnm); *dcp->lvl =3D inrep; break; default: --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 7D6731A0714; Tue, 16 Jul 2024 18:58:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156323; cv=none; b=KzHORB+7Ycx0VSY0bUXVvV6H+sYkD2nxfe5SFt+t8a4st2uIU6AveK+4E1NeXmZOI/aErGDcHtpFCG6nJXtAY8zyfmP+CKB1dOx0zu/grvmeIwJkWPrCeNL8ncbI8PMeSyfzFptAHyD3u2Ni0oTx2bp5zaNjCmMLvrV6f4v3P8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156323; c=relaxed/simple; bh=iJRabDk4n3FOVpiDfU5H29ecoGu4HIZhqD6br1cK+Tc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aZxooWMkdWvpUiXVvFL/9jM4yhrYWdamGjwp1fs6xldGDam8RP+QZJESKmBogCBFxjeALou3mh0sPYYyaVZpRpmvQUQw4GzPK3WvUrbl3zgEc7dNMwPhU1Qgo4VU2gWwpFY4222UqEhvjzNJClwhIXL0BkX9HuZvVhbpp5AKBMY= 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=XcP65Jr+; arc=none smtp.client-ip=209.85.166.41 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="XcP65Jr+" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7fd3dbc01deso6015739f.0; Tue, 16 Jul 2024 11:58:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156321; x=1721761121; 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=PG0HixeKNGYC1yKqg8pO4K0aUEEvqiNOUzi5OjavD2Q=; b=XcP65Jr+QJctdXvLEHQQTdbBVFf6pGFMEM5XKuHRbrHYO8Effh7IWTQ+XA6NgPsOMC +1s7W5zogx7FVkgWi4jlmMbZxdTtmjIPJ10SmVXWihVJBXoV/bOE3gZ85STh1kADlZuQ Y+39hK+NbXkNzzLHlTgCTmEoNu0Nc1uI9mhkJWvZqedW8iBCdy2cCKO0E3zLvSArxmsL N/mWoNXEIO4n+JE74i2VBaNIa25mTtsfI9BXqQVdafULzikKLDqXSbRFH6gmGTibwKo/ pAqk8A5b7r3HvDLkr6SfN181y6p5H5oQ3sbZAAVV/0o6nzYmCppa/3w1WnIASmgMkz6x L4UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156321; x=1721761121; 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=PG0HixeKNGYC1yKqg8pO4K0aUEEvqiNOUzi5OjavD2Q=; b=edIO5VaJV3F68lDT6ik54TedVdEVDq8D4xVNVt7eELta6mq3YQ8Nt25MpDGw3zDJV8 JDEZWh3/rGZR7jIonyvJSZFKrT8XcYMMX85Uf7mwSINWFQ9BOM0N0YRJ13dt5x2/gv8T lyanYSExyB2c+hEKANiKuvCMYXFwd1x/jYpG5jrvnF5toovqE6lru3lOh7u/9bvnJ0VU yjZGrYkxuDzqwfQs/Z5g/HLe3ZHjt5MFl+8VpIm4yH6AcxbeUtlvQyQIid7EOlR54DT+ lTtZ5bq7UYyYrlrnRCp/vJUoxbNQvo/Kyv8dmc6xLpH51puMHf/6nIyvihGsmOHtdsXh 1t0A== X-Forwarded-Encrypted: i=1; AJvYcCUuIT0IzOygDmZ6OpdSYH9TaK9uG7uwk0rWJ1xQbZ/6WWtl8G46ahXfPafw2R7JTAanYbsnJiRBfNFvIJOVvMDZXtYMrzInGm/y X-Gm-Message-State: AOJu0YyMJEvJjDdMSgsXtpGXvPgyPGG2wjiLQrgRKDORq/ZXBE76UZru Bq76slurCXwQUL7pg9HgSd4/9cgfZfBMMAYIaflZHRTQuB8gmGo4IK1lzy1D X-Google-Smtp-Source: AGHT+IGTZjuSx59fvBLEZu4nUn6dn9Q2x+1nuEiSc6h7Vo8FFTzb5CNqZWvEdUtshl/goBTMCnhqjA== X-Received: by 2002:a05:6602:6426:b0:7f9:40a0:dfbd with SMTP id ca18e2360f4ac-816c51c8095mr42802139f.13.1721156321173; Tue, 16 Jul 2024 11:58:41 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:40 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 13/54] dyndbg: reduce verbose=3 messages in ddebug_add_module Date: Tue, 16 Jul 2024 12:57:25 -0600 Message-ID: <20240716185806.1572048-14-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> 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" When modprobing a module, dyndbg currently logs/says "add-module", and then "skipping" if the module has no prdbgs. Instead just check 1st and return quietly. no functional change Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d4a0ae31d059..43a8e04b8599 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1245,11 +1245,10 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) { struct ddebug_table *dt; =20 - v3pr_info("add-module: %s.%d sites\n", modname, di->num_descs); - if (!di->num_descs) { - v3pr_info(" skip %s\n", modname); + if (!di->num_descs) return 0; - } + + v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); =20 dt =3D kzalloc(sizeof(*dt), GFP_KERNEL); if (dt =3D=3D NULL) { --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 B93451A070D; Tue, 16 Jul 2024 18:58:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156325; cv=none; b=VDopG8Y5fkcykeFyc+31HCt1vb9AyV04X8Sya5PQgIqv94jL+jnXBRhI93rEwF5bsXrOvnAne9W+q+K+E36vVgy1iC7J3pm3V0HS/gXf+dcemrdCvOGayFvyGwYL3CoWIXFGiusFv21u+7y/XLxluiM/riPo5pvRAL1D8xcM/TM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156325; c=relaxed/simple; bh=MCM1i/wNbYKPlJwHywrhp7dcSe6D/PAIccO47LXbzw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xana8qf2qgWtzydvmVFEsF/KmmKOzPO18iFh6BB5/UeBLDyvw5eqoUucpGV8TS6vPay1LP/2awxUNMfT38i6mNqIKbS8b4XyxNW6oEO291D7CQKODuZFtfye7f3kQo+9cz5NuYHj8pMQLjuZuLXJUsiKr8K5P+zF43SG2xqg5rw= 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=nnEuiPeu; arc=none smtp.client-ip=209.85.166.49 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="nnEuiPeu" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-8036ce66164so4626439f.3; Tue, 16 Jul 2024 11:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156322; x=1721761122; 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=M13qDl95MbnysTOwNRdqoCGiHr9lRTIuwR1yYXjlSK4=; b=nnEuiPeudVA7gD6YwzLApExng1xxozuK5hMilAFQpDYXK8N4EBr2Z7yiFt8bzqOehI tyrAmOWAn+tMrH2uNyYURCRkGS4HYUvN/uFisQg6ruNkVjShco3v8PddVhByU4ryM1y1 mfLNm7TODOyAT1y4ou5OIZHBOIiKAomJATR2MAJ8z1QtoWyJa05Mc9Ich4xKvHdaU5+u 8Us1zB7r8grvh5LrqAgxiqPW59QT+GWPHgaC94Rp8tpcW4m19Q80Ruwf9bYVMEAZeYGL AgpuqoT1YokrI/2nWbMGGi5B6fKO6dA+V+9pszBtkn9FUDcDWQnrfzbnWczJ8XjNFip+ EIOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156322; x=1721761122; 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=M13qDl95MbnysTOwNRdqoCGiHr9lRTIuwR1yYXjlSK4=; b=SAjECoVpL5MqYETKOAPmaTTyNxA6wbbx1laF9HQGYLRFfNORYBNY15iD6fXLKlelXt r74aykJ7m4JmmCeygoxZS5o2wM9F1Lk1fwHIOeh1rIetvZ/psAFa4ypNXUo3FTkTJret E9HYW9EMhHplTDgKGx3xYn4hdkYpIAohaUiNsj8meinjEQsCYEVGpLLNeQWXpS7I36f3 FtNxwLqPzpRYAYMvd88xpr3Nz0KCCOCIPNn633QUDmI14Z0R0hLGv1lgquqF8OhbRNGz +v4jXSVXrW6xcae6HABYACGHurZ/7koQkfyK3IKd0MszvYiNs0IRHHbPp9ti/59kjfKY z16A== X-Forwarded-Encrypted: i=1; AJvYcCXoDDyMaAbFdUdIoohzXdpvCVOQMM1duL9o/KZJIG6xsAqe46v1dygDJg3XozE/AauhEXd0MFtEGWGWYruJ71Zi3/mvGf2iYS2g X-Gm-Message-State: AOJu0YxnIW7Z5SOeXTbBlqhIgsRDTdEifxPnh9dgxm4eiVxeYnP0HWdy 38RdAypLU4mIFJ1o83JEz2M+dvh0gNk7yMKptGoEZcKqG8bcQ7bIS302DnTc X-Google-Smtp-Source: AGHT+IHqp9xsp28f7xZMs38IIVtyY0YwNMPY4v2OX2h1OBGE1hFOcS7DCO3/hXj/9rxn26jJtm77SQ== X-Received: by 2002:a05:6602:3cf:b0:806:1b47:64cb with SMTP id ca18e2360f4ac-816c52c03a3mr40987839f.16.1721156322482; Tue, 16 Jul 2024 11:58:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:42 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 14/54] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Date: Tue, 16 Jul 2024 12:57:26 -0600 Message-ID: <20240716185806.1572048-15-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> 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" Remove the NAMED class types; these 2 classmap types accept class names at the PARAM interface, for example: echo +DRM_UT_CORE,-DRM_UT_KMS > /sys/module/drm/parameters/debug_names The code works, but its only used by test-dynamic-debug, and wasn't asked for by anyone else, so reduce test-surface, simplify things. also rename enum class_map_type to enum ddebug_class_map_type. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- include/linux/dynamic_debug.h | 23 ++------ lib/dynamic_debug.c | 102 +++------------------------------- lib/test_dynamic_debug.c | 26 --------- 3 files changed, 14 insertions(+), 137 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index e458d4b838ac..c8102e89beb2 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -58,27 +58,16 @@ struct _ddebug { #endif } __attribute__((aligned(8))); =20 -enum class_map_type { +enum ddebug_class_map_type { DD_CLASS_TYPE_DISJOINT_BITS, /** - * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, one per bit. - * expecting hex input. Built for drm.debug, basis for other types. + * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, mapped to bits[0= ..N]. + * Expects hex input. Built for drm.debug, basis for other types. */ DD_CLASS_TYPE_LEVEL_NUM, /** - * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0-N. - * N turns on just bits N-1 .. 0, so N=3D0 turns all bits off. - */ - DD_CLASS_TYPE_DISJOINT_NAMES, - /** - * DD_CLASS_TYPE_DISJOINT_NAMES: input is a CSV of [+-]CLASS_NAMES, - * classes are independent, like _DISJOINT_BITS. - */ - DD_CLASS_TYPE_LEVEL_NAMES, - /** - * DD_CLASS_TYPE_LEVEL_NAMES: input is a CSV of [+-]CLASS_NAMES, - * intended for names like: INFO,DEBUG,TRACE, with a module prefix - * avoid EMERG,ALERT,CRIT,ERR,WARNING: they're not debug + * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0..N. + * Input N turns on bits 0..N-1 */ }; =20 @@ -88,7 +77,7 @@ struct ddebug_class_map { const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ - enum class_map_type map_type; + enum ddebug_class_map_type map_type; }; =20 /** diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 43a8e04b8599..d5701207febc 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -636,76 +636,6 @@ static int ddebug_apply_class_bitmap(const struct ddeb= ug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 -/* accept comma-separated-list of [+-] classnames */ -static int param_set_dyndbg_classnames(const char *instr, const struct ker= nel_param *kp) -{ - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; - unsigned long curr_bits, old_bits; - char *cl_str, *p, *tmp; - int cls_id, totct =3D 0; - bool wanted; - - cl_str =3D tmp =3D kstrdup_and_replace(instr, '\n', '\0', GFP_KERNEL); - if (!tmp) - return -ENOMEM; - - /* start with previously set state-bits, then modify */ - curr_bits =3D old_bits =3D *dcp->bits; - vpr_info("\"%s\" > %s:0x%lx\n", cl_str, KP_NAME(kp), curr_bits); - - for (; cl_str; cl_str =3D p) { - p =3D strchr(cl_str, ','); - if (p) - *p++ =3D '\0'; - - if (*cl_str =3D=3D '-') { - wanted =3D false; - cl_str++; - } else { - wanted =3D true; - if (*cl_str =3D=3D '+') - cl_str++; - } - cls_id =3D match_string(map->class_names, map->length, cl_str); - if (cls_id < 0) { - pr_err("%s unknown to %s\n", cl_str, KP_NAME(kp)); - continue; - } - - /* have one or more valid class_ids of one *_NAMES type */ - switch (map->map_type) { - case DD_CLASS_TYPE_DISJOINT_NAMES: - /* the +/- pertains to a single bit */ - if (test_bit(cls_id, &curr_bits) =3D=3D wanted) { - v3pr_info("no change on %s\n", cl_str); - continue; - } - curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); - *dcp->bits =3D curr_bits; - v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, - map->class_names[cls_id]); - break; - case DD_CLASS_TYPE_LEVEL_NAMES: - /* cls_id =3D N in 0..max. wanted +/- determines N or N-1 */ - old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); - curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); - *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); - v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, - map->class_names[cls_id], old_bits, curr_bits); - break; - default: - pr_err("illegal map-type value %d\n", map->map_type); - } - } - kfree(tmp); - vpr_info("total matches: %d\n", totct); - return 0; -} - static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *modnm) @@ -714,29 +644,17 @@ static int param_set_dyndbg_module_classes(const char= *instr, const struct ddebug_class_map *map =3D dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct =3D 0; - - switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: - case DD_CLASS_TYPE_LEVEL_NAMES: - /* handle [+-]classnames list separately, we are done here */ - return param_set_dyndbg_classnames(instr, kp); - - case DD_CLASS_TYPE_DISJOINT_BITS: - case DD_CLASS_TYPE_LEVEL_NUM: - /* numeric input, accept and fall-thru */ - rc =3D kstrtoul(instr, 0, &inrep); - if (rc) { - pr_err("expecting numeric input: %s > %s\n", instr, KP_NAME(kp)); - return -EINVAL; - } - break; - default: - pr_err("%s: bad map type: %d\n", KP_NAME(kp), map->map_type); + char *nl; + + rc =3D kstrtoul(instr, 0, &inrep); + if (rc) { + nl =3D strchr(instr, '\n'); + if (nl) + *nl =3D '\0'; + pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } =20 - /* only _BITS,_NUM (numeric) map-types get here */ switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: /* expect bits. mask and warn if too many */ @@ -801,12 +719,8 @@ int param_get_dyndbg_classes(char *buffer, const struc= t kernel_param *kp) const struct ddebug_class_map *map =3D dcp->map; =20 switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: case DD_CLASS_TYPE_DISJOINT_BITS: return scnprintf(buffer, PAGE_SIZE, "0x%lx\n", *dcp->bits); - - case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index a01f0193a419..9e950a911b6c 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -74,13 +74,6 @@ DECLARE_DYNDBG_CLASSMAP(map_disjoint_bits, DD_CLASS_TYPE= _DISJOINT_BITS, 0, DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); =20 -/* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 10, MID, HI }; -DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, = 10, - "LOW", "MID", "HI"); -DD_SYS_WRAP(disjoint_names, p); -DD_SYS_WRAP(disjoint_names, T); - /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, @@ -88,13 +81,6 @@ DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEV= EL_NUM, 14, DD_SYS_WRAP(level_num, p); DD_SYS_WRAP(level_num, T); =20 -/* symbolic verbosity */ -enum cat_level_names { L0 =3D 22, L1, L2, L3, L4, L5, L6, L7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_names, DD_CLASS_TYPE_LEVEL_NAMES, 22, - "L0", "L1", "L2", "L3", "L4", "L5", "L6", "L7"); -DD_SYS_WRAP(level_names, p); -DD_SYS_WRAP(level_names, T); - /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") =20 @@ -102,10 +88,6 @@ static void do_cats(void) { pr_debug("doing categories\n"); =20 - prdbg(LOW); - prdbg(MID); - prdbg(HI); - prdbg(D2_CORE); prdbg(D2_DRIVER); prdbg(D2_KMS); @@ -129,14 +111,6 @@ static void do_levels(void) prdbg(V5); prdbg(V6); prdbg(V7); - - prdbg(L1); - prdbg(L2); - prdbg(L3); - prdbg(L4); - prdbg(L5); - prdbg(L6); - prdbg(L7); } =20 static void do_prints(void) --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 7751D1A072E; Tue, 16 Jul 2024 18:58:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156327; cv=none; b=huz7cOqX+XnRCMXdd4dGDC2T1+AH4IRuo8hRK5A3+CbnuOPJlPlR7FlWddD4WxuNBo+BuW4a1OOYTi3Sjq6KvWuWccqsNR52PnqXhNjbwwkxYWr9IDsKAp45fkAZP5zjU9dsBZR96gypYn0hGJQEaZ+RGAegTtNvlZ4l0Aw+xsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156327; c=relaxed/simple; bh=IXUHM/Mg98zPp3JeIvB4pH5gGIr3uxsB9/aVgh53s24=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jr35Mp8kvT4v4Csw17AhtQZXDCJe1FJmmu2lTGUkM11RkRtageCOgkNBzoX+75R49eXoE3vPKUNsQ4PbdOOwscIUPCdr6Unyfjt84tru6G3c31VNAyz/gpFm/daaIinypKnDVmxcnupWSLEETOxwVei0wGoJMVPMaYsT5C6LhOk= 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=e/FBuy+G; arc=none smtp.client-ip=209.85.166.42 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="e/FBuy+G" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7f684710ff5so2519539f.1; Tue, 16 Jul 2024 11:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156324; x=1721761124; 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=6XXQ6l1oOPeMlE1QjUtDI8xPnpcIZhmlmrXVidtP2qM=; b=e/FBuy+Gj+R9pbIa7mrR4crjf6TGXfkmd3MdHM4dDWHUcsLRAQbUrRlER1ytfW15wT iTAdblB2q9nNccbK8KnO0F6PUCPXe+TL+HHEtuiRiG6gcrJ/3+sDUmvqsdszIm7w/ENE pCyV3w3oakz/UferP6C3m8W8+QFjax/o2a6+pXZmI12ogW7L2ygyCL2YUaWiFsMEszjD 13zqf57IffIl++plctnT1+6+aHBUov53LI7DfNdbfmP663Bzgh67cIBpC5E/8l4J9JXH kWgWoaVWV5m0OKLHCRP7ikcVMjIPASsx3Eh54rrI45FVDlfXEOJuKlxSIvmmHUbsNNLs cxeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156324; x=1721761124; 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=6XXQ6l1oOPeMlE1QjUtDI8xPnpcIZhmlmrXVidtP2qM=; b=GpwwrO+cFgdKb/IiIU0X9q3OYEpwXVSJqv88FvZkndrc6LIznusCPOInsoMHic0PA9 I3NVpby1cw2W6/agiTnjSgF0y2FIIB42tghqXmHxt8MI0chE8tu2VlGHfiZTOA0ldysM eOEzJZO+RSZ6+JMYkkHGiG6NO8eYEhBuzRvzMOWNHCvTBejqFpixCWrt6wMCRbmwmBRd uuhJTKtm8fVKMw5u7kyQ0V9a8sAzGjHEYMBZfBnCL3DG6BLl58xKC53Z4MnZEoGFg3qJ 8BYovbXPC6NdrVMbe4TXJLDZwH98ioM8aC7Yxg5VmWkIz4QBre9YV4V6VaovPh1JlnF4 wzig== X-Forwarded-Encrypted: i=1; AJvYcCXL+z2L1ZH7CqD2OySXIowha+SOqOndpwlh3u/wokq+qKGQF4EQ8ta3J4VKJcd/uAhGrkzFtEyEYWEFzYrPcoj11zJw+XpJmitV X-Gm-Message-State: AOJu0Yynx9p2fxCvsMTTLw7NhsNhMRQhBduNGzLYCxpZyvk1S5Wn1Y5n RumF/VR9KAjqvjS4bLnhxaLBxJTlJxi+kYqaEky8fcTJm75gk9wqv4S6mQHf X-Google-Smtp-Source: AGHT+IHo2pn2vyUsXCSA134r/IefiC9B4yGZNZoDXQFBbpecjyQnYOtVi5G3mP3X1REzvnPEO6ORoQ== X-Received: by 2002:a5e:c114:0:b0:7fb:c0c8:2fc7 with SMTP id ca18e2360f4ac-816c2ef3741mr24683639f.3.1721156323852; Tue, 16 Jul 2024 11:58:43 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:43 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 15/54] dyndbg-API: fix DECLARE_DYNDBG_CLASSMAP Date: Tue, 16 Jul 2024 12:57:27 -0600 Message-ID: <20240716185806.1572048-16-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> 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" DECLARE_DYNDBG_CLASSMAP() has a design error; its usage fails a basic K&R rule: "define once, refer many times". It is used across DRM core & drivers, each use re-defines the classmap understood by that module; and all must match for the modules to respond together when DRM.debug categories are enabled. This is brittle; a maintenance foot-gun. Worse, it causes the CONFIG_DRM_USE_DYNAMIC_DEBUG=3DY regression; 1st drm.ko loads, and dyndbg initializes its DRM.debug callsites, then a drm-driver loads, but too late - it missed the DRM.debug enablement. So replace it with 2 macros: DYNDBG_CLASSMAP_DEFINE - invoked once from core - drm.ko DYNDBG_CLASSMAP_USE - from all drm drivers and helpers. DYNDBG_CLASSMAP_DEFINE: it reuses a renamed DECLARE_DYNDBG_CLASSMAP to construct the struct classmap variable, but it drops the static qualifier, and exports it instead. DYNDBG_CLASSMAP_USE: then refers to the exported var by name: * used from drivers, helper-mods * lets us drop the repetitive "classname" args * fixes 2nd-defn problem * creates a ddebug_class_user record in new __dyndbg_class_users section this allows ddebug_add_module(etal) to handle them per-module. DECLARE_DYNDBG_CLASSMAP is preserved temporarily, to decouple DRM adaptation work and avoid compile-errs before its done. IOW, DRM gets fixed when they commit the adopt-new-api patches. The DEFINE,USE distinction, and the separate classmap-use record, allows dyndbg to initialize the driver's & helper's DRM.debug callsites separately after each is modprobed. Basically, the classmap init-scan repeated for classmap-users. To review, dyndbg's existing __dyndbg_classes[] section does: . catalogs the classmaps defined by a module (or builtin modules) . tells dyndbg the module has class'd prdbgs, allowing >control . DYNDBG_CLASSMAP_DEFINE creates classmaps in this section. This patch adds __dyndbg_class_users[] section: . catalogs uses/references to the classmap definitions. . authorizes dyndbg to >control those class'd prdbgs in ref'g module. . DYNDBG_CLASSMAP_USE() creates classmap-user records in this new section. Now ddebug_add_module(etal) can handle classmap-uses similar to (and after) classmaps; when a dependent module is loaded, if it has classmap-uses (to a classmap-def in another module), that module's kernel params are scanned to find if it has a kparam that is wired to dyndbg's param-ops, and whose classmap is the one being ref'd. To support this, theres a few data/header changes: new struct ddebug_class_user contains: user-module-name, &classmap-defn it records drm-driver's use of a classmap in the section, allowing lookup struct ddebug_info gets 2 more fields to keep the new section with the othe= rs: class_users, num_class_users. set by dynamic_debug_init() for builtins. or by kernel/module/main:load_info() for loadable modules. vmlinux.lds.h: new BOUNDED_SECTION for __dyndbg_class_users dynamic_debug.c has 2 changes in ddebug_add_module(), ddebug_change(): ddebug_add_module() already calls ddebug_attach_module_classes() to handle classmaps DEFINEd by a module, now it also calls ddebug_attach_user_module_classes() to handle USEd classmaps. To avoid this work when possible, 1st scan the module's descriptors and count the number of class'd pr_debugs. ddebug_attach_user_module_classes() scans the module's class_users section, follows the refs to the parent's classmap, and calls ddebug_apply_params() on each. It also avoids work by checking the module's class-ct. ddebug_apply_params(new fn): It scans module's/builtin kernel-params, calls ddebug_match_apply_kparam for each to find the params/sysfs-nodes which may be wired to a classmap. ddebug_match_apply_kparam(new fn): 1st, it tests the kernel-param.ops is dyndbg's; this guarantees that the attached arg is a struct ddebug_class_param, which has a ref to the param's state, and to the classmap defining the param's handling. 2nd, it requires that the classmap ref'd by the kparam is the one we're called for; modules can use many separate classmaps (as test_dynamic_debug does). Then apply the "parent" kparam's setting to the dependent module, using ddebug_apply_class_bitmap(). ddebug_change(and callees) also gets adjustments: ddebug_find_valid_class(): This does a search over the module's classmaps, looking for the class FOO echo'd to >control. So now it searches over __dyndbg_class_users[] after __dyndbg_classes[]. ddebug_class_name(): return class-names for defined AND used classes. test_dynamic_debug.c, test_dynamic_debug_submod.c: This demonstrates the 2 types of classmaps & sysfs-params, following the 4-part recipe: 1. define an enum for the classmap: DRM.debug has DRM_UT_{CORE,KMS,...} multiple classes must share 0-62 classid space. 2. DYNDBG_CLASSMAP_DEFINE(.. DRM_UT_{CORE,KMS,...}) 3. DYNDBG_CLASSMAP_PARAM* (classmap) 4. DYNDBG_CLASSMAP_USE() by _submod only, skipping 2,3 Move all the enum declarations together, to better explain how they share the 0..62 class-id space available to a module (non-overlapping subranges). reorg macros 2,3 by name. This gives a tabular format, making it easy to see the pattern of repetition, and the points of change. And extend the test to replicate the 2-module (parent & dependent) scenario which caused the CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy regression seen in drm & drivers. The _submod.c is a 2-line file: #define _SUBMOD, #include parent. This gives identical complements of prdbgs in parent & _submod, and thus identical print behavior when all of: >control, >params, and parent->_submod propagation are working correctly. It also puts all the parent/_submod declarations together in the same source, with the new ifdef _SUBMOD block invoking DYNDBG_CLASSMAP_USE for the 2 test-interfaces. I think this is clearer. These 2 modules are both tristate, allowing 3 super/sub combos: Y/Y, Y/M, M/M (not N/N). Y/Y testing exposed a missing __align(8) in the _METADATA macro, which M/M didn't see because the module-loader memory placement constrains it instead. DEBUG details: ``#define DEBUG`` in src enables all pr_debugs after it, including any class'd pr_debugs; its not necessarily all-or-nothing, unless you do the define in a header. Also, the only way to disable a class'd pr_debug is via the classmap-kparam or using "class foo" in control queries, to address the classes by name. NB: this patch ignores a checkpatch do-while warning; which is wrong for declarative macros like these: arch/powerpc/platforms/cell/spu_base.c 48:static DEFINE_SPINLOCK(spu_lock); 62:static DEFINE_SPINLOCK(spu_full_list_lock); 63:static DEFINE_MUTEX(spu_full_list_mutex); Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- v8 - split drm parts to separate commits. preserve DECLARE_DYNDBG_CLASSMAP to decouple DRM, no flag day. fixup block comment v7 - previous submission-blocking bug: missing __align(8) in DYNAMIC_DEBUG_DECLARE_METADATA on ddebug_class_user caused corrupt records, but only for builtin modules; module loader code probably pinned allocations to the right alignment naturally, hiding the bug for typical builds. v6- get rid of WARN_ON_ONCE v?- fix _var expanded 2x in macro --- MAINTAINERS | 2 +- include/asm-generic/vmlinux.lds.h | 1 + include/linux/dynamic_debug.h | 62 ++++++++-- kernel/module/main.c | 3 + lib/Kconfig.debug | 24 +++- lib/Makefile | 3 + lib/dynamic_debug.c | 184 ++++++++++++++++++++++++++---- lib/test_dynamic_debug.c | 111 ++++++++++++------ lib/test_dynamic_debug_submod.c | 10 ++ 9 files changed, 332 insertions(+), 68 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c diff --git a/MAINTAINERS b/MAINTAINERS index 958e935449e5..eb8312ea681f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7684,7 +7684,7 @@ M: Jim Cromie S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c -F: lib/test_dynamic_debug.c +F: lib/test_dynamic_debug*.c =20 DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 5703526d6ebf..05fbf9f05eb4 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -367,6 +367,7 @@ /* implement dynamic printk debug */ \ . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ + BOUNDED_SECTION_BY(__dyndbg_class_users, ___dyndbg_class_users) \ BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index c8102e89beb2..189e3f60c31a 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -72,8 +72,8 @@ enum ddebug_class_map_type { }; =20 struct ddebug_class_map { - struct module *mod; - const char *mod_name; /* needed for builtins */ + const struct module *mod; /* NULL for builtins */ + const char *mod_name; const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ @@ -81,11 +81,34 @@ struct ddebug_class_map { }; =20 /** - * DECLARE_DYNDBG_CLASSMAP - declare classnames known by a module - * @_var: a struct ddebug_class_map, passed to module_param_cb - * @_type: enum class_map_type, chooses bits/verbose, numeric/symbolic - * @_base: offset of 1st class-name. splits .class_id space - * @classes: class-names used to control class'd prdbgs + * DYNDBG_CLASSMAP_DEFINE - define a set of debug-classes used by a module. + * @_var: name of the classmap, exported for other modules coordinated u= se. + * @_type: enum ddebug_class_map_type, chooses bits/verbose, numeric/name= s. + * @_base: offset of 1st class-name, used to share 0..62 classid space + * @classes: vals are stringified enum-vals, like DRM_UT_* + * + * Defines and exports a struct ddebug_class_map whose @classes are + * used to validate a "class FOO .." >control command on the module + */ +#define __DYNDBG_CLASSMAP_DEFINE(_var, _maptype, _base, ...) \ + const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + struct ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_classes") _var =3D { \ + .mod =3D THIS_MODULE, \ + .mod_name =3D KBUILD_MODNAME, \ + .base =3D _base, \ + .map_type =3D _maptype, \ + .length =3D ARRAY_SIZE(_var##_classnames), \ + .class_names =3D _var##_classnames, \ + } +#define DYNDBG_CLASSMAP_DEFINE(_var, ...) \ + __DYNDBG_CLASSMAP_DEFINE(_var, __VA_ARGS__); \ + EXPORT_SYMBOL(_var) + +/* + * XXX: keep this until DRM adapts to use the DEFINE/USE api, it + * differs from __DYNDBG_CLASSMAP_DEFINE only in the static on the + * struct decl. */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ @@ -99,12 +122,37 @@ struct ddebug_class_map { .class_names =3D _var##_classnames, \ } =20 +struct ddebug_class_user { + char *user_mod_name; + struct ddebug_class_map *map; +}; + +/** + * DYNDBG_CLASSMAP_USE - refer to a classmap, DEFINEd elsewhere. + * @_var: name of the exported classmap var + * + * This registers a module's use of another module's classmap defn, so + * dyndbg can authorize "class DRM_CORE ..." >control commands upon + * this module. + */ +#define DYNDBG_CLASSMAP_USE(_var) \ + DYNDBG_CLASSMAP_USE_(_var, __UNIQUE_ID(ddebug_class_user)) +#define DYNDBG_CLASSMAP_USE_(_var, _uname) \ + extern struct ddebug_class_map _var; \ + static struct ddebug_class_user __aligned(8) __used \ + __section("__dyndbg_class_users") _uname =3D { \ + .user_mod_name =3D KBUILD_MODNAME, \ + .map =3D &(_var), \ + } + /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { struct _ddebug *descs; struct ddebug_class_map *classes; + struct ddebug_class_user *class_users; unsigned int num_descs; unsigned int num_classes; + unsigned int num_class_users; }; =20 struct ddebug_class_param { diff --git a/kernel/module/main.c b/kernel/module/main.c index d18a94b973e1..49329ca1df93 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2235,6 +2235,9 @@ static int find_module_sections(struct module *mod, s= truct load_info *info) mod->dyndbg_info.classes =3D section_objs(info, "__dyndbg_classes", sizeof(*mod->dyndbg_info.classes), &mod->dyndbg_info.num_classes); + mod->dyndbg_info.class_users =3D section_objs(info, "__dyndbg_class_users= ", + sizeof(*mod->dyndbg_info.class_users), + &mod->dyndbg_info.num_class_users); #endif =20 return 0; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 59b6765d86b8..8662e26aceac 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2831,12 +2831,26 @@ config TEST_STATIC_KEYS If unsure, say N. =20 config TEST_DYNAMIC_DEBUG - tristate "Test DYNAMIC_DEBUG" - depends on DYNAMIC_DEBUG + tristate "Build test-dynamic-debug module" + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE help - This module registers a tracer callback to count enabled - pr_debugs in a 'do_debugging' function, then alters their - enablements, calls the function, and compares counts. + This module exercises/demonstrates dyndbg's classmap API, by + creating 2 classes: a DISJOINT classmap (supporting DRM.debug) + and a LEVELS/VERBOSE classmap (like verbose2 > verbose1). + + If unsure, say N. + +config TEST_DYNAMIC_DEBUG_SUBMOD + tristate "Build test-dynamic-debug submodule" + default m + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE + depends on TEST_DYNAMIC_DEBUG + help + This sub-module uses a classmap defined and exported by the + parent module, recapitulating drm & driver's shared use of + drm.debug to control enabled debug-categories. + It is tristate, independent of parent, to allow testing all + proper combinations of parent=3Dy/m submod=3Dy/m. =20 If unsure, say N. =20 diff --git a/lib/Makefile b/lib/Makefile index 30337431d10e..81afaa5b756e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -82,6 +82,7 @@ obj-$(CONFIG_TEST_USER_COPY) +=3D test_user_copy.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_keys.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_key_base.o obj-$(CONFIG_TEST_DYNAMIC_DEBUG) +=3D test_dynamic_debug.o +obj-$(CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD) +=3D test_dynamic_debug_submod.o obj-$(CONFIG_TEST_PRINTF) +=3D test_printf.o obj-$(CONFIG_TEST_SCANF) +=3D test_scanf.o =20 @@ -224,6 +225,8 @@ obj-$(CONFIG_ARCH_NEED_CMPXCHG_1_EMU) +=3D cmpxchg-emu.o obj-$(CONFIG_DYNAMIC_DEBUG_CORE) +=3D dynamic_debug.o #ensure exported functions have prototypes CFLAGS_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug_submod.o :=3D -DDYNAMIC_DEBUG_MODULE =20 obj-$(CONFIG_SYMBOLIC_ERRNAME) +=3D errname.o =20 diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index d5701207febc..9150e0e5145f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -43,13 +43,16 @@ extern struct _ddebug __start___dyndbg[]; extern struct _ddebug __stop___dyndbg[]; extern struct ddebug_class_map __start___dyndbg_classes[]; extern struct ddebug_class_map __stop___dyndbg_classes[]; +extern struct ddebug_class_user __start___dyndbg_class_users[]; +extern struct ddebug_class_user __stop___dyndbg_class_users[]; =20 struct ddebug_table { struct list_head link; const char *mod_name; struct _ddebug *ddebugs; struct ddebug_class_map *classes; - unsigned int num_ddebugs, num_classes; + struct ddebug_class_user *class_users; + unsigned int num_ddebugs, num_classes, num_class_users; }; =20 struct ddebug_query { @@ -148,21 +151,39 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 +#define vpr_dt_info(dt_p, msg_p, ...) ({ \ + struct ddebug_table const *_dt =3D dt_p; \ + v2pr_info(msg_p " module:%s nd:%d nc:%d nu:%d\n", ##__VA_ARGS__, \ + _dt->mod_name, _dt->num_ddebugs, _dt->num_classes, \ + _dt->num_class_users); \ + }) + #define __outvar /* filled by callee */ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e const *dt, const char *class_string, __outvar int *class_id) { struct ddebug_class_map *map; + struct ddebug_class_user *cli; int i, idx; =20 - for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { + for (i =3D 0, map =3D dt->classes; i < dt->num_classes; i++, map++) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; + vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); return map; } } + for (i =3D 0, cli =3D dt->class_users; i < dt->num_class_users; i++, cli+= +) { + idx =3D match_string(cli->map->class_names, cli->map->length, class_stri= ng); + if (idx >=3D 0) { + *class_id =3D idx + cli->map->base; + vpr_dt_info(dt, "class-ref: %s.%s ", + cli->user_mod_name, class_string); + return cli->map; + } + } *class_id =3D -ENOENT; return NULL; } @@ -559,7 +580,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) =20 /* handle multiple queries in query string, continue on error, return last error or number of matching callsites. Module name is either - in param (for boot arg) or perhaps in query string. + in the modname arg (for boot args) or perhaps in query string. */ static int ddebug_exec_queries(char *query, const char *modname) { @@ -688,12 +709,12 @@ static int param_set_dyndbg_module_classes(const char= *instr, } =20 /** - * param_set_dyndbg_classes - class FOO >control + * param_set_dyndbg_classes - set all classes in a classmap * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type + * @kp: kp->arg has state: bits/lvl, classmap, map_type * - * Enable/disable prdbgs by their class, as given in the arguments to - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative + * For all classes in the classmap, enable/disable them per the input + * (depending on map_type). For LEVEL map-types, enforce relative * levels by bitpos. * * Returns: 0 or <0 if error. @@ -1038,12 +1059,17 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) { struct ddebug_class_map *map =3D dt->classes; + struct ddebug_class_user *cli =3D dt->class_users; int i; =20 for (i =3D 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 + for (i =3D 0; i < dt->num_class_users; i++, cli++) + if (class_in_range(dp->class_id, cli->map)) + return cli->map->class_names[dp->class_id - cli->map->base]; + return NULL; } =20 @@ -1124,31 +1150,134 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 +static const char * const ddebug_classmap_typenames[] =3D { + "DISJOINT_BITS", "LEVEL_NUM" +}; + +#define vpr_cm_info(cm_p, msg_p, ...) ({ \ + struct ddebug_class_map const *_cm =3D cm_p; \ + v2pr_info(msg_p " module:%s base:%d len:%d type:%s\n", ##__VA_ARGS__, \ + _cm->mod_name, _cm->base, _cm->length, \ + ddebug_classmap_typenames[_cm->map_type]); \ + }) + +static void ddebug_sync_classbits(const struct ddebug_class_param *dcp, co= nst char *modname) +{ + /* clamp initial bitvec, mask off hi-bits */ + if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { + *dcp->bits &=3D CLASSMAP_BITMASK(dcp->map->length); + v2pr_info("preset classbits: %lx\n", *dcp->bits); + } + /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-= param */ + ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); +} + +static void ddebug_match_apply_kparam(const struct kernel_param *kp, + const struct ddebug_class_map *map, + const char *modnm) +{ + struct ddebug_class_param *dcp; + + if (kp->ops !=3D ¶m_ops_dyndbg_classes) + return; + + dcp =3D (struct ddebug_class_param *)kp->arg; + + if (map =3D=3D dcp->map) { + v2pr_info("found kp:%s =3D0x%lx", kp->name, *dcp->bits); + vpr_cm_info(map, "mapped to:"); + ddebug_sync_classbits(dcp, modnm); + } +} + +static void ddebug_apply_params(const struct ddebug_class_map *cm, const c= har *modnm) +{ + const struct kernel_param *kp; +#if IS_ENABLED(CONFIG_MODULES) + int i; + + if (cm->mod) { + vpr_cm_info(cm, "loaded class:"); + /* ifdef protects the cm->mod->kp deref */ + for (i =3D 0, kp =3D cm->mod->kp; i < cm->mod->num_kp; i++, kp++) + ddebug_match_apply_kparam(kp, cm, modnm); + } +#endif + if (!cm->mod) { + vpr_cm_info(cm, "builtin class:"); + for (kp =3D __start___param; kp < __stop___param; kp++) + ddebug_match_apply_kparam(kp, cm, modnm); + } +} + +/* + * Find this module's classmaps in a sub/whole-range of the builtin/ + * modular classmap vector/section. Save the start and length of the + * subrange at its edges. + */ static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { struct ddebug_class_map *cm; int i, nc =3D 0; =20 - /* - * Find this module's classmaps in a subrange/wholerange of - * the builtin/modular classmap vector/section. Save the start - * and length of the subrange at its edges. - */ - for (cm =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { + for (i =3D 0, cm =3D di->classes; i < di->num_classes; i++, cm++) { =20 if (!strcmp(cm->mod_name, dt->mod_name)) { - if (!nc) { - v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n= ", - i, cm->mod_name, cm->base, cm->length, cm->map_type); + vpr_cm_info(cm, "classes[%d]:", i); + if (!nc++) dt->classes =3D cm; - } - nc++; } } - if (nc) { - dt->num_classes =3D nc; - vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + if (!nc) + return; + + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + dt->num_classes =3D nc; + + for (i =3D 0, cm =3D dt->classes; i < dt->num_classes; i++, cm++) + ddebug_apply_params(cm, cm->mod_name); +} + +/* + * propagates class-params thru their classmaps to class-users. this + * means a query against the dt/module, which means it must be on the + * list to be seen by ddebug_change. + */ +static void ddebug_attach_user_module_classes(struct ddebug_table *dt, + const struct _ddebug_info *di) +{ + struct ddebug_class_user *cli; + int i, nc =3D 0; + + /* + * For builtins: scan the array, find start/length of this + * module's refs, save to dt. For loadables, this is the + * whole array. + */ + for (i =3D 0, cli =3D di->class_users; i < di->num_class_users; i++, cli+= +) { + + if (WARN_ON_ONCE(!cli || !cli->map || !cli->user_mod_name)) + continue; + + if (!strcmp(cli->user_mod_name, dt->mod_name)) { + + vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, + cli->user_mod_name, cli->map->mod_name); + if (!nc++) + dt->class_users =3D cli; + } } + if (!nc) + return; + + dt->num_class_users =3D nc; + + /* now iterate dt */ + for (i =3D 0, cli =3D dt->class_users; i < dt->num_class_users; i++, cli+= +) + ddebug_apply_params(cli->map, cli->user_mod_name); + + vpr_dt_info(dt, "attach-client-module: "); } =20 /* @@ -1158,6 +1287,8 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + struct _ddebug *iter; + int i, class_ct =3D 0; =20 if (!di->num_descs) return 0; @@ -1181,13 +1312,20 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) =20 INIT_LIST_HEAD(&dt->link); =20 - if (di->classes && di->num_classes) + for (i =3D 0, iter =3D di->descs; i < di->num_descs; i++, iter++) + if (iter->class_id !=3D _DPRINTK_CLASS_DFLT) + class_ct++; + + if (class_ct && di->num_classes) ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 + if (class_ct && di->num_class_users) + ddebug_attach_user_module_classes(dt, di); + vpr_info("%3u debug prints in module %s\n", di->num_descs, modname); return 0; } @@ -1337,8 +1475,10 @@ static int __init dynamic_debug_init(void) struct _ddebug_info di =3D { .descs =3D __start___dyndbg, .classes =3D __start___dyndbg_classes, + .class_users =3D __start___dyndbg_class_users, .num_descs =3D __stop___dyndbg - __start___dyndbg, .num_classes =3D __stop___dyndbg_classes - __start___dyndbg_classes, + .num_class_users =3D __stop___dyndbg_class_users - __start___dyndbg_clas= s_users, }; =20 #ifdef CONFIG_MODULES diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 9e950a911b6c..ff9b879286d5 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -6,11 +6,15 @@ * Jim Cromie */ =20 -#define pr_fmt(fmt) "test_dd: " fmt +#if defined(TEST_DYNAMIC_DEBUG_SUBMOD) + #define pr_fmt(fmt) "test_dd_submod: " fmt +#else + #define pr_fmt(fmt) "test_dd: " fmt +#endif =20 #include =20 -/* run tests by reading or writing sysfs node: do_prints */ +/* re-gen output by reading or writing sysfs node: do_prints */ =20 static void do_prints(void); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_para= m *kp) @@ -29,24 +33,39 @@ static const struct kernel_param_ops param_ops_do_print= s =3D { }; module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); =20 -/* - * Using the CLASSMAP api: - * - classmaps must have corresponding enum - * - enum symbols must match/correlate with class-name strings in the map. - * - base must equal enum's 1st value - * - multiple maps must set their base to share the 0-30 class_id space !! - * (build-bug-on tips welcome) - * Additionally, here: - * - tie together sysname, mapname, bitsname, flagsname - */ -#define DD_SYS_WRAP(_model, _flags) \ - static unsigned long bits_##_model; \ - static struct ddebug_class_param _flags##_model =3D { \ +#define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << base) + +/* sysfs param wrapper, proto-API */ +#define DYNDBG_CLASSMAP_PARAM_(_model, _flags, _init) \ + static unsigned long bits_##_model =3D _init; \ + static struct ddebug_class_param _flags##_##_model =3D { \ .bits =3D &bits_##_model, \ .flags =3D #_flags, \ .map =3D &map_##_model, \ }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, &_flags##_m= odel, 0600) + module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ + &_flags##_##_model, 0600) +#ifdef DEBUG +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_mod= el, _flags, ~0) +#else +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_mod= el, _flags, 0) +#endif + +/* + * Demonstrate/test all 4 class-typed classmaps with a sys-param. + * + * Each is 3 part: client-enum decl, _DEFINE, _PARAM. + * Declare them in blocks to show patterns of use (repetitions and + * changes) within each. + * + * 1st, dyndbg expects a client-provided enum-type as source of + * category/classid truth. DRM has DRM_UT_. + * + * Modules with multiple CLASSMAPS must have enums with distinct + * value-ranges, arranged below with explicit enum_sym =3D X inits. + * + * Declare all 4 enums now, for different types + */ =20 /* numeric input, independent bits */ enum cat_disjoint_bits { @@ -60,26 +79,51 @@ enum cat_disjoint_bits { D2_LEASE, D2_DP, D2_DRMRES }; -DECLARE_DYNDBG_CLASSMAP(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "D2_CORE", - "D2_DRIVER", - "D2_KMS", - "D2_PRIME", - "D2_ATOMIC", - "D2_VBL", - "D2_STATE", - "D2_LEASE", - "D2_DP", - "D2_DRMRES"); -DD_SYS_WRAP(disjoint_bits, p); -DD_SYS_WRAP(disjoint_bits, T); =20 /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, - "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); -DD_SYS_WRAP(level_num, p); -DD_SYS_WRAP(level_num, T); + +/* recapitulate DRM's parent(drm.ko) <-- _submod(drivers,helpers) */ +#if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) +/* + * In single user, or parent / coordinator (drm.ko) modules, define + * classmaps on the client enums above, and then declares the PARAMS + * ref'g the classmaps. Each is exported. + */ +DYNDBG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, + D2_CORE, + "D2_CORE", + "D2_DRIVER", + "D2_KMS", + "D2_PRIME", + "D2_ATOMIC", + "D2_VBL", + "D2_STATE", + "D2_LEASE", + "D2_DP", + "D2_DRMRES"); + +DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, + V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); + +/* + * now add the sysfs-params + */ + +DYNDBG_CLASSMAP_PARAM(disjoint_bits, p); +DYNDBG_CLASSMAP_PARAM(level_num, p); + +#else /* TEST_DYNAMIC_DEBUG_SUBMOD */ + +/* + * in submod/drm-drivers, use the classmaps defined in top/parent + * module above. + */ + +DYNDBG_CLASSMAP_USE(map_disjoint_bits); +DYNDBG_CLASSMAP_USE(map_level_num); + +#endif =20 /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") @@ -115,6 +159,7 @@ static void do_levels(void) =20 static void do_prints(void) { + pr_debug("do_prints:\n"); do_cats(); do_levels(); } diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submo= d.c new file mode 100644 index 000000000000..9a893402ce1a --- /dev/null +++ b/lib/test_dynamic_debug_submod.c @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Kernel module for testing dynamic_debug + * + * Authors: + * Jim Cromie + */ + +#define TEST_DYNAMIC_DEBUG_SUBMOD +#include "test_dynamic_debug.c" --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 960CF1A3BBF; Tue, 16 Jul 2024 18:58:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156328; cv=none; b=REHykA4s4WCz1FesgJOn/Qpmj8EBUu4Y3DsS1TNhcaxYOoCkQFmO6j6whKzhC4aG2stYkoNpoiB70ZMwxhQG4owTcV1YSLhiUiPg+N/WRB7cePy0xJD/jp097zRlK0XV+VyhYY2kA94Wd+Wj23QCiQGt/wKnlbm14BbN25p23dQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156328; c=relaxed/simple; bh=qPoHeHKaNt2ADRpuU/hSuSHZCiAloyydafxYcBbGtoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nBcE/xS1wO+l2GoJwPNODfeROqKEcUdKlYemxtxvP+HPURPdYO0RN3805FhlVtIrj4doCMOx0r0vqP5IOHjCcrWPsuyOBXISLNVzZTfEfNJjWwcSdhkVsr57EF5HvVra7qi/GhtaA2MvRRRZRMbMZfgW2bPaRbltNm6lLN/Seok= 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=T+kWA2ZF; arc=none smtp.client-ip=209.85.166.51 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="T+kWA2ZF" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5211239f.2; Tue, 16 Jul 2024 11:58:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156325; x=1721761125; 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=4S+2qr0Nx8V7Wt9mGFuHZ4lGBCN5y3YK4bB9crjyLn8=; b=T+kWA2ZF5roFDpVv5uOpWsL4v2Q9a1k2VLD4N6eenkXLciw3WAnpIi5p8cz3bwCBUC zpJWZ6IIhUCjYV8POitJvo+SRgw3cbcw0X9qJ4hiIPKSGxqqR86x1sOlZ+zBQV1mKsoT cDRIiiZ1bvSYsKxavq4BybpZXMhzxJaG08rViWlI8A1AMODMhh9bxGqgX9pghdJChtJH ZoguG8fKsg6ye6aH6dXysjz8d/lp6I0tha6ukFlV3N0ubb50zZUG60pccKUL7sL7RfAa 5BTmHavebzC5lxDYwu0H60Mh2dAz+SoVViIG0VPYSjOYAMTUsaMIXyVfBZXnlKDZJDiA XRfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156325; x=1721761125; 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=4S+2qr0Nx8V7Wt9mGFuHZ4lGBCN5y3YK4bB9crjyLn8=; b=JSwA7cD0mVLqRe2HfU3bPpa6xiy2F0rHpRQGJ9nTEH2dUVjnaLvPND+wVtDGy35hnW BVgwkcmnD76qOYMJqbQiAFDiUK0XUoQZ4VifgIst3f0YKGDSCYEYOS0Am34hL77rS1EH /+zPU7u2Kwah87dsDzHdNqegFkiAMI0UTFZasrzhjkBU3LMkr9o6Ke4ehJIvStNk+sgE STGA0R8qvkaYbrCC3Of4a20wQ5rpK5KVBiRL3yjIqB/VgvL/AwdMisMTnNCppG5BRSvT yX69Nk4loCQLtTvcbXgg1BFlPTrn33+v16r7vjhzDUxwueSx58sUHbY5CEwLr0xbB8MB qwIA== X-Forwarded-Encrypted: i=1; AJvYcCWaiFgrkcRTNYIKBpb+EG3qtdeSIomQg0ACCAxkGW+b27+AdZ/td9A/MUCjrisk0M8FwArxBKNJRZMn2hm21iZOvSU2pIea/uy7 X-Gm-Message-State: AOJu0YzK1Dw9TVJdu8bCG2+J+istOHryZBSNipvqpolM/sdi502OL8/3 IRv/n+r/Vr+yIWyVIrT6CVEcjZHrfnPRuuC3d9z+tZFMRBZm+AEkHtJSMjpb X-Google-Smtp-Source: AGHT+IEETisqF8AasMqCEUvxhtG5T7JwD3BrHas/WSaIXmjat8emY/K+TY8RKhes7qhIA0B+W/k69A== X-Received: by 2002:a05:6602:1493:b0:807:4340:947e with SMTP id ca18e2360f4ac-816c4a15d70mr32237839f.15.1721156325487; Tue, 16 Jul 2024 11:58:45 -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.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:44 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 16/54] selftests-dyndbg: add tools/testing/selftests/dynamic_debug/* Date: Tue, 16 Jul 2024 12:57:28 -0600 Message-ID: <20240716185806.1572048-17-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add a selftest script for dynamic-debug. The config requires CONFIG_TEST_DYNAMIC_DEBUG=3Dm (and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm), which tacitly requires either CONFIG_DYNAMIC_DEBUG=3Dy or CONFIG_DYNAMIC_DEBUG_CORE=3Dy ATM this has just basic_tests(), it modifies pr_debug flags in a few builtins (init/main, params), counts the callsite flags changed, and verifies against expected values. This is backported from another feature branch; the support-fns (thx Lukas) have unused features at the moment, they'll get used shortly. The script enables simple virtme-ng testing: $> vng --verbose --name v6.8-32-g30d431000676 --user root \ --cwd ../.. -a dynamic_debug.verbose=3D2 -p 4 \ ./tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh virtme: waiting for virtiofsd to start virtme: use 'microvm' QEMU architecture ... [ 4.136168] virtme-init: Setting hostname to v6.8-32-g30d431000676... [ 4.240874] virtme-init: starting script test_dynamic_debug_submod not there test_dynamic_debug not there ... [ 4.474435] virtme-init: script returned {0} Powering off. [ 4.529318] ACPI: PM: Preparing to enter system sleep state S5 [ 4.529991] kvm: exiting hardware virtualization [ 4.530428] reboot: Power down And add dynamic_debug to TARGETS, so `make run_tests` sees it properly for the impatient, set TARGETS explicitly: bash-5.2# make TARGETS=3Ddynamic_debug run_tests make[1]: ... TAP version 13 1..1 [ 35.552922] dyndbg: read 3 bytes from userspace [ 35.553099] dyndbg: query 0: "=3D_" mod:* [ 35.553544] dyndbg: processed 1 queries, with 1778 matches, 0 errs ... TLDR: This selftest is slightly naive wrt the init state of call-site flags. In particular, it fails if class'd pr_debugs have been set $ cat /etc/modprobe.d/drm-test.conf options drm dyndbg=3Dclass,DRM_UT_CORE,+mfslt%class,DRM_UT_KMS,+mf By Contract, class'd pr_debugs are protected from alteration by default (only by direct "class FOO" queries), so the "=3D_" logged above (TAP version 13) cannot affect the DRM_UT_CORE,KMS pr_debugs. These class'd flag-settings, added by modprobe, alter the counts of flag-matching patterns, breaking the tests' expectations. Signed-off-by: Jim Cromie Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + .../testing/selftests/dynamic_debug/Makefile | 9 + tools/testing/selftests/dynamic_debug/config | 2 + .../dynamic_debug/dyndbg_selftest.sh | 231 ++++++++++++++++++ 5 files changed, 244 insertions(+) create mode 100644 tools/testing/selftests/dynamic_debug/Makefile create mode 100644 tools/testing/selftests/dynamic_debug/config create mode 100755 tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh diff --git a/MAINTAINERS b/MAINTAINERS index eb8312ea681f..a5197bac717f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -7685,6 +7685,7 @@ S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c F: lib/test_dynamic_debug*.c +F: tools/testing/selftest/dynamic_debug/* =20 DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Mak= efile index 9039f3709aff..1b4826d5d09c 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -22,6 +22,7 @@ TARGETS +=3D drivers/net/bonding TARGETS +=3D drivers/net/team TARGETS +=3D drivers/net/virtio_net TARGETS +=3D dt +TARGETS +=3D dynamic_debug TARGETS +=3D efivarfs TARGETS +=3D exec TARGETS +=3D fchmodat2 diff --git a/tools/testing/selftests/dynamic_debug/Makefile b/tools/testing= /selftests/dynamic_debug/Makefile new file mode 100644 index 000000000000..6d06fa7f1040 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# borrowed from Makefile for user memory selftests + +# No binaries, but make sure arg-less "make" doesn't trigger "run_tests" +all: + +TEST_PROGS :=3D dyndbg_selftest.sh + +include ../lib.mk diff --git a/tools/testing/selftests/dynamic_debug/config b/tools/testing/s= elftests/dynamic_debug/config new file mode 100644 index 000000000000..d080da571ac0 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/config @@ -0,0 +1,2 @@ +CONFIG_TEST_DYNAMIC_DEBUG=3Dm +CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh new file mode 100755 index 000000000000..1be70af26a38 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -0,0 +1,231 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only + +V=3D${V:=3D0} # invoke as V=3D1 $0 for global verbose +RED=3D"\033[0;31m" +GREEN=3D"\033[0;32m" +YELLOW=3D"\033[0;33m" +BLUE=3D"\033[0;34m" +MAGENTA=3D"\033[0;35m" +CYAN=3D"\033[0;36m" +NC=3D"\033[0;0m" +error_msg=3D"" + +function vx () { + echo $1 > /sys/module/dynamic_debug/parameters/verbose +} + +function ddgrep () { + grep $1 /proc/dynamic_debug/control +} + +function doprints () { + cat /sys/module/test_dynamic_debug/parameters/do_prints +} + +function ddcmd () { + exp_exit_code=3D0 + num_args=3D$# + if [ "${@:$#}" =3D "pass" ]; then + num_args=3D$#-1 + elif [ "${@:$#}" =3D "fail" ]; then + num_args=3D$#-1 + exp_exit_code=3D1 + fi + args=3D${@:1:$num_args} + output=3D$((echo "$args" > /proc/dynamic_debug/control) 2>&1) + exit_code=3D$? + error_msg=3D$(echo $output | cut -d ":" -f 5 | sed -e 's/^[[:space:]]*= //') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function handle_exit_code() { + local exp_exit_code=3D0 + [ $# =3D=3D 4 ] && exp_exit_code=3D$4 + if [ $3 -ne $exp_exit_code ]; then + echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $= exp_exit_code" + [ $3 =3D=3D 1 ] && echo "Error: '$error_msg'" + exit + fi +} + +# $1 - pattern to match, pattern in $1 is enclosed by spaces for a match "= "\s$1\s" +# $2 - number of times the pattern passed in $1 is expected to match +# $3 - optional can be set either to "-r" or "-v" +# "-r" means relaxed matching in this case pattern provided in $1 is= passed +# as is without enclosing it with spaces +# "-v" prints matching lines +# $4 - optional when $3 is set to "-r" then $4 can be used to pass "-v" +function check_match_ct { + pattern=3D"\s$1\s" + exp_cnt=3D0 + + [ "$3" =3D=3D "-r" ] && pattern=3D"$1" + let cnt=3D$(ddgrep "$pattern" | wc -l) + if [ $V -eq 1 ] || [ "$3" =3D=3D "-v" ] || [ "$4" =3D=3D "-v" ]; then + echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}" + fi + [ $# -gt 1 ] && exp_cnt=3D$2 + if [ $cnt -ne $exp_cnt ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO check failed expected $= exp_cnt on $1, got $cnt" + exit + else + echo ": $cnt matches on $1" + fi +} + +# $1 - trace instance name +# #2 - if > 0 then directory is expected to exist, if <=3D 0 then otherwise +# $3 - "-v" for verbose +function check_trace_instance_dir { + if [ -e /sys/kernel/tracing/instances/$1 ]; then + if [ "$3" =3D=3D "-v" ] ; then + echo "ls -l /sys/kernel/tracing/instances/$1: " + ls -l /sys/kernel/tracing/instances/$1 + fi + if [ $2 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instanc= e \ + '/sys/kernel/tracing/instances/$1' does exist" + exit + fi + else + if [ $2 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instanc= e \ + '/sys/kernel/tracing/instances/$1' does not exist" + exit + fi + fi +} + +function tmark { + echo $* > /sys/kernel/tracing/trace_marker +} + +# $1 - trace instance name +# $2 - line number +# $3 - if > 0 then the instance is expected to be opened, otherwise +# the instance is expected to be closed +function check_trace_instance { + output=3D$(tail -n9 /proc/dynamic_debug/control | grep ": Opened trace= instances" \ + | xargs -n1 | grep $1) + if [ "$output" !=3D $1 ] && [ $3 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not opened" + exit + fi + if [ "$output" =3D=3D $1 ] && [ $3 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not closed" + exit + fi +} + +function is_trace_instance_opened { + check_trace_instance $1 $BASH_LINENO 1 +} + +function is_trace_instance_closed { + check_trace_instance $1 $BASH_LINENO 0 +} + +# $1 - trace instance directory to delete +# $2 - if > 0 then directory is expected to be deleted successfully, if <= =3D 0 then otherwise +function del_trace_instance_dir() { + exp_exit_code=3D1 + [ $2 -gt 0 ] && exp_exit_code=3D0 + output=3D$((rmdir /sys/kernel/debug/tracing/instances/$1) 2>&1) + exit_code=3D$? + error_msg=3D$(echo $output | cut -d ":" -f 3 | sed -e 's/^[[:space:]]*= //') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function error_log_ref { + # to show what I got + : echo "# error-log-ref: $1" + : echo cat \$2 +} + +function ifrmmod { + lsmod | grep $1 2>&1>/dev/null || echo $1 not there + lsmod | grep $1 2>&1>/dev/null && rmmod $1 +} + +# $1 - text to search for +function search_trace() { + search_trace_name 0 1 $1 +} + +# $1 - trace instance name, 0 for global event trace +# $2 - line number counting from the bottom +# $3 - text to search for +function search_trace_name() { + if [ "$1" =3D "0" ]; then + buf=3D$(cat /sys/kernel/debug/tracing/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/trace | head -1 | sed -e = 's/^[[:space:]]*//') + else + buf=3D$(cat /sys/kernel/debug/tracing/instances/$1/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/instances/$1/trace | head= -1 | \ + sed -e 's/^[[:space:]]*//') + fi + if [ $2 =3D 0 ]; then + # whole-buf check + output=3D$(echo $buf | grep "$3") + else + output=3D$(echo $line | grep "$3") + fi + if [ "$output" =3D "" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO search for '$3' fai= led \ + in line '$line' or '$buf'" + exit + fi + if [ $V =3D 1 ]; then + echo -e "${MAGENTA}: search_trace_name in $1 found: \n$output \nin:${= BLUE} $buf ${NC}" + fi +} + +# $1 - error message to check +function check_err_msg() { + if [ "$error_msg" !=3D "$1" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error message '$error_m= sg' \ + does not match with '$1'" + exit + fi +} + +function basic_tests { + echo -e "${GREEN}# BASIC_TESTS ${NC}" + ddcmd =3D_ # zero everything (except class'd sites) + check_match_ct =3Dp 0 + # there are several main's :-/ + ddcmd module main file */module/main.c +p + check_match_ct =3Dp 14 + ddcmd =3D_ + check_match_ct =3Dp 0 + # multi-cmd input, newline separated, with embedded comments + cat <<"EOF" > /proc/dynamic_debug/control + module main +mf # multi-query + module main file init/main.c +ml # newline separated +EOF + # the intersection of all those main's is hard to track/count + # esp when mixed with overlapping greps + check_match_ct =3Dmf 21 + check_match_ct =3Dml 0 + check_match_ct =3Dmfl 6 + ddcmd =3D_ +} + + +tests_list=3D( + basic_tests +) + +# Run tests + +ifrmmod test_dynamic_debug_submod +ifrmmod test_dynamic_debug + +for test in "${tests_list[@]}" +do + $test + echo "" +done +echo -en "${GREEN}# Done on: " +date --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 634491A3BCD; Tue, 16 Jul 2024 18:58:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156330; cv=none; b=QlOqQ7qMYzZgoH3lRLtm+Wg9xBbP/wAnHstrEwp1QGySFZqsUPC4WH01CVpDSv66OM+7GPAJHYLxsDEK9hqjnoseU6GsT1Y/z3YruXl77UUnUltTeUjAAt/8nOQXYV88qTQjk/C+Q9fTi2l4+xGr7YKUEIW3fpnB/7Nz4qwiYFA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156330; c=relaxed/simple; bh=Bw41aVikVNWjDZXLjO8Be8Qnn63BkBtdGsnW+5W1p84=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VZegTMr4HAmMSLQDx3QNDlMKnPIlUnaSt6SbJOh0FtQMMFVyC6ZhwYlGU6eAQGw988VC8AQRjLPDkr5NSQnF8dMWW8JN1NdZpEpPR3faWCiZX+XmAq3Pe8wWQ/cWAPSAGit0wvDpESjLNe/f2p2Hvx2rMB5HMl5HtxvE1xrCths= 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=fI8WZ10L; arc=none smtp.client-ip=209.85.166.43 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="fI8WZ10L" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7fe8d029fbeso5415439f.3; Tue, 16 Jul 2024 11:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156327; x=1721761127; 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=YKcpqrjp0jRP0pX17cWlggKOGpzd2gWHL9vIhHrSM0A=; b=fI8WZ10LUuOrYoo7myCheQiiJKAycCmI2dZvU3jyC4KfVvZhG911bc9qCaz0jZTzWm dHvmrPFv0u82hkm3ZznHG4Mt7mLt6igtiix1wTuM22BSEmUj59uX4a8rZZhooEnRupyS pgZe/OE7hL6FSrFrzYPGeDbrGHAuOYceh6bFQl+0qO4XV/Q2b6TTIpxW0i9bwHjRIrS7 Ksbu2a4uQTJLxnLYPXPHNdHsLXmFICzGyFNz3sZ2KmGN46GPkAkv9FWT5X5H81cW2xdC LI+MD2LE+B3EufNLTk1i9nlx0R+E+UZEkNHNrdTcexEcuga5w5ZcVg/5XqkhqRV4vRwq 2BTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156327; x=1721761127; 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=YKcpqrjp0jRP0pX17cWlggKOGpzd2gWHL9vIhHrSM0A=; b=nJ1ndlrTnQ5TRyjbPBLVFqIO+kROyVHhw9/MJei9dl20VNTL+t5B0zJh0E9E7Nmlrd lO5lFLEXNiHNabLysI3Cvy0xhi+7THiuyBwpux+mACdMPIHUaRfbMvx9vGme8yXLetQH YatzuRHM1zqUTrio+e9JuON14dwW0N6zalKmqcShrb9xYu+wkDvHxdpOhG63ti6fehLP 0GGUbm5Jrzq+1A0xSiDRrXSsmXXpkFBpLl+MVCLvsIe/TS0W9qgZvRHO96j9e52nY42u wCS6IeUThtYv+hBSgqGbFDPyQibj7XwCjBQIawhMG2iWj0I8oyxVdrPBpzEgQsB5Es3V FqqA== X-Forwarded-Encrypted: i=1; AJvYcCVzdV3jxrUS5JvOSw6G1GIl+A+RI//3ENkQGZhLQorfBhE9om12mA+8Jx60o0OHE9ZQL7PGlE+SIXgR0dzVLjA/APw8u8t44Wwg X-Gm-Message-State: AOJu0YzN9OcV6YDUsHgERZjtKDk3OLE05N+k0YxsKHajVkBJYfjWuoEI v2W5gnrftA6p2upFrQxt3TJNS0XGxCjTrdNR67K95GpSyoDa0gbI7S+V4eIk X-Google-Smtp-Source: AGHT+IGlCyGU6SJZh8MB4murVbsokLKUnVGVle0fRqnnMoJ0fngP15vZtSaVhLjBUnPLS8BYMS4Xrg== X-Received: by 2002:a05:6602:26d5:b0:806:31ee:132 with SMTP id ca18e2360f4ac-816c2eef653mr47320939f.4.1721156327055; Tue, 16 Jul 2024 11:58:47 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:46 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 17/54] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API Date: Tue, 16 Jul 2024 12:57:29 -0600 Message-ID: <20240716185806.1572048-18-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> 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" move the DYNDBG_CLASSMAP_PARAM macro from test-dynamic-debug.c into the header, and refine it, by distinguishing the 2 use cases: 1.DYNDBG_CLASSMAP_PARAM_REF for DRM, to pass in extern __drm_debug by name. dyndbg keeps bits in it, so drm can still use it as before 2.DYNDBG_CLASSMAP_PARAM new user (test_dynamic_debug) doesn't need to share state, decls a static long unsigned int to store the bitvec. __DYNDBG_CLASSMAP_PARAM bottom layer - allocate,init a ddebug-class-param, module-param-cb. Also clean up and improve comments in test-code, and add MODULE_DESCRIPTIONs. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- fixup drm-print.h add PARAM_REF forwarding macros with DYNDBG_CLASSMAP_PARAM_REF in the API, add DRM_ variant --- include/linux/dynamic_debug.h | 37 ++++++++++++++++- lib/dynamic_debug.c | 70 ++++++++++++++++++++++----------- lib/test_dynamic_debug.c | 50 +++++++++-------------- lib/test_dynamic_debug_submod.c | 9 ++++- 4 files changed, 110 insertions(+), 56 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 189e3f60c31a..4a9b9cd53eb7 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -91,7 +91,7 @@ struct ddebug_class_map { * used to validate a "class FOO .." >control command on the module */ #define __DYNDBG_CLASSMAP_DEFINE(_var, _maptype, _base, ...) \ - const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ struct ddebug_class_map __aligned(8) __used \ __section("__dyndbg_classes") _var =3D { \ .mod =3D THIS_MODULE, \ @@ -164,6 +164,41 @@ struct ddebug_class_param { const struct ddebug_class_map *map; }; =20 +/** + * DYNDBG_CLASSMAP_PARAM - wrap a dyndbg-classmap with a controlling sys-p= aram + * @_name sysfs node name + * @_var name of the struct classmap var defining the controlled classes + * @_flags flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classes defined by the + * classmap. Keeps bits in a private/static + */ +#define DYNDBG_CLASSMAP_PARAM(_name, _var, _flags) \ + static unsigned long _name##_bvec; \ + __DYNDBG_CLASSMAP_PARAM(_name, _name##_bvec, _var, _flags) + +/** + * DYNDBG_CLASSMAP_PARAM_REF - wrap a dyndbg-classmap with a controlling s= ys-param + * @_name sysfs node name + * @_bits name of the module's unsigned long bit-vector, ex: __drm_debug + * @_var name of the struct classmap var defining the controlled classes + * @_flags flags to be toggled, typically just 'p' + * + * Creates a sysfs-param to control the classmap, keeping bitvec in user @= _bits. + * This lets drm use __drm_debug elsewhere too. + */ +#define DYNDBG_CLASSMAP_PARAM_REF(_name, _bits, _var, _flags) \ + __DYNDBG_CLASSMAP_PARAM(_name, _bits, _var, _flags) + +#define __DYNDBG_CLASSMAP_PARAM(_name, _bits, _var, _flags) \ + static struct ddebug_class_param _name##_##_flags =3D { \ + .bits =3D &(_bits), \ + .flags =3D #_flags, \ + .map =3D &(_var), \ + }; \ + module_param_cb(_name, ¶m_ops_dyndbg_classes, \ + &_name##_##_flags, 0600) + /* * pr_debug() and friends are globally enabled or modules have selectively * enabled them. diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 9150e0e5145f..e9a95b0f3757 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -657,6 +657,30 @@ static int ddebug_apply_class_bitmap(const struct ddeb= ug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 +static void ddebug_class_param_clamp_input(unsigned long *inrep, const str= uct kernel_param *kp) +{ + const struct ddebug_class_param *dcp =3D kp->arg; + const struct ddebug_class_map *map =3D dcp->map; + + switch (map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + /* expect bits. mask and warn if too many */ + if (*inrep & ~CLASSMAP_BITMASK(map->length)) { + pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", + KP_NAME(kp), *inrep, CLASSMAP_BITMASK(map->length)); + *inrep &=3D CLASSMAP_BITMASK(map->length); + } + break; + case DD_CLASS_TYPE_LEVEL_NUM: + /* input is bitpos, of highest verbosity to be enabled */ + if (*inrep > map->length) { + pr_warn("%s: level:%ld exceeds max:%d, clamping\n", + KP_NAME(kp), *inrep, map->length); + *inrep =3D map->length; + } + break; + } +} static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *modnm) @@ -675,26 +699,15 @@ static int param_set_dyndbg_module_classes(const char= *instr, pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } + ddebug_class_param_clamp_input(&inrep, kp); =20 switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: - /* expect bits. mask and warn if too many */ - if (inrep & ~CLASSMAP_BITMASK(map->length)) { - pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", - KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); - inrep &=3D CLASSMAP_BITMASK(map->length); - } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: - /* input is bitpos, of highest verbosity to be enabled */ - if (inrep > map->length) { - pr_warn("%s: level:%ld exceeds max:%d, clamping\n", - KP_NAME(kp), inrep, map->length); - inrep =3D map->length; - } old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); @@ -1161,16 +1174,27 @@ static const char * const ddebug_classmap_typenames= [] =3D { ddebug_classmap_typenames[_cm->map_type]); \ }) =20 -static void ddebug_sync_classbits(const struct ddebug_class_param *dcp, co= nst char *modname) +static void ddebug_sync_classbits(const struct kernel_param *kp, const cha= r *modname) { - /* clamp initial bitvec, mask off hi-bits */ - if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { - *dcp->bits &=3D CLASSMAP_BITMASK(dcp->map->length); - v2pr_info("preset classbits: %lx\n", *dcp->bits); + struct ddebug_class_param *dcp =3D kp->arg; + unsigned long new_bits; + + ddebug_class_param_clamp_input(dcp->bits, kp); + + switch (dcp->map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + v2pr_info(" %s: classbits: 0x%lx\n", KP_NAME(kp), *dcp->bits); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0UL, modname); + break; + case DD_CLASS_TYPE_LEVEL_NUM: + new_bits =3D CLASSMAP_BITMASK(*dcp->lvl); + v2pr_info(" %s: lvl:%ld bits:0x%lx\n", KP_NAME(kp), *dcp->lvl, new_bits= ); + ddebug_apply_class_bitmap(dcp, &new_bits, 0UL, modname); + break; + default: + pr_err("bad map type %d\n", dcp->map->map_type); + return; } - /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-= param */ - ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); - ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); } =20 static void ddebug_match_apply_kparam(const struct kernel_param *kp, @@ -1185,9 +1209,9 @@ static void ddebug_match_apply_kparam(const struct ke= rnel_param *kp, dcp =3D (struct ddebug_class_param *)kp->arg; =20 if (map =3D=3D dcp->map) { - v2pr_info("found kp:%s =3D0x%lx", kp->name, *dcp->bits); - vpr_cm_info(map, "mapped to:"); - ddebug_sync_classbits(dcp, modnm); + v2pr_info(" found kp:%s =3D0x%lx", kp->name, *dcp->bits); + vpr_cm_info(map, " mapped to:"); + ddebug_sync_classbits(kp, modnm); } } =20 diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index ff9b879286d5..b3c6f90b9fe8 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Kernel module for testing dynamic_debug + * Kernel module to test/demonstrate dynamic_debug features, + * particularly classmaps and their support for subsystems like DRM. * * Authors: * Jim Cromie @@ -35,24 +36,8 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0= 600); =20 #define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << base) =20 -/* sysfs param wrapper, proto-API */ -#define DYNDBG_CLASSMAP_PARAM_(_model, _flags, _init) \ - static unsigned long bits_##_model =3D _init; \ - static struct ddebug_class_param _flags##_##_model =3D { \ - .bits =3D &bits_##_model, \ - .flags =3D #_flags, \ - .map =3D &map_##_model, \ - }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ - &_flags##_##_model, 0600) -#ifdef DEBUG -#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_mod= el, _flags, ~0) -#else -#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_mod= el, _flags, 0) -#endif - /* - * Demonstrate/test all 4 class-typed classmaps with a sys-param. + * Demonstrate/test both types of classmaps, each with a sys-param. * * Each is 3 part: client-enum decl, _DEFINE, _PARAM. * Declare them in blocks to show patterns of use (repetitions and @@ -64,7 +49,7 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 06= 00); * Modules with multiple CLASSMAPS must have enums with distinct * value-ranges, arranged below with explicit enum_sym =3D X inits. * - * Declare all 4 enums now, for different types + * Declare all enums now, for different types */ =20 /* numeric input, independent bits */ @@ -83,12 +68,15 @@ enum cat_disjoint_bits { /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; =20 -/* recapitulate DRM's parent(drm.ko) <-- _submod(drivers,helpers) */ +/* + * use/demonstrate multi-module-group classmaps, as for DRM + */ #if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) /* - * In single user, or parent / coordinator (drm.ko) modules, define - * classmaps on the client enums above, and then declares the PARAMS - * ref'g the classmaps. Each is exported. + * For module-groups of 1+, define classmaps with names (stringified + * enum-symbols) copied from above. 1-to-1 mapping is recommended. + * The classmap is exported, so that other modules in the group can + * link to it and control their prdbgs. */ DYNDBG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BITS, D2_CORE, @@ -107,19 +95,18 @@ DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LE= VEL_NUM, V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); =20 /* - * now add the sysfs-params + * for use-cases that want it, provide a sysfs-param to set the + * classes in the classmap. It is at this interface where the + * "v3>v2" property is applied to DD_CLASS_TYPE_LEVEL_NUM inputs. */ - -DYNDBG_CLASSMAP_PARAM(disjoint_bits, p); -DYNDBG_CLASSMAP_PARAM(level_num, p); +DYNDBG_CLASSMAP_PARAM(p_disjoint_bits, map_disjoint_bits, p); +DYNDBG_CLASSMAP_PARAM(p_level_num, map_level_num, p); =20 #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ - /* - * in submod/drm-drivers, use the classmaps defined in top/parent - * module above. + * the +1 members of a multi-module group refer to the classmap + * DEFINEd (and exported) above. */ - DYNDBG_CLASSMAP_USE(map_disjoint_bits); DYNDBG_CLASSMAP_USE(map_level_num); =20 @@ -180,5 +167,6 @@ static void __exit test_dynamic_debug_exit(void) module_init(test_dynamic_debug_init); module_exit(test_dynamic_debug_exit); =20 +MODULE_DESCRIPTION("test/demonstrate dynamic-debug features"); MODULE_AUTHOR("Jim Cromie "); MODULE_LICENSE("GPL"); diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submo= d.c index 9a893402ce1a..0d15f3ffe466 100644 --- a/lib/test_dynamic_debug_submod.c +++ b/lib/test_dynamic_debug_submod.c @@ -1,6 +1,9 @@ // SPDX-License-Identifier: GPL-2.0 /* - * Kernel module for testing dynamic_debug + * Kernel module to test/demonstrate dynamic_debug features, + * particularly classmaps and their support for subsystems, like DRM, + * which defines its drm_debug classmap in drm module, and uses it in + * helpers & drivers. * * Authors: * Jim Cromie @@ -8,3 +11,7 @@ =20 #define TEST_DYNAMIC_DEBUG_SUBMOD #include "test_dynamic_debug.c" + +MODULE_DESCRIPTION("test/demonstrate dynamic-debug subsystem support"); +MODULE_AUTHOR("Jim Cromie "); +MODULE_LICENSE("GPL"); --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 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 988371A3BDB; Tue, 16 Jul 2024 18:58:49 +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=1721156331; cv=none; b=PynkcuXwZntRABXiJUuQnKQ24wfKCruhdQoiJPszwwMPiHq0mcnbN6BHJa1ohsdxwDwRwQOaLKWEwkDk2HWuJVIyLjlCtFHOvLwR8q3fE6u5Kq2frvh7nsohc3RV2KNJBVHp2FMQRho+iEeaOyxokIW4b5MmmY6jBehsTfZbhVE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156331; c=relaxed/simple; bh=BW4pO7uYwWxn0ojsfglU05J91bpCDuylVWspoKc2hXA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GIBH1Dhvn5NYwPZLArBfQTTQVAHy7MaOlFFX3FpuUCKtaNx33vueXmQGCMi31TpWUfVK3nOAbNKDLaEbtX6pvrxNjlRy3bG9MyDAVqUfZNsWRE8+qbMcwHBEMhsU0UgEnemua6RB9Ps7JOPxJ2Oi+LE8PlzgPX5QCKkEvOSwT9s= 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=XU6+WbcH; 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="XU6+WbcH" Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-383dfcd8cdfso574975ab.1; Tue, 16 Jul 2024 11:58:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156328; x=1721761128; 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=gkFYDr1/VaUp9nR5GtDe+QedLaRcp6UcXGPB2Rd9f4k=; b=XU6+WbcHLcZt/bsYSFqoJTP/NqUS420SKFkbwPZEVHFikkF1g6vw8Bw08oHFWbXzuL xYoX/FmpnofxVWcaTAa9HgJKtPwBEZtYE2GZVawF2ycAP2kZCmdOt7V2iwLxO0HYdY5H YnK2aGm/I08MXlKFa3qr2wn2gm/4zYW/tWNogkPXu3Cf/WHo0/hKexJ9STe8m3oLocWg h6SsnlvOyT7UW4Qr99Px0ZxOx22XZ9vHw7sl4rgfYD1V1na7mb1TmsseXE4VqHdzZyYY 0RbTEX3ew9GBG/h01iIPhRHdsftyh6kXFpxLvNJzfzJopZ6Zgxn60aM0eEHPy4M8SVhe T+OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156328; x=1721761128; 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=gkFYDr1/VaUp9nR5GtDe+QedLaRcp6UcXGPB2Rd9f4k=; b=H3l7COfOjJmejZBWGHAR2vWC5ZK69nrEhM9ePwZI+ZUI7bs2UQnjo/YRGuukzUXNYg RmO/+KeN0AjIklbff2ODk76nnkGu43uNtXChE1EJ2JO8x0zRLH1aJkiMSLlCxG4WTOG+ 2nSLkNGS3rOh8gPq5UVqxMu7KvWoXs+XxpXY93XzDxM/CVpthKmwYdkh9aBO00p/Z5RW LMV9yZlBkFK0vyrZJpienbPoMp6GosSvQe6h2t3a65MEwDox7AzRJZPotJV1b9TSMYtU IcGC/HN4d3loNli8lPi3d5moJceUnwgayILTaxFO4IJn/sP1aQYkT+ke+x375b727gJi 446g== X-Forwarded-Encrypted: i=1; AJvYcCVJiSrRHnwOusyJXTbNEk1CYOGWcHAk2cVXpPwVJcpkxitAorVc1dvWTfx90IN2RKcjKHvmQy0U0Kvn37k6nHugYfKZ0erXZHdx X-Gm-Message-State: AOJu0Yz0CnrXwCJGuFpX77vXk03zYHBcJBMLtkpD+uVSpThLWPC92mwc 2TshSBzEQeC0hCSPyNIZr/b8vHtMDyXQW1C+qBeNbVz9SLMJ7bStHc4eo2ST X-Google-Smtp-Source: AGHT+IEDXU829hTYXjpQpLIXYUbB2ymJ2g2HpirLkcPY0d/I9d3Q+7hGqbny6/SZBNd7qQlx61Y+GQ== X-Received: by 2002:a05:6602:154a:b0:804:c529:8601 with SMTP id ca18e2360f4ac-816c2dfb0e5mr47126939f.3.1721156328275; Tue, 16 Jul 2024 11:58:48 -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.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:47 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 18/54] dyndbg-doc: add classmap info to howto Date: Tue, 16 Jul 2024 12:57:30 -0600 Message-ID: <20240716185806.1572048-19-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> 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" Describe the 3 API macros providing dynamic_debug's classmaps DYNDBG_CLASSMAP_DEFINE - create, exports a module's classmap DYNDBG_CLASSMAP_USE - refer to exported map DYNDBG_CLASSMAP_PARAM - bind control param to the classmap DYNDBG_CLASSMAP_PARAM_REF + use module's storage - __drm_debug cc: linux-doc@vger.kernel.org Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- v5 adjustments per Randy Dunlap v7 checkpatch fixes v8 more --- .../admin-guide/dynamic-debug-howto.rst | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 6a8ce5a34382..742eb4230c6e 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -225,7 +225,6 @@ the ``p`` flag has meaning, other flags are ignored. Note the regexp ``^[-+=3D][fslmpt_]+$`` matches a flags specification. To clear all flags at once, use ``=3D_`` or ``-fslmpt``. =20 - Debug messages during Boot Process =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 @@ -375,3 +374,65 @@ just a shortcut for ``print_hex_dump(KERN_DEBUG)``. For ``print_hex_dump_debug()``/``print_hex_dump_bytes()``, format string is its ``prefix_str`` argument, if it is constant string; or ``hexdump`` in case ``prefix_str`` is built dynamically. + +Dynamic Debug classmaps +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Dyndbg allows selection/grouping of *prdbg* callsites using structural +info: module, file, function, line. Classmaps allow authors to add +their own domain-oriented groupings using class-names. Classmaps are +exported, so they referencable from other modules. + + # enable classes individually + :#> ddcmd class DRM_UT_CORE +p + :#> ddcmd class DRM_UT_KMS +p + # or more selectively + :#> ddcmd class DRM_UT_CORE module drm +p + +The "class FOO" syntax protects class'd prdbgs from generic overwrite:: + + # IOW this doesn't wipe any DRM.debug settings + :#> ddcmd -p + +To support the DRM.debug parameter, DYNDBG_CLASSMAP_PARAM* updates all +classes in a classmap, mapping param-bits 0..N onto the classes: +DRM_UT_<*> for the DRM use-case. + +Dynamic Debug Classmap API +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D + +DYNDBG_CLASSMAP_DEFINE - modules use this to create classmaps, naming +each of the classes (stringified enum-symbols: "DRM_UT_<*>"), and +type, and mapping the class-names to consecutive _class_ids. + +By doing so, modules tell dyndbg that they have prdbgs with those +class_ids, and they authorize dyndbg to accept "class FOO" for the +module defining the classmap, and its contained classnames. + +DYNDBG_CLASSMAP_USE - drm drivers invoke this to ref the CLASSMAP that +drm DEFINEs. This shares the classmap definition, and authorizes +dyndbg to apply changes to the user module's class'd pr_debugs. It +also tells dyndbg how to initialize the user's prdbgs at modprobe, +based upon the current setting of the parent's controlling param. + +There are 2 types of classmaps: + + DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, like DRM.debug + DD_CLASS_TYPE_LEVEL_NUM: classes are relative, ordered (V3 > V2) + +DYNDBG_CLASSMAP_PARAM - modelled after module_param_cb, it refers to a +DEFINEd classmap, and associates it to the param's data-store. This +state is then applied to DEFINEr and USEr modules when they're modprobed. + +This interface also enforces the DD_CLASS_TYPE_LEVEL_NUM relation +amongst the contained classnames; all classes are independent in the +control parser itself. + +Modules or module-groups (drm & drivers) can define multiple +classmaps, as long as they share the limited 0..62 per-module-group +_class_id range, without overlap. + +``#define DEBUG`` will enable all pr_debugs in scope, including any +class'd ones. This won't be reflected in the PARAM readback value, +but the class'd pr_debug callsites can be forced off by toggling the +classmap-kparam all-on then all-off. --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 D5DF81A4F09; Tue, 16 Jul 2024 18:58:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156332; cv=none; b=bjfZswOfEObSz3zrBvh5E6tOLIsaEpKhfwhypLzEh5cje8fzUPAeFi/qfzgX3NebeA0IX6B5LASGtIMZv6+S7jV+aaZMKi1sOlqM76lRnDBeKazyTW0v+1lVyKGyp/wVpv2qHNuDsvG3jztUjPHDCReVzXaSNXeV1C3GYBufPDU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156332; c=relaxed/simple; bh=icwqeywsyrttsSDlGtVX51FXgI87DPMODzf+SUKMTJ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=a4ipBFLnNS7LmkHtyuHNmo6GVKBCYUm7s/XpRWySUkpUIS9KU1JYr0Vn0d2oX2Pg4G7QtrMg6YoIiAcCIQU41b4E2BmWEB7Jgm1JrmNHolK/MPnBpyDD8p+8TTmZPcfipqvKwUIAY6dYZi/IoWII5g2pgUkwog/MEg+iKNgJzds= 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=nFV/27yf; arc=none smtp.client-ip=209.85.166.54 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="nFV/27yf" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-80557928673so6037939f.2; Tue, 16 Jul 2024 11:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156329; x=1721761129; 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=xowWZ+ekpberKm26oOQ15iL0A2hZa3GfKHRI1+lg3PY=; b=nFV/27yfeH0gZXzkPd6YsHjAk1vXCb2xzQjzTRdPfozLdHZWeHh3oAG5iy+WexSY4+ MhncCPZzNGUy1+OQtnOq8sytubf7rrsdE/c64FD2I7sg7KqpylCL9fwWR8qe1z/WLED+ Dl1uA73DqVTO/6aYwNwqlD9pkF//LfiEgj89nwAeDI2ALDIB1OqXR4E/Q45WNb7LuUVa l+lU4KcvAWZr/zESDpgh/i/TYIR9OplQXOEf017E3m6NEEWESDsY5C1+C/pTXhrJ407+ cWV6d7mU5p2hJKyBqm66JDhAVDyLc5OhEDJh9+g72H0sDYDniNl5Ug3HkiNg5gisIIHC 5rUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156329; x=1721761129; 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=xowWZ+ekpberKm26oOQ15iL0A2hZa3GfKHRI1+lg3PY=; b=ARGf7KXN8glJknzzZc2MpPs0fuFx5nfnUzyCK6nvFg3ECp1heppCZF9QjEwkMdFBRB 1GVJSK+vCAtaaY+8n/I9nRPZM9C0qoGLhwVHSP+xUzZLQyPX2mSXtTSm9BMA9ki8Ff5Z oSA1zKbA1PaQgxUm7cCao3ez6zXshMRDsFCkaYgMbSSZGDF2FuugqBmqw/JRJXiN3zqp f9mfmtSeCIeLK3l1rE+KNEJu6/bYXgJloVzdcoCZFMNFC3FEV0Qsu06TvS4afqkX2fO1 dxV+n53I3/Th00UJywS/Tr2Hg6m9wNQGfgQcY+6N1uMSByh+muuh3P5gqngN7NH2D1wo PnIQ== X-Forwarded-Encrypted: i=1; AJvYcCW4rq4kXaFVVk9T/nqFznSB+l0h35j4fFhYlgJs+7cpow8IrRwF4MiKoNWiY06AL8FKmdE+QthzsMzNGVH+Bj6PbBx2iR7ZJIBm X-Gm-Message-State: AOJu0YwjzdjxKMprkuOdIsT/YzlKCvEpS5VPltVX0NUkmwp4LQhySiff gQjraCH6lvgH0MeFBqUeUhO68v828DZ6h+wkPZKXOfSQz0J1efAhh2JVQE5l X-Google-Smtp-Source: AGHT+IFbKxBJYJFRLsqlIc8X6rZ3ddxjJaHcru4WtjoSkVJW1iE/Ay/MRGOURVvx09A7Mej6GaYQYg== X-Received: by 2002:a05:6602:1513:b0:805:afed:ce90 with SMTP id ca18e2360f4ac-816c578dc7bmr35156939f.16.1721156329549; Tue, 16 Jul 2024 11:58:49 -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.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:49 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 19/54] dyndbg: treat comma as a token separator Date: Tue, 16 Jul 2024 12:57:31 -0600 Message-ID: <20240716185806.1572048-20-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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Treat comma as a token terminator, just like a space. This allows a user to avoid quoting hassles when spaces are otherwise needed: :#> modprobe drm dyndbg=3Dclass,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=3Dclass,DRM_UT_CORE,+p # todo: support multi-query here Given the many ways a boot-line +args can be assembled and then passed in/down/around shell based tools, this may allow side-stepping all sorts of quoting hassles thru those layers. existing query format: modprobe test_dynamic_debug dyndbg=3D"class D2_CORE +p" new format: modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+p Signed-off-by: Jim Cromie Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e9a95b0f3757..235d85765b63 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -290,6 +290,14 @@ static int ddebug_change(const struct ddebug_query *qu= ery, return nfound; } =20 +static char *skip_spaces_and_commas(const char *str) +{ + str =3D skip_spaces(str); + while (*str =3D=3D ',') + str =3D skip_spaces(++str); + return (char *)str; +} + /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e. without nested, @@ -303,8 +311,8 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) while (*buf) { char *end; =20 - /* Skip leading whitespace */ - buf =3D skip_spaces(buf); + /* Skip leading whitespace and comma */ + buf =3D skip_spaces_and_commas(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf =3D=3D '#') @@ -320,7 +328,7 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) return -EINVAL; /* unclosed quote */ } } else { - for (end =3D buf; *end && !isspace(*end); end++) + for (end =3D buf; *end && !isspace(*end) && *end !=3D ','; end++) ; if (end =3D=3D buf) { pr_err("parse err after word:%d=3D%s\n", nwords, @@ -592,7 +600,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) if (split) *split++ =3D '\0'; =20 - query =3D skip_spaces(query); + query =3D skip_spaces_and_commas(query); + if (!query || !*query || *query =3D=3D '#') continue; =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 E78291A4F1F; Tue, 16 Jul 2024 18:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156333; cv=none; b=KLFTCuhpSqC3fGQk9AUlbqkNDEC7Qq2Fgo09PfevkMs+mkJ/EoYBjRGcGDl3lsEVS+fxIKjUxt4hsx+Ci7tRUmfuBPRdGqaBExrh4frejIk5Yocseo84GedCOGagZKwWOD6kLD2/2l6bpEFfzecgtuc2MOm/vY97R7WMD09DN5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156333; c=relaxed/simple; bh=kNrEoJCOfsjI6sAferW1c8ANnU9jCPipaa5wQV97i2M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fqQ7sA09eO4391fM5krT/6QdGX7W+c+3Czw2Eda7pKs9Dmut99La8ad0E1tw5dp6rRlLZodwuBmMhExf6AsFjifgaYIHWWLu0X+nrduY4gcuSknSvk6nTEZL2+4f7D1X7nIPaH968/gJP6WK08JvQtlj7QcM8bTumGgbzs8K3lM= 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=iunp8IaY; arc=none smtp.client-ip=209.85.166.41 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="iunp8IaY" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-80767b21543so4322839f.3; Tue, 16 Jul 2024 11:58:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156331; x=1721761131; 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=86vugQ8piC6pzh4RgCq/qOTI8lQn1pJMR2FsXqHUdq8=; b=iunp8IaY6oqYIMWeLqM9SfKdkVtVT3LzqrmQTPGo8qvndVWwJcK9NOWEZbjzyqclUH ufZG8WNgTyC9aMJgYel7NkOkc8DMqKxgLx+T3sM7snuHIavWHQRSLvreTfTbfvobClUj sLjPTWdXImZSlGrVW5/SyII8Gh4pmKCepKtr+ZNCTNRy3rGBr8RrNBxIzfJpUUHN8g5b B6byRDmUW7fq6WVhhnM8qgKU+YdW8/FIAJFrnHPgi4JgsitQv+RCjqJYafoXXV6SMqTB oFEFnFh56PdzF3CEjWmGyg1etI43heeJoz3C0n+jkNWxPqhbYOM7VdIgec9F8/L665za +lmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156331; x=1721761131; 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=86vugQ8piC6pzh4RgCq/qOTI8lQn1pJMR2FsXqHUdq8=; b=DD+o2GEe6H/sTZIZZIHi6MT3wRP8MTtghMpOQ1/U/BcyTNNEmhVxTbiDK7ULpZHx0H BciL9mob8dG6yjCS8cF+lW+mrfe+DKU0HNZNEX0c9royjcqZFwqxG7b/ucEtwJYiBHZt 2n144UI8ea9/E5jZ7f6NIr+1byEOVZckO/YrJrCqSxIB7Xh3kbkZY4GA2NR8doA7RmzT 37QoromDJRMNFeGC1k4K1Zm6jZ8b3MDWJdBbBzVjzN6R8Yvy3iCjQqC1TACWyKS5kBm8 qr3htGgrRTFzKYEcdgpnQpGwhfQG24a06x1vdnB7YnlyZfMZjQ4gxN5SBM8kKjJo2mBk Hbcg== X-Forwarded-Encrypted: i=1; AJvYcCWXtIuk36mruEKOQDrS3weqNopi9G63vi1p1iywpNjaoN2Uz+zoUDucw5kWKCIbZWLY9g8cLHX3fma75AvyLomixlPSW2Eeqyc0 X-Gm-Message-State: AOJu0YwxHgy3m7I8x+ZeKK8pwcXgVKBZ5nlZwzVbUa4Lxjexi3HzPPaR cxSJP3rsrt1V2HQQybM1fcCCT+Ix9g24QgaHSDHIldpGzIim4Y3KF1kahUFT X-Google-Smtp-Source: AGHT+IGspWRAZ8xQXE2wAmaby0oqEdb49oPrtrp7fF/Yp/QyZ4mDqvRaV/q4mGSb06mvHiXzLyf7xw== X-Received: by 2002:a05:6602:2c08:b0:804:2216:4b23 with SMTP id ca18e2360f4ac-816c6519eacmr47580439f.17.1721156330718; Tue, 16 Jul 2024 11:58:50 -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.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:50 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 20/54] selftests-dyndbg: add comma_terminator_tests Date: Tue, 16 Jul 2024 12:57:32 -0600 Message-ID: <20240716185806.1572048-21-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> 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" New fn validates parsing and effect of queries using combinations of commas and spaces to delimit the tokens. It manipulates pr-debugs in builtin module/params, so might have deps I havent foreseen on odd configurations. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- .../selftests/dynamic_debug/dyndbg_selftest.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 1be70af26a38..b4ba293ab227 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -212,9 +212,23 @@ EOF ddcmd =3D_ } =20 +function comma_terminator_tests { + echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + # try combos of spaces & commas + check_match_ct '\[params\]' 4 -r + ddcmd module,params,=3D_ # commas as spaces + ddcmd module,params,+mpf # turn on module's pr-debugs + check_match_ct =3Dpmf 4 + ddcmd ,module ,, , params, -p + check_match_ct =3Dmf 4 + ddcmd " , module ,,, , params, -m" # + check_match_ct =3Df 4 + ddcmd =3D_ +} =20 tests_list=3D( basic_tests + comma_terminator_tests ) =20 # Run tests --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 439391A4F3D; Tue, 16 Jul 2024 18:58:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156334; cv=none; b=mwURlJXVcrEYQo7u2uByUcFxg/tuquQEziamjqTvq++Zcx7QTbKlgyzRFWYk6aj/KGUgOJAa9Oaa9S4jxHs1BP88uOTCmxQ00a3tnbxO7WiuyITXDnirh/QOTpmZtSbjgvOzXeG5jymRiscITWse05vCYP8+oSfCH8R+K5yppGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156334; c=relaxed/simple; bh=OoinRYwI1RLCkMaax/q6nzarMvJOHgCe+p9o/nhwCQA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=njJO9FMdlM29AkEnm8qLExELM59IE9MIjOQWNm7+JbwwFI6G2taCsyocCClY6R+DpLN4xtLZhl1liFKmvn8B/Zji1zjEaPPZGul7dcGzLONQuVeYa8pI9b4sX/B6w7MmJXfklnEDayRUm6/+9qyGOve+b2KQSQikn0g5v8C7CE0= 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=FdAJHsft; arc=none smtp.client-ip=209.85.166.42 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="FdAJHsft" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-8036ce66134so4803339f.3; Tue, 16 Jul 2024 11:58:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156332; x=1721761132; 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=VIvOBtUs6wwUYmdF+Bm1LKjLjq3TMDH2Ljy+h6N5XvY=; b=FdAJHsftAKFUKu1WpzM+7sCIOmOwVcLQ4pct8ZPqyfNl5xAYXH600Zw1IyPeoUc5oZ R5bYxBCn8pq9+clBiyTWZXeAovKEwakEKi7kfAsXmqepjwWErXdfIwptHhA/x9NC9A42 FYl+p2orepCl6gMp6RP/neyBRxJOoOvsxzETZ1Y8qqEFS6I/TwgztmmQdZcw5lf7LR21 Z/KH1wwzwxJGdUC4A2JkA9wqlkCZGoKSDEiffhMMaf+u7gEGGY8jMw5HPLLYUue2dp9l ZewaAGGhxdSFpstwOu9mW77V0/hTXgVhdi39syVA4R0zl6ZwAroabpwwPk+vWezsIUIu C+kA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156332; x=1721761132; 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=VIvOBtUs6wwUYmdF+Bm1LKjLjq3TMDH2Ljy+h6N5XvY=; b=gMhGrh7zNfzHivOu/5oQ7qPnqsmavTgJc92YWrWuegHEbD0l44s28O2BNJ3a+CZidx avQkSnCbh/B0+97Y722TANvcbwrT9s+4KE38mH5zTWu3LYQyOrmgNR7EDLs1ggZkInpR LGBsOUucuZVXTuVK6zP/Ud6H58xqyqom2GPgBORhHB1pV3Ji1UHsvhnslsq5t5PKmV+e bEczILO9iVsVIUeCKNL3D57zkYmsmNSm1nG2gv0A9XYxWviGr03S7NCcAPKiKdY84NUA rjxqQFy8+ufVbyvHgPPPVmLHYE3+DX4JInvY7rkWJruondVPLN5wEpxNKfFprNUYJ+Dc EoUA== X-Forwarded-Encrypted: i=1; AJvYcCWihKPsjlLGkCBQ7cZKaZu3hei1N78cbFsobR+6kgylAXTPBvwmvApSe1nLFhl1RT2EfSNZxQiZhx1UJ/kxejVmJ4RwZT25h/iT X-Gm-Message-State: AOJu0YyclJ12sXB3bmoroqR43EFQWob4Y5mOqvQqF8RAmoeiNYRtIUAH PbON8Kg9THBt4JC0Z3clvjTdU267bCHTmDVQOgyVJBZB1+ujSvxlr3fq1yYO X-Google-Smtp-Source: AGHT+IGIzqzPIEDRHp4d7Lzv1bJMSuo67sIN7LKuY04te4B9L6LczQkAf5ej+65dlhPKvxI7KIqPPQ== X-Received: by 2002:a05:6602:13d0:b0:806:6b24:ee2c with SMTP id ca18e2360f4ac-816c5883f11mr40915339f.16.1721156331976; Tue, 16 Jul 2024 11:58:51 -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.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:51 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 21/54] dyndbg: split multi-query strings with % Date: Tue, 16 Jul 2024 12:57:33 -0600 Message-ID: <20240716185806.1572048-22-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> 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" Since commit 85f7f6c0edb8 ("dynamic_debug: process multiple debug-queries on a line") Multi-query commands have been allowed: modprobe drm dyndbg=3D"class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=3D< [ 203.902703] dyndbg: query parse failed [ 203.902871] dyndbg: processed 2 queries, with 0 matches, 2 errs bash: echo: write error: Invalid argument The '%' splits the input into 2 queries, and both fail. Given the limited utility of matching against the working parts of a format string "foo: %d bar %s", nothing is actually lost here. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- lib/dynamic_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 235d85765b63..dcec7b3657bb 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -596,7 +596,7 @@ static int ddebug_exec_queries(char *query, const char = *modname) int i, errs =3D 0, exitcode =3D 0, rc, nfound =3D 0; =20 for (i =3D 0; query; query =3D split) { - split =3D strpbrk(query, ";\n"); + split =3D strpbrk(query, "%;\n"); if (split) *split++ =3D '\0'; =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 7340E1A6524; Tue, 16 Jul 2024 18:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156336; cv=none; b=HtCWaLKQHX4Gq2svXoshk5Wl9WaJC6kHczIQ8QncAPJcGy+VVRwsTCa2K9vUoOQxvpAntXdojDqcOzMEpQvFu1ytcGdMzWoYBRFmP+5unp8lsx10S24gBBQWKs/9n3V4SP0oYJZSv7NC9iPxzIQuZ9ETQo7gOPPGGpRCxzQ6+Ms= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156336; c=relaxed/simple; bh=XNa+7BsfG3j+8ZebdUR1b6sN3/Wty2dm0XB0JSgVOIM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ruX5WdNmmt86tcEmy4cgNaBttljxFZEQcmZJwb5HEWBny6vMFTojnhRK3w1JrMYJGk8JmRY2XGuUnsDQGXWNE4QnnYCaL4MmX5L0upYvSj0QMcWCgNK1GaUytkin+ZFLiBdldpDdNQ6GDVloPO2JbtqU9/fFSYuXYwtEvbitek4= 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=ep1/mZdm; arc=none smtp.client-ip=209.85.166.43 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="ep1/mZdm" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7f97e794f34so4334639f.3; Tue, 16 Jul 2024 11:58:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156333; x=1721761133; 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=aFcSRVkNrMoAaN9TOyRvWGwNcmbCrlZN4vnmf8E27Go=; b=ep1/mZdmc4oUCyQnztYm6hnSlxldv/WfNzPSM6XOE/REdeBG5CErMN22xHQqHflj4n okErHgJczoyrNZHGKZys0ZY1yShipDbi3wwRvA3gHsCdAAnfKhtk0mspKVbw1JvoxzPI Z+ThW5TzKnYN4HuZf+BQM4UQanCH0cl3u231O0ct/tnJNBePKOMN+TM0Tus86L/DRLp3 r1l14tWywu0J8Vg6K9QC+YGH684Uq7LVeiAT52gkZ+ihL+CTOUzOuvhZeBub7I2pC/o9 EQGWN18WrRhKjpsjhVJG2fWSqw1ZKh3f6C1EhuJ7ZCP6LZWCDZljpMugcHbtyuH1oSfm GY8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156333; x=1721761133; 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=aFcSRVkNrMoAaN9TOyRvWGwNcmbCrlZN4vnmf8E27Go=; b=dUVW71nfkr73EbqtFcZi2/oBbthFcvNDNfoISTNjRBd/qEloSMROQs6qpgCYKFRPKz 2uQRNFBTCJLEpZybv/47gizBh9cm7XuiSxxVp6nTgcAEjEC2lG4s6M8wM7x7fMGw8koS pQVd0CHESdrge8JCzioRterI6jhqGpXuoSKFAVAQSPxoWs60i3C0+gM9FLOpkyqDB/g3 ELGm3DjUTBWVsIPtBncVmifn3tmeVYLA5oy8ehhFvHcVTqipmAkMzowBn8naVpMZiL8m DPxvxa9sUsyvqsphRTm8G/8jemntQBa32UN6Sren71lZSE2ESrXpm6JZch36n9XyqcG/ tFtQ== X-Forwarded-Encrypted: i=1; AJvYcCUhZDgi4ybP9RlJCOnOGHADjtkOzJ2qH/SUbhrkTXk7aXRo4JZBVEHzDMYoQH1RGYi5RE+pPu0lYZWYmk3na3vFmN6OzbpeJnMo X-Gm-Message-State: AOJu0Yxw/679XNnPEz1QxvmDbgaG6XdXDzP/yBISVZWj9bnjqieOj/CA yxhZRqMDE28mHiUx1UXyE+Vgty48tvkQQguUcwhHdydcGpM3G4Ag8uRYEYz/ X-Google-Smtp-Source: AGHT+IFg9obh5N7uqV0H0s+HstduYRg6QMF6jZMCgR24AZccd/1wfKc7SoX9qV+9pLjIo/o6Xjceyg== X-Received: by 2002:a05:6602:2cc2:b0:7fc:89ed:c15d with SMTP id ca18e2360f4ac-816c4a1693emr26868439f.13.1721156333211; Tue, 16 Jul 2024 11:58:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:52 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 22/54] selftests-dyndbg: test_percent_splitting Date: Tue, 16 Jul 2024 12:57:34 -0600 Message-ID: <20240716185806.1572048-23-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> 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 does basic testing of classmaps using '%' separated multi-queries. It modprobes test_dynamic_debug with several classes enabled, and counts to verify that the expected sites show the enablement in the control file. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- .../dynamic_debug/dyndbg_selftest.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index b4ba293ab227..996e6fdcfb52 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -226,9 +226,30 @@ function comma_terminator_tests { ddcmd =3D_ } =20 + =20 +function test_percent_splitting { + echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on= % ${NC}" + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =3D_ + modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+p= t%class,D2_ATOMIC,+pm + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + check_match_ct test_dynamic_debug 23 -r + # add flags to those callsites + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + check_match_ct test_dynamic_debug 23 -r + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests comma_terminator_tests + test_percent_splitting ) =20 # Run tests --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.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 D8D981A08BA; Tue, 16 Jul 2024 18:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156337; cv=none; b=gato61mD9/sWpn+0ilyKiH1b85+j5KxIF96ifN3BqmNSmkNLVllL6QPfQsFMGrofoGZTpTXVL5QAeiNcEiqiPBlBXpusbaKJ+OSCLymZdHqocX+KlE+hfcqUHVxKwLkFF6tOYhfg9ygPikGTF6E6+xmMMsvRXfsACdIn+JsvkT0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156337; c=relaxed/simple; bh=K2Pt5C7+uMfFDUJDGtIwDknCNCrErFm8MnfSc8YM8c0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ELwk79WNEnfj6+BboyG4LnJmdAJvs29xRZdPJHysLaSIKx62XsZFIF6B/N2ZneISbNaVi36amp6UTsr9aOTf6WD2UKUVll6JoF3PI7NUwJeSzR98UYrtbk0SQ3/U8eiz5dqBTr0Dxpf5Jajr3p2Vuh9+KCXjavLQ81fjk8+lw0E= 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=feHEnsqV; arc=none smtp.client-ip=209.85.166.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="feHEnsqV" Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7f70a708f54so6553039f.3; Tue, 16 Jul 2024 11:58:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156335; x=1721761135; 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=mXTp2HWUUrTrRl4eZ7svqhTsXgDwW8WuleRWg/xTtcY=; b=feHEnsqVk9VfNpf76r6EHMyHqLPlzH3cjQOgbgsRx9Nt40Owjl9KQ4xoOdQwICHWEQ bGbn4Fd/k96xRChq/sVLw3LRvLvUfUMhUJvUD/FObW2zgd04nM1Rcm7NgD2l+B4Sys9t HXgl9ZTEeGpFWC9XvQPCZZgOrLtMjbFBmxl9QIKDcuzJQe6tf8TGs8VlY4/oGBlo7CSI 3irIrrRGmYpf5PySFc6A/0T6vAnBKRuz8KyoiHpCJjrlRZBqFGFaU1D6eXOmgvhtK0W0 QJDy+5rA7xcAUaZH4mzhj0VNQU1mNBgngtcR5JrTTqUwR+7w/xTB/kcMEmLUydN9ggRX 98QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156335; x=1721761135; 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=mXTp2HWUUrTrRl4eZ7svqhTsXgDwW8WuleRWg/xTtcY=; b=eP1LZKk0S+aQqv70nldoNoHSvLYrNzDzIKw4eAgMsP0VX1IEVS3LsZxD3u4wIu7sLZ NygttvkEWgluO9FzUpkyroW0xU2o+cpCCLQ4TNAtuoNaskNA02wfJQ85DV8zqOVSByYW mLwBbp18bIRt2ei1Zebnvhhf+S+wUzR0YXFWTjq3nlbxBahQtg+xqGvxdUwGyFi5o61d 9am2+Rb6ZuHbtVUL+9SWWD1phZMRvMRRw7rJXtk/RqJLH7JZENOVFJYR+Rpcd5nSW9QO u81kSNN/5wD9yocDx9H9TpoGB6flqo5rbsrsOtTeLXQLprpicK0UsRC8NaUeGr3A+EgY qUbg== X-Forwarded-Encrypted: i=1; AJvYcCWibw2EgStbPDT5qRtUdRNtFIHnGAwnyk/yt/4VPO6MXlpPzOz2mHs45TZBOFHx0AOykTVLjwdewKPLVcPjjoH1PfRch7fOooUO X-Gm-Message-State: AOJu0Yxuc9l/+rbmEUDr+d0yz7HPBUd46V+p0EhUGHOUR5GuvkDYXQsF qi5rIxcPHxPLF1ixy1u3UZit4IHQbc30JIcxynhYOaXuQh2NdFlLw4e/UIdl X-Google-Smtp-Source: AGHT+IH2C/cO4EXdioXS3mRKkhPmm4/Juz5I1U0b++x+rWSnGrySgsdsPc6Js5tCOzBXgxSZ2aDSeA== X-Received: by 2002:a05:6602:3ce:b0:7fb:790c:a317 with SMTP id ca18e2360f4ac-816c32c9ademr47925339f.6.1721156334626; Tue, 16 Jul 2024 11:58:54 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:54 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 23/54] docs/dyndbg: explain new delimiters: comma, percent Date: Tue, 16 Jul 2024 12:57:35 -0600 Message-ID: <20240716185806.1572048-24-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> 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" Add mention of comma and percent delimiters into the respective paragraphs describing their equivalents: space and newline. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- .../admin-guide/dynamic-debug-howto.rst | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 742eb4230c6e..7b570f29ae98 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -73,16 +73,18 @@ Command Language Reference =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 At the basic lexical level, a command is a sequence of words separated -by spaces or tabs. So these are all equivalent:: +by spaces, tabs, or commas. So these are all equivalent:: =20 :#> ddcmd file svcsock.c line 1603 +p :#> ddcmd "file svcsock.c line 1603 +p" :#> ddcmd ' file svcsock.c line 1603 +p ' + :#> ddcmd file,svcsock.c,line,1603,+p =20 -Command submissions are bounded by a write() system call. -Multiple commands can be written together, separated by ``;`` or ``\n``:: +Command submissions are bounded by a write() system call. Multiple +commands can be written together, separated by ``%``, ``;`` or ``\n``:: =20 - :#> ddcmd "func pnpacpi_get_resources +p; func pnp_assign_mem +p" + :#> ddcmd func foo +p % func bar +p + :#> ddcmd func foo +p \; func bar +p :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p @@ -104,7 +106,6 @@ The match-spec's select *prdbgs* from the catalog, upon= which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". =20 - A match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are::: @@ -128,7 +129,6 @@ keywords are::: ``line-range`` cannot contain space, e.g. "1-30" is valid range but "1 - 30" is not. =20 - The meanings of each keyword are: =20 func @@ -153,9 +153,11 @@ module The given string is compared against the module name of each callsite. The module name is the string as seen in ``lsmod``, i.e. without the directory or the ``.ko`` - suffix and with ``-`` changed to ``_``. Examples:: + suffix and with ``-`` changed to ``_``. + + Examples:: =20 - module sunrpc + module,sunrpc # with ',' as token separator module nfsd module drm* # both drm, drm_kms_helper =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 0A6851A708F; Tue, 16 Jul 2024 18:58:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156338; cv=none; b=uU1EwcA4QmhzxbuYKos7W9Z7sWjC9YNu6Cl1O72cLTNwpZGMJYgsTc/d/SRKtZWUV2ynXD973szOw1UrhMhOfcTJywHw1ZIJxn27sYwzz+FKEj+9GWAtNqvT+dupCxblbi9lQOrxml2/MHe+5CmCSb7Vjkfg4sxPMP4c0GW4v0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156338; c=relaxed/simple; bh=kN/R7Fl1F1fcLv8VsLR2kYVGn+R+bGjHHORasn7sytk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=prEnhQJ2kqVVk+TmHz8qtLc9Zh7HzLaGTEclDHPna7X1TMaDefHH4q+GNdqVcPCFmCOJ1OcG70Swy/Kmsj52XvM9PQI11QKoDSzIrjdi7T9gMLNBjXlRZnqWzKP57NkbLg2WF8MPTM/vNgm9w2LB+lkfrNyfXTL1jS96xY/Whbo= 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=DgT9+PS3; arc=none smtp.client-ip=209.85.166.54 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="DgT9+PS3" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7f70a708f8aso5855339f.2; Tue, 16 Jul 2024 11:58:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156336; x=1721761136; 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=gJdYoevwZB2aGfv474+weXhid0sQKo8sv3F+UqQdL9E=; b=DgT9+PS3sdVkmNDA1n9HtBvhTCqaguqQczjnD9H/KrumX/lSmm+6/2GseHVW1B+oUV tykf+iM66y0W9fqLH2hGrz1OhrepiwY9vDy7mmFY8ZW4Sn7EzyeB7k37ub0Pt0q6w1C5 +Ifffx9Qovad5RdLFprgoaSNffv1JLV6hdH86VymU/7p05cO4OhuDkHzxvHPSudSjMkk GGUFSU4r1AabX/wBaNb8Gxtyct/p+rI0BPdU2uZf1M/9sDmqLNLjDxe2UvUb+WT1rH3X MqZzbK3mBMWXC0ye9vcfhOLbljUbtwfQnJvYc82RWdN8TpXwAXUjJJwhun9VUPi5JkJE 3Jww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156336; x=1721761136; 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=gJdYoevwZB2aGfv474+weXhid0sQKo8sv3F+UqQdL9E=; b=OC8mwxSnwDS+bSHc/rxc7NC0vMkkqZLpoHEyJReo+1PPrkTi+/4ZbaP63TCP2bN2TO 1DHPS4zproYcXDmwU8hFSG5CpjKioEBKCT8FOay798qAoXzlYXzB0T3DMOvpmeNgLCBE HFz35RSg6TLmRTqPQOfLemlx49plF1enOfvaa9dlvXs3VuvQ4LcF6DtV8jb6YLarz8hd 0tLaCzzgkBNWKdsEDN9u0dvzZ0lEPy8PkBmoACi3Lv5C1aDbqW7d0RedpBr2DHBzpk4C jBDF0xezo+8wGaKopt82ARMMkkCAd2q6bBQASHAX/iShidrhKLXoHiSzekYIqtpvPb18 wpGA== X-Forwarded-Encrypted: i=1; AJvYcCVKJg1HqJsbwIUFd+bOGblTnAZUVWX5BzeTL/XvpU/PX2YZ4VY7aX0A0rKOybtSRAf2vx4lc6J1oft3wJJdi4fwit0XQubn2f/7 X-Gm-Message-State: AOJu0Yxlc9Fg2Pg5NC7IfGFdxt0RKp0LrVSYGROv44ODDPUo1I+p6ZDo 7yhQd4QUC1zkDNkrii6irmBkuk1NmxqdJfFMLPCGhGDFcDBCOdmUCCh5ocMH X-Google-Smtp-Source: AGHT+IEznmXe0kK0CoynYcYtF+WgxWhQ96VOhaEo0TmnyPyzHHCMylbYsvdKD2W05mtvEUB7RgFdSA== X-Received: by 2002:a05:6602:2b91:b0:807:82c2:5247 with SMTP id ca18e2360f4ac-816c34e59b4mr35528239f.6.1721156335827; Tue, 16 Jul 2024 11:58:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:55 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 24/54] selftests-dyndbg: add test_mod_submod Date: Tue, 16 Jul 2024 12:57:36 -0600 Message-ID: <20240716185806.1572048-25-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> 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 Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- .../dynamic_debug/dyndbg_selftest.sh | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 996e6fdcfb52..fccd2012b548 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -246,10 +246,77 @@ 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 -v + check_match_ct =3Dplt 1 -v + check_match_ct =3Dpml 1 -v + # submod changed too + check_match_ct =3Dmf 1 -v + check_match_ct =3Dlt 1 -v + check_match_ct =3Dml 1 -v + + # 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 -v + 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 -v + 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 -v + + # 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 -v + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =3Dp 14 -v +} + 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.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) (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 434441A83AB; Tue, 16 Jul 2024 18:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156339; cv=none; b=jKhHcXhzSkRQXPvHOrwJhHc8gZ/zA88CgIkEj6sv/YX/xCEI/nAtNj6veZ5tJ01dIM3TPZY+OigRAEun8tU+HmKF/G0Wv2t7JkWWVQDMz2vYDogL8jTra053+8J8m2UqOjJRIrVrViiDCAE+lP4AHDJHTWuinMaFaVHohaIvjnA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156339; c=relaxed/simple; bh=xz4ayeIEfnsbKz6byqcq4Sdf23ac6igLKRe8POg37eI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IrQGsBIdB2Hbx8SI4ABjaaQs2mzF5jIRFvhncEfoqapE6l91dnIV/EhE5J63cU7OnXqHhgg7NHsdPf+N95ioflkTNQeLiUXzr0i5oB+vifp0aAcx26AXv5HkZzCWKZ6NNVa+Bnrng7SQ6NhhEIyBKHFMsYzXlL9SxODf4xLJ6zc= 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=et64Y234; arc=none smtp.client-ip=209.85.166.174 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="et64Y234" Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-3815aaa2ab9so247555ab.0; Tue, 16 Jul 2024 11:58:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156337; x=1721761137; 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=c/0f+WJi9XEdvmbVJJgJH3wGY/BCuH90DF46SNcsdjc=; b=et64Y234II1Rvc45SmHez7T8XOkvcnzsNtvXDD0wGbjxLG5VANscOuyTmX0qyRUOBg /dOntx2yR0cwvIDaEu0lG8pdUCDPFgk7gGKm3aK22nONfyNp/pR560lFmR1OX8zl3qiV Y5dBmB65pAjhot8TeL/507L1QXm+NDbvMPDLMolbkdUIdkkFbyUsre2ak9j4tfYHUI1n 5WQpdUM/JwIaYrfryEiA5XgXXiIFJwBDxXLNo1iacvT55to7mFJOoh+4KlLBTtD/9CZN Sb6dKcSy+TKG8+3vceq3+8VorhCyzO6BR8jbjufGpFBPlnRQV8x98v+6SDpQ4k15K1Fm a4Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156337; x=1721761137; 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=c/0f+WJi9XEdvmbVJJgJH3wGY/BCuH90DF46SNcsdjc=; b=l84UR8Tn7m4vhiRaWrDjtM1ymJCtIRZsSk8iLwIbL31XdacBGQ977KpWGzn/0jxEPa 1UBfKHEevUNTgui9kFzyBg5+tC4PbaA08nlboPmg/awpcNw70IkgzpQbfo9HkljOTWmc vb1PwlgpT5Z77bPqN5fMkQ0dBmFW/+yw13bLt1YNl6nBK3+Wb3G2bZ+YDxWkzaxkkBbS SpwMJP/Trv1Ko8KyHI+DOLTSlRalj1sOipP54MZmBMezsgfkJ6ome6EVRxWodSdPOJdM oYhWRn+vP582t6S/Tjb/TnQL4HmJieaiNmPVSZ7ySlkaEh2EZw7ZQ/uKDIGJCZTW1tA2 +EMw== X-Forwarded-Encrypted: i=1; AJvYcCXGAwKfgddHdKQqswzTPP7XPoPUKdBc1Y1RHl09d6wQYuOIkCAzDLNJfOaCsjmosDHh8W4rJNvd8eY888Agw+PR8K2rz52rJrZ5 X-Gm-Message-State: AOJu0YwZRoxy1l1PbfY+I6+GG332bDdP+i/XE6+s5LzZXLbmaoar5kU+ AiOFaqoZNffzgKG695KV8vrE4N3LHtXiq4RZmtnZfrmsp+9PMyJkbfwUvXp4 X-Google-Smtp-Source: AGHT+IEi4sdjxzQ0oudUt7GMdorsoDaH0Xjh0/KlGssDHL3rDixHQ7EbnOzUaj0Aj/gbK9+Ua+nMLA== X-Received: by 2002:a05:6e02:1a04:b0:380:92fd:c4fc with SMTP id e9e14a558f8ab-3950f2854b3mr2319965ab.14.1721156337088; Tue, 16 Jul 2024 11:58:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:56 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 25/54] dyndbg-doc: explain flags parse 1st Date: Tue, 16 Jul 2024 12:57:37 -0600 Message-ID: <20240716185806.1572048-26-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> 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" When writing queries to >control, flags are parsed 1st, since they are the only required field. So if the flags draw an error, then keyword errors aren't reported. This can be mildly confusing/annoying, so explain it instead. This note could be moved up to just after the grammar id's the flags, and before the match-spec is detailed. Opinions ? Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 7b570f29ae98..ccf3704f2143 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -106,6 +106,16 @@ The match-spec's select *prdbgs* from the catalog, upo= n which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". =20 +Note: because the match-spec can be empty, the flags are checked 1st, +then the pairs of keyword values. Flag errs will hide keyword errs: + + bash-5.2# ddcmd mod bar +foo + dyndbg: read 13 bytes from userspace + dyndbg: query 0: "mod bar +foo" mod:* + dyndbg: unknown flag 'o' + dyndbg: flags parse failed + dyndbg: processed 1 queries, with 0 matches, 1 errs + A match specification is a keyword, which selects the attribute of the callsite to be compared, and a value to compare against. Possible keywords are::: --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (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 92A621A83C6; Tue, 16 Jul 2024 18:58:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156341; cv=none; b=KUS/RM/E9KXrJzPJY++KCyuLVxSE6UWzenK1Bp7TRP7DVTXdBw3QVRTovIfzlKQWjlCU/9xw8luXA46L/5NJ+1s1eqwaTNptAD0eUyr1LbG4IhZWEP2J6tIwE2I7aXFTllZbBtA6hI8mRx8GxOLn+EA8S1Pyp4th/ZU/GMeDkn8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156341; c=relaxed/simple; bh=YM09ov2aL5TsiapWtesYtdrCJOGiLL44YOpci9XSkuU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p1et7TmzMWeqh4K74M921n+jRF+RWIGdOuXuRFafBsqhF6G1WIbTZR/Z7DS7ngkCx2WUvz26wpFHD/5MclQ8U7YM+F0XCiWrpUkuu09je+9ZTTC+4CsIjuNR+0RL/lI1/kelCwAycsUlC39DTue2NjzKT2VDCtSyk/BgaotDNFc= 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=VYbxfpeU; arc=none smtp.client-ip=209.85.166.50 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="VYbxfpeU" Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7fd3dbc01deso6030539f.0; Tue, 16 Jul 2024 11:58:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156338; x=1721761138; 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=i/7VuWci/fAdciTJrLUpogyH7arPQhCiQPPhJCx3EJc=; b=VYbxfpeUpQ3fkcJXzhbR2NHHLsPdn5yEwDuNVrGTJtOR4KiiecQBr6Ym2FL3GS97cg s9XlNoVNBqhyUEBYhnXE1gLGdhsbTLvvd/uLzIE4yZoqwxEE6cEmyEF0XvHCSojWd45u bcKe9GyZddh2hyN8wsP6tWykdiaRZlDtUVtqqzC69rk4mi3XWWJKCWOxTXvCKnPj36pC q3oeU9CKt2RpXmu3Kr56oj5zVryJGbNRRQ8yswzvrcaZAMQMhvBMtejKyttpogrsOEg/ F8nes2q6MWJRPkilQIByKaE/CdkVS2tTA3EXrP2XEgPrzO/fB0Wzj6GFitRfZkN4tZvj 6Vcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156338; x=1721761138; 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=i/7VuWci/fAdciTJrLUpogyH7arPQhCiQPPhJCx3EJc=; b=JUjPc7KZsCj0QqSVz2LC+gbWoNTfWJOvIAjYoLR++gIbTJ+bjr+fEqg4IMLjcZhJJa 8HiFxu2YT38cO87YdbNF5UnhtwoAumkuqqFjkynndUwohfz4wEDKMeASes3n3dMkKjj3 KsGeJVfHGfOUvKm8RcwHhThNvcoMPpBarjcRborgA5uQ1e4E5Ihq8svx3F5mpVlhHY8h EM2ccICoGg5nRAXtVdv/T4hFhOSB7/o2xAuMRXMWJK9hI8ejKfru3rlDI2WVD/RtGfjV VVXOWgrAf4hZ2tLNLPu+5a/WZiD+BOJvd+WMuPLgNuGdB7eP1up5zEjKfv5JDBpEN3mN qPQA== X-Forwarded-Encrypted: i=1; AJvYcCU7B3/fQ4vsODms/W+/zowJReUtDnd3/7HYfOO4bvcGTHn3j//srVGv4KXp8hmoOWj5ZcDDVld9Eg+BYWnCh9/NecrHqfEMP9g4 X-Gm-Message-State: AOJu0Yy+em0Vk7yX2WBa8nmiGw+IDbCh4mLFJAFcPTqUqE56+ipEKxVO wbvow1dzPiN+bElTYtefJ3KqRR58PfSsnjovRmq3/euSo4HTOXlD48ZsYo4n X-Google-Smtp-Source: AGHT+IHzpE9SbYwkG5siTLQEKUl8Xu5QeKQLe1T8MPzVIFBNpAur8fUdPhqKhgFYHtZREDVfwyEkOA== X-Received: by 2002:a05:6602:484:b0:809:83e3:a35c with SMTP id ca18e2360f4ac-816c33f0308mr46697739f.7.1721156338284; Tue, 16 Jul 2024 11:58:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:58:57 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 26/54] dyndbg: change __dynamic_func_call_cls* macros into expressions Date: Tue, 16 Jul 2024 12:57:38 -0600 Message-ID: <20240716185806.1572048-27-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> 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" The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy because the invoked macro has a do-while-0 wrapper. if (cond && (drm_dbg("expr-form"),1)) { ... do some more stuff } Fix it by changing __dynamic_func_call_cls{,_no_desc} macros into expressions, by replacing the do-while-0s with a ({ }) wrapper. In C, all legal expressions are also legal statements, as converted by the trailing semi-colon in a statement-style macro invocation: drm_dbg("statement form"); Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- include/linux/dynamic_debug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 4a9b9cd53eb7..c958085e0df4 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -287,20 +287,20 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * (|_cls): adds in _DPRINT_CLASS_DFLT as needed * (|_no_desc): former gets callsite descriptor as 1st arg (for prdbgs) */ -#define __dynamic_func_call_cls(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(&id, ##__VA_ARGS__); \ -} while (0) +}) #define __dynamic_func_call(id, fmt, func, ...) \ __dynamic_func_call_cls(id, _DPRINTK_CLASS_DFLT, fmt, \ func, ##__VA_ARGS__) =20 -#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(__VA_ARGS__); \ -} while (0) +}) #define __dynamic_func_call_no_desc(id, fmt, func, ...) \ __dynamic_func_call_cls_no_desc(id, _DPRINTK_CLASS_DFLT, \ fmt, func, ##__VA_ARGS__) --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 BE5691A83DF; Tue, 16 Jul 2024 18:59:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156342; cv=none; b=HN5D1OjXXXaTJqHFrXqjpalW2xfHFT8uBkG1y+qCeceNK5XczPeyZmisDy7zA9/59zp0dKNvLm3dxrZ9gUAwyka3X/T41AftTo87T8LhFJVDjVLM1A1r6YWV6RHMtOF6NHR+Fbv6KEHK/OIkHLhmky8jlpksleLPZfW4vory5z8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156342; c=relaxed/simple; bh=ruM/z33ybyG4BT7EGafatX+PVpfZYy41EY6pGKapSCM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VEgrog49JwrbCboIrfmWcANisou93TsFGNt+FIw4ikLJ1+Sjf2K+MphLAFP11taCWZxFQKLe+PFiDVPD9KMib+fVUuobIW0enViFo78wTLZurL5CWMM/L9ja4RWr4gwD6ty9IxP+3vkYVbz/z5wb977n/DRhWlTbdAd8CDeJbMg= 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=HBPrnUuG; arc=none smtp.client-ip=209.85.166.49 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="HBPrnUuG" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-816d9285ebdso1242939f.0; 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=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=Gt92vv+l+QrwNWjlUzQRBip24zXOkaNnGwWlphVTLFQ=; b=HBPrnUuGTdKX/tKLv4f7UzJukIXOnJBS+Y0uz55iRdgNlvIyyQtgX3MqtsbKLekoEm Tjh3x/0nSdwWOTaDwKx2YiW1xbWRKgtDvTNQ+WI5PqWQ/jCY/O67Lne1Dj/GT60RKN4N ujekN7BpOhPThQAFBE9MEwtXqk4U2+c7DnUsbMHGYabOJTq0hGDHmpalsrKeoYBbgNQq o+o49TGOHYbAQDhAwuy7NrKM/8ONFbld87YYjwsToYVzee+b66i/Xwoo5/UN2M8QjCyT nI9+IjSb5iMzW/8e7LGAx5wW5LnSbSmjgKbBvq3w7SWd6bbcAV1o3/oDrIxgk4M7WeJM glbA== 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=cGAM3mIpiRnefA3O7LYMjv4LZ2XYSla0Yjq+X5XbUPm+JWKOtRxm2FkCshZ6mvRio7 X/aQcAWlOZs7INx953u8kdsFkz34EvqY/NWb92/+O0YlSDA/CdWM5mDm/02bkBGVlDnl VD55wvJBj4PJflV+xwBkwCS/Cb7pQKZKOO7+sfen5OANg9opFQe2g0skoSwACT35v0k0 jPcLJYqrU66VMRImwXzqR5Rxi6FiwmRJDD47HrNPPWPu3FEzKXfg6sOL/vg80bAuAc/w FTe6gnEZbahyaz99BORp6w3+ssWJyvheFFpNatZEge6NJNBWSZqxdjypnipUu0SVzTOC Tjuw== X-Forwarded-Encrypted: i=1; AJvYcCUNWBxDGqeEXVkJ7FlWJhu96u+LGZSN23MnEQ8VaipH8P1udMjJb24lLxalL1EruUUjyNr/BOtdMIWTL1R2Z3jjnbeO8UeCvN6M X-Gm-Message-State: AOJu0Yw0bpxHf6qSpP62o6zI0HKqE+XekI1Zen6GmTuCK46xdbtKTbI+ /XlkANlYj9fKF96ItLmubeQn53vXAgZnZ7yy5WyNFIpOpaZCDnbJMrftix7p 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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie 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> 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" 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=3Dy: 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=3Dy 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=3Dm 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=3Dm && CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm test_mod_submod() recaps the bug found in DRM-CI where drivers werent enabled by drm.debug=3D. 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=3Dy 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 Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- .../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/too= ls/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=3D"\033[0;36m" NC=3D"\033[0;0m" error_msg=3D"" =20 +[ -e /proc/dynamic_debug/control ] || { + echo -e "${RED}: this test requires CONFIG_DYNAMIC_DEBUG=3Dy ${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=3D".config" +if [ -f "$KCONFIG_CONFIG" ]; then + echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG" + grep -q "CONFIG_DYNAMIC_DEBUG=3Dy" $KCONFIG_CONFIG ; LACK_DD_BUILTIN= =3D$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG=3Dm" $KCONFIG_CONFIG ; LACK_TMOD=3D= $? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm" $KCONFIG_CONFIG ; LACK_= TMOD_SUBMOD=3D$? + 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=3D0 + LACK_TMOD=3D0 + LACK_TMOD_SUBMOD=3D0 +fi + function vx () { echo $1 > /sys/module/dynamic_debug/parameters/verbose } @@ -192,6 +216,10 @@ function check_err_msg() { =20 function basic_tests { echo -e "${GREEN}# BASIC_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi ddcmd =3D_ # zero everything (except class'd sites) check_match_ct =3Dp 0 # there are several main's :-/ @@ -214,6 +242,10 @@ EOF =20 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,=3D_ # commas as spaces @@ -226,9 +258,12 @@ function comma_terminator_tests { ddcmd =3D_ } =20 - =20 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 =3D_ @@ -248,6 +283,14 @@ function test_percent_splitting { =20 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 =3D_ --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) (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 69DB01A9085; Tue, 16 Jul 2024 18:59:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156343; cv=none; b=nnDTOFZeOlDRHs5IZZZDteDSHqRp4UHWxgMbN6F7C26Vst6CVSXmndUBSi1OGiducPfhfS2vAf1wenQNew6Z7KoJ7dUt5M371TzpBbxH/C4DfcNCpMr6z2eRd1HqfhlKWGtPvOB/lL1ZBUPOVvKIzqySlBPVxP20t8y4t+0gLb0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156343; c=relaxed/simple; bh=hyHbJk6o2snR4KrsEWVQDXEtI57f/QBUmVmXmJ8RFGc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HyLtj2MmumqLW1YWbVNHPFJGCtoP0xuwki6ERzurcCBf683fXpF1lTL1TOIADwvmUmymqUVlHlPRb8e53CmHN71nhgHrBBdmnGHGQQikXZOSYlHfqCrPBzYUKKPicw9B3iMXahMADG+7PA3NEBeNo++Tn2A3zq6hgy0PcFA818s= 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=AhA6KHh7; arc=none smtp.client-ip=209.85.166.50 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="AhA6KHh7" Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7f684af6af1so6704439f.2; Tue, 16 Jul 2024 11:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156341; x=1721761141; 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=FUz2fuyNm0/W+cer/IlT8tdUcSLjwR0swYFnYz1+7bA=; b=AhA6KHh7Dk/PC3xV4LMdVmJQhRdCc7Zt+OhmM51BC2yWMEYuCzJNcu7EsSqfWNI5WH GNK62rYakSjqJu7INr7qAtmP1+wHOcoWFsC1+whGsYvA3PYSgTU8+bUu9N/UcHb0g7kO dLjtDFK4QHzWeI9BHojWOiFw92dsHk8ODG+3XSFMOG7yRVyWWs7jBakrclEkyBTSQLgT Kcrk6MAFcA1/+Dz/U1q55d9AgBjlaSUgQKfLlnRmniwZagiKaLCNenL3LpEUZGp/WFIO RKwNgI9ZHvZoy8jyvjl/CF5tvpfc38+KdtMl5EjF2IQOknsC7pvtEERjpEB9o96WwhRs 1DtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156341; x=1721761141; 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=FUz2fuyNm0/W+cer/IlT8tdUcSLjwR0swYFnYz1+7bA=; b=ZzjAvPCqo+vGUCIHwNFvAJkFg0rIaPeCNzwmojhqmmYZbmb/EX4UKtSLwvWFrPYD2Z fQSno/KavGT8tKay2Q56ncN2RLvP0WH18IUjZnnrPZrgra5Oy8WwmnYQuQmUr3mm1CfS TLTU/eKsjDUvA4Z8E+IPN3o4DKfQlgZiIcdBEl+OVSC5gC/B6w2alAOGqiXtkI2qaQIH 5PdoMMIUJSJb01lWa0dLW9fJzopV+Hf1UhIm9J1ajiHTUa127ehfkuv6Ef7y29tB0SUv CpuQKBLKdAwlsJsQdnTds/YIChFuBkdoxexAQHLqVlZSx4oQ/hiuF8v8FuwBjXf4XHOk 8IFg== X-Forwarded-Encrypted: i=1; AJvYcCUgfeakGxVWD63kH0cFiuro8kYYpzDSABix1izeqwjhHrJYW8ADTylzZO9Du+soKLVSdFIVcpMy+DPnF7XAc0ulGxxEh4nzmktm X-Gm-Message-State: AOJu0YwubsH4bmKd/ejb4qSayfKYG1SKeXrzxAAD4xnahc6IV1NfwrRC aagJp45HvG3o9qUmrhZW9GR/kQvrRewf17+yZrJlPwvxijpgWC7EC2ASEOgN X-Google-Smtp-Source: AGHT+IF4Unf7gwTLxZgnHey2dXasTlyxLHDEt1SBVRbfc0oATB2X5dpSsvnnnOAQb/XIyfd8CFvaag== X-Received: by 2002:a05:6602:3c6:b0:7f6:1cd3:9659 with SMTP id ca18e2360f4ac-816c4c041ecmr47881339f.6.1721156341182; Tue, 16 Jul 2024 11:59:01 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:00 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 28/54] dyndbg-selftest: reduce default verbosity Date: Tue, 16 Jul 2024 12:57:40 -0600 Message-ID: <20240716185806.1572048-29-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> 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" Remove the '-v' arg from the tests in test_mod_submod(). Setting V=3D1 in the environment turns it back on, for all tests. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- .../dynamic_debug/dyndbg_selftest.sh | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index d09ef26b2308..b3d7155cb45c 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -168,7 +168,6 @@ function error_log_ref { } =20 function ifrmmod { - lsmod | grep $1 2>&1>/dev/null || echo $1 not there lsmod | grep $1 2>&1>/dev/null && rmmod $1 } =20 @@ -316,13 +315,13 @@ function test_mod_submod { =20 # 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 -v - check_match_ct =3Dplt 1 -v - check_match_ct =3Dpml 1 -v + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 # submod changed too - check_match_ct =3Dmf 1 -v - check_match_ct =3Dlt 1 -v - check_match_ct =3Dml 1 -v + check_match_ct =3Dmf 1 + check_match_ct =3Dlt 1 + check_match_ct =3Dml 1 =20 # now work the classmap-params # fresh start, to clear all above flags (test-fn limits) @@ -333,25 +332,25 @@ function test_mod_submod { 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 -v + 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 -v + 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 -v + check_match_ct =3Dp 6 =20 # 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 -v + check_match_ct =3Dp 7 modprobe test_dynamic_debug_submod # see them picked up by submod - check_match_ct =3Dp 14 -v + check_match_ct =3Dp 14 } =20 tests_list=3D( --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 E77821A98E5; Tue, 16 Jul 2024 18:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156345; cv=none; b=ZDfmzjgsVAab+AkdqLB6n/LJnjC+0qS+OXi095p8WHCpvdbdj1orTuXh7AVKYFwIIlYSre+MrP3di1DzuF0eKprG8GlRGTTk7Ij+N/Takerf7mSb6Dyh/suxxguHfYvuVm8IIlxqbk3RR8/yaoF1ZRRczyERJVTMn7dSUo9PYAA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156345; c=relaxed/simple; bh=3nsGd1yvcHQVmgJMnEfsgLWbvRxble523gz448yN+Pw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=koEYt03N0N1QozxL3b6GAn/VeedLt0jdUZ0iiCxnCuVdFS6I9SJQzCsEff5cTd0XAomUm2gqYtlKrxlXNjiK8npn2cGxz7upGX9J3JbPFdGqT36N2lvNfbe4oDIdoG6MnfE7AJiUadg+uOKytRmgoXXXxDNDQLRDba8G1O9novo= 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=JDeOKjtR; arc=none smtp.client-ip=209.85.166.51 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="JDeOKjtR" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-816d9285ebdso1245739f.0; Tue, 16 Jul 2024 11:59:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156343; x=1721761143; 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=BKKrQEnQvZmCWcaogVUFAqXRidWX9wMTYH0GRy1A0go=; b=JDeOKjtRqygnvKRvwyiuF4gptLyNr0b4fh67GDKI/DnxibF/bEAJ9O2ZSinSJfjdgu uPFte9YyUGRR3UqBn+1zUtoABAIbBd4rI/dpkhEKu6zHtFxnNyVOLl67h+mCsYD+hBNv ZsuaP8QPnzKF/QgHelndiwaV2tk6GOCYkhqQYe+D7eVYFEz8jVj9SeudhSBpcp1A6lRu m2Xob5Z4lSMm3KzaP5sk2ohAH7gVfAGEbRBIJHBGlXJe5zqL/W1SVq3cPHwZ8LCUFiJ9 CAHRZKHF9JkS9VYYut3JmcqWK6VisWoU4GOxyMh8crMFyegqLXOjGLvepC6QUkawehmN r4jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156343; x=1721761143; 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=BKKrQEnQvZmCWcaogVUFAqXRidWX9wMTYH0GRy1A0go=; b=nr0IkVkMdCbEYOzPEBlkn0Iez+zO6ELcEP9+k/QAdoO+10nAFCNIPeR4kVXvWNdOkO kSTNzLBUR/5LApvYY9D+D31h/uiOQZ8wwcxyWb3CeVXM9IjS/Q38+H/SF0/GLGtq6XqF nebghvX1Tqd+ezPDVmUTANHj97nFae48bchcsPt9MGqBsz8ca7WV1yYYIgn9upE2SxoL s9LKD46GnPfhdkdd2OlUVcF59iN7znB6sR+cmjyFr0aK9OBm6ISOVvT9TlJ7iurWgxB3 YQ0W3NnO/cYFqehIyVN3XYmv5Rgq4kyfMop1dfrF/5O+PSIyHyqzgqAe5KMSwowpZhW2 dNUA== X-Forwarded-Encrypted: i=1; AJvYcCVelUsVY9k50to6SI4OsL0abXpCfbP/OrP2u5V9vMe3UaacDrfBOvkTLS5yP+FaxXqYHXs90IKj69mI7NbT0nEN5D+rc+q/ZSGF X-Gm-Message-State: AOJu0Yza/Zp/6vLN8gfJ4QDxre0nXOtLPmysmu/TYES31A4KambCqtmL D29eeZVgZF7iTksxWtIgHF/taW6fPkrqHVjT6oEHWN7B2a3tfCSWxcouSTOa X-Google-Smtp-Source: AGHT+IFR9EqMqI1TrHKs8IZsHfJ5cpqX4KLoCBbhGhwmA4IXulbHvDMqbNpb4AouVkB3s3rT9DekFw== X-Received: by 2002:a05:6602:1602:b0:807:aebc:3bdd with SMTP id ca18e2360f4ac-816c2fe92e3mr41453439f.5.1721156342762; Tue, 16 Jul 2024 11:59:02 -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.59.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:02 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 29/54] drm: use correct ccflags-y spelling Date: Tue, 16 Jul 2024 12:57:41 -0600 Message-ID: <20240716185806.1572048-30-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> 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" Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which broke builds with: CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy CONFIG_DYNAMIC_DEBUG_CORE=3Dy CONFIG_DYNAMIC_DEBUG=3Dn Also add subdir-ccflags so that all drivers pick up the addition. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factor= y macro") Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index f9ca4f8fa6c5..78b464cd4348 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -3,7 +3,8 @@ # Makefile for the drm device driver. This driver provides support for the # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. =20 -CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE =20 # Unconditionally enable W=3D1 warnings locally # --- begin copy-paste W=3D1 warnings from scripts/Makefile.extrawarn --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) (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 3D4721A98F9; Tue, 16 Jul 2024 18:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156346; cv=none; b=BhqwmTRKqN8lJ7ePuAsD32kFJqmm64daugmEPxoYChPw7K2+RuejcpWJkspczPOZN5NmvN5mZ82qGm37DtZrrQwuszyb3pXVO0WExMj6TBZ3KIgvDXNiESOwTPxf5EqHSVT5CEf1ZTAwJg5EbvO6/X8dJALBnk4wD88VBUYI7yI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156346; c=relaxed/simple; bh=VKETVvP29EC7pBLY1S1yuOzRNXKTxw4JIyKxF/iAfi8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dy/dEwIVoaT+HNUvZnUhXx91Rmvk8B6eJ2jai1I8aUuy5hIjL2FBLLyjsjxSr3TM10NMIZIM/ri3SFm6vDwXCyI7oLtv6WVsrIEr6MloD51fpKJf7lkMmYbzLOMoJUQMJXFh3+2BBRq5zsWWk0YsgSZ8U+d+l3UbuaRYeMfxz68= 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=V8Llw1QM; arc=none smtp.client-ip=209.85.166.179 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="V8Llw1QM" Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-382458be739so541375ab.1; Tue, 16 Jul 2024 11:59:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156344; x=1721761144; 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=M7xcpbsTDFqLNkX6yLBfMI4Cmqq9UEc7Ib3kRvowNps=; b=V8Llw1QMf5BlQb0mCfSi1u+NGLnQbBp6Tw88BAbYcgHxpAQ1zOUTLf074IuyC008tZ C8gMEEECqwXnZVpGQ9JqvEtZWA9mcsTrHOQRYg79dTZRGnOl6denVyXpD9pZfCGojI+N dx5p9w+vV4QNsCcPuTTJOGE0wyGCyTxRNuForywY10hviCCc9tEfvplgyVgAz10MC5zn JJI77Pmoq5fTD/bG0MsCFct9ZVPaIBl+i2+2ugq2V5YhP4rb6Zu/Ls7RJ6E5me/pmkkY nxnKZHY325PUEyxQVjJb6QGH4dCP94Op+bv4BKA7Smz619gyMRiGw1fHfTMQYXJIsKC0 Emyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156344; x=1721761144; 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=M7xcpbsTDFqLNkX6yLBfMI4Cmqq9UEc7Ib3kRvowNps=; b=dNXORWHZzfPJCWJ4dJuXszAbhT3MWtBMh1yU5JgKc1kfonBPckgVPqgkbfau0mvYR7 EcEHPYo2tpGwh6wvhyU/IHDqwKNTxfY1sUA++yL0yk5g50iNBiKCdTViISAtVyU/m9u0 naD20ux3qHjTanGLCn15rzvZ8zRX+2qPEauce7YA8sYBLl+3/s0V+h51yykZarmw0yic nyoC4Ht907GgHUNmNSXuZZSumL6Gaa5lFW2hXVvKFcNZpQDd3O4+DuWEKC69VvhNivIJ hWTKDKR93TglEb6+6aLP+FLS3kt90U9GWniCsBm+uoT5GGXKkNAnNazWtPYX+kJT2dwd b5KQ== X-Forwarded-Encrypted: i=1; AJvYcCVDLDlxdawaqS48GjZfFEUvkm3THIuFGv1HK8lBFk7JqhFr1PXuZodlh22nlHsc8x6nzbOiQGmpS4NBr3U5lmKh+tcPQbrttirg X-Gm-Message-State: AOJu0YyWMAzT+qDffpCacZhqTWUgZ0wW9QtPBZTuYhnpfRhTXQ0AuSqh dqm5qVynSW3BsqtvQGPaFsXiv50tguB+bMpGmWdE1VCnaBdtfxYtOdTuXr0y X-Google-Smtp-Source: AGHT+IExllrK/dDXx9zHRPe0P0zQSNNZHGhy8f3RcoaQKjATZG0VIQe5Ln/GSLSi2fMerteHcMi6Pw== X-Received: by 2002:a92:c267:0:b0:375:ca62:a418 with SMTP id e9e14a558f8ab-3950e9d74d7mr3061045ab.22.1721156343924; Tue, 16 Jul 2024 11:59:03 -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.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:03 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 30/54] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Tue, 16 Jul 2024 12:57:42 -0600 Message-ID: <20240716185806.1572048-31-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> 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" dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to do too much. Its replaced by DRM_CLASSMAP_DEFINE, which creates & EXPORTs the classmap when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, for direct reference by drivers. The drivers still use DECLARE_DYNDBG_CLASSMAP for now, so they still redundantly re-declare the classmap, but we can convert the drivers later to DYNDBG_CLASSMAP_USE Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/drm_print.c | 25 +++++++++++++------------ include/drm/drm_print.h | 8 ++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index cf2efb44722c..41f167082042 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -55,18 +55,19 @@ MODULE_PARM_DESC(debug, "Enable debug output, where eac= h bit enables a debug cat #if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) module_param_named(debug, __drm_debug, ulong, 0600); #else -/* classnames must match vals of enum drm_debug_category */ -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +/* classnames must match value-symbols of enum drm_debug_category */ +DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, + DRM_UT_CORE, + "DRM_UT_CORE", + "DRM_UT_DRIVER", + "DRM_UT_KMS", + "DRM_UT_PRIME", + "DRM_UT_ATOMIC", + "DRM_UT_VBL", + "DRM_UT_STATE", + "DRM_UT_LEASE", + "DRM_UT_DP", + "DRM_UT_DRMRES"); =20 static struct ddebug_class_param drm_debug_bitmap =3D { .bits =3D &__drm_debug, diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 089950ad8681..b467ee67a281 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -140,6 +140,14 @@ enum drm_debug_category { DRM_UT_DRMRES }; =20 +#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG +#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) +#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#else +#define DRM_CLASSMAP_DEFINE(...) +#define DRM_CLASSMAP_USE(name) +#endif + static inline bool drm_debug_enabled_raw(enum drm_debug_category category) { return unlikely(__drm_debug & BIT(category)); --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 2CB611A990F; Tue, 16 Jul 2024 18:59:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156347; cv=none; b=fG6Xidbq+pOumsm+FPoPogVKr7Nv9Hh2u61/KWMWCrB9+lofUluBzoDl306+74+VcEipWuMCHwkRnUDRm5kKGoHc2SNM9z9hTdkvkRgFJTYJn+38ecGQ1U265u+9XRNmF3AmgUSjNK/IA0uj+BL5NIZ6JzHCqpH4xEbVz7mFNF8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156347; c=relaxed/simple; bh=Fo3ouD/xxQzt9CuwigIdltJve9vn+WUo/Pr6E3kGia0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AOF6pfYcewIThxZ6T/4KAYhn3ufxOHoj6Sad1tEmKWThzggkHxjWYbP+mdmRhrI2k72Ivzf45vvGguUcpq8aZ4Y27WHL+VvlyI5kEISEkQKEksxVnbCTRxIo8ZKdahMxdx2EOfEaXmEAVSeKy8TxwDqurlNhg/KswC2mE1wb7oY= 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=Rat52FxB; arc=none smtp.client-ip=209.85.166.43 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="Rat52FxB" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-808a8c90f5bso4659339f.2; Tue, 16 Jul 2024 11:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156345; x=1721761145; 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=y6blOBSVnowRsDepJzeTCLiu7QXKUuExri+0RrzbqrM=; b=Rat52FxBFTnMZ1xLpkDaSv7omzCHxhYkafHgvBXS/HAibo1qXaJTxG1TiaOz7vNB9I N0cDsHv5DOJBEOCvtRAQdqu+/V0pn4jszePXTC8D+IR9OaSv8PjXto+GC/TUxk7JTNh2 nlHEjt/E5qqvk/uAx+kZMmbf+/i4wg7Nyyy4u+SmeqpEITSKHY/KeomA0w5pkMmePHpq 9M7JxT5OvLvEa/NXKgFdNDAe1U074DRbZTJA9iSytl40CPRWGfJCO49ej2vsTsHcjnhS rRY6Kic6bpEgFy4MSTOnkHrepMcJsIY+Jsggreb0nBEisE5n3xZuhmp5bmRt4Fe1RR21 e/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156345; x=1721761145; 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=y6blOBSVnowRsDepJzeTCLiu7QXKUuExri+0RrzbqrM=; b=oGRIr3j3E1ueecS9zScrgv/YtHsO955zm42AXJDHDTkuXSYJRiDeTZ1fdhtIy6IAsH Vky4w3LvrrhIzbto/OK9zCdS1ETC9ng1m1qvlIkZRia8v+moEqQq0u7A5Wa//ds4d20x x0MxphgpX+1G44qJobOQkWgY3hNTvqZLy8wf/nZ5mdYs4ca/RW1nQPW5YRgPevXP4WoD HBSg7xK6ba9HzldcIPWMXH48ESr6w2ppyW3IGy17SB/XMtRTVVHnk3ZKCQMdiw283J+q odmpo3pSldVRfPo6figxocef9T8VLIxicziYw8mLk5/i69Q+w0SGbtFM/p9grWl+8Hhu YO6g== X-Forwarded-Encrypted: i=1; AJvYcCUo0P6gVrgMKoVnFikQqfLXhs3DkYsvGWW+fF2X+6QCZaRtZU4gwY9IN43pp/7gVYkRfOqog1d1r72TPNwyP/mKcFbo4cZfte2c X-Gm-Message-State: AOJu0YxQ5NVrhZ5+uHT3T1ihzjc6fDwIvXD73UTXXRa2ChJR9JP5hUyy B8928OQk1U3mXndgj6ZlphgDkX8NBvV5fNWVNtJb2JFaJQNXhB636uupESa4 X-Google-Smtp-Source: AGHT+IHupF215B8HUHSFyCfq+EhhBdI8n2Uwkool8jFM4Uueq2pJrHXQgCTgI0PTVZNLug7iKTYbjA== X-Received: by 2002:a05:6602:14c5:b0:803:85ba:3cf9 with SMTP id ca18e2360f4ac-816c38c0218mr44418339f.10.1721156345102; Tue, 16 Jul 2024 11:59:05 -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.59.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:04 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 31/54] drm-dyndbg: adapt DRM to invoke DYNDBG_CLASSMAP_PARAM Date: Tue, 16 Jul 2024 12:57:43 -0600 Message-ID: <20240716185806.1572048-32-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> 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" Invoke DYNDBG_CLASSMAP_PARAM to hook drm.debug (__drm_debug) to the DRM_UT_* classmap, replacing the ad-hoc wiring previously doing it. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/drm_print.c | 8 ++------ include/drm/drm_print.h | 6 ++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 41f167082042..c7455f2076b4 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -69,12 +69,8 @@ DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DIS= JOINT_BITS, "DRM_UT_DP", "DRM_UT_DRMRES"); =20 -static struct ddebug_class_param drm_debug_bitmap =3D { - .bits =3D &__drm_debug, - .flags =3D "p", - .map =3D &drm_debug_classes, -}; -module_param_cb(debug, ¶m_ops_dyndbg_classes, &drm_debug_bitmap, 0600); +DRM_CLASSMAP_PARAM_REF(debug, __drm_debug, drm_debug_classes, p); + #endif =20 void __drm_puts_coredump(struct drm_printer *p, const char *str) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index b467ee67a281..aa3708c7b6d8 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -141,11 +141,13 @@ enum drm_debug_category { }; =20 #ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG -#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) -#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) +#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) DYNDBG_CLASSMAP_PARAM_REF(__VA_ARGS__) #else #define DRM_CLASSMAP_DEFINE(...) #define DRM_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) #endif =20 static inline bool drm_debug_enabled_raw(enum drm_debug_category category) --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) (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 5B8351AA346; Tue, 16 Jul 2024 18:59:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156348; cv=none; b=i4j5CE2mvmJNprvYJicKZYaL7JNRVARWARqG12O8X3igRWo1FvxxP6kz47UjgKVaE5zv/MRe+Z2phah5IW5Nm9VXbQ0KRt0EJVqKebT4gZqUfhOXEMOLrCXVDDgk44yp4PFoZckYNydsJ/Kaoj4pXm3mxYDCV608U4NsMOulRP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156348; c=relaxed/simple; bh=a3i5ykbtpUblqWtNGFzaAe8Bc7wDaK61y9Dw8nUw3n0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qxBz76eaVv9sT5ilI1eMWIDojxYVEuKj2S3iWvLbLHmzEvkNV34ZegstXvsy/oylFZZOJgeRTGjzJ1/LJGQcZb6/1qMHqliiFP6h9uIZS39UtuaOCpsyl7rpaj0x248uvWWdXArQsmETuIMbGDrgvwCfVBgNqxn01PEwiilpRms= 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=lr/H8O0c; arc=none smtp.client-ip=209.85.166.53 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="lr/H8O0c" Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7fb93b2e2a3so4689839f.1; Tue, 16 Jul 2024 11:59:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156346; x=1721761146; 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=wA7EEvNcqBzVLrMMb21MWcD/ne6Fagi31tYXyTCW1gg=; b=lr/H8O0c2s+pm0t/w/L3PRU9HO/HWtBWiSbzhVke1xiKjDsworUp6y6RwblXMEYQaJ MTCV782zb5iqDcna8r9VbcBqOYbY5DJfch5ZOjCy8S8SCxl6wfsy0+vvHzardl7tOUmX rl1ut7g37lOedc02NhAJCAtEfQrBJQka7GJdwDHo/pQqu0cuJjTeDA6siv+5uR88pytP 3sSNsbyCMRI4rralRJLvOfZC01MVc0OWd6fAH2v5Fl9nmH1JUDG4mY+LrzcebB3Ioy+S NLnjvoMOdnU8L80sIs8JNxOkdXkLnZnQXaH1K40Rn/Br2wmxCl0Nf5N8yDchTPH9cAwk jpIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156346; x=1721761146; 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=wA7EEvNcqBzVLrMMb21MWcD/ne6Fagi31tYXyTCW1gg=; b=CR0hR051+m4n9oimv4bCixMXWacKnKbNhr7IYCWSX4TSqBoR0DI+mS5fiLGeu9zS9r nXIN9SHBJefuCUpD8Va+pcQh5GYdhY/2mEy6uHWOdU/PnxNztOC18CsDaMsesI7bqCSG s0gwsGOIFia+aHN5oRlzSd+qKJdlbR9vomezTA0k0jECZ+4ExcdceTCyV2mSEoTYgzE+ Yfe6aV0RJI0GMQGsmpXvyUYxxvh6J7zmX3maUUYYyHXDkacOcSYA2MKmypYoXgNhcBYz FgvABQooyCjBVpgQP4/S4EShPy1dc5jcLtik0gXfRTSa3/V7ecF6y1j3289xwuuR29yU HN9A== X-Forwarded-Encrypted: i=1; AJvYcCVYOhcs+FeSHVID+464aHWkHySOCvo9tQsgBQLBfOrZD6OMsRtnIkWac/CjBmrkAcD0ppGZNIz0UGDx+OdjumTFftYf8zABiehU X-Gm-Message-State: AOJu0YzjYhxC0iimzzlxM/+IXsV62UhmD5GPVNmPh5G1pNwqqcPEYJ2j T6O8PWi7ZTJjLH9flzQMkbH+5NSCXAIp+HeZH32F1SftF5H1au4J/eEmBu5a X-Google-Smtp-Source: AGHT+IEhC47yLHdZQK/ojVAnON7EakJJDxnjzB59bSxRuEzqdArkdfVAg42BfhkcRtZiTR0u/zHvDA== X-Received: by 2002:a05:6602:15d3:b0:806:f495:3b34 with SMTP id ca18e2360f4ac-816c2a1fbfamr43897839f.2.1721156346283; Tue, 16 Jul 2024 11:59:06 -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.59.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:05 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 32/54] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver Date: Tue, 16 Jul 2024 12:57:44 -0600 Message-ID: <20240716185806.1572048-33-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> 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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/= amdgpu/amdgpu_drv.c index ea14f1c8f430..83763d37566d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -217,17 +217,7 @@ int amdgpu_damage_clips =3D -1; /* auto */ =20 static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work= ); =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 struct amdgpu_mgpu_info mgpu_info =3D { .mutex =3D __MUTEX_INITIALIZER(mgpu_info.mutex), --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) (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 7FD8E1AA355; Tue, 16 Jul 2024 18:59:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156349; cv=none; b=nKdG7HDDVWHxvacn/C6/s3BBsaYlVSOayVUuKjRIcHixNQV2mlHMD98wydKNbXG/0LdLM3ieUbcN3AkB2oBzNUPKHdW5l+pE/CrB3FpSMOG55cn9J5yHba8fxnpwS2rTq4tpkLzZ+qPWIwDfA2v/lzMCY7O9/ro+OmWuheHr7L8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156349; c=relaxed/simple; bh=hp2dvFGE74xKiGr3DsmKyZBastfXAUcYKeMcCwG8BhY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bXhuyiaeNwQ0zZ9RPIUwTHuGOecwGSG2n6AfQCIah0Sm4j0N7tw9HV754JjnUhxW9htrVpkEbeBOBvz6kdj+JqT0SD9qkVk935sNs922FVdAo25/t9TnEMsJDQxjEuHz6OpDrc2vyTpyQRDpHo4s6M/6wjDPAJh55xAc7+eii2U= 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=LmC5D32O; arc=none smtp.client-ip=209.85.166.172 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="LmC5D32O" Received: by mail-il1-f172.google.com with SMTP id e9e14a558f8ab-383dfcd8cdfso576645ab.1; Tue, 16 Jul 2024 11:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156347; x=1721761147; 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=W+5ldzNpNWEVuNo6jiIyzFS2EBImxXk+RE6JhqbDago=; b=LmC5D32OUIiHcz3JfN2cjFYn5rZk1FX8t3EXAebSANX1OsV6IHuuikK7QH/y7TzI0+ 4sjELZZYZkq3KsSIkQOwIS0ATCYPAsbZ2cE98ffGW5Xo1OMBg+sSTAchJKEyne27h+vh ICbD6ZbU/5M97yq6Uj4qZz1uf8zAEfWaVjJy4xogrEKz8XQSb9j991CPhGonRKIi0b2j wErEGuSc0EgYKFmnKuJHY7gUY+l6vrfK1apU2JrzJ5CvRs3D+mBQY+idDJIrrqGuWfW5 henu13/Eur+nKFyHh2Wj37ItychIzy2xXXkm8Ccq6KaEFiZdbgGrE6AyB/Cp3AYOcK8U ZzbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156347; x=1721761147; 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=W+5ldzNpNWEVuNo6jiIyzFS2EBImxXk+RE6JhqbDago=; b=e5QJN91LwqKkeOPkBDP47MOTZd1ZB2aNaZd66aTL45/8sEZewLfeLQEHOKimYQGhdF 92md4PKcHfTO71WsiCGucdLato2OQp6uYmJ9JiN7tebu8ptmpadUFyH4+G3sj9UnJKY6 oXhK3banIsSmF0THcFyntI6kjb1lPHb2PLLp839aJ/gE8r+sVSoVPj980UW9TB78Aek7 0UwfiEu0IIvoNEzmGyZ/H9zSqNBic8Fh0Y0n1oyRFI2ogO7MIxLGjjQXFzMAqVjdyLRP FCNy/ueeswI5VX0QVLqFerPT6w47Ky9cXEz/OzXwHBPKpM7K3dJccF0wkk4AL+LfOWeW kh3Q== X-Forwarded-Encrypted: i=1; AJvYcCWUWP3cUInFXtr3jRrBxTF7PLLkM5QzL5j0jvAbRluUZ44oPxyPrt7oeQljFANtuvN/byO/TvMgmnSLYmrGw0/NFjCXu4CBJplm X-Gm-Message-State: AOJu0Yy+O7b/b9FTfODMgB+hS+coKL7jwQZzriQBnFx31FXqPfQcOrf9 TlS1qFsLPPralRSHbNKqKpt+jbU5yKV2Qxb08pYC30W2biXdmf6qKZnL95VP X-Google-Smtp-Source: AGHT+IFVgXPtcAVN/LY3hiWBdgpsl/UgaLXlcklh8fq4iOux4ImC/Nd3IFqSrYYu5bPD2ZMJxqpWYw== X-Received: by 2002:a05:6602:601b:b0:80b:8cb:e9a2 with SMTP id ca18e2360f4ac-816c39b5f53mr48171639f.9.1721156347462; Tue, 16 Jul 2024 11:59:07 -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.59.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:07 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 33/54] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver Date: Tue, 16 Jul 2024 12:57:45 -0600 Message-ID: <20240716185806.1572048-34-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> 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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/i915/i915_params.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915= _params.c index 8c00169e3ab7..a8f51f138895 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -29,17 +29,7 @@ #include "i915_params.h" #include "i915_drv.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 #define i915_param_named(name, T, perm, desc) \ module_param_named(name, i915_modparams.name, T, perm); \ --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 49C261AAE0E; Tue, 16 Jul 2024 18:59:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156351; cv=none; b=qjoJa+WEbUZ3hA5RzKOj4WnOAbNMInMeI33wW8EGjGePmAhqjexGvIQMSg00gexCv3kCzEJVrMpGt1HakJE/Y+TBW5fj5X9K36gC8U3SyPiNetRtCcCL9VrEUQa/w0/Xe+dPREkEVtZJs0T+00Oy1B2V9Y+wCl+aQ5qb2TPRTmI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156351; c=relaxed/simple; bh=lnEKbpx31gnha3NjGpIlzNeFmEq5vg/O7ge86dQKUe4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pZ1gdVneOFrFCyfZtQYdNLGthp1uchUrzfQsFJbtf5aoxswtzrmt/fsfuhvSK04PaL7X4S0eq7FpSPdgRoY203gn6tq9kZNh5gH2j8YGGAIPvtjazVW/Mue/OGpURfJMfXveG3wHUW3b7hIKvsGgKyGJjiGgUijAebPRSUl/neg= 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=IROmWSRJ; arc=none smtp.client-ip=209.85.166.45 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="IROmWSRJ" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7fe8d029fbeso5430739f.3; Tue, 16 Jul 2024 11:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156349; x=1721761149; 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=O4fvGJdIiqN/FgQMIjeZ3X03BzfZdJ4Rgy3d37CjnOY=; b=IROmWSRJRxxDSmRHUp2N4yb+gPAI4GkJv2WmdpiIyLWQM/553I6iLBVPMH8tSU9eCS +9p8OvdpwUccEUtXc0YpU7wN4v/VwIWOko+57GPxeIvyQ59IZba+skZf5vffMRi5uozz W0W6ZeLr6cxC+f8jU11St5UQG+LwrcZ9mBRGfY4LeiOxAgGwymMwp5QBlCDm4bvwRipG je2+n304JymEDCiVIl8XURzB236MnaeWiMvtCPu+6aFLC1Ult3Eu0ozlTKNqlEa9dhv2 B8sbjkgP755B0kbKLT9q+RKhiKsNrB8Nwq66zJslMryC+uuYnzOIT0i43hsw8gCe+JGJ 9nTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156349; x=1721761149; 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=O4fvGJdIiqN/FgQMIjeZ3X03BzfZdJ4Rgy3d37CjnOY=; b=bqcXhXMrYsm4jlELOncFEn2pxOqcqrjWoU4CvmYbTU4um7nkEcdGaRkOAgxDMx+oXr V10CtuXLBXcqMD10KCmC3rmEDfR8048vc/s4Dbjum5nI8r7ked9sYdE0YF84gwtBYf87 lEPCwyO0eYmtFaqMox0hZtzEXi2WUg+DKXZY11ts7Rf7RqgcI8Hbz+rTRf9oQQ775pJR 8pR6bqW2iYcJsIvkU600FzSOZm3gQDmVD/PXj1cyiSImjvGV7H68cYGn0OvT4NVjoqYd SGDvYVL6lcESAq6U7BcCC5EkGxv286xX8Cq8vA+oyeG+CutNOitBqvV0DIe+WvpM+qAY L6wQ== X-Forwarded-Encrypted: i=1; AJvYcCUcQrt0kihjEpZQVqXjtEZammVFM3mH+4JdSP92Jz4r3lKiG4MpqaMnVZCsm3Pgxf+sUJJphpoovaWmTbp5KvE+Sy50SWRtv+2n X-Gm-Message-State: AOJu0Yz5eZCOjfvxwqVbl+7u9kpV0UEu8lpi3lQ8dyibWlQCBLFu3kYL s51YrTANbRBmud9X+nQKfkdye90WzEvhrHPhrRr5dKF6HZAjCBHKzhV3POB2 X-Google-Smtp-Source: AGHT+IEoPFvoLU8se7cKFs7615nIvxsDK/GhCsg3TpkmqEyVLb7MNLpf5NEeCEideKkhW1/TmoHWuw== X-Received: by 2002:a05:6602:154c:b0:7fa:2902:aec5 with SMTP id ca18e2360f4ac-816c578db22mr35533339f.17.1721156348981; Tue, 16 Jul 2024 11:59:08 -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.59.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:08 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 34/54] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper Date: Tue, 16 Jul 2024 12:57:46 -0600 Message-ID: <20240716185806.1572048-35-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> 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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/drm_crtc_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_h= elper.c index 0955f1c385dd..1d08d759f238 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -50,17 +50,7 @@ =20 #include "drm_crtc_helper_internal.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 /** * DOC: overview --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) (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 58B4F1AAE23; Tue, 16 Jul 2024 18:59:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156352; cv=none; b=moQ14r4qG8bK7FbyZ+AVDU9gkmfeQ5lFXVpEWEoqwQXSwa9j4OcZzdVbnyzm6DX5nVgY727cOkqPp2XfPA56brgxBkGVJnDDj6kai1OXDKKFU3+fgRM2NlOTk4EKO5VGFmS4JwtW0SYT/viTsvY9j7cCw3zwIIYy8ENsD8YBue4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156352; c=relaxed/simple; bh=ZtjiOxyDx5G+NF0MTgM592M7DAgCamR0xuhg7eXNnRs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e8rVvc9zj6Gm2fikSvNH9WuzUuNzHBkZFWPHNgvFvK+ZLz5YCfasbjmUzEAMJLLqxWHWbEk4YH+SrygMCcoBil0OD1bbw7f6VemAFM44ZARmIDM1S0LZ77V/zF/peJivnfPl+2jhAZq6Q7YU5uxOSoG0bxtlKP72EnsBzkiChkI= 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=AKLJmsaJ; arc=none smtp.client-ip=209.85.166.181 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="AKLJmsaJ" Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3833cd120e5so184885ab.1; Tue, 16 Jul 2024 11:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156350; x=1721761150; 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=IzkSEhdc6qQPvOwslzLZ6D0OWHzi5mSETKdlQKCmmYw=; b=AKLJmsaJ6WSRRwUfLzKnUGcj1K2aDkPuZ7mY6u4BrVhIHbURUeh6wPBWrg7MMzonWc 9RTPkDrBrqKyjil7DUs8kU+CRGR78VrVlzmjO4faGhVpwInMf9wSSpkjEEK0UY5UXcxa azgy97OEa9fGuFPrW9TS0PnUGnEC6uir3y8N1CUTsfO8Qmn4X16jGOAFcr/F/vtQmMnm yiJfLxwn5N3DiJ1oLKTjNQlXDsuXp2F7qpbpIiESK+H1bGlK606iGSMf4jM+oqVfILSV 9JqrNYleD7Qz0IhjRGiXd1tuAl/Xx37OSoScU88ICK+m8jK+NsIIPspcpPqeKt/jqkbD CgHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156350; x=1721761150; 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=IzkSEhdc6qQPvOwslzLZ6D0OWHzi5mSETKdlQKCmmYw=; b=g2UF5Ba0hk6zt4Gw1sMrH9yTUlnWya2F2zLHmCgyJRe5clDazRsMOsUW/9wmdK2ucy 85rASAYTaBy/LSvQaE4NvwLHKBsEDrX3WHIqJm9MAywrmlLkgo2NnW0EOF5wwumVShWI xs754MOm2HSesf1wS1210DNNME8VuHg1gvzQm5IocFn9z9BBWlvo9QbvDU7y5zz69vG5 wElSV5lx1kZKILhJmezmY9UVW7RkZBQyQ5MRN/R9sDPD/2cTtO4DAotc1tyUdOfAxKfX LxGK+y4K9TYBdAqxKcl2ujXJ1Y0ZCUZNGhyHT8K35bp4BLVIj5kVGzMew5pJC1/jj7YP ZhJg== X-Forwarded-Encrypted: i=1; AJvYcCVbhXoE4wmO4eN48tO5YeeTHRqXnjJZOwWUjYojCzhYVS78iCHtsHdO5mDkB2aCLVKb6nrjUAJDLEEBb2B0X2dTgL6+J0jHbZ6f X-Gm-Message-State: AOJu0YyS+92oJwCIfkwhgVveKLw3H5ZKuCSjPJRmFaJtMnSMYgEdnBaS C2xPuqW5zlwPT+VidWog1qC3v4WL7yXoXzHOQHQQqmN1eSiGIwbGNF/JrYju X-Google-Smtp-Source: AGHT+IEKdNdnUCPqRDB/cRLNi7N28OEYYkl4r/3na57zdfEFy5knZy9YrMuwF5a4lw45gKdShvcnlw== X-Received: by 2002:a05:6e02:1a42:b0:38b:3985:433e with SMTP id e9e14a558f8ab-3950de3a6e2mr1987225ab.7.1721156350166; Tue, 16 Jul 2024 11:59:10 -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.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:09 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 35/54] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper Date: Tue, 16 Jul 2024 12:57:47 -0600 Message-ID: <20240716185806.1572048-36-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> 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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/display/drm_dp_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/disp= lay/drm_dp_helper.c index 79a615667aab..26e01845531e 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -41,17 +41,7 @@ =20 #include "drm_dp_helper_internal.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 struct dp_aux_backlight { struct backlight_device *base; --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) (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 87F861AAE3B; Tue, 16 Jul 2024 18:59:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156353; cv=none; b=XZzgGSFQvGbWqy2F4kUksHJNWhsHZ6ALtNOc2PHh1cdTTer0oULcn//+RCI3IW+4pmm2WC+KaY1Wk6FgSzkvPAJZwZEf7lK+GYXH4+yhGXPGxLR0K4MEuwpRoNjXh7KDD7EpjJs2ZN8ACqGqGYLXueZzpV9pNNkBgk16FGusNCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156353; c=relaxed/simple; bh=HsVJ+8bSyTwxbd5PVHZFf8uV50bzhcBL2G646/K/2NQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yia3MVu4Sj/Z5H2JxHAzLxuY+CFim9zAhmu8Ct7krwe2sRMaU72waK13HyJIFz2JUSKdOrPR5watifhxliGc8MmmtnTfGqWn6l0zJlVz65WDpWtqG25CMGtmiXtskl1Pd6ipjEM7i5NJo7IxT5izKHd+d+Rqh/J3R8RnURIcLSk= 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=CS/T4BaB; arc=none smtp.client-ip=209.85.166.49 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="CS/T4BaB" Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-8046f65536dso6078139f.1; Tue, 16 Jul 2024 11:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156351; x=1721761151; 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=Qc7kDWbr1ZOLQ8+EMlKcMIOk0gPIa550UiXaV/Fsdqw=; b=CS/T4BaBvJZJOi3TWTCoFEwIqxYetz3ip+DkmTy4p7mYeXSM2k0Qe+ggUNKgfjay0j PKt7NwkKRSuKCPnV3U978J5YHWMYuzmxmekCtyTXnRJe3qhv0ckvVyRtbL0WBLKHkjzg 0V5pkZX4SjyLtCv0BmJaqkMOW+ksRh+CoG4fAzW7Y4UXB2us4sG6U1Spqr8Dyt8oLO7r MLmKnC1mmTLCqNlPQi6EKoKotMq+3Apqc1NESDyXnx27m4LGCc+dlbUkOpj2imV+48Pd yetxDlS/AB4bfQ6T5byI6GcBTxU2MTfJLcvRgBpVzYqNncMgweCxthqO+DHNkIVGwcN1 zHNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156351; x=1721761151; 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=Qc7kDWbr1ZOLQ8+EMlKcMIOk0gPIa550UiXaV/Fsdqw=; b=kPqc4n+sF5TOIEqTbYqxQoYeAfkfwAySV1JSMska/5tdrGljwHIin7w8DuwrD89LFx Ofb9sJbW4UJojowko7oskVlNomzPjgqX9StonvFPfOQBN9kN7vs8uJ4BbDOpca5yNHdQ 9/25lyKm/MvLI/U+z2w/xVwWqFmZd55fBcEd1VC61Hku0lrXTctso+Mla/tSU5Y7jIJn /zMwC2h3XTddXl8/Ya8G/GbVDg6Xx0VrhO3Vcnn8+igDLEqA6+IlgPPaF9wHXsNmgCWY MOYs1yheiLNxzcugXZW9P7Eop/KPozTPm01HcnUoFu2mIdJATeYf6mfFI5FG3w/0p5CN zh7Q== X-Forwarded-Encrypted: i=1; AJvYcCXvN4/YGLi5y6tGpqxnxCT++xGyy9mWv4tz7eLB1NyvCjjAjUO9V0J4nKj6ygvdtaS8UCKyAFhuICbPnvsZHQ6SrXl4wnXKEhmn X-Gm-Message-State: AOJu0YzwqL7Zp+QGlVvVz7pvtJTrMIyLN4r8rFJ12S4mHjHMNsZj3cVb IlskWNeypBkI6aJRna4vXfS1ZXusfj+Lp4z9TNV5V1sfN0oelVwDA8quTwtw X-Google-Smtp-Source: AGHT+IHniHFngXKTceOiLqztTPmU7D7E7YPzARR6ATJ7IKtQAVjxB0kHb2reQWR1pBYIGtzlOj9sIw== X-Received: by 2002:a5d:9f52:0:b0:7f6:565d:9046 with SMTP id ca18e2360f4ac-816c52c12c9mr28199839f.19.1721156351398; Tue, 16 Jul 2024 11:59:11 -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.59.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:11 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 36/54] drm-dyndbg: DRM_CLASSMAP_USE in nouveau Date: Tue, 16 Jul 2024 12:57:48 -0600 Message-ID: <20240716185806.1572048-37-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> 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" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/nouveau/nouveau_drm.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouvea= u/nouveau_drm.c index a947e1d5f309..27995c0c9b31 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -72,17 +72,7 @@ #include "nouveau_uvmm.h" #include "nouveau_sched.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 MODULE_PARM_DESC(config, "option string to pass to driver core"); static char *nouveau_config; --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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 A20061AB514; Tue, 16 Jul 2024 18:59:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156355; cv=none; b=KCghWdHabBVZ5G1krUbeK5U/ybzhXNP1OcYa+1EM+R7+KNipjN9HW5PadRPVPemPBGo+F64uhsdvqek/AFmEAKaDMphlKOpN6pmyo/6DOPoy2fhd0yILSQe3kL2MjujMcjbnFELGLEG5CsZVNI4Xub5taUMGCb4MR8UhMgAXSB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156355; c=relaxed/simple; bh=xfPWPjds0sJ2AfvIzcf5l+NieqwtWcwFGJNxWcu7kOc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eQ5Vdv+MVqmnT+TbrY05J6QmApCuMSgpoPy83/bgzk+pqp6I9TG/HdIC3MXcXn4GcdVROFb0zIOp6xV82G1Arm/hPCdZzJvSGFC8gG1gAILq/ceKmfMEgwmlRHWfTJ3anyJcRVJ8RHoF/hJmUWtULgXBfP7UvJxw9rrsnuWWw08= 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=aHbbCdaF; arc=none smtp.client-ip=209.85.166.48 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="aHbbCdaF" Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-8076708e8ffso5040439f.0; Tue, 16 Jul 2024 11:59:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156352; x=1721761152; 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=+4FIF/HbRAgi1F45UWnC13uNax9+Z9AZXMw7KimFe8Y=; b=aHbbCdaFlaJsamoCYgL1hJM2dt1L+ESWs2/y5r4YIrR1AcDbgfW+8go1uDDyRihjte 2lJKSn5uCSoWlb3IyoRQ6roCPBG8peQBtiu3k5AxTbL5DOz8QKn630FHnU6TXWs3SCRJ g3g0wbv7z1mk7wbeoD0gQ3Ew6iRkUeflVFIjqVtb8YDgL2TRExaQsomcOPKj/OJHzNtO Ss6mY2lnccMH/moduRor9EqTcgxQftqMuHpTcIULQH29XWAVEyW/EftsyZIlI+R4xy5q tVX0VVMZmo3keN6NGhL78at9ORFfilicE/lrZIPfMSjL7L9+5JTxMFpfhwuXSzHZwBoM OnGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156352; x=1721761152; 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=+4FIF/HbRAgi1F45UWnC13uNax9+Z9AZXMw7KimFe8Y=; b=FbZe241OHv4KzyauuiKf5JbrZDmfWTCGPn8RxSVPVFpez3A9R4rhNMQ+cipm1l+3Uo S+XdAH+17kXUKDx+BSmgII4CqVB/QxvDNXb2QaJsTesSRSBah16v+f0CRV7mfbMPoe9R I0sVtcEnZpbtZNodQPOBEXS95iQiK2osVjtHyAbP7tTO9ep7U9LBiBui0ZETdtxyMKEP GPwdMyJKnDBkcVB9VipiFJeIacFHyfme/WLU7JqVfQ6L68/XCtTL3cTQZMSBma+0fZ0e UUt6MHUQKK0aTw7SsP7gH6NCdMbPbp4ND0iz/BE2Bkt328oIg6o0voJroAytsLPQxFYc 3M0g== X-Forwarded-Encrypted: i=1; AJvYcCX3gSoraQXhKtscqoifovkSIPQbCVax0augRp8mPdfHNdnrU8LeC/oyYJkSFBOtAwVO2STCvCe2pcIJIxWWKLWYa+OrF4N6vRgu X-Gm-Message-State: AOJu0YxwGTVdW6HzHpVhqptS+ocsmbiLEfi5YFjYZkdbHvL7DHRu2MnU IECXF8XHqJg4vuiGMfiKaXZCIy/1waE3R+1Re8C3rRQyGpwVqWentk0TTALi X-Google-Smtp-Source: AGHT+IGZMA5Wv6HVLe5IZ1iRd2dcUnxU5c1yurtEkdS2lNPSvZcznoMoprI5GhjJCIIceYNE78q/rQ== X-Received: by 2002:a05:6602:3ce:b0:7fb:790c:a317 with SMTP id ca18e2360f4ac-816c32c9ademr48017039f.6.1721156352545; Tue, 16 Jul 2024 11:59:12 -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.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:12 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 37/54] drm-print: workaround unused variable compiler meh Date: Tue, 16 Jul 2024 12:57:49 -0600 Message-ID: <20240716185806.1572048-38-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> 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" With CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, I'm getting an unused variable warning/error on 'category', though the usage follows immediately, in drm_debug_enabled(). This drops the local var and refs the field directly in the macro-call, which avoids the warning. For static-key optimized dyndbg, the macro doesn't actually check the category, since the static-key patches in the proper state. This is also likely why the auto var appears to be unused by the compiler. commit 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device speci= fic printer") CC: Jani Nikula Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/drm_print.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index c7455f2076b4..0980210a5146 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -183,11 +183,10 @@ void __drm_printfn_dbg(struct drm_printer *p, struct = va_format *vaf) { const struct drm_device *drm =3D p->arg; const struct device *dev =3D drm ? drm->dev : NULL; - enum drm_debug_category category =3D p->category; const char *prefix =3D p->prefix ?: ""; const char *prefix_pad =3D p->prefix ? " " : ""; =20 - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; =20 /* Note: __builtin_return_address(0) is useless here. */ --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 D95201AB530; Tue, 16 Jul 2024 18:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156356; cv=none; b=j8ZJfvOGC7PPCwIDUlyPKp6eowTyifQwXKykMeyuMT6MgNPDTOh/ecL5nxb+enbJEC048KCPjss3J9C+GcGQFVwStn40wegs5SpirHHLS3GDGOMHoUkmLP1a6Tg00b4p9YVptZozOEiAfoGVzeiTahB/HwqvkktSwcsclrv4CjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156356; c=relaxed/simple; bh=rtayNFZqbsyoteA9BiS1vZ4JECzl8M/Zbo3Ltgx4d9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eR24UC32RxU3kNXVJ/J5jTusDVznoi9eMgAPVzpAPJJUmqbQUHf1JW0/Nkq9uWxV9O1KPFBevDPICfyy3rmk2rErizYFmRI2HEc3oG0dn5aak3+qqyBgjCQLdfPNL+dgBgSKEekxpNpMnwT6+lDnDKemrei2HVA+0s1pvMGZsQ4= 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=gGLrWlTN; arc=none smtp.client-ip=209.85.166.54 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="gGLrWlTN" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-816ca307407so4164239f.2; Tue, 16 Jul 2024 11:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156354; x=1721761154; 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=Js70Xgv7tO+TEiqyDegu3yGlviUzyyQPsaTm0/0JTcY=; b=gGLrWlTNzyaifONAT9iO93h7CMO9IxxhKAL3otrlAiZpCAIQmR6CXUmmAwIBtbXYMm pWNrpiVCXvykoJVqotWu/ok1uLhLReiprSNg1ZpTzoQ+dOWgp6KzmfxEGfLVWW+Cmaqu auQtI9AzvFk5er+Cu1gQkPPcIYyFLM+X/p2Ly+m0EqiNcAoY+P0fMT9P4n1Lx34Z1HpG JvFQfeiLKLoAhh5iQAQXPhQJ0dJNewddwYzDEbJY7gb4FHpwA+l1qCQFjgZaIxHJA1VE mpMM2zS/lVdU5SDXYQQSrqKloqZXgN83wQLgbLoOZG+G6qi3xiFIzRT+3Jjfqm5WUl89 Hrsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156354; x=1721761154; 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=Js70Xgv7tO+TEiqyDegu3yGlviUzyyQPsaTm0/0JTcY=; b=cgpXHMnAulXjsnI5+47+hGVNG1sU++r3KTXXZcBuKnPTa/pjM3t8HJsq+PCrj3UTCr nmrlNltLQk3/XWr+ZVIkn/NrsfZPBiHu77nxJ1RAKsZ0sul9WHRcS5P3f3Nfh48gzsuU Fr2Tsk7yMUwvb3/gv9wDsFGf1YO/V5pPU9xXf59UC3Zk2rEeWV9RnUH7le4CZzsSjiN3 ndrV3EimrUHIHMA/hyxNFraPc/WKnpSeN/ghHZGv99MY0GrdmfmY4GuEHJjRSNLFrlps h6V2/iv6nTOvrL2kDTmy6K4WAQf8l4/QAwb4+8kk52GZD9zlqSQMvIfViXitua36PwbQ KoRA== X-Forwarded-Encrypted: i=1; AJvYcCUV+Ih3Jq/v80iRvyyncyzQexX2VqBYk6CCVCuWyQTu+6qvx7a9ZTMSK7hugcaTn5o8SKo1esTqeI9nCjdjBjCSyR27x7jYOQsQ X-Gm-Message-State: AOJu0YwSF1So/FD5ZF326v5nnO46MqYaHomOnunlVyjVPaxPMDbgiuYC TpOgxhTfGcW7HFQVWyyCFfH4mv0QpViLT29zKRYodz8Wc3Al+kLghWivgS0O X-Google-Smtp-Source: AGHT+IEAAxHzBu/3CUMwZXKcGeHVjTG9/MciUgkGKMQnclLMbDsGFn2sctNnI8XkLFXsXcs8f15EyQ== X-Received: by 2002:a05:6602:2c91:b0:807:f0fb:1192 with SMTP id ca18e2360f4ac-816c4071593mr42423439f.1.1721156353753; Tue, 16 Jul 2024 11:59:13 -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.59.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:13 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 38/54] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Tue, 16 Jul 2024 12:57:50 -0600 Message-ID: <20240716185806.1572048-39-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> 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" Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, this tells dydnbg that Xe uses has drm.debug calls. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/xe/xe_drm_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/xe/xe_drm_client.c b/drivers/gpu/drm/xe/xe_drm= _client.c index 08f0b7c95901..ffd6e237f3c6 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -15,6 +15,8 @@ #include "xe_drm_client.h" #include "xe_trace.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /** * xe_drm_client_alloc() - Allocate drm client * @void: No arg --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 2B1CC1AAE23; Tue, 16 Jul 2024 18:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156357; cv=none; b=SogyTbu/CbBcv7WjPLebI7q+Xlty5TpzirNil3w3W+0wYIJAQw1NDgOc4GlU2UiDQPb2SCZJaxgmzZxvDwpBpyYwjjNdFG/hxESnN9W7zqbg3nD41P+MzUk+y2tr1qKT9AlITAWf/onz9XN6IRLfELUZQtLdAcpZkNqzCc35IR4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156357; c=relaxed/simple; bh=YU2UQyfbg5EPJu/ixpXIX6osoJjWV5HNauPmSud0G/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jOnAdpGZaaTCMugSQr7FQkRsmul1y/PpDd/l18gymQKvmtQwkPBTKAyVLtN5Urcj4qSgacjC/LgrSv3RhBHO3lCdXA7aoXys6HA6KigdKw8aMkFjXP2jXMHlv0r4HmX7ODeu9ek0vh537F7X3OHUBv/Q1vwrJDo3Zg3/QxHw29Y= 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=O4/ncys3; arc=none smtp.client-ip=209.85.166.43 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="O4/ncys3" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7f684710ff5so2537939f.1; Tue, 16 Jul 2024 11:59:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156355; x=1721761155; 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=q0SsnMAz6GH/rDMkbSAQVrT9nuU+frPtroMw7DfrzhM=; b=O4/ncys3HNuIsDlJ3XFHFZhBViXrZFn9Sr+eWY2x1S+NXqnpKV7MSgpgrL3NiX3pvl eS21/jK2Q7dLrAm9SJnkGwEmppNH5Z9PttRZitTEK6JvCrsVHecjq5oyDoKjA8K43M7o aE/cTFNHQ7eqSVe+c65EP7CDXZYNaf79/lCHd/03tAHOd/yypDo6LM7ZBX1EEzdyGnq8 uA6jZx/hbpaEuG7Ff/gMHW9CFaIpTATJ80D8g/dhkgUjqml8BRK2u/mglf+3g56k6hSL dhDZrLYD5F2evjFYBgVNaeSH8G9x39fdQpAgPVwCcHMN8Kkbmfwj6S9TInGzMQ3O/WXr 8VCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156355; x=1721761155; 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=q0SsnMAz6GH/rDMkbSAQVrT9nuU+frPtroMw7DfrzhM=; b=IXWKUgB1ku+ZxfhejGppkuNJ1KLnT3se/0NsbKfkr+9szZANfZpyQAo+wkiggWLjdP yX+iFRbvGRLo2iiAt9k/mYpq91i6+9gEQ6pyIA4k2Jl0fuEzTvn1oxrDwnmO4WxALvSE fTYZPqQ+bJMHAur0jV/GKX8UscAON3z+puWHdOyTaOEG/8ebKX9e8mUzOhUiQZQnqoV7 vgAD6jrZxksjbGfoJH/MEFtX2YzXKKtnEj+4K+fJHoAac+j5OT3lDZY9qtaaHHQdvTn3 ovoyXehp9A2BONWjLioN8qXwoZ1HnL9Qwm/ivOpwxY/4TIRcCtfR83Q9CDu4E1jf0z9M q68Q== X-Forwarded-Encrypted: i=1; AJvYcCUMhgZ1WHTjncvqiviUEj9vkIeq4brqJUcLuIZdhI9YNUumMeX9NirrBz4vJAQPG2KFmZs+Ly5P/eujVx0wlpG4joD55TBGWbf+ X-Gm-Message-State: AOJu0Yx4xMn9fUEBfofXoZXejQV8cDveo9M5CDerwZDpcwTuxedyZFvW uW7Vmfl6K8iqTOrzyRJbOeS1ouutYgxQ5gAQr/lpCu3JlqOlTI5WsHAV7xjx X-Google-Smtp-Source: AGHT+IG4PMiQc6lo3f14z8Q6mtR1iYHrjoCgqtBhH8cIy0Dzz/zfd1kFjfu0oHviBWuod8DuEZ49Gw== X-Received: by 2002:a5e:8b4d:0:b0:805:2048:a492 with SMTP id ca18e2360f4ac-816c4ee6d5amr23979539f.6.1721156355006; Tue, 16 Jul 2024 11:59:15 -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.59.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:14 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 39/54] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu Date: Tue, 16 Jul 2024 12:57:51 -0600 Message-ID: <20240716185806.1572048-40-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> 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" virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/= virtgpu_drv.c index 188e126383c2..d69d517de2a3 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -44,6 +44,8 @@ static const struct drm_driver driver; =20 static int virtio_gpu_modeset =3D -1; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, virtio_gpu_modeset, int, 0400); =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (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 A18591AB913; Tue, 16 Jul 2024 18:59:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156359; cv=none; b=GVxD8ZFcdI0df2wosBOxmWT5CRt4SHALPYYXFXYpcAuJF3C/WwBYeSv77QX/ebCM1V1CJAgi2TqJnrJRykfJer05e+kAm2HFar9YkeXuhgX1aPlXyq98TDIksUDVAaGyWpSV+vWyvMgFzvm3OtD1FM5xsfE9B9BLTR4XIdyfjZs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156359; c=relaxed/simple; bh=a9VDp0JxfwFaUs6P03HBzP4MVDWbWcJdL6+oQY7SWZg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JaMmFGOcpWxtDEip3GRqLNsl95xyw5JemVdrFerfR0IKrTRegi6ayNW/pri8EO7dWr5AObE1gea08l+yJmgto/uqj2RKWFx41faWFqvo+vc/AKFiPN3ipmGCyi3+JRsbLf8CntcKNda1pzi0ZQBywYN2znBvKgfonjDEdJ52Guk= 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=J0+rNVyF; arc=none smtp.client-ip=209.85.166.44 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="J0+rNVyF" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-8076cee8607so4724739f.1; Tue, 16 Jul 2024 11:59:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156356; x=1721761156; 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=iNQhk3CU61T+AcfVcUeB9pjaIkKdAz26cxffCe7xJQA=; b=J0+rNVyFglt9pPRH4Mb4wCHZAXXbDHrsAMKTz2BNFrlS0akkasEYv3M6xOG1iIR6qq LAuXwDo7MGJNAU+mPjk+JJaKThiXZrIlNmEoJInfzMQNC9ixMbqlabMBWLDwDCiczn4G DkvqjdO/YV+RanblajbxD3GVoe/Lz7XUpOoYIlaS7OSysPwst/bph01MxUwtt61a+TwH U6Gbucocuo+lwKVvyLtUwSCbF5ZojX9/UQHnTQHzNo6d2dH63aaPG4Uj+eWz4hZP9HWi 8UOsnIVPUbvzaMF/tZQax3zfJf1dg7jQxNYEpBt0MoG2AqP0nnzm21wCaQBCN8xhcGgJ Ceew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156356; x=1721761156; 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=iNQhk3CU61T+AcfVcUeB9pjaIkKdAz26cxffCe7xJQA=; b=W8kK70BmizzrWhM3n1ohIQPSJYDro5RPoxzNF2f2rjVtBAzXlgHi1O2mGp83PgIrFB /NQNmq+FpA9pw8DVctIObp8D9k6w1ar9beiOHwotTfbW4nKjY3WTFEXXtwBvB3q9xzrG eoa198vSTK8k8x6KUM9Fg4rrqbxn8c22mTtUzYN6Va09VVctMh/l250JDJ8xUoE9R+sJ yDT2GFIgyIxfmV03vMuoFOBm8nc9lozoYn2mzeTiulgyN0+qmBNPiVN9r2/WwFN/b05g VaeK4UnpIA5X19Qw66aPOLVqajlOs/A1QZwuMpzV8Bpqf5lXdTSxGZfR2Q3w1JV5cQ9l j5Xw== X-Forwarded-Encrypted: i=1; AJvYcCXYWypwU35qpeQUH4SfFYe3yRHMBC1csmcWRkp7b17NmNfwXXvu/3OYSZ4YwrGsxua9kvjZPmS6oqK5rpUXOaHP4SRZxya3HL12 X-Gm-Message-State: AOJu0YyEX+oD7MYjDamSYQsMPcTDLCPNye3kPj5aTOk3SmBIzXevqWNT Y1J5eNvtiuWpbXwZhFCN40kucWKhH9/e53zhzFF3jijEp941hC/xXpIeN5/h X-Google-Smtp-Source: AGHT+IERqs2wFcp6BuPJMtdrHm6x9C6aaXku1vgcCPBJMhxnTRyvGKpPaEvovr34nmjY1Lv8JYbY2Q== X-Received: by 2002:a05:6602:26d5:b0:806:31ee:132 with SMTP id ca18e2360f4ac-816c2eef653mr47483039f.4.1721156356447; Tue, 16 Jul 2024 11:59:16 -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.59.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:16 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 40/54] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm Date: Tue, 16 Jul 2024 12:57:52 -0600 Message-ID: <20240716185806.1572048-41-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> 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" tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/tiny/simpledrm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/simpledrm.c b/drivers/gpu/drm/tiny/simple= drm.c index 1d8fa07572c5..69cb580ca9d1 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -34,6 +34,8 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * Helpers for simplefb */ --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (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 D5EAC1ABCB3; Tue, 16 Jul 2024 18:59:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156360; cv=none; b=fpeykr2N+Ki1Wn1JTRxPSkkMZnZvRgyxWUuOMHEgt7S3QKqtnAT6vxckk+AdiXtY54l20Gjj0VCpRK4b3Gr3fgqCOW5kn6DmA+9ZWh0Cjw4keqobPKM+WbKsC8e9H+pYRxx5rVIZr2wvFmEazCGH8LheWB3juDlPKdjZTK0+lgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156360; c=relaxed/simple; bh=tCPOUZzz1n3M3/Vbz4zH5Gffd4O1Gv0jydxTr8IfQGM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nrwsiN6Y9loNk24KksWSs4dFpuj2LLAbGqC9NxBQmjOz9H9y+lbQlfjl3ra/+b+5L/Hcfik3n2StcFgozu1t7eIwvf3mjWvbcg2HLO6I0UTNQcU1ExEG1/Z+l7W6/nLs7gKybd6Hx8XpG/Y2aRLc/km8L5Oqsr11fbcJxIZDkWg= 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=QQurEcht; arc=none smtp.client-ip=209.85.166.52 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="QQurEcht" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-8036ce6631bso5974739f.1; Tue, 16 Jul 2024 11:59:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156358; x=1721761158; 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=BVVliFbCcRiwMu0SQpi190huBei8IpcPa+B6oudggrw=; b=QQurEcht0lkgNTKnoDQPvwTOp6//JGBX8VkPv6+js7WOHG4d9UStbHrqkocxinahuO ZDSkz0Y3ES2rHLUXRTKDPu4pUEVHPjKbO10QFVL3lkQxEzITFA0WhbpEr9vGOqZTfds8 dUUFTvbwdch/39TK8IRVmiyinP494wwjOtd/yfoWKAEywST/cK83XjmM57s5cxnQcF1L QVu0h7ClyjvpxheVJ0E+9iaOVYsgFpPBy2nBIjS2Fmn4JmhqjsQIZKrj88STtWJVlu9G MX/g2UPKRYu+4aQxX00QKmG6bo8r7EYbxHWQqN8TDxFtNEpfzuH6Ll7y7t7r20M7WghX VrBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156358; x=1721761158; 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=BVVliFbCcRiwMu0SQpi190huBei8IpcPa+B6oudggrw=; b=SeKtqNwmq6cvfZQ/+MFERLtClSx/SxdvTp8Qi844dcssUHMV3aInm1QB+etBok4hLT 45Q5X5bmbjcyHd23ypGYBy1pd+5NIGxNngxZTlej6xIL6BePlX8UUo42MxqgDKtFTUoa xo7V6zvpwVSOOJhgbkbRMO8g1o0YtuHIUzqdLvOdUkXhco5kczrHKKdYGgi+efEjZbFi OCTnT2ev5tabSoviOzuMFQ+6E/7ShhIokfmWjEeNtjk5GTQl/5CH2OQgQqdWXXtLtOlR j4RCiO13h/MozvOf1vlIDNE5a5ogfj3H6ZyWGZQIoLZNNzrvCVhGtoWFhtM1bBJA+f7/ BbGg== X-Forwarded-Encrypted: i=1; AJvYcCXb244X6EU5S6HixBFEvPSGR6Y4C3v3m23W0P54vgPgJ7cEEYdpFWGzoSTIVcOHyfbYpdEn1ddCoAbFdONfjj2M47wo0xgnAwvw X-Gm-Message-State: AOJu0YwMFdoTSA3RdMNqGsqv1aRxJeun8q90/GXZCm1bjQlpGWjQDV2B 9iAHfrh09/zzdkbyyjiJRsCgW3nZNeh3TtPwP6ypOD7KiLjoVB2w2TA760NL X-Google-Smtp-Source: AGHT+IG55r3J/+WPjmFCfm4i2FdKqBFiyLji83RgakUJ5UGwMl7NPkDm7WMlJ0D93dK102jpqkJ71Q== X-Received: by 2002:a6b:ee19:0:b0:7fb:87d6:64b with SMTP id ca18e2360f4ac-816c51c78f3mr33599139f.17.1721156357639; Tue, 16 Jul 2024 11:59:17 -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.59.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:17 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 41/54] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Tue, 16 Jul 2024 12:57:53 -0600 Message-ID: <20240716185806.1572048-42-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> 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" tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/tiny/bochs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index c23c9f0cf49c..ee98fab5597e 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -54,6 +54,8 @@ static int bochs_modeset =3D -1; static int defx =3D 1024; static int defy =3D 768; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + module_param_named(modeset, bochs_modeset, int, 0444); MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting"); =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 F3F091A0B00; Tue, 16 Jul 2024 18:59:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156361; cv=none; b=fq+iAqudDWA3Ku4RCs54X0e/oF2TGXiKFc5kFM/4txAD/Bf9wD9p2/8QDuQDz1k978QIRfaJwrWyRSLR1qqurLTsJAk161jZlC32i9xRb/I4M3wLobzMhJtPi9EJbpelJDu5iKFkDo0t9QtU+9z8cZoXVxcxxEFJxZW0Zo5A2eg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156361; c=relaxed/simple; bh=jGiueC+Dh5EN2Lejau2B4bSvCKR8MfH5CgBIgeJvpL8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F31woDmBUE9y9iIKmk3T4iM9ufA7td5aYcQzEe9Qus92w0+pDsFsHFomdx3a4E4HyuYqRUyShVP4kysesH4ncCvQWcL6eUp/NnLI8/A4WCaMyq4W+7sDAPkqiF9VXH4fQN8Mq2W8uUkoAHq/jDv3WHrlj8A9Mvf4qbbuu2uc+R0= 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=UNTpPZzX; arc=none smtp.client-ip=209.85.166.42 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="UNTpPZzX" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7fb93b2e2a3so4700439f.1; Tue, 16 Jul 2024 11:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156359; x=1721761159; 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=pIsdMzCagTnPqkjtDJJFzcS6RuUfrVRwKo+d8V5q9yk=; b=UNTpPZzX2HTNWMlDnQn8IfNKx+PZHp91yCqQVhqT7CvywN1vvXkT0VTDy+luz25Tcb qUjNiG/0DJaznw5wkPWP9/U7oPhYz8zA/NywLwor3C5G57mvxLsCJEG2xEpE7wqCPaTa vf4RuXhADkCjk8FsmTTkySBIzamKdNZU4V0/IbJV8yZjAVAknS8AjeArk+eyv39nDzAM 0a1SdlrqwT+dDYFTl60hfsHCfURUWg5CxiQXJWCFaPoYTyzBUbksmQiB+S4P4RaUnePa SCKXFsLtdvBIG0h/1zQfZLPrb3BTiLQBjdHnmHnoJo9ejjqRH4DFFIm5G9PgNZLQRg1x FBzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156359; x=1721761159; 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=pIsdMzCagTnPqkjtDJJFzcS6RuUfrVRwKo+d8V5q9yk=; b=jONswiWXlKdB8JQK2tv8CWnARWn2KTib9HvqEnseYSsyJ73ql6UK/o+eZ+PH8slO35 DMk9GbVgz7mcrvVpiXi/RTPkFa2ZrfQFGAQm5HvZAJH58tTfk1sWkovNuptznHhwrAyU aVCjf3mLs6IMQ5hYv1K5s1JO4Jqmr7ENmxGM3dD+JF4J4WFeA9GWR1zFMIvPpxCicwzZ XFMFs2amTFDx/ebIVMNw10dekygMs9/hPK2Qb4BiHf7og44hd/EAzzxxMFFJkqaBsF9Q mu5lXufwxJNxMnEPP1YPtwHaquSsOq8yWdDsUuMlgwkEUBUhke5IUUrUiRLxtlTbKVCr GXng== X-Forwarded-Encrypted: i=1; AJvYcCWVzgBue74gjFV1AJvEdGie2KT8Lde2u6EpOwwj8vlCT4sYiH6mGHpfyinwr40TIWGxNAO7fBUp0DehP8SQGw+EodPlJvnYns7O X-Gm-Message-State: AOJu0Yx4VJybs3iWPuV/w8+PqXteDw/9pNZbqUPK/4LniJcz2FXRIpHA MWHOOFgnhGXDwFOMxRvjRtzs6rh3aXQ/CMi5Hzvo4v0nTKhHkX/meL/KMBjD X-Google-Smtp-Source: AGHT+IHNiuOywTynIegoUOvJ19aVvPGNEUWBbbHPTejWdZydJpz41aRG2QF6opmLXH5eEouAFJcPxg== X-Received: by 2002:a05:6602:3fc7:b0:7f9:bef6:2068 with SMTP id ca18e2360f4ac-816c35dac54mr41725439f.10.1721156358829; Tue, 16 Jul 2024 11:59:18 -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.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:18 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 42/54] drm-dyndbg: add DRM_CLASSMAP_USE to etnaviv Date: Tue, 16 Jul 2024 12:57:54 -0600 Message-ID: <20240716185806.1572048-43-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> 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" etnaviv has 5 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs as well as plain-old pr_debug()s Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnavi= v/etnaviv_drv.c index 6500f3999c5f..1d1ddbedcb5a 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -25,6 +25,8 @@ #include "etnaviv_mmu.h" #include "etnaviv_perfmon.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * DRM operations: */ --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (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 291E61AC225; Tue, 16 Jul 2024 18:59:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156362; cv=none; b=tD1Netc7cQo6jvg8xd+tS16Q1wizLFmdxajcJ9Lypg7LDbZD1L+GpQPhYCnBZvxzRaHUvyTVF8/T7UXoBM56WFQZ5gWdl9lBsjSaXjM0udAhEFN4PdXWY5e5IyArvO4egevzisuGFdb//VKvt4HdXxIcMlPAqbVtUsDfDXEA/WE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156362; c=relaxed/simple; bh=Bnq5BQKfMG5kstkLfy63VtsHV2NPk24N/ajWD1f0Eak=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T1mxJMhPRabAHHzqXfTLLeFtiC8yGoPE/lOHy+VoRt3sYCEpNlcBYkpq28EMvSve7eI8HEkEX5tzMQSmX6DTCl0HjQbSDWddA3qZGNb8uBTFstsTwwGNwQQ1/dNTZsTOqaWwO0eI0Ilaf32P/EfbxkL1c8obmZn/BfeSyT6sDfY= 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=mHBwnrU+; arc=none smtp.client-ip=209.85.166.43 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="mHBwnrU+" Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-8036ce66134so4816739f.3; Tue, 16 Jul 2024 11:59:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156360; x=1721761160; 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=MstXp7FK88BMTd8JHXdyfJJm9pHe+R2QRKpv7nuxLhw=; b=mHBwnrU+3zcVShXP1EZ2fcYPTimelr7waAicW+i6R8MWvpIgT6NyQZRYT9HW4Zls9Q Z8d1rI57HVEuQi9FL6ysri2hDmKoltcHtNuONZBD0JKIMMh8piHOTRp2bKO/DMa+5mYi Rk8NBgkLRee49gVx2b1BCbi9fz1IYWa3n4mfUvOAoEi3m46NBOzYOgr3MamzfnprcE0g XGBfVyLaLRIkeGu8WujRe8pIiiCmWc00jVoKv3gHnHYZunb7HMYvlXrAvWmEJE3tP1Az 9T+Hl6a4jGR8ThnEuWdfMnJVL3y51sZ/YqLU/WZs4TEhHCXAGmH50HAgVoEb0ZGzD4dv c2UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156360; x=1721761160; 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=MstXp7FK88BMTd8JHXdyfJJm9pHe+R2QRKpv7nuxLhw=; b=f5VA2S8+N6UOrzuIhYN/IWT7gEp810LkaWnI7njBHTjUa4EbmzOBJAr76hIIBNPNHd M69pyqdfBg6YWfoTiWii2/w4J4kl006xR3TioBneo5w0jKysjEasXo9QoCznc2HoOydI ALnEP4JXPOZBBlBDuUhps+gcTM30L9fh44fTT+bQivl/r4nw/85eFz2fpdEUJq14UhkE iRZx5OfrFZqae0KAauDJMY4zDkPOiUQ5y32zVRKgKmA9Y39FYgXfIox6ernEpgREtfxP Xwx+5e+ed8CECUaOhpbnzspTk14TgQesvU4dYZFc9gAJMRvmjKGDjnnf3sK0LDWgYQFa VeCQ== X-Forwarded-Encrypted: i=1; AJvYcCWGowS1thoF5aNkUwnmagawS/gRS9rYOo++RIwDVmc8q5rBgcyF7kphq8WPsjZRgIc908P0ykzjN2YL4uGdG36zn22Jinyf+2jt X-Gm-Message-State: AOJu0Yw/MQvnxxmok4rRlWnpzrffAzm1W3x+lr3O3UxzDJi+kIuqlwLF h2ZtC8k9bqLrbKZAIF0nZ0KqKpiHWWSLVAf17O6O3czAR31BX+y7ZLujktbM X-Google-Smtp-Source: AGHT+IGQuunN6rsgX1Y8tE4Gm2pjADPPVTDv3hD9rbQpd59uugz0Y/Tl+qes57urn2HroXprfn28JA== X-Received: by 2002:a05:6602:2cc5:b0:804:fc36:dd02 with SMTP id ca18e2360f4ac-816c52c09bdmr40756239f.12.1721156359955; Tue, 16 Jul 2024 11:59:19 -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.59.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:19 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 43/54] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver Date: Tue, 16 Jul 2024 12:57:55 -0600 Message-ID: <20240716185806.1572048-44-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> 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" The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/gma500/psb_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_= drv.c index 8b64f61ffaf9..5e03ac7ff433 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -39,6 +39,8 @@ static const struct drm_driver driver; static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id = *ent); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * The table below contains a mapping of the PCI vendor ID and the PCI Dev= ice ID * to the different groups of PowerVR 5-series chip designs --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (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 563801AC245; Tue, 16 Jul 2024 18:59:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156363; cv=none; b=QoDMUAi5YlfCarYdX1izki7SpHLdPNXlGLenyaXxh6STEsmu1w9Gb4aUESElMKvkYPYPytLJiv6LZGarLL6yzeWC1uqLa8C+T2BbXIvmDkWnWJR6cZfPxNa4WzwmE/H9a/uEfq4AR3VusJBu0EA1w//vxc0OaftClZJDtaSMjNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156363; c=relaxed/simple; bh=iX3YPrehKsc8JYsY/MYFOXIO6YJ0coOili+oIW2ckmc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MnJ4lAWk6FyjIo2WvGHBrNvI2Yr3/Mx5hmXDpgzTT5uZ9MIStEQIIOIk12SKNA6ZjAX3z6SsaflU5TJXe9CcLkPLK6l2n3z+n+/0iUi3XuzO1h37CvCVLtz/aQ2OyP0CC1Y5lP5xfXZBQfEVkJrPLvrHa/bEs6qa8ihq/cuwDTc= 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=QjBuM3Ij; arc=none smtp.client-ip=209.85.166.44 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="QjBuM3Ij" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-7f99d50c1a6so8660339f.0; Tue, 16 Jul 2024 11:59:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156361; x=1721761161; 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=6+Eqreo55RWzciyFbwYCY+bKp2K8wKhzwrrhakb4uDM=; b=QjBuM3IjAs1RuQZWkVfY7Q3qozfsA0fcjbpValTODKIraMLKz5ntH4eqV2QO5n6aYJ scy5AfK92R0Jt64/TwB0+7a51H7HMlUeORjUco4NICl0g2GsWXFryyXLetcBX1yHqSeO JhCvFbXHBtBbFd4UFEYjupaxHDKm7g4jK6wgW3OXvKyozqerY4YCh1AjJHyrTPcFCUp3 IPRyM1NwjHVB9NajxBhEmewAd+SSzlX32OjgabrKS+fBh95Vv3Q8TvmrAv2nuTj1P9Z6 hrrZ/eOxnaEcSc4s+9BusgOB7xsKV5ZUNUR3i3avBeFaleRDeimGVeQAtGauGfXJUx1s VCVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156361; x=1721761161; 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=6+Eqreo55RWzciyFbwYCY+bKp2K8wKhzwrrhakb4uDM=; b=LmOEAJCxkynPD4wUC2xV60inRnuCUhF4K0pqvLsSmrIvYuiMacphkw85wAxVV7UhrF t94HoSu9kFDZITcOeb0nrOGQziB/OHbQZ4H/+ybNBe0iMSxB4eF8rYMJl0+fVrL2yXe+ yO67qWRMvFcBk4BaxY+r1paw7H93hBa/uzDz7wwwgE56HGISw4YIAztkVDzbOHZSNm9N xAGdAg9UcdjRbsgcLaic0nkCgoR/jlAkp8hWfAwsUv8vNgWcRhB9iXuljGKSCvM/1oFF yUePvdrmN+7HBHQ+xHaJ18s43FAtNttXEwSQ3gby+pCDC/IpcU10ldSUbCQg40BeIJ6e GaZA== X-Forwarded-Encrypted: i=1; AJvYcCW+HGbPsMyzRopFdYIaRgalmLLU5Gyi7jSEdiwS1LJ/Op7bHtk4uNbRfZtJa5MhsKqYG8fGgR+4n2B2/mUFo4nUOVjg/q9bUlU7 X-Gm-Message-State: AOJu0YxFc/PmAUyRZs793b8V3jixIt4K/y5Pi4ZIEQixppwfuoAuzPvM VChIOcJrF83o6sUba4kggBKlsBLQNS9uirgZV9Rmly409bmrr0/cpuMWMWlR X-Google-Smtp-Source: AGHT+IGtnYxBzY2m77Nru2t8Ww4iLoER0sn1zlADUp06c3lK5XjVl/QUreG+Vnsvc+0HVrc3CXJwNw== X-Received: by 2002:a05:6602:1595:b0:803:6699:787 with SMTP id ca18e2360f4ac-816c00ab42fmr43054439f.0.1721156361195; Tue, 16 Jul 2024 11:59:21 -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.59.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:20 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 44/54] drm-dyndbg: add DRM_CLASSMAP_USE to radeon Date: Tue, 16 Jul 2024 12:57:56 -0600 Message-ID: <20240716185806.1572048-45-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> 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" radeon has some DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg about its use of the class'd debugs. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/r= adeon_drv.c index 7bf08164140e..d22308328c76 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -247,6 +247,8 @@ int radeon_cik_support =3D 1; MODULE_PARM_DESC(cik_support, "CIK support (1 =3D enabled (default), 0 =3D= disabled)"); module_param_named(cik_support, radeon_cik_support, int, 0444); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static struct pci_device_id pciidlist[] =3D { radeon_PCI_IDS }; --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 E39F41AC421; Tue, 16 Jul 2024 18:59:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156365; cv=none; b=hyQO+2TBpBdqq0byJ7A8wLatSQlzViO9WTiv/wFEQ5pNuGWSyvoXQ4dyIvRXu/wtg3pSRGNY6lGJrXT0qt4Go7uFfX8iNb3jhswFIiMagTw5zDIz39TQjL2izztvQnp/D3uVKt25pO3MCA0Hlljs6Tl9zN4yFtG3oErC27NlAiQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156365; c=relaxed/simple; bh=IW3s7sT2wCImsg5MxCShRcdd54vAplC2TvpdeZuQvns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rAbnJ9X4WxHpUDHIp8JkuGDTvCZhVsGCrr/j27pPvgLYcigSPywvmKf0TJL5DBMLhydyvCaz1akA5qjPtBqDePQn2ud7+VGzm6K2V1KOuJPFhyAL5J8mF/KQ41qhOlbABWjXUngOGSJXCE8jouPUfEX6luZhATWc8/XOyduOp94= 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=l/4ygcl6; arc=none smtp.client-ip=209.85.166.41 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="l/4ygcl6" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7f99d50c1a6so8661639f.0; Tue, 16 Jul 2024 11:59:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156362; x=1721761162; 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=WP6HptfiTdQ0tPqLXKJ5a+6n7jBPHeNyJUhIr64YncM=; b=l/4ygcl6L7cTiGPLtS7Yuki8zXHHmoAP+1G5r9yMtXbZ4ZPnRDfZW17QIGRKsVGCFK yxt9wNnJ1BvNjOGt+f6fTp68XGNouoVlHHkFjBbSVpr6SxKgp/vViRdvuxSNCSOfZKTR 8veqY2N0yn8SpUb09vrdaG83c78baTC26IkOctuGY198UcEm5SPK0HYU3NIrqZgsMQa1 Axm9Rc9mw0cDQsMoWqpuTiaSMI2fGN4owLRDpcRohIuEnGH16dAA09RZolbBIVXScQvG BMYValnUr50LSCMlagA4Ulruzw7MkRHR8Kh2/5QsQ1VjVKh4r32dUhR5iwTZc2Ze5ApZ /R+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156362; x=1721761162; 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=WP6HptfiTdQ0tPqLXKJ5a+6n7jBPHeNyJUhIr64YncM=; b=Y9X/jn5kSmip6L6aD7rXtFpi02UN2zCitnwFOkgWOs60TyOx7gO0ne+CmViEAZ3XAV ML63WH0aWjv2z//lvegI9O50Ei9cCBV0t9G6kfS1tgiGRXix4HMLqWGl/0At177I44XL wBvBq1szFpIb+2Nobfm5acR66j4EX3tvQSdZRh2HES7+p1MxkdF99c/V5W76yrmMyReJ DvUisEUhAOzFyhTcS3ZbUZgD+IxRUMXwojPizluRQflfEZp4douf+rzhiFGotmzttSCj guKdVAK1GEoKLNesoTf1dRc8r0pO/2YHKLfAfD5TiPEV3/bGPdMAZYj9lJow/TEdvIXp c6Nw== X-Forwarded-Encrypted: i=1; AJvYcCXX44lTGV986kYLAIIWFFQtlBsGcYSRMXb5drYrv9seg43JaK+0RmHevI/IKvI+WjyjMsvYC9TzcIK84bEni10cXeViVInOhDLo X-Gm-Message-State: AOJu0Yybchn0bArKbth03v/+xh/zDxLtV6lVWwKuClgyf/mOB2d6XH37 ZdL1XtWarTLkMgjT9id5Gv8l2DeijrwMQw1MarDO6Qt2CFt4DNdHf0RfDf1V X-Google-Smtp-Source: AGHT+IG0qJNgrwAVUIeZbI3iE5ZWAneLU5YeLYaL9upPtNIQr6xsAykXRcCjaAh8RTQq2lp/KAQPhg== X-Received: by 2002:a05:6602:6019:b0:7fa:b6c1:c35a with SMTP id ca18e2360f4ac-816c51c7898mr35514039f.12.1721156362418; Tue, 16 Jul 2024 11:59:22 -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.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:22 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 45/54] drm-dyndbg: add DRM_CLASSMAP_USE to vmwgfx driver Date: Tue, 16 Jul 2024 12:57:57 -0600 Message-ID: <20240716185806.1572048-46-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> 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" The vmwgfx driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/v= mwgfx_drv.c index 823d8d2da17c..fd6cd62608a9 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -277,6 +277,8 @@ static int vmw_probe(struct pci_dev *, const struct pci= _device_id *); static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, void *ptr); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(restrict_iommu, "Try to limit IOMMU usage for TTM pages"); module_param_named(restrict_iommu, vmw_restrict_iommu, int, 0600); MODULE_PARM_DESC(force_coherent, "Force coherent TTM pages"); --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) (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 6AAB41AC444; Tue, 16 Jul 2024 18:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156366; cv=none; b=DtMNHsGtOnxCdliT7uRg4JezqYV02FlFnxZWHYGNqZWft88URoZvVelB8AxxTxqjNP9LA1NxdT8FabbkL+bkF/VuMvKVtQ1ibhGLCJ51Hojo7yhsDXA73uVDVy471rVjdkPADNsUpbptXcJ6Jp63J3URH/Wa2tFjd4ei7OlVeLw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156366; c=relaxed/simple; bh=oYOe2lhXkLlShr79+oMb5s3dimYUvU++xTU1aiSXEBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HpPecM6LxRtZrH/0KW1w0j1ewN79ktrbCYad8U2CCBMlm5E7VIc9BtycuPcaXn2/NkWMd+NMgmjJg9/UJb0Wxxt2/9VDn3V479xjmpAz3tF0NGvhZofKn4FpaSp/+lruox/+uf14Qxea4tosi05htfpDP7v28lBlEUH/3PeGLSI= 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=ebjOzy6l; arc=none smtp.client-ip=209.85.166.51 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="ebjOzy6l" Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5239439f.2; Tue, 16 Jul 2024 11:59:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156364; x=1721761164; 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=Wh8QJ3ROh21ShBzcCiOPzlcJgoRl8pzdhd6qJVNHlVY=; b=ebjOzy6lH87HQXHmm8t30PD8J9iO/bdiTPaXK9OZ7Wed+m/J/MKkmsmtVpjR4iLlC8 bPl6N1oASWf3Syl23AetpMKkaXNWAZH+BngysPpvmjYjoN17jgeUBdomRNBda6n/PO6V ubohT/apvf48rvWAPCUUD1JEIxF/XKrf3WhMD4OtncjxFluXNfh7oLg09koumb7Tgx3i EODRLvj2/23791KnoTI8KwcDXrRNutXyJ/mscBr38S/YwjrNjtjrSnWH+oXwvTL7Oma1 Di0R5pIjv0zf9/Dd+Rh4G+brfXpGzWe4OQm5N+BD+PMoOIgWJHAvm0a1FaKiXDhFrrSl R//g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156364; x=1721761164; 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=Wh8QJ3ROh21ShBzcCiOPzlcJgoRl8pzdhd6qJVNHlVY=; b=BgW+cRSKDg+si5XzYS9DkNG4eg64/xsK+JTVPa5Hp3i1M8ep4QIvFtYw6G8f8Kk1Tk FdnDo0ZeMYYiURk57+lzwvPIQDEQM9N290uDsFFMcQFprWVDC4/717RKD/4qmK7fLjcO u5r1+VYFIvpPTQpS31Bv+V9UpwH6ppGNAcjfW0vSeFyuiNL4Uk5x/rvgH/D7j7Rh8P92 w9pioIPUA9fe/ms1Au6VKzLz+QrsX69ZjRW9nmGubSrps9gK5e08uiEGHOIOJe0aEcjM X0AkXUKF5XCLYmqCQftSzJWLzPow1eriipfih+/sHeSAqQIBefN/0/jPqlNpVoV0ceHP W0EA== X-Forwarded-Encrypted: i=1; AJvYcCWJ2rB1G1k6eEtLnjfpxXXYWU+CmE1co0Vw3uft7uMOBUQNWI5WqVeIuglm2YYkuuMfsBw3DTADoXGDkMvCD3W9TxecLdoZDKIK X-Gm-Message-State: AOJu0Yz5enm03VaEzLuvB6oV+vlv+sppQek6D86kbn3zzBzuZ5V3ACuu 39vG7Y+E9e27e2v+jvaRs92QufdIky0mpocZXLrs4LiKtFZgjtJlCVxy/fRk X-Google-Smtp-Source: AGHT+IE7JSdS637yqmgSK0kAxgcum1cr1TH5x0rj6iYZ0/p71OMWMmUHkP3RXNMmv9mFZHhsjrkz/A== X-Received: by 2002:a05:6602:1493:b0:807:4340:947e with SMTP id ca18e2360f4ac-816c4a15d70mr32398439f.15.1721156364251; Tue, 16 Jul 2024 11:59:24 -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.59.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:23 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 46/54] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver Date: Tue, 16 Jul 2024 12:57:58 -0600 Message-ID: <20240716185806.1572048-47-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> 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" The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_dr= v.c index dd0af086e7fa..086797c4b82b 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -39,6 +39,8 @@ =20 static struct vkms_config *default_config; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static bool enable_cursor =3D true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.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 866F11ACA10; Tue, 16 Jul 2024 18:59:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156369; cv=none; b=Osd3yE5uD2iQzFKMUYuR2CjEop4zYKfHwazusKcpzDupoWi47CxDOroFNGMTzWDIuKEuJRyvQvthILE3RAoxRkA6djRXajnZE2ZnBKi+St2VynFkk0mnHvCItgcE9Xb1Oc6EGtVE1Q1bwvUdF+4gHcvXHpMMc0UcKdRaPwLDFi4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156369; c=relaxed/simple; bh=y0Zoxeh2NDhcrC27lg8sSPwKxWiQbpVmdMoWiREKFWk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dEYR0DqC9UgWVwUPVbgS4B/KOnr7HFlZYFAXvKSiAKDZvW67vumIHZAS3rhXf9My2n43DmQHA3zE2Xge00VRc3sqdaSnFExjqKw3dDGIGruXW5rkd7acmJCjGAEUZUuXUHRMvTifaVphX/R30GIOQuvu40R3fg2l3dIxUMayyBE= 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=X0ph/9w/; arc=none smtp.client-ip=209.85.166.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="X0ph/9w/" Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7f70a708f54so6577139f.3; Tue, 16 Jul 2024 11:59:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156365; x=1721761165; 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=o0YsvOK5afJ8qV3rkuOU7CKX9HpGcds0hiKx8bDl++s=; b=X0ph/9w/sUyeFk3HjpCH+EKQUpleTxUxhFA2P5q0uOmg06FfXCJQE/jLtSrTa5jKpS mNpQqtj5ESg0+sVrjgxCceacXSB/VNwk3FeHOEa8JYS+cU/D/DEu85kZ78Oqp93OVV40 tojSVsg6vB2sqpqIqr7cx9oc1hzZSubuvwWpe56goDDUPHbkeUoe9Xby7ivReUZtyFPB sWiAVC2IoNpTs3aRlmpsGGZYjgovhW4woLK31x35EBEcr5+cOcQiEgxXP93hmLf4k6N0 ZKAKrDC6BaJskcwvWzVUUcJNmK+2xuczFC9mkBi7ckjw3ibvfRz4uqA6mDzN2XZYShpg DfaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156365; x=1721761165; 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=o0YsvOK5afJ8qV3rkuOU7CKX9HpGcds0hiKx8bDl++s=; b=KvfFmT5AXA4JnXIJ/MAqr+ilClk1M0CGDzoY1kcK9FEzfvb/sbU+faFpRAe9gBdoz9 AwqEsu46SG6KLc9c1wv+cqYCDLXpfMkb3odm6/F9VZDWrOAI7gil9ooIgAb2PVD7ea+2 aNzklu/SY/8MmxjWZ++6FxqA1SuKWCxY9VE0NuA5chSnBpHfgvgDu8Sq/kttP7A0tEv/ VzXxU1t0sjTDhMyFiqNh4Mkfolf84ARmEYBJ0RLHlj3WixlIFoYenhQaSo3MPO6nrl2K VoajJXXJztzYr9xg1xY4BZKLTKTC0Pjv9nnUutximHKc2cQaTM9ZfiTqXiiOu3c49Ppv TwAA== X-Forwarded-Encrypted: i=1; AJvYcCVTMsa0mlID0sguBd6SORYIgrCa5YXAdiH99UfVHOZAHSyBuCfKK+dtegw9yI04FwwwqeNnn6J2yiHhW01lLTfVxFwi1FzhVs++ X-Gm-Message-State: AOJu0Yz1CpibcqXY9iZiDMV2rD8c0mLITM/l1rwzsTUL0C9oNq6m3i8Q /H79BSG93R0W87bwlO34qQKjElRJs4TvHyyeWvs09PsBOBz6Mg8+B79rRhCg X-Google-Smtp-Source: AGHT+IFqBmnPojKGoLSqJ/fbhD9h9vqlD9OR7+D3gArRQ5jLMYdMb3YLCZRkAWmsE4QPVuPM6u7NJg== X-Received: by 2002:a05:6602:3ce:b0:7fb:790c:a317 with SMTP id ca18e2360f4ac-816c32c9ademr48084039f.6.1721156365415; Tue, 16 Jul 2024 11:59:25 -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.59.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:25 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 47/54] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver Date: Tue, 16 Jul 2024 12:57:59 -0600 Message-ID: <20240716185806.1572048-48-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> 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" The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/udl/udl_main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c index 3ebe2ce55dfd..ba57c14454e5 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -19,6 +19,8 @@ =20 #define NR_USB_REQUEST_CHANNEL 0x12 =20 +DRM_CLASSMAP_USE(drm_debug_classes); + #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) #define WRITES_IN_FLIGHT (20) #define MAX_VENDOR_DESCRIPTOR_SIZE 256 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) (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 1C2001ACA18; Tue, 16 Jul 2024 18:59:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156369; cv=none; b=SasxKbgVl/Gzr7xT4TWD5imEts6GA57/e9AD5IJMFpKWFwpclLNGRgmyH3nZ/4dMP7haQSf6L4aeeO1J1nbB0uvdmoaSMbKyv4nYX5PhIsoH7IlD/L/13Rp7y7bKY53UB6DAthTDIPTnE0+TkeUU642nmyVA0ZwNZEPsmuzECQ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156369; c=relaxed/simple; bh=TX38Fwwl2zTMhUpMRgW8omd+SgE7ILpv++5XKavk0hc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u7W1wSWDE8ydhzgFSBePTYqgjIQglvF8DKDgevaa0+oocTwmIN9/0wGejB+p1dSAuDDHa8x0Za8lRzHVSw+3gCOmZyLJj3EMv/+g3HEOTGl657T00F9MaKVD38H0iG/PAoSqYUL4X0DXXFsDz2H66in4wbaUHsGtO8TmN0eLd+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=MLlKfEbf; arc=none smtp.client-ip=209.85.166.45 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="MLlKfEbf" Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-80a2939265cso6231739f.3; Tue, 16 Jul 2024 11:59:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156367; x=1721761167; 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=oC5iipR2BEVxGSl/++A4yY4qqMQYODae2mcnPNjxpHM=; b=MLlKfEbff2SiTZIiWl/PMtPqbtfAkwDwvPGkkeAfH9vdZwoCjHLVUovYz6YJ6oWH1T pTfJUWj6Txw306cd0gr9FQTUoEoOhUgTdQOzVm6V5RMIg6RVDllMvEJjzulijTTCpF01 TvCadX9BPHGuvCAhgWqTZVz/lAi0rYSHdtO9jEaYC0mD5mrHfH9tmOIGCNU9agoIVnkD lecNzE1HUrJzpxvMTdjrOFOGRVWLfEvcfVYhKOugOJ6eZq9KjgANbTmUcX4hs4lCnqje HfeWrFF580LDkZ879NEtCFHfMIwHeVRhlDCCDL/IEa0KoeK70l1m/JxijRe3x+cnzRYR ySWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156367; x=1721761167; 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=oC5iipR2BEVxGSl/++A4yY4qqMQYODae2mcnPNjxpHM=; b=OzJyxsobZLItnAPbsup1U4GKmiJJ6YDP8r7HhECOnRHGmyVer5U46nUdms7BZwi4r7 8VdbugrrzWZXqkBGduC2+KJV0sCvE5Dd8lQeWfAFBTQF+K/N1QQLXP81DybC0EI07zB0 MWzdfHmUHMN6MVUFTcumF734T/YWp6JEPAudN3K2vp8SAypix8QXo6UlUyyeH1J7ZnDr KQ/++NbVIY+Ti/EGxpF+O1nKgQ0FUPOr4ujds2MTQ+a1x0HD3KKq9WbIUH+ZNGRu/M7u y0gqSrylg1xUU0eaWk6s5yD1wygtYF/Upn5wtzUb0cLwSmriUWLl8XlGcu6myNGxvGwJ 8RIw== X-Forwarded-Encrypted: i=1; AJvYcCX9fMxX5SSi1IXA5irmLuuV3WDXLEHl3j6rc/UeaJws2Ubo1uAaX5gdUuyW9iuD7XyGuYRD6FoILE/5xCR7U4qDyQ2EYyuajeN0 X-Gm-Message-State: AOJu0Yz0kNz2xCkjfp0ohIJL8FslsdcaEz5hgRdzgqoSben5UvwdwCSQ AWup2QLpxpNwygGBRIz2uvhoIl8/TaF7gprvmdWOrKoQIpAoddolgsiRElrF X-Google-Smtp-Source: AGHT+IGMFr+WRvPUWShhESRsbZEGA/7YjF6pB7FvYBPrtixRbfhiQCet+WIVbY4uyS0xlTwYTUKheQ== X-Received: by 2002:a6b:e60a:0:b0:814:65dd:8cdf with SMTP id ca18e2360f4ac-816c39b7267mr38223039f.10.1721156366976; Tue, 16 Jul 2024 11:59:26 -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.59.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:26 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 48/54] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Tue, 16 Jul 2024 12:58:00 -0600 Message-ID: <20240716185806.1572048-49-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> 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" The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag20= 0/mgag200_drv.c index 573dbe256aa8..88c5e24cc894 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -25,6 +25,8 @@ static int mgag200_modeset =3D -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev =3D &pdev->dev; --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 452151ACA28; Tue, 16 Jul 2024 18:59:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156370; cv=none; b=p3gZ5CSJRKhEZay3uP8HDrxeYERKeVM38SwMYRCbUdaX2zANpJBSj1CCGl+wjsuHzCh2UoK/EemjZAgeEm71rWfrAsFdaFx6WCnTypnbH2jH9T096QZ9srCYTSnfxC1uvO6hSmfOn5MpxI1wZJonhm5AarYIslquE5ANyA85UdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156370; c=relaxed/simple; bh=VcaoUfrcouQV0gFCR662Kxzm42SL0jyYYKIh4ngnOzI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GN6iGUIEbQl8Ynim5EJMlvUny9yy0vWDn/XqP2McH9Avu1xGK+Wl8se5YN5sY6rHE1qtYf7pFXIMqHUgY7Kv2QOFesutqnR5DELSvaTOO389HraTWwmbzalIApegdyVNvBwp/fKb3QBNF87Xwm9rkOFmYOTpGUD4hhOc0qKeVjw= 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=ZUb9wP1G; arc=none smtp.client-ip=209.85.166.54 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="ZUb9wP1G" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7f70a708f54so6579639f.3; Tue, 16 Jul 2024 11:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156368; x=1721761168; 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=LdxS3Fv+DdtdyD/OX9RwYgW//DQBvhU2TaujYV4igeo=; b=ZUb9wP1GFE9IM0oaNbWy1x6OWmXl+PGNMmJWBS5smxWqnSvn8/OhqTFcll/sAoZr1i Q3fQj8R5yoY5gZ0viYgG+OAa6ww0nXmjNQsRFosfJHb4dQ+NuhRKW7imHQ0NNvifwc9a Lr1GO2RlNQhBHPEfLrUfWtQWujZx37fKRsOvu2zkG+NA4ZFamcI18X2WFIOAAFdxydjs 9R4WEPO62OlDsNtgImlwY92PbbPtXVflelBCVNdcPmzzr3TgPPxR+Ru7XPU0DQugZzmb 2nofetgDs2AahKqa9yRiJwfrAy4UR2If2gCAskWR2M+WKkceeCVbceJK/Y1Dq1DK487H RUTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156368; x=1721761168; 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=LdxS3Fv+DdtdyD/OX9RwYgW//DQBvhU2TaujYV4igeo=; b=kAszxCRkHJXRTVIp3aIrysy3X0vvgwiNKTGO3ySKFrt+v5tBdCQXuRSihBksSPBGMd IRC7hNbE/LZ7o4fvcqnKOahsZGVfWgZcj0FHH6WgjLdYJTSGu+A8fOfpO8qzsx5PoT++ geAlpPHhEGH9IB52WVIRiKe/ZVU+FPwX90hglfBES73CFqJtpcvx5FtVDPB/mSs8R0FV q5w6mhRDIeAGim+JypMbpDPM9Hl3Uf0UbL0BdXVh8HiPPgDKQoLWTYs1/DGHZdpDjXRp GH754UeMqIpLHGJfQ3EFw0uAA/0QRLbbLCGt6OvOlo9g8HGjqWam/Htw5PavNj2OMsV2 uxDw== X-Forwarded-Encrypted: i=1; AJvYcCVc7rDnAJH9MKaNXvV8jbTnrapLTgll2busOUy0SIUvYTuIzdEFMRuV07FLIikV7warF45TqdQkIHEbMF7CPk/yDVhJEOpx9yI1 X-Gm-Message-State: AOJu0Yw/G1nOJtbdx1XpyxsLzM53Cmo8DWMrHQmeZweax+ZrA6cMgAEu TWYC4bxczLqHnjXYZO7as/uxqm0C7luQByOKKniMD09vB+JQsVY17IHNddLo X-Google-Smtp-Source: AGHT+IH6IKw5JArubE44ma76RRQ/D8ylu5XLCUV75AdBLcATiRJS8BMkgjWPefk5pTs0a712LpVuig== X-Received: by 2002:a05:6602:341c:b0:804:b27:82c with SMTP id ca18e2360f4ac-816c4a1aaa7mr36704139f.12.1721156368121; Tue, 16 Jul 2024 11:59:28 -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.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:27 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 49/54] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver Date: Tue, 16 Jul 2024 12:58:01 -0600 Message-ID: <20240716185806.1572048-50-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> 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" The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/gud/gud_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c index 9d7bf8ee45f1..5b555045fce4 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -31,6 +31,8 @@ =20 #include "gud_internal.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* Only used internally */ static const struct drm_format_info gud_drm_format_r1 =3D { .format =3D GUD_DRM_FORMAT_R1, --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) (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 3409E1ACE62; Tue, 16 Jul 2024 18:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156371; cv=none; b=pE2fcQJYozfIopGY7KTPDww8vp4Z6bIxRaIW9mDa/YvWJDxjJS7kQFEGLtAINj/48kXck4ljgVrPYX1cY2ehKBHqrCpvUV2bjmSp6+J8ksHCfibGh4XdxxoxjMFJVVZtk5Gb79QYou2gwGiZ0o3fCJNdJ1u/4pofOLGtCxmrbO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156371; c=relaxed/simple; bh=ZdgkYt8StKCj0Myc4WWZURkgaMtctnUiCw+YT1im5Eo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e5wpFZDBuWWZR8h0g85nMGxP+gvWG8rrlv9O6I2C9LQEYpDXCZc0pgtxKZueD02M06QkYL1I/RzFaIP9xtrDjdccOAFr5F18AU4XXxJYmPt8Vw/EQfpGPcvEhzUenb81Ac8zHfVvQuLbIPs3xO9DXKK6Azouwa+qYv0SV+Jx67A= 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=VOBbYkWb; arc=none smtp.client-ip=209.85.166.42 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="VOBbYkWb" Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5242639f.2; Tue, 16 Jul 2024 11:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156369; x=1721761169; 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=3JTbEivvcQUwAcXrAriYcuJGP77J1qAidh1sZIrKRVg=; b=VOBbYkWbvk1zhGeI26BmQMyZIbWRR6Nb5fTHcQpTr7vLfbHj5yWZwEuLgTzh5UNqN6 foiuAGOxr5DKok5OoZ63hC2CgRBWHr6dBJ9mBfudZIWmym5x1/IKKb6+ITA+cAaq9pce HTocU58RDCpn8Paytf504l7cCaTpDmlJ9DYHfpOZDqwBLtuu8ExeRvzIIr1mywd3w7gH 2bT109F+RlV+uTfc5p4GD9FNLJs+0cnuf10LvRrRVcq3bI8EaCJlQmfF27wBm+SYmwDg EMq7rnz4xBag90MmAPDWZjkgWe2KNHjcox2OJzBySxoJanJ1x86EwXjgTPX3e1KGneen FHmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156369; x=1721761169; 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=3JTbEivvcQUwAcXrAriYcuJGP77J1qAidh1sZIrKRVg=; b=B6yYA4oiDTOuhe+zMeg4id7c89m35QkXbVFNoAite5N/jHlm1u975DZOonhVufZ/M+ +i57tT7ZgPoWdRSKnnEiMJ3XrSGtMg3KtyVHcV7O9FXHG7Y4X8wEJACrc7c72IPx+Bgc m0Hl9EndddPoft8wGizRSiSq6RsRXmxO6vmEX/SLBDjLmmTco1NgXGD4nvLwBFfSey+C zw6t6dsI/zuz9tUS8EHvuWldXTinXznSP1KYw/e9/s6/TvhiwKhDxVejizWeCMByxIDU c2wXjt8uVI98z1Ud1ZdTJXei4UOyYiTjTfzwx6hjXq7LFkH7ZCCgUS+9MaFpovsN4efO EpWA== X-Forwarded-Encrypted: i=1; AJvYcCW7ttm6uvzQHKOBTyQuqqwYjx14fRgj0HgBNsJU/X0RnqMtO9eUo6z+abB996BETHVQzliL6fi2p35q6/Rh6ycFJPMmpqaL8q6n X-Gm-Message-State: AOJu0Yyve6gRmIqzI0nU8371k5OpWT2C4J3E6mn2Xij8oSmbQ9NWsVzX XP7icSDjN4p+lH80K2VdVrGsI6hQP5SW45Rc5I2vGjcn+T9tDVFSeyZkdjO9 X-Google-Smtp-Source: AGHT+IGARWh4QxiG+Icc635bMvQOuQFO/eTfpUh5U7VRGb1JDZZ9GA0bt8iTtTyAJOTCk1Gv5ICnMQ== X-Received: by 2002:a05:6602:6d0e:b0:80f:81f5:b496 with SMTP id ca18e2360f4ac-816c4a16988mr40830239f.14.1721156369258; Tue, 16 Jul 2024 11:59:29 -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.59.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:28 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 50/54] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver Date: Tue, 16 Jul 2024 12:58:02 -0600 Message-ID: <20240716185806.1572048-51-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> 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" The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/qxl/qxl_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_drv.c b/drivers/gpu/drm/qxl/qxl_drv.c index beee5563031a..1971bfa8a8a6 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -65,6 +65,8 @@ module_param_named(modeset, qxl_modeset, int, 0400); MODULE_PARM_DESC(num_heads, "Number of virtual crtcs to expose (default 4)= "); module_param_named(num_heads, qxl_num_crtc, int, 0400); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static struct drm_driver qxl_driver; static struct pci_driver qxl_pci_driver; =20 --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) (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 8CDA51ACE9C; Tue, 16 Jul 2024 18:59:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156374; cv=none; b=OQhhzYWBF8a5ppc7dLTtI7J6h2aClrU8NFQnvZ2myLiEwB06OsPud8be0/24k0ZT1b/CDIo0QlsxhbME9IdgcWK5Kn/diJCL/DhgC62CtM6sPR00DqEc8DHGA7l1/j1P58m0YUNjZQaviXiQc6DbGLD/a9w9im2VSE6hHTqHNTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156374; c=relaxed/simple; bh=2OnloY1X0a7rOUMOi6pjoyUyTvSveAIvNazc7EXQIsE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uKolsXixDNtL05s/Lome+3tdiDyOdQFhE7B4SuXwlXOh4bPVonhFbt5IHuD+kmX7GiU8QlpuNKu0SlCIwLDUgtf9aHaLLLcLZyH9n1yb4ypF1i+sVsNKYdy+RDty5BRekyEktnZ44tzy9tdTdkfnI3CL2gnLW4c7y4tFTz5vSu4= 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=MNCHlsBy; arc=none smtp.client-ip=209.85.166.41 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="MNCHlsBy" Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-8076ef91d8eso6276239f.1; Tue, 16 Jul 2024 11:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156370; x=1721761170; 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=3SFMpYtWIMdGDFXAXC7/EjtlRd2ef06a7BB52SDKmgM=; b=MNCHlsBy09YYUiaDkDkTeZpsDt5iaHT6lOWIQvDll0PCxVJjrd/iaTHHR4DzbHlRVA WuTD1O1SHnx6cTGZEmcT3wLrAOz/qnuBvI4JYrxKiG4njrkvukUNMiotxomXV8ut9Wfb Fw42ugyB6qu2gmwm1GPOECkJ1HFdf01kLI6Bv1FNr/jorNgM/m23oIlWf03le7b7ldrD YqCNKcLj3aImOyZNpZMhSIYKHTBoJtCiJilefv+dw+1l1SApo27FHq1IphEiBMSoiybR 9P6kx8aPgN0sTR++gRyMCsRCG6Vts05ZUwB9K4dMdoCtClUf/oblBQgh41s8wxD6xI8g FV4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156370; x=1721761170; 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=3SFMpYtWIMdGDFXAXC7/EjtlRd2ef06a7BB52SDKmgM=; b=pXX7wua5LZobRwR/xps390NRaWbDJEubi7cyvlsQH1VcrbeUwLGozVblh/O/b1Op8J TxHpVF1YGdwUIpItmxUmCiClp3iwT9+ozZGz/DGB9530y5p5nTAvsZA2Yi7qaVL9dclf HStkCxdmSshJxaE1WcVltWVPYM86muXlSfrfjiP3WJUMQLO0BLTu3wFlT283uwTJE5eB JCUWd54ME2qtfcskGrUXtB/BiqeNV1XVCLKtJsemCVDE7aJtiTQq/90c4+JOdsEBr0Fg 0xDzMOv/UUnt1OX/aTz10fm/xisf91DoDjenLXi6peufFxf1MDUTdQtLt0IB9XQ1XQ3J 6Y1A== X-Forwarded-Encrypted: i=1; AJvYcCVxT0zQ/qzjiGom6zu2afAu7Fa79MUgs3J86te9IEKflIGDWJkwB6P95HBm2EFH36fdlvE+TNHGjvOjFvLFfAjmWIL09VC07Sui X-Gm-Message-State: AOJu0YwVqWTBmBBpMBH/OxFwzwMRtmTTd77kRTTD43P+jUAFz2C2cw35 qnv6oXpA+sjksqzmYUhPXAaA3kfd9obG6otODMPyYVk3uESAY8WPlYFoZ4hP X-Google-Smtp-Source: AGHT+IFNNv9vS+/MrWaSGvQuA7wRhxc0WqtmfqfwoM/4kcX2nyGI9RecReeel4bYcF/zOW5GGLx/pw== X-Received: by 2002:a6b:7c4c:0:b0:7f6:8303:ba80 with SMTP id ca18e2360f4ac-816c3aabedcmr29885939f.11.1721156370398; Tue, 16 Jul 2024 11:59:30 -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.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:30 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 51/54] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver Date: Tue, 16 Jul 2024 12:58:03 -0600 Message-ID: <20240716185806.1572048-52-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> 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" The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/drm_gem_shmem_helper.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_g= em_shmem_helper.c index 53c003983ad1..2b269ae9ea18 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -22,6 +22,8 @@ #include #include =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_IMPORT_NS(DMA_BUF); =20 /** --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) (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 ACDE61ACE9F; Tue, 16 Jul 2024 18:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156374; cv=none; b=LOttdynRaUvlTIEy8qjy1Hxjl+Dc51401jwHmZlvVODFsDfwFaj09EhNYvou6msWdH2G8GYt+7TM7uT0UylY0KGL4qT+O9symCgL7JRP1gtRmXa8sNIfNjKmxvUfDefxCArbK6U3a+IlRGq4yqio/bfCwpBYIkMZzpgyWtsqXIE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156374; c=relaxed/simple; bh=Ra26uMBZu3ZP5xzbYRr0cuuxt1adYwYS+TsR1/DN7dw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p27oXZHKdCOgqK5MrnGTuYHXcGLLpf3UcI8XPi1C5IbwBYBnktrQja/IvdigMLYppHWN38ZJo3HWGe8i2VqosTsO8NWQDRIxoQcCZPx8820MZojxdgBm4arNSJTWRHV9yhw2T98kFONaWeaLLULzuB12X9ZB97gAXsxVy3f/fhc= 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=cJ6zZFxx; arc=none smtp.client-ip=209.85.166.46 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="cJ6zZFxx" Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f99d50c1a6so8672839f.0; Tue, 16 Jul 2024 11:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156371; x=1721761171; 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=Gp+X7P7M2G0wGzmEuARHD4YdNz5MLe60OdfLiwoM2pk=; b=cJ6zZFxx8//rZ/R/I7IX63UA6uFo3KWaRXBAhCeiXGJUyTs++9x4h24oaj4r+FifQY RzDrm3OE5dmpvJfzOsabmA/Gper7hm9NcR0c8S70s1WH4YnDKOV6U34jcLuOTKf6mRz8 PmII9rMQi0jx2hJcc4Ys2+WGheiayQ+UxiH1S+zuLEjQtxLP1tjCZ11esQUpyhLCTytQ oHEWtyMHxvg1haPatnYPENpzyIBzcdoyVNpmbUbWh4T6FUrBYztmIqm982o9axg0EeBn /b/A3zOU76NfSdNnzf1PnoRCtl19OslRmmXX1l0NcSUk96FITBUaho/oUQMM4Zv7iYBo ew+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156371; x=1721761171; 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=Gp+X7P7M2G0wGzmEuARHD4YdNz5MLe60OdfLiwoM2pk=; b=hLf6YASn132GoEDiBoO/3m04LLYxR9PLM+e1ZCiQ9TMAK9+/twxMQXozQaaEQpfDbc rOlW691GMCg7nMWS9MP4E5o+PPWw6drpm++Adr/3C1K8hMh8mBjDjpmTmC0b3/Msw+oG Ctg0z4seSap/7JCeBTwANkvgafyHDAWDbDvQW+3z0/qadkhk756bvHMTeEjDKhijlqNT rT+ScbylWMzDKMpnkL9blR0MIpm+rnEmA0PY6CJumGjnaaNFpC6GrTxGnnR3YNndnWYd b2SMjiedqLr4IhlB9fuU098H2dmBoKv/AUgFVYLKe8E7/k19EclQL0JdAxDst7qRC9Ro 8kOg== X-Forwarded-Encrypted: i=1; AJvYcCW1qHkDMnIvvKg7Sg5zgCs3aot0f4twXjOdtd5MxtvBdgC5Pg0cExQN+MwjT3XKhXaI4e+tYUlr6l8xiU4MSTXN4PfyQFqqjfIf X-Gm-Message-State: AOJu0Yy+iIHU9F+e6nSdqOYknVJYTwRLGDoh1B4WnHoRCaffhuyhANiV LyQKXQhmKieKgM2jay+UEqapZo02nx8GvDeKnq76SSk/SsovQ6x+KykSN/Pu X-Google-Smtp-Source: AGHT+IECS3LE4CQlGR6D3c9f2we0UYXUMv74VI2oB5R/1GanbhvcHcS5G4efhI9oRo+zYRzuj4p1RA== X-Received: by 2002:a05:6602:14c6:b0:813:f74:e6df with SMTP id ca18e2360f4ac-816c51c790bmr46646439f.15.1721156371575; Tue, 16 Jul 2024 11:59:31 -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.59.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:31 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 52/54] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Tue, 16 Jul 2024 12:58:04 -0600 Message-ID: <20240716185806.1572048-53-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> 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" end of official submission. Time for some quality CI Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- drivers/gpu/drm/Kconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index d0aa277fc3bf..c508c0834641 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -56,8 +56,7 @@ config DRM_DEBUG_MM =20 config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" - default n - depends on BROKEN + default y depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) (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 075E71AD3F6; Tue, 16 Jul 2024 18:59:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156375; cv=none; b=LC1XV1XiIX49UN4PDk5QMrTSMV6zUPc5vOg6HiM+PDjpB3LAI6qFUX1zyVQ0Anpa5QXW3Q5g8LvOLOxbWpEjWyOvjag+gI+Vs8tcdzbmKpmQbdFOnqe5REA95QL3w/9wFFrirbJda30oA0usovi2TBl64ipyTvu5SA5EvYWfo0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156375; c=relaxed/simple; bh=r2J6F3T+xrlwuOrDEvu+SHWJ55NNYhDEHu73NlVsz0M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b6ELfUujDXe+2ktRIaJdwSLLgkpWMqzSzJ6AsFMVDNSBqk/tWE8RXRprp2q7wqqyNWJN41w/f8RVENEm2dacAguDwIt0lq/4UuSUuKtvKxSKgqT5vtPw5sKuNi0uVbWdyh1TCVd9pVXr3BU3ocLt+TvG92XiIEI/OwsFL3Cacr4= 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=g9IRwKfJ; arc=none smtp.client-ip=209.85.166.52 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="g9IRwKfJ" Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7f684af6af1so6731439f.2; Tue, 16 Jul 2024 11:59:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156373; x=1721761173; 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=wgAqMd3+iIWmYMpud2tAag7fU0ZRfIKBjcu44k/UC/A=; b=g9IRwKfJzHdw0U8tVVfYPJHm8Vm3UbtLyCdww0QuvGTTKFUVLYC9KVAn3oS+fMnkpO u7W2tmA3ltjvzbSSY6mTt974XkhbYuHnhlcYgkSbLsCnsqjT6oY4OaUPrZ60GK65FlGF b9Fph/nPnRuHRVIZDMC98FT43oXPW7yXxchUMHZ0l4hJPv39/F+P64XVqLQ66fznrZoY 17R7HqVSFfk7ZWy0AFVUnTL81INIqhiCVvuWzMzyjoU6ePXfd0RbYr9agqTDeHo86MyL iVL/OIy5cBhivfsYHxvnBlbVEyuNb15ifnOhsJ0oE7vYv/qLi/AxBVdYBzpNS41GzLST 5zbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156373; x=1721761173; 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=wgAqMd3+iIWmYMpud2tAag7fU0ZRfIKBjcu44k/UC/A=; b=r/iROHO9VjOuTYxXrjtECIovBfsnRwpng5LDn+It6qSA2SJayLJbifVhN2ZpR+xvX4 OiNGjJ88U9bUjRjq65Cb8ok/JF1yjq2dvAbUnew1oo6qv55zjghsZxUcBJtvS2bxjD6C ga72PpfG3sH+OUwuv7Nf7fJb0DtXRPLJSCmrAACSpA4Y4NE1XYlkdBwHp4ZK4ln2aANp OGcfuwtPono6+0KOIYrIakRxdhh2SoymvCnmm/w/pJtYshNIgauFuDyNvLaZO/st6nQ/ TTI0KEMxIEK+rfGhwCfKFFB1zrHpaUkA5S7MNRZwjxxzmUuBD1dU9i1fS4PULyNLZtBk bCgA== X-Forwarded-Encrypted: i=1; AJvYcCU9HTbXWsK0pMqAXK82SdI45rDUdj24/rmfbmZqA4rwXRuOyBpORcm+qnuhSFhh7bTAd2EayKhnGuzpejtVb3rcPG3buQ6qk6kd X-Gm-Message-State: AOJu0YwDBHnVV8TSMKKbmawqozk3FN/QL/TcD5KHyRFFYbpf8vU7pZH4 p3yaL1kpjw1T7EJDvFonVwxBjo5vJU876/NS3YstCRHP6fa4VNq+oEFP/cdt X-Google-Smtp-Source: AGHT+IFni6bIdZqwUH+Scyf8+nuvN3S+CKoCazA0MHSZb6wujlaADABqWvB5L9YjT5+rHUGh02BCbQ== X-Received: by 2002:a05:6602:2dd2:b0:7f9:c953:c754 with SMTP id ca18e2360f4ac-816c45417e8mr42533539f.3.1721156372732; Tue, 16 Jul 2024 11:59:32 -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.59.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:32 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 53/54] dyndbg: tighten up kdoc about DYNDBG_CLASSMAP_* macros Date: Tue, 16 Jul 2024 12:58:05 -0600 Message-ID: <20240716185806.1572048-54-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> 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" The DYNDBG_CLASSMAP_DEFINE expects a list of classnames, and maps them to consecutive classids starting at _base. That 1- list-of-classnames can be syntactically replaced by a 2- designated-initializers-list/map. But this creates ambiguity. The 1st thing the macro does: static const char *_var##_classnames[] =3D { __VA_ARGS__ }; This construct accepts either list form, cannot distinguish between them, and they place data differently. 1. puts the string values into array[0..N-1] 2. puts them into array[_base..N+_base-1] 2 wastes 0.._base-1 indices, and more importantly, also spec's _base twice: as a parameter, and then in the designated-initializers-list/map. Further, the code is written for a contiguous range of classnames and classids, and passing a map allows casual violation of this reasonable design choice. In particular, DRM_UT_* is a contiguous range, and each maps to a bit in drm.debug. The macro interface shouldn't suggest a sparse map is possible. So reword DYNDBG_CLASSMAP_* macro kdoc to more actively guide reader away from designated initializers here. TBD probably squash this back into the patchset. CC: ville.syrjala@linux.intel.com Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- include/linux/dynamic_debug.h | 52 +++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index c958085e0df4..d75a5d3ae388 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -80,15 +80,22 @@ struct ddebug_class_map { enum ddebug_class_map_type map_type; }; =20 +/* + * modules using dyndbg-classmaps must invoke either + */ /** - * DYNDBG_CLASSMAP_DEFINE - define a set of debug-classes used by a module. + * DYNDBG_CLASSMAP_DEFINE - define debug classes used by a module. * @_var: name of the classmap, exported for other modules coordinated u= se. - * @_type: enum ddebug_class_map_type, chooses bits/verbose, numeric/name= s. - * @_base: offset of 1st class-name, used to share 0..62 classid space - * @classes: vals are stringified enum-vals, like DRM_UT_* + * @_type: enum ddebug_class_map_type: DISJOINT - independent, LEVEL - v2= >v1 + * @_base: reserve N classids starting at _base, to split 0..62 classid s= pace + * @classes: names of the N classes. * - * Defines and exports a struct ddebug_class_map whose @classes are - * used to validate a "class FOO .." >control command on the module + * This tells dyndbg what classids the module is using, by mapping + * names onto them. This qualifies "class NAME" >controls on the + * defining module, ignoring unknown names. + * + * The @classes also name the bits 0.. in any CLASSMAP_PARAM referring + * to the classmap. */ #define __DYNDBG_CLASSMAP_DEFINE(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ @@ -131,9 +138,9 @@ struct ddebug_class_user { * DYNDBG_CLASSMAP_USE - refer to a classmap, DEFINEd elsewhere. * @_var: name of the exported classmap var * - * This registers a module's use of another module's classmap defn, so - * dyndbg can authorize "class DRM_CORE ..." >control commands upon - * this module. + * This tells dyndbg that the module has prdbgs with classids defined + * in the named classmap. This qualifies "class NAME" >controls on + * the user module, ignoring unknown names. */ #define DYNDBG_CLASSMAP_USE(_var) \ DYNDBG_CLASSMAP_USE_(_var, __UNIQUE_ID(ddebug_class_user)) @@ -165,27 +172,30 @@ struct ddebug_class_param { }; =20 /** - * DYNDBG_CLASSMAP_PARAM - wrap a dyndbg-classmap with a controlling sys-p= aram - * @_name sysfs node name - * @_var name of the struct classmap var defining the controlled classes - * @_flags flags to be toggled, typically just 'p' + * DYNDBG_CLASSMAP_PARAM - control a ddebug-classmap from a sys-param + * @_name: sysfs node name + * @_var: name of the classmap var defining the controlled classes/bits + * @_flags: flags to be toggled, typically just 'p' * * Creates a sysfs-param to control the classes defined by the - * classmap. Keeps bits in a private/static + * exported classmap, with bits 0..N-1 mapped to the classes named. + * This version keeps class-state in a private long int. */ #define DYNDBG_CLASSMAP_PARAM(_name, _var, _flags) \ static unsigned long _name##_bvec; \ __DYNDBG_CLASSMAP_PARAM(_name, _name##_bvec, _var, _flags) =20 /** - * DYNDBG_CLASSMAP_PARAM_REF - wrap a dyndbg-classmap with a controlling s= ys-param - * @_name sysfs node name - * @_bits name of the module's unsigned long bit-vector, ex: __drm_debug - * @_var name of the struct classmap var defining the controlled classes - * @_flags flags to be toggled, typically just 'p' + * DYNDBG_CLASSMAP_PARAM_REF - wrap a classmap with a controlling sys-param + * @_name: sysfs node name + * @_bits: name of the module's unsigned long bit-vector, ex: __drm_debug + * @_var: name of the (exported) classmap var defining the classes/bits + * @_flags: flags to be toggled, typically just 'p' * - * Creates a sysfs-param to control the classmap, keeping bitvec in user @= _bits. - * This lets drm use __drm_debug elsewhere too. + * Creates a sysfs-param to control the classes defined by the + * exported clasmap, with bits 0..N-1 mapped to the classes named. + * This version keeps class-state in user @_bits. This lets drm check + * __drm_debug elsewhere too. */ #define DYNDBG_CLASSMAP_PARAM_REF(_name, _bits, _var, _flags) \ __DYNDBG_CLASSMAP_PARAM(_name, _bits, _var, _flags) --=20 2.45.2 From nobody Wed Dec 17 15:31:14 2025 Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) (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 EB1B11AD40E; Tue, 16 Jul 2024 18:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156376; cv=none; b=pldj8hzqOpwWaXITUUpptkR4PM6IvG9DyN21Tw4FJGZZbyZTFsbdBIOMu1MFpTKxLgyTi3pwRWeqsd9VWdU0BcEPrIXemL7G1jSQn8xjLLB/bXuS+VSyQZe++ONBLRsRGevPuoLih5+aE6JjNPQNUOliMfelAUL8CwGQqoi1Lsk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721156376; c=relaxed/simple; bh=AhxpBW2V1Nnpaq8GxpYUxfaMj7C/CnQkNUZprsGq5Jw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OYAbZ/GQ6kjQrMkmLrbPLS+RoLfO7861XjPwCxezX6MkiXQSfZd2XwpB9iIigXH2nMFXiMp61Ewl+hQFWDm9dvpu9i7xgte3mv72CcXFsR2fD3iIAELRzE5TMLwqDUHdNJKPvwodAz/LGfpeiHOyVxLO2cGxBfFSdwWDIOua1B8= 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=MUcZWYcT; arc=none smtp.client-ip=209.85.166.54 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="MUcZWYcT" Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-8036ce6631bso5987239f.1; Tue, 16 Jul 2024 11:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156374; x=1721761174; 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=02GQEyQ8Fgm4yEF+9D4Fm23zLJa07LslS1GKZkXapgQ=; b=MUcZWYcTh1pNdJxMKvF5QFuqTKPpRcpZIl2uMB5aA0nNkQln3hrASw6yGX5IShjxsw KhSgTtcrBkh6dQYN8S0AWdi3SoiIJH2BDkJLFUVujJj1MpvM1zHftpfPc8QW2/iE8Hpo BM7SaCs0nlFQqlKqnhLcC6z/yCAZ/tRC6fI5OUpS3jTkvvzVhgODehMcCgg1h9wo2wud I+X8SnOBR5YhYzU+ohEeHouOvCe8J4b4w8qpf3yhqYM9Z72ZS5v9Lan44imhokC0o2ql u2yU/oImS0/YL4cPB3+R7qyvxB/HWXq/0XEQthfgr9R46gt1avVzoTjYrVFRx2A9q5Ek chew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156374; x=1721761174; 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=02GQEyQ8Fgm4yEF+9D4Fm23zLJa07LslS1GKZkXapgQ=; b=vmI3e1u2F4f6vCiQw4Bc2RK9IUZcNEDOT5oeX6WMbqN3RtdJ+yMF2s2MBsoLwQN5P7 QMfPJ56XJyK80MyLcOTRqmEr6UllrKTRt7ACNAZ+Ce/C4/2XXt9awMbuhwpCELRDYY7H HIM41mxzobklnIa9sa/zFO2bJ2cUXgit8EhDIsJ8L5bpX8+6t3VW3XSuGKixoy6UUVte cEnB9OoIFsQ6F7Nj4ED5WBFXFQ9Djm8A4s+PfKn1kHADPV4ocF/jDoDx/g1P8+Q5BmAx emYGvqv6xUq9h+bdf8r/l4u/84wSSsmxAxf73fzSzqAOqNlFkN7J4T3x7D8RtT594/uE z0Vg== X-Forwarded-Encrypted: i=1; AJvYcCWKW6PotlVA/DfjcKwvgTXN18ClEyNc3YolvahZSXi6pLctFTokclLPqi564/CXV0GZOhgynhiVsryrAAEEwVMLkoaOkKSgAP9N X-Gm-Message-State: AOJu0YxV7yVejnF+Nq0N+/mt7kwwjFlho1XxxNRl7Lx257PderZ0/HrJ AOEiwDw9VNsFchh9caeFPZDJfVGULJhl1gR/N0Z5RtIrq8laQYlLhgrBAz+x X-Google-Smtp-Source: AGHT+IH2P7UQSoQkuUq22B0bjuKA/ngzw01JbZNtKHx44WAJD4WRstjL+48jrY+j0JQqgWF+0C1c2g== X-Received: by 2002:a05:6602:1548:b0:804:f2be:ee21 with SMTP id ca18e2360f4ac-816c2c0d633mr43164039f.3.1721156373964; Tue, 16 Jul 2024 11:59:33 -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.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:33 -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 Cc: ukaszb@chromium.org, linux@rasmusvillemoes.dk, joe@perches.com, mcgrof@kernel.org, seanpaul@chromium.org, robdclark@gmail.com, groeck@google.com, yanivt@google.com, bleung@google.com, linux-doc@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, Jim Cromie Subject: [PATCH v9-resend 54/54] docs-dyndbg: improve howto classmaps api section Date: Tue, 16 Jul 2024 12:58:06 -0600 Message-ID: <20240716185806.1572048-55-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> 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" reword the classmaps-api section to better explain how it supports DRM, and (a little bit) to steer clear of designated-inits in the _DEFINE description. probably just squash this back in Signed-off-by: Jim Cromie Tested-by: =C5=81ukasz Bartosik Tested-bys would help greatly, help get it off the fence it straddles. --- .../admin-guide/dynamic-debug-howto.rst | 64 +++++++++++-------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index ccf3704f2143..1ffab6be07fc 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -390,42 +390,56 @@ in case ``prefix_str`` is built dynamically. Dynamic Debug classmaps =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 -Dyndbg allows selection/grouping of *prdbg* callsites using structural -info: module, file, function, line. Classmaps allow authors to add -their own domain-oriented groupings using class-names. Classmaps are -exported, so they referencable from other modules. +Classmaps adds the "class" keyword, which selects prdbgs based on +author supplied, domain-oriented names; this complements the code +organizational keywords: module, file, function, line. + +The main difference from the others: class'd prdbgs must be named to +be changed. This protects them from generic overwrite: + + # IOW this cannot undo any DRM.debug settings + :#> ddcmd -p + +So each class must be enabled individually (no wildcards): =20 - # enable classes individually :#> ddcmd class DRM_UT_CORE +p :#> ddcmd class DRM_UT_KMS +p # or more selectively :#> ddcmd class DRM_UT_CORE module drm +p =20 -The "class FOO" syntax protects class'd prdbgs from generic overwrite:: - - # IOW this doesn't wipe any DRM.debug settings - :#> ddcmd -p +Or the legacy/normal (convenient) way: =20 -To support the DRM.debug parameter, DYNDBG_CLASSMAP_PARAM* updates all -classes in a classmap, mapping param-bits 0..N onto the classes: -DRM_UT_<*> for the DRM use-case. + :#> echo 0x1ff > /sys/module/drm/parameters/debug =20 Dynamic Debug Classmap API =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 -DYNDBG_CLASSMAP_DEFINE - modules use this to create classmaps, naming -each of the classes (stringified enum-symbols: "DRM_UT_<*>"), and -type, and mapping the class-names to consecutive _class_ids. +The classmap API is closely modeled on DRM, which has: + +enum drm_debug_category: DRM_UT_* // 10 independent categories.=20 +dyndbg's .classid encodes that directly, allowing 0..62 classes + +DRM has ~5k calls like: drm_dbg(DRM_UT_KMS, "kms msg"); +these are unchanged, even in argtype, since classid =3D=3D=3D category. + +DRM controls the classes together via sysfs; bits 0..9 control the +classes independently. + +Its expected that other classmap users will also provide debug-macros +using an enum-defined categorization scheme like DRM's, and dyndbg can +be adapted under them similarly. + +DYNDBG_CLASSMAP_DEFINE(var,type,_base,classnames) - this maps +classnames onto class-ids starting at _base, it also maps the +names onto CLASSMAP_PARAM bits 0..N. =20 -By doing so, modules tell dyndbg that they have prdbgs with those -class_ids, and they authorize dyndbg to accept "class FOO" for the -module defining the classmap, and its contained classnames. +DYNDBG_CLASSMAP_USE(var) - modules call this to refer to the var +_DEFINEd elsewhere (and exported). =20 -DYNDBG_CLASSMAP_USE - drm drivers invoke this to ref the CLASSMAP that -drm DEFINEs. This shares the classmap definition, and authorizes -dyndbg to apply changes to the user module's class'd pr_debugs. It -also tells dyndbg how to initialize the user's prdbgs at modprobe, -based upon the current setting of the parent's controlling param. +Classmaps are opt-in: modules invoke _DEFINE or _USE to authorize +dyndbg to update those classes. "class FOO" queries are validated +against the classes, this finds the classid to alter; classes are not +directly selectable by their classid. =20 There are 2 types of classmaps: =20 @@ -436,9 +450,9 @@ DYNDBG_CLASSMAP_PARAM - modelled after module_param_cb,= it refers to a DEFINEd classmap, and associates it to the param's data-store. This state is then applied to DEFINEr and USEr modules when they're modprobed. =20 -This interface also enforces the DD_CLASS_TYPE_LEVEL_NUM relation +The PARAM interface also enforces the DD_CLASS_TYPE_LEVEL_NUM relation amongst the contained classnames; all classes are independent in the -control parser itself. +control parser itself; there is no implied meaning in names like "V4". =20 Modules or module-groups (drm & drivers) can define multiple classmaps, as long as they share the limited 0..62 per-module-group --=20 2.45.2