From patchwork Tue Jul 16 18:57:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735541 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A95B8C3DA42 for ; Wed, 17 Jul 2024 15:01:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EEB3310E22F; Wed, 17 Jul 2024 15:01:45 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="e1gXDnXu"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22D5410E83B; Tue, 16 Jul 2024 18:58:21 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-8046f65536dso6038339f.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=lists.freedesktop.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=e1gXDnXuceDz3Tui3WZH7/C5PEmpr+tyRKtdh6x4JJeaQp/9c7lIbdanDRgE/U0PX0 Og/cBZoGGj1X8B1s2Yx2JsPxTonYXT/462Z2hL5gcfQpDD0KVDs6QCjhNakKdX91aPg3 pMdqeKs+XcGq2GiIcTPiCeHX4Jqc3AtspzUNCCH0xvB1Oa8TIeykwCxMktkMc7fzJCUI nwkco5v4pF5u6VvlHjtPIsjP1VY96q/82qHILlwf96TCkryTwrKDAIP1tlJb/egmOn5C 75sBzGhJcVsaKGoYPcHcMgREavzcAix5GsnXkCE2JSg9RbXP9OpggOooqjEuGj/Gp59w NM8g== 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=G7xa4B7C0XAiXYlwGSTkD+93UeItQ2QsK5SG/e5njlmAvzC6OhUrGa4Xq5HPzV/kaR ChmLMYG07NSTRWv1ipbOjP5Gg6TvoBYkVWCzxJgktIyExuU39okpSLTUyJ44+Ect450N ZasUe/utp6nJj55md4t9eEvDwoD0WB06jCY1614KyezKHD6DUEbGtjnLpjE5Iv79qHV+ rHHwcTWk5L2u9kZBASEAr7+LL31dy0HeNmMSulTyShw0GS/OnTfTOfWMMsKlDVGilg/E CVgXJFLNmIcyh5u3bnD4yY7Bs4uER88VOq+vLu+Ulz2z2wNSgnpdk/buysqUu06GP4Tk qZZA== X-Forwarded-Encrypted: i=1; AJvYcCWv7GY9bDPcBRdUozzlYenCZAL8q/IWEldu63ymzvHyEcS1KQzI08Z29jRjhSPCVk1eRYBfxUCRmD59r3XZ/NE3aM3Yq0SGgirblZbWpkuGQlOhhUJROICkPvw3IGeXNItqhxGX3+sQ7GPcwCB36oWP7FLP5Gxit2aS6DLg3UA8MP883cA5XolLqCEswNmPgukqIyQRejzkjcVueqmWC2C5KloIv1RM5C8aN3errMz3VlIGwcA= X-Gm-Message-State: AOJu0YwJZ6m2Bvxp7vs3i1H87Y9Soys2+w6rH4WE0FA0dxDCBVTNIwn8 0akQESc+yYcdUlqtvCYkWpb/VY2b01znHT/1oFND1dOCJ8zH6Y2d 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:11 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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/Documentation/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='echo $* > /proc/dynamic_debug/control' - :#> ddcmd '-p; module main func run* +p' + :#> ddcmd '-p; module main func run* +p' # disable all, then enable main :#> grep =p /proc/dynamic_debug/control - init/main.c:1424 [main]run_init_process =p " with arguments:\012" - init/main.c:1426 [main]run_init_process =p " %s\012" - init/main.c:1427 [main]run_init_process =p " with environment:\012" - init/main.c:1429 [main]run_init_process =p " %s\012" + init/main.c:1424 [main]run_init_process =p " with arguments:\n" + init/main.c:1426 [main]run_init_process =p " %s\n" + init/main.c:1427 [main]run_init_process =p " with environment:\n" + init/main.c:1429 [main]run_init_process =p " %s\n" Error messages go to console/syslog:: From patchwork Tue Jul 16 18:57:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3C3BC3DA4B for ; Wed, 17 Jul 2024 15:02:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1342410E261; Wed, 17 Jul 2024 15:02:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BFlM4AVv"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BBE910E681; Tue, 16 Jul 2024 18:58:22 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-80767b21543so4305239f.3; 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=lists.freedesktop.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=BFlM4AVvOc5rH5WMLHCHImb4KEdkczFrQAC4PNQ/z1V6VRqo9EL359sqH+6Om7lqgn bHsosekzWswu9ggM25hDpqUBS8ER0i+pBvKd90b2t81AxjiHD4norI2dKD4cDkQSvkez ae/ZVnZLFLgMA53eaWCLEyq7oHhB+/at+4A0xEGupHhUAta1NuDqRtcB7ULwprBOZBPN QNbj674WTE1XiUL/xzpIklMH3VAXpL7vgftL8IQuqOcYRUgVyys5LExFLTu8A5nsh9hT raGsYfmWCB6wGreQaxVsa/PLNHTncTZffTJg8FrbSCiJi9wP7bkbGlrItAwTfnfhBEz1 Botw== 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=XH++4nhMEnROG7UJhvYY3LtRaje5qQtJ0etzmNaz/tmd1/kz2OnzzRqghEli9Sfg34 C4CzltqJHgCF4J1SNsczNJtZ2ZeKUEeiq03kBU3EAJEKCHp8C3RlyvKZ4NJYyyJfUNe8 h4J/8/oXIFrr+sLaYc4tS9eG3XetMZnj7byu22iwU0/WIJXUFF5frRS442V/3oftn9F+ OI6RLpuKaRN7F2oJLMchv4+PV3IfKybrlzk+Xn1s/rVkpZNDHi8xEw06oVicTVaJJ+o7 LqXEGE0b6oJ494ioBcx66P8Gf3MfCIy/6xxF8QYxXQF4BWhIIOjbqQn17yvr49sfsHqL wZrg== X-Forwarded-Encrypted: i=1; AJvYcCUxB0VFRLxTXs8b8JE5WaA6YBA7rgstRjy053rcrjAml4aH/R8r9rMm/qVZ84SwT+rs9goGsy+aRmJPi5gyXxuCqFMy6LkcVI2kMnPyMRomIYcWLu/RHezr/edBi5Htvjd//RhhGjDmC7Mn/UsdSq8R1eHJeXHE+W2gBWYWn3w+Eczm/bvdnd4nq9DmJ1QHINse0jya+Sz4/jHblcl9Zpw5aKIFXAW/c3rac3zNNp01/+ijXo0= X-Gm-Message-State: AOJu0Yzpv0xFR0hxBjN9Y8KeAtfVVeLg8h0/mNZPCixhUVnc2WrnBkD8 ZxH+DAXS4pVGiaaIUvGpShJ6VQGBnx5IUmytyjxexWyvrgk6WjGo 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" A more careful reading of logging output from test_dynamic_debug.ko reveals: lib/test_dynamic_debug.c:103 [test_dynamic_debug]do_cats =pmf "doing categories\n" lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =p "LOW msg\n" class:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =p "MID msg\n" class:HI lib/test_dynamic_debug.c:107 [test_dynamic_debug]do_cats =_ "HI msg\n" class 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 --- 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); /* symbolic input, independent bits */ -enum cat_disjoint_names { LOW = 11, MID, HI }; +enum cat_disjoint_names { LOW = 10, MID, HI }; DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, 10, "LOW", "MID", "HI"); DD_SYS_WRAP(disjoint_names, p); From patchwork Tue Jul 16 18:57:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F51CC3DA62 for ; Wed, 17 Jul 2024 15:02:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5BFD210E279; Wed, 17 Jul 2024 15:02:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gDnwpWi5"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id A00AA10E299; Tue, 16 Jul 2024 18:58:23 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7f97e794f34so4316039f.3; 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=lists.freedesktop.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=gDnwpWi5UfwHOmOvwcoYnEqgoVQHl80oC11Z3ziw0LoyTuWSKje+1tBB6PjzVjFqAg QeEuj0cAcuRF+DJMUq4nRpA6wckuHIf1spPLFte9LuAirg9pbSZ+xXLf+vBVH+pEZPDV kMShWCBRQJBfgk69pRJtNhxZu6hCUvnkSI9iQhBI+xQBusAUHaGuyklW53gtFcErO5ZE LvC28a1LrY9Abrwej0h22duT/FU5HWNqr1ahkA5bniZ3SNn5ZOHswl0ByphxIfqxrmar /K3phog9bdP6HWBH0kTid8162fFRhCxVSQheD7jhW0EZz1uECyiOsupnrMT2zbxysF4u B0YA== 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=VUCmLqSJPaDof8DO49sYo9Ic+WJpVHmCPv68lmzGihwLwxK21vRhzeanA/SV5pP8b8 k29v8UdGUQQtz+3PQbXn+mJAcCgDhmkkZfCD8vBaRfmygmrdvaPePw4CaWr/nYXuza+r xhT9Lz0WQkhqmsjQiX7Gm7YyVRqUk5Xhcp3YkAAyaA8kGeLhrx8AXU6rGzc2MD6MPLaw ekA/CLyhLEL7xoHcAqNeUHiyxKTvf5tbrJB4g8wB93wSLqDe2tMtZkXsO7y9DUIXA1Hj pT3X9dNfrzpQFW4nOkbbUTBZsZCe9vEPtPFA62NXMgsQN1WIgCpGYf9XqrZ82+Rrq8Eh UcTw== X-Forwarded-Encrypted: i=1; AJvYcCV9hlphnvRTBespJHe+PW6f30qdaBAeAJsnRqnflKx7gy+vGVt8Z9FcQKlL8hKZlljUNmtCUPHMLnSzzGAD00Wc8HBFGdWIMcXECU3wGoLtacdp05mudVnLMgIp/irLu3dhsKAkyXs06/CmCphZPTJtl44CMfIZri2+e5Hl/3gpzMtJvOkAq0FslGvpUgJG2bZvGFeXc9jifrhlV7JbvkAqnzuzfWae7yDVUWuOq7cMUmWXcdA= X-Gm-Message-State: AOJu0YzLOFJS91Svos7z2hunnFLdNzXa+tG3dZ5FdE/PfxHcfIAG14cD ozw3lM31dYAGfkzXsg+cZKr677KaeWLGUW/XiYTF5AoyGn9pR+Zf 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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"); From patchwork Tue Jul 16 18:57:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735517 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BCDCC3DA63 for ; Wed, 17 Jul 2024 15:01:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 95F0110E1CE; Wed, 17 Jul 2024 15:01:20 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G5CeGAEa"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id BFE0410E718; Tue, 16 Jul 2024 18:58:24 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5193839f.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=lists.freedesktop.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=G5CeGAEaEjShCy3jYqNExGPO9WUQWXE2xoomMHAzWcp+kBVZCDzcB0lbCpSMOM5LJg P0DIIiQ7JMZuZz4mrvb6SOZ1GjuxuqyJqTHsfdmrenlweKVVGeOD+Te6KmmySOw5V6rw sLTILjZl36amhGeH+rKkcaYrZwUOnzYWRQzTd5DMQWF50B6soZivtd/LTRpKuSFCPXy/ 4/c+7EFvWf6q93qf7YaJskX0ly2tnr0qKJ6rlD8kYZ0Ou5D5iLCfdKtHTjqoEldlTMIu mKQDw106YOffYov6jhAfvW2LhwP1BFer+MVH2k4HFq80b9NtllIBOKKP/b7J5q57sTVA ++2A== 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=C7yrm5ngR5iDHDS3adkjY7pADKvJC9BRK7MbMFqIHSJwCrT4tUVQtFo/mS00UOINYV CmUbsTJiFrsXT/K2fXi7/8nR/DoJRpXPEcoUCCttPBcq18RCOzwfGtyMtuQZfl35goAj np/S3gxcTKIf5ZDml11cw244U1sIgqi0s/EhYiYdJyKCYToiIScrabyMRLrEsrSWm/I6 iWcv8SpDGEh4K9F6SdrjNY+SDCo1aYoIkKuBjkQ3oM1fGRV971UUYiNNPgwhkt7a1Sdv 9J940wC8R707PM0mkLwp42dE7TqTBRvwjr9j1iGOLUAVsyw9+AW6eHgc0cbVdl/N8QRa blQw== X-Forwarded-Encrypted: i=1; AJvYcCXT+hI3N5C3L/gbg/wKNGS2Pnx/GUKpBLRngTaKfsXphcx/yXRmZ/y9H2o/9jdUWlFJvmfZFdkAbNnB+8YigKD0y48wjdakz1SmbqJpw0VdTHykRhJ90p8tVmqob60N326gRbKYn7WkXZiiFLgSaEE8+Cdtg1Ri/0kT9GwLSUi8UDBbcFuWImzYjQoQYHiSTut3vifgNVOTSPtATpsa/37dyTwXJJiIQOotIvOrWtG+DdyUDlk= X-Gm-Message-State: AOJu0Yx3dRZBpy93rRUHIPoBAxSAuAhhsgNiAmYoEGO+mHRNGqhFZSON g8e2lxs4bg/rUMNdFu+HR3eh0MeQ5RZQdByMbnr79+jtiz0sitLy 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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) 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; } From patchwork Tue Jul 16 18:57:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735559 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5D370C3DA4B for ; Wed, 17 Jul 2024 15:02:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D49210E282; Wed, 17 Jul 2024 15:02:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V0Wb71NT"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id E586710E2C5; Tue, 16 Jul 2024 18:58:25 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5194939f.2; Tue, 16 Jul 2024 11:58:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156305; x=1721761105; darn=lists.freedesktop.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=V0Wb71NT7nPUwGa2HxQIFpArwu+diAb4+q5r0LWOSjuhZEQh3xBaJc/JVL8aPxc+eV NqTyyJ+Jel9J1jkvYsXaPLyP/J3KcrJncfkRNJ129aiAhN3ID0IWb67VvHWP4jSkBsHq uVaNiCczmZ4glTDKJrUbUj6Rd59P0nTmBjkw1ecVSKZmQMa0hmN/gB/5bo16IoQX0ubW 5m8zpg8CbPxV1gT2wfYGVqONnYkxOLIO8sqrBp5h99tFDy3Ot0pC0b5dtRDPVnAla4Wl AooWp6rcjrveVg/8M4VSM1T/Iz0gZ+wlYloi6MyPPq7Dir7ZJtYO4WQ5zxpOPpU/Ik87 aPhg== 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=bKgeH+2xZwIYfEW+j96OXT8sLkHr/iKiYboxPsWb9m/zre6R3m8R0OKZcP7fy0OQBB EpsFwzkZPhDR87+MfaDQQD8LDQNNQgGZGc8RyzMhs06K3uvXSIB0gBK7uxQdBxG4Gx/E Hy3C978WVujoQSShGNBiP9lXcFyWqrLTzmKB2C9c9/3xyQTIllMjSDMhhjM4BBy11P1X 7Vvo+m9j379fzuUblmuhnNpxKQihBvIJEk87vkAOVQ/5XfcF0EK4KRtVoBWuVzC+UxHe +BUgz5CXQTxxuA3+RmAqADQRbq0q9dcfoS6m16gSPnDfXTD6eQZDSm9G2dYP8y5R1CGF 9S5w== X-Forwarded-Encrypted: i=1; AJvYcCVp4yhawp5OTcfg505nQYhQjtAR1pY3LMCM2LL5bqIjnO/I/zus68zHLp0+U5Tsi3skyb0HJrD6WHxSPwcOu5HcUcGDvfWKz8XcCtMukvQMp+QkL+2x/c8ef9RuEjrVe8a6K57/9C8+sDaq+a46WzcvAovIt9eMbFT9UGD5qQ9ruO76AcD1fAYYY38RTONhQR/AhEhcn7jHbfPojq1WlLOPr8yg/cWzjOdKpqo+jerm+o1Ot0s= X-Gm-Message-State: AOJu0YwGRCCf0AlNsRINvr9CPATslKYtTsUSoTE8lISP+EUJCRaXcXVn WjvUMVE8vCuuQMEF7icqwQz8syUyT24MIS7cN+O1SjAXV7vjGLT9 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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 { }; 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[]; 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; }; struct ddebug_query { @@ -147,13 +148,15 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } +#define __outvar /* filled by callee */ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_table 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; - list_for_each_entry(map, &dt->maps, link) { + for (map = dt->classes, i = 0; i < dt->num_classes; i++, map++) { idx = match_string(map->class_names, map->length, class_string); if (idx >= 0) { *class_id = idx + map->base; @@ -164,7 +167,6 @@ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_table cons return NULL; } -#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, void *p, loff_t *pos) static const char *ddebug_class_name(struct ddebug_iter *iter, struct _ddebug *dp) { - struct ddebug_class_map *map; + struct ddebug_class_map *map = iter->table->classes; + int i, nc = iter->table->num_classes; - list_for_each_entry(map, &iter->table->maps, link) + for (i = 0; i < nc; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; @@ -1200,30 +1203,31 @@ static const struct proc_ops proc_fops = { .proc_write = ddebug_proc_write }; -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 = 0; + int i, nc = 0; - for (cm = classes, i = 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 = di->classes, i = 0; i < di->num_classes; i++, cm++) { 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 = 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 = cm; + } + nc++; } } - if (ct) - vpr_info("module:%s attached %d classes\n", dt->mod_name, ct); + if (nc) { + dt->num_classes = nc; + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + } } /* @@ -1256,10 +1260,9 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) dt->num_ddebugs = di->num_descs; INIT_LIST_HEAD(&dt->link); - INIT_LIST_HEAD(&dt->maps); if (di->classes && di->num_classes) - ddebug_attach_module_classes(dt, di->classes, di->num_classes); + ddebug_attach_module_classes(dt, di); 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 = list_entry(ddebug_tables.next, - struct ddebug_table, - link); + struct ddebug_table, + link); ddebug_table_free(dt); } mutex_unlock(&ddebug_lock); From patchwork Tue Jul 16 18:57:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735542 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 42B77C3DA4B for ; Wed, 17 Jul 2024 15:01:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 027F710E231; Wed, 17 Jul 2024 15:01:47 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UOBeey8P"; dkim-atps=neutral Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 16CBB10E82A; Tue, 16 Jul 2024 18:58:27 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7fedb09357aso5196139f.2; 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=lists.freedesktop.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=UOBeey8P94mimQC177jMpQS2c0QqSPufjTR9z7LHjr/zgnTtqOHAVPFy0SLF81573I +r0y1c0u8+iiCDh3WLw/34sx3iAUSpiCgTaaqQYUd39nxY/l7eW3kgBQbgJsP+0cBpDy tBO2gwXBef4HBCyEZXL9N+6NS2LnbVtV7i9FNjhZgpqCwOls4v55EHMcTqwQtVuorJAb mOfHZ4cxkHgf7lUbNG8SIxDUH7t0cnaoGBXCbXnVQNTUZTOGsxob1kfwix78IIPqlhvo whXdq+83LDvYNhceNteNoY/gvcLjKBKNbDLuZpXQKQpjSQcbjJjP6IoyVRxAG5tB1vSI rXGw== 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=uGz7pnWNFhtCUFlsEhEnkmYTcLnqiNhjyBZStqOLHARIRchKNSmsvZWzVI2Xc6A5Tc N9lNGCbKxON3ykvw5FHo0q7uxfampQPz0I0MOb83KleghZ1GYRVCuHTLRxAp0QrdyoQW SfLSw1IQwpPjOxHt9k9EpfCF5R7flvUq8hXTZTGotrGndJLoh1HBXvrZJ62CytfnVkl6 LlNNohEqwene9oTUns7WN9z0qM8QVqyleQXKEBrHXE96q2HZdmaIqAPUKciSIqEmIQp9 8wYyMmEZvIefKBrpgc6V4lXicizyRZD8tpMiID9SX86L4wNmgNU9jH/p3+eMn2vXyj64 C2pw== X-Forwarded-Encrypted: i=1; AJvYcCW2fHvCGGcUu2W8V1B422JljmSpjsubmsMVAr4QJpoIq5E692x1mmkWTwa1O4Qrl6TloR9lId2m3rleYJKIajMvvYNBIM/bcpawUy/Mf7oXUkjAUsPkjxItpOGJ2hvqVrZMwkX0bUNJsCRhldxLoVp4A1U4N1fXcgKw14ijKdXPJyUU+rlYmRz/HFFW9f7h95WPPxm9iaq/TolLDc/nY6j1eFzsmoFG4LP1Xl1jqaDtilde8fM= X-Gm-Message-State: AOJu0YwOV0pv2m8j1euFj3mEy495xebByHG/iqIP77cMdMkwMv2zJg/v wiyVpkrjMyrm58KmlWIQClWGjqbv73pztBW5It9rnlZtyX2d914R 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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) /* 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 ddebug_class_param *dcp, int matches = 0; int bi, ct; - 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 ?: ""); for (bi = 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) == test_bit(bi, old_bits)) @@ -622,12 +624,15 @@ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], test_bit(bi, new_bits) ? '+' : '-', dcp->flags); - ct = ddebug_exec_queries(query, NULL); + ct = ddebug_exec_queries(query, query_modname); matches += ct; 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_bits, + query_modname ?: ""); + return matches; } @@ -682,7 +687,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa continue; } curr_bits ^= BIT(cls_id); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); *dcp->bits = 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 *instr, const struct kernel_pa old_bits = CLASSMAP_BITMASK(*dcp->lvl); curr_bits = CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); *dcp->lvl = (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 struct kernel_param *kp) inrep &= CLASSMAP_BITMASK(map->length); } v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits); + totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -768,7 +773,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); *dcp->lvl = inrep; break; default: From patchwork Tue Jul 16 18:57:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735518 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14483C3DA62 for ; Wed, 17 Jul 2024 15:01:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF4D510E1E5; Wed, 17 Jul 2024 15:01:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="I9jDOf9D"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B3FE10E2C5; Tue, 16 Jul 2024 18:58:28 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f684710ff5so2495239f.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=lists.freedesktop.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=I9jDOf9DnytO0NjwX2RgESoK0axdTzCFVQ+b0+ixWlxXaHThGKnJfYtw+80V1kBKEC Cy7TuHDUBwfAlLEuwqQ+EBbk5KfRQwcZzQ9LXH6MqMVetGx40kRMZJguRqW/iQqromuq x4Q0xJ7h4Vp5C+T0P4dVRsIHZtNspQpUoJugKMuO2/T4icCKFgfsQP5bLN4BeygjXE4w vAbMxvCjgrvXxQapk33RvSea50HMq9Lmg/7x9IUAzh0qs9JdzPFZhVDFCIWqqEVtG6L5 Q6TWnyvpnrVfCmXCNj/RJCnsIIKCjwnjyBRcGakQ46J9/KU2+Sp/f4IVvzW4mjHuTuZf zsrQ== 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=a/d89qvJ1rmBvp4LXPC15gW8Kp00P7j3iS/gVAHjpnAOY7V5RgsQnaLJzkssmpe0kE eFOK54wh2kH1FQFUNcKb4T7tFeGaEFl/0dgsgKj9hXn6vIp/VKiRgtM9gbSEdTF415ic LIQ1Sd8BXcswZFKIkWpNaEqTDoQ5xaGbOEnJbp1Kp+WBGWh+TNyzx4pcaVChQ2QLEd7d WGDgsUsQsOicJbYwpN0alAfR9trjvtuVqZahyUOoerjXzjZBLeYFROCCaIoYi3k3yfcF pqNOiBJeVoxqROM1/rHQasx+XbaBuCsvf4IjpE/yYNqZeJPIWI/t/W7q0nhL+31IFgdf sWUA== X-Forwarded-Encrypted: i=1; AJvYcCXJtYKKEk1rLzi2g3hbpKjAJW5mtQx5XmyH/A3100xSBVoLstq0c9o8qPYOam0BZ5ol5aFhQY7qv7SKE0Py+IWptpMoro/c7zCfTr+asNRIec68N1LpbHmiTNfvlFp1cY+7G3Rh+SGU9BVjsU4/BOrqZ7GT6JUPIrjl21+X7U7TlZhRQxDPo6Z1BzoeR4ZpjmvAkeULlmqBzXbvvTWCosdIQK6fcXK0xCA7xXuSKV5BeXpQedQ= X-Gm-Message-State: AOJu0Yzy6HRI6ZyjiRU9bcxO+iWLnw+QBupC5z8X1Pvnm0NZ4UUiSECI UUq6ti3/5cKuyxJuezM29t7vQf0RJdD7FNpTUEEbMqdzz4JqBTEVNb6Cun2e 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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 *instr, const struct kernel_pa 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) +static int param_set_dyndbg_module_classes(const char *instr, + const struct kernel_param *kp, + const char *modnm) { const struct ddebug_class_param *dcp = kp->arg; const struct ddebug_class_map *map = dcp->map; @@ -759,8 +750,8 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); inrep &= CLASSMAP_BITMASK(map->length); } - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, NULL); + v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); + totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -773,7 +764,7 @@ int param_set_dyndbg_classes(const char *instr, const struct kernel_param *kp) old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, NULL); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); *dcp->lvl = 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); /** From patchwork Tue Jul 16 18:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735520 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B605BC41513 for ; Wed, 17 Jul 2024 15:01:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E9EC910E1C5; Wed, 17 Jul 2024 15:01:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L23nUUxQ"; dkim-atps=neutral Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 853CB10E841; Tue, 16 Jul 2024 18:58:29 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7eee7728b00so5285439f.3; 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=lists.freedesktop.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=L23nUUxQwBRf9kGCKiuIBPfYDO8eJ7fbi0Oc5myhhxOY3nyrZWFS/+Th8KqQOAL3AQ G0JvmhZqq6E8zYm9/5pTFCxxZRrwHZ+uPZcTRH5oCdw0WQwa2OCTsJP5oZAUN+JMEKSj pAaqKC4wmyamx4yyq2+4zTd1Y45v3/7xiQ12NTmE0dnHfAnowprmx6Hj9ZftEzFaE108 5hRsJAh806V2UglY3MuLOpAjppOeVgt+Kue3Pm6UNKMTp50viV6tTrWlWUKuSc5rYik7 1875Abalbi1CXGllt4v0lEB2y1zUxehzqDro+uREm9TZFTtSt+6zbEjjDhJKtJzOQrnA cnsQ== 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=qMVhKfjdPzBVY72nUuDaXc6dGWOO8A9sQP3tcRvcNRGDQHq1gFl1oxNfl3GKK930WH 9H3AFR/XYu58waoWlrUTY7PzhtNk2i6AOm91+wXJQj6j/h0MrjC1i2A5df0Ed+giiPVX /XtJBHHW9YmvFOUZgkDhsqsVi4n+kzgByql9z5tLoNyqZhTLuM4xLGArCHQ/I6IYEcCR aFiM4StBOfFjeBIYXn3015T7N7kOPE7OqOrqPFufs/8m2P5vpZXgZY9TWcbW18tQQRlG 8hpSpK8dLMmmzImHFpUX0J9dzTsjm8+dGZzQlT532lU/UvwfDOCHVlizOLFGfe7QLest 9Z2A== X-Forwarded-Encrypted: i=1; AJvYcCUNqmvsxin72zUMsCY5KW/fJY61w+63ApKBgwnHp2SyRxr9+9i8SrxdWWEjPN1Rf+GVs45lG15Fvw7euJVcEo1WkCusTJ32YuaIniFZ0Cm6KGOcokBs8h1wGuPtZRwmTb5B+MDDJU340uK5QC+5bH+r0vAnZtOY8c88bfeB72andQcsZctfGhjaSnJEZPQxQMHY0p6FCYBhryAm94WRNbGnPftnZEQVCweOpXYoeUPcNe69fno= X-Gm-Message-State: AOJu0YxTXbia3YhibLgSf2QjubvS7uEmOh7orOo9QJMdlgbqLNPA1rrd P2Zx3hd5PoJb0/u5Q5HqfV1iN0dUPsQoFBVSle1smhhW2pe2/HOT 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" ARRAY_SIZE works here, since array decl is complete. no functional change Signed-off-by: Jim Cromie --- 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 = KBUILD_MODNAME, \ .base = _base, \ .map_type = _maptype, \ - .length = NUM_TYPE_ARGS(char*, __VA_ARGS__), \ + .length = ARRAY_SIZE(_var##_classnames), \ .class_names = _var##_classnames, \ } -#define NUM_TYPE_ARGS(eltype, ...) \ - (sizeof((eltype[]){__VA_ARGS__}) / sizeof(eltype)) /* encapsulate linker provided built-in (or module) dyndbg data */ struct _ddebug_info { From patchwork Tue Jul 16 18:57:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735558 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65FF9C3DA42 for ; Wed, 17 Jul 2024 15:02:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 57CE110E27E; Wed, 17 Jul 2024 15:02:42 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WFhoLnie"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id B67E510E850; Tue, 16 Jul 2024 18:58:30 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-80a2939265cso6199439f.3; 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=lists.freedesktop.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=WFhoLniethKtXYZ5pXtdbA+Yfdu9ES0B8T25vkNHEmCWUuTTWHWojXpqqYNEHWpCHx v4Tikt2oEn6jEIiFUbD7F8aaZOLVmPoik/GwLRttLzaXLOd14vyjDZdjhuMEKJ/01xiy K3G/+INFIas8HuCyhlOwS7Lwniec6McgZq574A31moye1uICXRMVtaFWel5PUrqPoSwB 2uPdGaIG+SJhBoGzIryAzO0FdB89hZBz63+o6vAfXvTIYBwtC6BWvA3odZkxsB0HvYvJ 6v4EImg4MPo1ZFTz/fp97wGg2zaS3mGgutgGkav0q72AhAP1ZQBj1apxUiTP4bMvppG6 OOFw== 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=hl0Dwd+2LsSKGdcIsU3El3iGBoVY2IFaekfk3or0F/6RYOn99AwG8//t8DNUTUeQOj cQaoqYBoECPnQPY2QUnynQVkYUQQG0RCn/7ghAU+lrDi/jKbRfFiEpCCo+P3/YjJdtNq tQubDi6yJV/rVlM03JK1ZJWGFxQtW28WlVjl71L8c+BiPCsWM1mplusCTwFquO71w0yH h/QGDtFOa4ofY6psAphfZF3T4cuiqMFhIat6zIilxw0KpU7ndpTcMj9bpfYewd7AIY85 x7YUJ5+CmGPmGG94jcoQcXeTNQLi3dlmULHvYHyDRhNauFklU4UZ/YV6QND/vDc+1PtH /1Yw== X-Forwarded-Encrypted: i=1; AJvYcCUkT3SuxMe09+wjU4A/eB845bkqrayHR4OzZO8ZLdaDNVRW9/Eda8oT3aLD/mTYLXgdNSPne4/IqD7AQt3n4eFj2sd0xxRHRb0cyew1Vld+nfBWBcXJfJTgXJC8yvT8EeFclxB52gDYrtCsBiW0efkh9WEYDVMaxevMfXLc+02diEyanqp31oagqDh857JMlD+8DWMD6mFfgp3+r61U9Aj4dqcMQkQ9bVqUhLD8KEwVrfF2myo= X-Gm-Message-State: AOJu0YzZQN4Tg+ivUDgtkYb5/gNUq5XHU5gf6iVHoQuGQHlMCSgMhCyI Gk43mmLN3trVIuG7Z52a0GYO0rRt3Qh2Gj/7lKJ6T57kXp9/L8v9 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" currently, for verbose=3, 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='+' dyndbg: flags=0x1 dyndbg: *flagsp=0x1 *maskp=0xffffffff dyndbg: parsed: func="" file="" module="" format="" lineno=0-0 class=... dyndbg: no matches for query dyndbg: no-match: func="" file="" module="" format="" lineno=0-0 class=... 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='+' flags=0x1 *flagsp=0x1 *maskp=0xffffffff dyndbg: no-match: func="" file="" module="" format="" lineno=0-0 class=... dyndbg: processed 1 queries, with 0 matches, 0 errs no functional change. Signed-off-by: Jim Cromie --- 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 *query, } mutex_unlock(&ddebug_lock); - if (!nfound && verbose) - pr_info("no matches for query\n"); - return nfound; } @@ -501,7 +498,6 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - v3pr_info("op='%c'\n", op); for (; *str ; ++str) { for (i = ARRAY_SIZE(opt_array) - 1; i >= 0; i--) { @@ -515,7 +511,6 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) return -EINVAL; } } - v3pr_info("flags=0x%x\n", modifiers->flags); /* calculate final flags, mask based upon op */ switch (op) { @@ -531,7 +526,7 @@ static int ddebug_parse_flags(const char *str, struct flag_settings *modifiers) modifiers->flags = 0; break; } - v3pr_info("*flagsp=0x%x *maskp=0x%x\n", modifiers->flags, modifiers->mask); + v3pr_info("op='%c' flags=0x%x maskp=0x%x\n", op, modifiers->flags, modifiers->mask); return 0; } @@ -541,7 +536,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) struct flag_settings modifiers = {}; struct ddebug_query query = {}; #define MAXWORDS 9 - int nwords, nfound; + int nwords; char *words[MAXWORDS]; nwords = 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 = ddebug_change(&query, &modifiers); - vpr_info_dq(&query, nfound ? "applied" : "no-match"); - - return nfound; + return ddebug_change(&query, &modifiers); } /* handle multiple queries in query string, continue on error, return From patchwork Tue Jul 16 18:57:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735530 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A9A8C3DA62 for ; Wed, 17 Jul 2024 15:01:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4960010E208; Wed, 17 Jul 2024 15:01:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="neDSdMs4"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id CE96110E83B; Tue, 16 Jul 2024 18:58:31 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-807007b8dd1so4811639f.2; Tue, 16 Jul 2024 11:58:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156311; x=1721761111; darn=lists.freedesktop.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=neDSdMs4xpAR9dvlscP/mx4ZHe10Fjrk3QQHyD1xXDr6D2m28FRakxfNjSKLLkf8gO qB7c2pgGYX9MAmXoUfMinGNKW3EcW3EXmr8Gute5Jh31ftSVAjANXkgjqjdRpNiYlHdP D8K4vOPje4MwpHO3T57D1d5caz2bCMWpTTEF+f2WzdGCSIzEIabTrN2+6JTL8SeCpbvy lKUQRQep3rUFTSXk3UuyxlbwJKmHhz4CUY1rPqdscvvmYr3EYfzIdqgpP2AQqPbSzk7L e12nHgisZcCtccJtMM1zMgn/HeCjOkyGfHw91UWoqJexoKf67KmHKBmDZFH0C6ixQ4iQ FGNg== 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=AHbDHwGsSgY5xM4tpGCtnMMpwQhtCXKtUfi71s4/IWefjlsgs4065tWc/q/vT1U6xb RPjQ1lw106MmXm/X/HuV/EGyQyhe8BhnUdVPRCXqZBfq8ICwZwE4nyYJngCzIxbOhwqr 4Q7xFmb24OBUX1wkctmq5U/TE7s8zUT0aBXHh6QK/QZCdH+oUfs8sVtUr88Xd6v7zio3 uv04/BlRFAqza2Rx29KGufHPjTv248WoKbyGEjDai2vt8KROVo1KpVArlfPatNhQzC3t PDZCYPfyPe7Rpa2rksocMYaLE+D9394G2hiWyPtSZQ5dOOOSO+cx3/hYgtUf63d2ooDJ tZ7w== X-Forwarded-Encrypted: i=1; AJvYcCVlYzQ7oGND+fN44RPDd+BcMym+Q3GB6f2uD4DIcAFe/MmIFITqS0+XmmR+YQrodUjbFA2Cz//9y9bTXWbnsQ8dAbAjwqBshNK5ArJMc12uUJN+3NWi6mC+fW3RJPA2munqsmg1pO/SfvG4x3NOdw/CtvVomshwnl5eYx1JFVkdVa07NSC0BP385oGCqcY4kgYX9DWgScOgCJqQ95+otudjwDRjwGaHI9M/AL59lXxGJ99PBtY= X-Gm-Message-State: AOJu0YxiMW3R6Astik7Y3Oi/ry3yfV2b1676wKudP5sOARGaLjiYSEW8 Kp0xUyvw0oKfZRKPJxQMPuo/7brRXf6dPdHGDoEUk9zDcjw56sj+ 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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; } -/* 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 ddebug_class_param *dcp, int matches = 0; int bi, ct; - v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, *old_bits, - query_modname ?: ""); + if (*new_bits != *old_bits) + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); for (bi = 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) == test_bit(bi, old_bits)) @@ -622,8 +623,9 @@ static int ddebug_apply_class_bitmap(const struct ddebug_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_bits, - query_modname ?: ""); + if (*new_bits != *old_bits) + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); return matches; } From patchwork Tue Jul 16 18:57:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735512 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1E5C5C3DA42 for ; Wed, 17 Jul 2024 15:01:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5DE5710E1C3; Wed, 17 Jul 2024 15:01:17 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mIjdECPE"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0E08410E855; Tue, 16 Jul 2024 18:58:33 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-7fd3dbc01deso6009939f.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=lists.freedesktop.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=mIjdECPENjptGk5kOiNjjEPjYGZBqu/Bcpveu9l0hORMP244ICD0qXrk1Jakti1ttk 2CApqz0cOmF1XBPnQiW8f0dscEdeMMKDaUrFFfiqqpH5FyUEcOP4SqpSyl5cBUl07eHm +Z+vEulpdfdtpvaO6DSUkO9/lgeNqcG7oKot38WZrj6hAWKvXDwJ+qWFZSDblx3qXw8W 1Om/LJHMuo1egrKi585bg72F21J3Oj+J9/+zlQUyZ+Vd0jNRBREQEu/UKhxzVA9X02fo AlmFhCnwTzdNKINPnPyaMA0aRDeZeRC25ttj2CIiYXXQU7CrFbp0uHUtb9RhUdu0GGXY Rkzw== 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=lvzeADbBQoW+XWaMT315MIeujMDLXkPrOstyXSYl73N6Di4hzoAtrxWfryS4MNlx4r 2Gt9A9rPPiWhTLxyyaraY9nmJvQGUNcc/G1Okn+a46loNWaeRi1huG/8l2eO1Z0BZD/m ytkwlUIAzSiGwkmbLgBhhYg+//ZXNIxl/n1caOTkP5AbUniNovqctpCL+KRJvcIcbIZb aJ1ZHTfITEukvuLwIQWXDW9L9fX0qi4E2QSY86rGh0WGM8qOhgPyWjR+t40eTF1zdR0g 4zJcJmBjh53saWj9gfZo9m3PeeTCcHBmrKieSWer9vDv1BBLGSl4VV0AzNc4NaGTa5kX zC6g== X-Forwarded-Encrypted: i=1; AJvYcCVSLjlpTlXpIezSwJKvrXMviu0BegP59XDz1NzUnl0LCRPmPHHrr5lRM6TqBqoCBWYsMqwqz9tkQdz9mSDfh2vd4G/YEHI+rHT96yCIq4FJRrUVThguFzCht+80lHKulKjFtzr5jn2jqIlZu7EbZNh6CoplUzeUiWvdRYdbi7uyLGFLC/HWGPEDdUchrr9DYn8uTzLp/xhAyloV+aukvoC1c5GBqukuqmmqIpj8TR1Z4HLfOoQ= X-Gm-Message-State: AOJu0YyHIWTElAqHwW9ZeXzFvRpMa11MaZWl27MJsAoTtz1Gg96QVkWc kpcK+DLniVxnzdR7Jwr+afdtT7T4AclcW9P2v9Vq9fiGogYNDX8s 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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, void *p, loff_t *pos) #define class_in_range(class_id, map) \ (class_id >= map->base && class_id < map->base + map->length) -static const char *ddebug_class_name(struct ddebug_iter *iter, struct _ddebug *dp) +static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddebug *dp) { - struct ddebug_class_map *map = iter->table->classes; - int i, nc = iter->table->num_classes; + struct ddebug_class_map *map = dt->classes; + int i; - for (i = 0; i < nc; i++, map++) + for (i = 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; @@ -1159,7 +1159,7 @@ static int ddebug_proc_show(struct seq_file *m, void *p) seq_puts(m, "\""); if (dp->class_id != _DPRINTK_CLASS_DFLT) { - class = ddebug_class_name(iter, dp); + class = ddebug_class_name(iter->table, dp); if (class) seq_printf(m, " class:%s", class); else From patchwork Tue Jul 16 18:57:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 439F4C3DA61 for ; Wed, 17 Jul 2024 15:01:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91C3B10E1ED; Wed, 17 Jul 2024 15:01:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S7zmZGAc"; dkim-atps=neutral Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4A2E410E83B; Tue, 16 Jul 2024 18:58:34 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-8036ce660e5so6225739f.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=lists.freedesktop.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=S7zmZGAcAsi/KP8bejSRBBws7l9wEVFpJbn11Fvh0EsqGYEFZsVKzcAPAT08sEjmlI jDOjHX82Jq8sEcFvm+2nIt0MrHLo6juVcsAQiIxU5Cczs2um/l6x3G9eEeDimGc4oDtB GP6JyWMwFVydle3kPC7XB7sPRdRWxjKfst2IojJ+YH7Fw+Mjlq1GnGeKHxJiK8ewjIUy LrWxUGNZo+7HJ7uiePkTONPteOAgHSY/dVY71BBFMo2QY2XzfGhuEBeh68Cq/gBH+yQR e2k+T8IkdlVV/ywrr2Wp9Uoe60yl4Icuekjck01Rxn5QWDaxeEHREhEScqNH2tqaJ1Up PXCQ== 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=xDz4qKhuo+v9QR/sZeyjqJwbnITlgpdPlWZIDsrRGdLtCYiRGtMZCI3x2WdTdi43jC eokez8li6cf8nvgSj0N5rrWQDKzLom8dXamk4ICaHaE1I1VBq/8w6TOEzke6w9TsB2Fx sheyLrOQxrWycU2pgejX7fLKN21aMmEFEh7+PjsGkDf9P9vpI88Op2vP6RmGI/8TjP8O ZpkjskiEC8GrZ7/lUod2/lhtxhQ723Qse+QIC9SdmNehLM7NA3wdRF25Jhse1OEHhcaT FmY87ePTVJVN+TjFBBfIxbZqsfsrJArdFcmlKnTWhhELUpbFvg/UQC1iFC0pPQBp9syn /5tQ== X-Forwarded-Encrypted: i=1; AJvYcCXVOnz32w4aY/KeSRG4poSRsJGMNW7n4PhOIRisPpi4cIw5FteTMNOgPFyfVlEtiaaIdXZZmm/CSvh0bF9Haq8GWHC3GsL40nvIbkyyB/vt+8ZIx1q6uD9ufvggH8yJveyJmYPGgS3v2X92cIYj1Tg6h/KT87hJwpqeF7vU5NQFYzTd0y59SrJ691gvmbBwlym5c6KptlgSHmX8fYgJdwdXIBAlbPJ/jleXpJUGEGhqlOFqXNE= X-Gm-Message-State: AOJu0YzMLM3Q9jAb6oKdr3N33gi27/89LoeN53ZaXjxzKvobmxbDkl9p 62dtGAsBJbNsFnJkNZOhEhqZA2etKOeunJ28rjhCjJZ4p3OARwON 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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) /* 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 ddebug_class_param *dcp, int matches = 0; int bi, ct; - if (*new_bits != *old_bits) + if (*new_bits != old_bits) v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); for (bi = 0; bi < map->length; bi++) { - if (test_bit(bi, new_bits) == test_bit(bi, old_bits)) + if (test_bit(bi, new_bits) == test_bit(bi, &old_bits)) continue; snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], @@ -623,9 +624,9 @@ static int ddebug_apply_class_bitmap(const struct ddebug_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 != *old_bits) + if (*new_bits != old_bits) v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); return matches; } @@ -681,7 +682,7 @@ static int param_set_dyndbg_classnames(const char *instr, const struct kernel_pa continue; } curr_bits ^= BIT(cls_id); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); *dcp->bits = 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 *instr, const struct kernel_pa old_bits = CLASSMAP_BITMASK(*dcp->lvl); curr_bits = CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); + totct += ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); *dcp->lvl = (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 &= CLASSMAP_BITMASK(map->length); } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, modnm); + totct += ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits = inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -758,7 +759,7 @@ static int param_set_dyndbg_module_classes(const char *instr, old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct += ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, modnm); + totct += ddebug_apply_class_bitmap(dcp, &new_bits, old_bits, modnm); *dcp->lvl = inrep; break; default: From patchwork Tue Jul 16 18:57:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8090FC3DA4B for ; Wed, 17 Jul 2024 15:01:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BC1FE10E1F2; Wed, 17 Jul 2024 15:01:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MO8P4MUz"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B26F10E2C5; Tue, 16 Jul 2024 18:58:42 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7fe8d029fbeso5410839f.3; 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=lists.freedesktop.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=MO8P4MUzasiZONyaQWjLx7ItFRDcnLnjeCvZTWd1/+c/7ufgHJNYEkwbIEppsHa+GI GbT3SMXJhj/2tbb+MoV1bk9w3IQR8DHyf5HxFgbzr8y7w6/t7SNQh7uTz03MIMgXJ8XZ Ac2X7Tv56n6o5zLJ8MvKhtjVK8gM7GYbvejVP2uRrcPOrSp+iTphIx2CYW9mENUm/4HF g4XoouRmgh6oqC3XeIu1m0xfYfLiugbvxv2U2iP3d2rIGCScep+L4Dhhtn9rDTuk/xLE 0LwqmH20IgtPuu8RwQC9lBxU2UpZONYByepZfz8ShdR5bteziH6tjJac4lcZQkOSGnaF AhJA== 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=BCJcmGVg1S0Uvr0+FjPllLbxLKDyTmZNyjZlgX1XB80NGhmk1ditfaRpNqdDQWSIqK AbWFe1cbp9H9FQomH91wFXMY22e8JKaqKIRbZNXO7hZRsnooszQ86rh/JYluft4a95Rt 7u4vA1oMoQDQA8CArCZjc1WK8fuc/ZDiCkJZOgSjK1HhMGxQxJM2KPh7BN4f+tGRBEga ZgcAjkK36m1VSPI3SVuDBnW1HC50XC7KJ2ndbEe6ziufmwPaTvbA27B4PP9X2mscmxMy NWjwlWdX9YrJx/t6ET/tpG677eaeOCFK8ZU/lVqHDr9+XEolSyUM5+XhFxj1sDrxnL71 pQ5w== X-Forwarded-Encrypted: i=1; AJvYcCXFKrOuKEaaKF0IP/QPRkqBydr/K5DCzxNv/Nqms1m7FQmhTlF4ujTxJaTC7bRTRUlh3O9lWSytja97ZzV86H3IFHwJxrAkMVcVIZA0iotad+Bnpf6+tFcyIse6ilpmKqdO18OTfkyDcXWRTG/kSdZ0Aks75pWr42f5NeJiVe1uGGc6diJJBxgRIoLfVdAAyMVT7DVcDFvkVVevEyPeUnYJETV9o/Jyfe5IenIMZwPQ2y4pfuQ= X-Gm-Message-State: AOJu0YyIRCMqZR+x8mVun79BZFAFmrWeyt855pl1p2VZeyEOuGgTs9NL 9B8RdwHZOqt/5a1rjp4ATzKkjbRrvb50zvx5Fjc5kOz/yTlOwdRo 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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 *di, const char *modname) { struct ddebug_table *dt; - 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); dt = kzalloc(sizeof(*dt), GFP_KERNEL); if (dt == NULL) { From patchwork Tue Jul 16 18:57:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735524 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 76555C3DA42 for ; Wed, 17 Jul 2024 15:01:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8286C10E1EE; Wed, 17 Jul 2024 15:01:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="H+nQdpb5"; dkim-atps=neutral Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5734510E2C5; Tue, 16 Jul 2024 18:58:43 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-808a8c90f5bso4646239f.2; 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=lists.freedesktop.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=H+nQdpb5+05v210O9BPT9oY9YXcn/5pNX3D8IeWudqscbrGDDp2lsqNjG1jv54mGGL xC+uquDlrvkA+8KdknHBYRVzs1j8A5BR/jbgz8pb/peIsVOEqJ1rjR+iTpEV9e3W7P0d dKlADZYKvFINP5EsLiC17CvQOoh04O/qBFIZFfrOTcZtAqdL/cBgViiyzXUCn5bwVc/C KEwnbN2i+DcYOcKFNHFK6YbPz8oQUXsPaUxFAEZTMYoWOlrjT41RCx/BX8Ifrz+oWa4a xi/w+Zw5J+JDSMa19rpVCopv1NXT5MQqDBpKT9YuWbEnDv5BC84rxGxuUyumkaYH2OeA EMjw== 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=FmPKL0nMG1mJobLyE/kpnwetllc1SUOUpA7HFPHCnLspYQgl3EF5k7BeP0n06PiRE0 peu8WP0HVpgpDiQ1trzLrzrEDvEWlRIFshDEXyfKv/PZPEjMrrDIKMkIcvGJsDKipiJv 50vbyV1bOkflftm5KgQYIowJOK24eM2VyuoWJSEqcFZd/fUrqfuvEsOgD/9BwMWrLj3G Vk0YGp0v3tB7At/LFlGaNlspycDByOIjWqAUWhAMC9gVaoN3wRQxkO1jYJUHlmCJA8kR IODIx7ZhYHBvGAwaduxOyTXT66nglzlsOP0qrIwoA5iHPiyxoCuKPV9snyM3896iGFIw 1qIA== X-Forwarded-Encrypted: i=1; AJvYcCUgcywMbzBZWP4RWMpTIDF8t/MhbQcr93vvNWOTfgTbENK6h7/EYFjSoVwHb4Y9AidyQC0FULc4an5XxshBF2qoPKOziwvJot5bfPhcWZ6oEyrnNRKV1kebx15t+VLgTkFIh2QdMLalgbfpkbbZVFwI2edZSJH6yS0fFhWlxhoVnk+8fvNmkB3uBu3MKGkdz9dupDCTYq6uzV3904whkIOKmrMVgMFxEJA/3LHLbNgdViFidIw= X-Gm-Message-State: AOJu0Yx3fAcX6fol+5yy6VNnF817h5klZ5ujHFZxA6x9GlL37hqmlYAB sPheCFR2vZ+5mu7CvtI+8234LhP3JL9nZrtmtgZbRbgTrKqmd5Qo 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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))); -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=0 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 */ }; @@ -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; }; /** 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 ddebug_class_param *dcp, #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) -/* accept comma-separated-list of [+-] classnames */ -static int param_set_dyndbg_classnames(const char *instr, const struct kernel_param *kp) -{ - const struct ddebug_class_param *dcp = kp->arg; - const struct ddebug_class_map *map = dcp->map; - unsigned long curr_bits, old_bits; - char *cl_str, *p, *tmp; - int cls_id, totct = 0; - bool wanted; - - cl_str = tmp = kstrdup_and_replace(instr, '\n', '\0', GFP_KERNEL); - if (!tmp) - return -ENOMEM; - - /* start with previously set state-bits, then modify */ - curr_bits = old_bits = *dcp->bits; - vpr_info("\"%s\" > %s:0x%lx\n", cl_str, KP_NAME(kp), curr_bits); - - for (; cl_str; cl_str = p) { - p = strchr(cl_str, ','); - if (p) - *p++ = '\0'; - - if (*cl_str == '-') { - wanted = false; - cl_str++; - } else { - wanted = true; - if (*cl_str == '+') - cl_str++; - } - cls_id = 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) == wanted) { - v3pr_info("no change on %s\n", cl_str); - continue; - } - curr_bits ^= BIT(cls_id); - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); - *dcp->bits = 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 = N in 0..max. wanted +/- determines N or N-1 */ - old_bits = CLASSMAP_BITMASK(*dcp->lvl); - curr_bits = CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - - totct += ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); - *dcp->lvl = (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 = dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct = 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 = 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 = kstrtoul(instr, 0, &inrep); + if (rc) { + nl = strchr(instr, '\n'); + if (nl) + *nl = '\0'; + pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } - /* 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 struct kernel_param *kp) const struct ddebug_class_map *map = dcp->map; 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); -/* symbolic input, independent bits */ -enum cat_disjoint_names { LOW = 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 = 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_LEVEL_NUM, 14, DD_SYS_WRAP(level_num, p); DD_SYS_WRAP(level_num, T); -/* symbolic verbosity */ -enum cat_level_names { L0 = 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") @@ -102,10 +88,6 @@ static void do_cats(void) { pr_debug("doing categories\n"); - 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); } static void do_prints(void) From patchwork Tue Jul 16 18:57:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735515 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2F911C3DA60 for ; Wed, 17 Jul 2024 15:01:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A230E10E1C4; Wed, 17 Jul 2024 15:01:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TIJXJp2V"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB3B710E2C5; Tue, 16 Jul 2024 18:58:44 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7f684710ff5so2518739f.1; Tue, 16 Jul 2024 11:58:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156324; x=1721761124; darn=lists.freedesktop.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=TIJXJp2VB0bJtiUAX4Ng9PI2ZXNU3GvlnUioJPvbOVXkuumQV5joxyPW4t2xQjpbsQ 1IOniwBoFoabMysRNMLyKSvdaLeetkDmeGdgMVpvWY9EgB86lzCLU799OySx9G7Anyk0 hTENhVZnARGSU6ONnFrAh4Zmn5mNxz8ZTNfhU14XZ9S3H3/K5WdLOqIPfA/6kA0qWXQ2 xuRLNgPxLf6kPHGPMz8Tyxydot5daZ91yJPYi5hW6rocR/DU+SpOIb1ApXanZ48SfoUH v8N0lyNAiptnKBJPLKMxKDBJD0yrjrUy+M+JuAruaClLpED4ZZvHsnedtlBL9i+p6zFR HS3A== 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=UVTDJ6ph/fiNM0+lxjL46SEts1KEa3W8Rq23y78e3ekyx7HnKTL+LyS/DEglDo4L5I aCUFx/vw+zJQUj/A2m9RHsPdYzdSbWhsUM8yByHBo1DupXMqnoxQLTslHBoBLEcGEqry ugMxFPPUPQ2NLF72SwB8WMYfVJ6F998SmFO3rLvvaKatagLwVjyyLMe6BtUYztR3pf6s euugy7KttjGMaaEanE82WfuZ++swk7kCGuNQv8sjIx/Nyo94D11eIQ4rxAxxLxKM+pA1 ufQeznrcbFtt99jLxM4Ge7GSc4BlO4yfGu92Q5gDSRmJ+pP81qcCFG95K8IYVh5HxfsB Rcww== X-Forwarded-Encrypted: i=1; AJvYcCXA3S/tp6ExVpDpzykOGqcM4Np2vATc7BDJSwc5FYmJdNYGjueceMVtNacv6YJYB4f7nhi/vV6qqI22fhH0u5DRb285269JzBUdVVOQFaVGx5JP188dop82zbmk+ZcNrcW+iThbgRfMsxaziLSASulCLqbPBl0zE6x0zGjZJsC+AdrXw8Su1qy+oR9TOwRv7HkdnQrj1B0KCn5rnWcQw1JUoXHmDTD4m26DIelcetLdvvyopZ8= X-Gm-Message-State: AOJu0Yw8zTcTJURZfeO+N8dtgMRdU7lZrV8Vh3QE/g01X4BPvHVIBExc HdLC57J4+zB1xSqwZidvpoon0oA6mEZpxEJUg5GKNepa0JsdS+RH 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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=Y 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 others: 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=y 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 --- 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 DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.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 */ \ . = 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 { }; 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 { }; /** - * 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 use. + * @_type: enum ddebug_class_map_type, chooses bits/verbose, numeric/names. + * @_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[] = { __VA_ARGS__ }; \ + struct ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_classes") _var = { \ + .mod = THIS_MODULE, \ + .mod_name = KBUILD_MODNAME, \ + .base = _base, \ + .map_type = _maptype, \ + .length = ARRAY_SIZE(_var##_classnames), \ + .class_names = _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[] = { __VA_ARGS__ }; \ @@ -99,12 +122,37 @@ struct ddebug_class_map { .class_names = _var##_classnames, \ } +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 = { \ + .user_mod_name = KBUILD_MODNAME, \ + .map = &(_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; }; 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, struct load_info *info) mod->dyndbg_info.classes = section_objs(info, "__dyndbg_classes", sizeof(*mod->dyndbg_info.classes), &mod->dyndbg_info.num_classes); + mod->dyndbg_info.class_users = section_objs(info, "__dyndbg_class_users", + sizeof(*mod->dyndbg_info.class_users), + &mod->dyndbg_info.num_class_users); #endif 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. 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=y/m submod=y/m. If unsure, say N. 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) += test_user_copy.o obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_keys.o obj-$(CONFIG_TEST_STATIC_KEYS) += test_static_key_base.o obj-$(CONFIG_TEST_DYNAMIC_DEBUG) += test_dynamic_debug.o +obj-$(CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD) += test_dynamic_debug_submod.o obj-$(CONFIG_TEST_PRINTF) += test_printf.o obj-$(CONFIG_TEST_SCANF) += test_scanf.o @@ -224,6 +225,8 @@ obj-$(CONFIG_ARCH_NEED_CMPXCHG_1_EMU) += cmpxchg-emu.o obj-$(CONFIG_DYNAMIC_DEBUG_CORE) += dynamic_debug.o #ensure exported functions have prototypes CFLAGS_dynamic_debug.o := -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug.o := -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug_submod.o := -DDYNAMIC_DEBUG_MODULE obj-$(CONFIG_SYMBOLIC_ERRNAME) += errname.o 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[]; 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; }; struct ddebug_query { @@ -148,21 +151,39 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } +#define vpr_dt_info(dt_p, msg_p, ...) ({ \ + struct ddebug_table const *_dt = 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_table const *dt, const char *class_string, __outvar int *class_id) { struct ddebug_class_map *map; + struct ddebug_class_user *cli; int i, idx; - for (map = dt->classes, i = 0; i < dt->num_classes; i++, map++) { + for (i = 0, map = dt->classes; i < dt->num_classes; i++, map++) { idx = match_string(map->class_names, map->length, class_string); if (idx >= 0) { *class_id = idx + map->base; + vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); return map; } } + for (i = 0, cli = dt->class_users; i < dt->num_class_users; i++, cli++) { + idx = match_string(cli->map->class_names, cli->map->length, class_string); + if (idx >= 0) { + *class_id = idx + cli->map->base; + vpr_dt_info(dt, "class-ref: %s.%s ", + cli->user_mod_name, class_string); + return cli->map; + } + } *class_id = -ENOENT; return NULL; } @@ -559,7 +580,7 @@ static int ddebug_exec_query(char *query_string, const char *modname) /* 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, } /** - * 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, void *p, loff_t *pos) static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddebug *dp) { struct ddebug_class_map *map = dt->classes; + struct ddebug_class_user *cli = dt->class_users; int i; for (i = 0; i < dt->num_classes; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; + for (i = 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; } @@ -1124,31 +1150,134 @@ static const struct proc_ops proc_fops = { .proc_write = ddebug_proc_write }; +static const char * const ddebug_classmap_typenames[] = { + "DISJOINT_BITS", "LEVEL_NUM" +}; + +#define vpr_cm_info(cm_p, msg_p, ...) ({ \ + struct ddebug_class_map const *_cm = 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, const char *modname) +{ + /* clamp initial bitvec, mask off hi-bits */ + if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { + *dcp->bits &= 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 != ¶m_ops_dyndbg_classes) + return; + + dcp = (struct ddebug_class_param *)kp->arg; + + if (map == dcp->map) { + v2pr_info("found kp:%s =0x%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 char *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 = 0, kp = 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 = __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 = 0; - /* - * 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 = di->classes, i = 0; i < di->num_classes; i++, cm++) { + for (i = 0, cm = di->classes; i < di->num_classes; i++, cm++) { 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 = cm; - } - nc++; } } - if (nc) { - dt->num_classes = 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 = nc; + + for (i = 0, cm = 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 = 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 = 0, cli = 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 = cli; + } } + if (!nc) + return; + + dt->num_class_users = nc; + + /* now iterate dt */ + for (i = 0, cli = 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: "); } /* @@ -1158,6 +1287,8 @@ static void ddebug_attach_module_classes(struct ddebug_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 = 0; if (!di->num_descs) return 0; @@ -1181,13 +1312,20 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) INIT_LIST_HEAD(&dt->link); - if (di->classes && di->num_classes) + for (i = 0, iter = di->descs; i < di->num_descs; i++, iter++) + if (iter->class_id != _DPRINTK_CLASS_DFLT) + class_ct++; + + if (class_ct && di->num_classes) ddebug_attach_module_classes(dt, di); mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); + 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 = { .descs = __start___dyndbg, .classes = __start___dyndbg_classes, + .class_users = __start___dyndbg_class_users, .num_descs = __stop___dyndbg - __start___dyndbg, .num_classes = __stop___dyndbg_classes - __start___dyndbg_classes, + .num_class_users = __stop___dyndbg_class_users - __start___dyndbg_class_users, }; #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 */ -#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 #include -/* run tests by reading or writing sysfs node: do_prints */ +/* re-gen output by reading or writing sysfs node: do_prints */ static void do_prints(void); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_param *kp) @@ -29,24 +33,39 @@ static const struct kernel_param_ops param_ops_do_prints = { }; module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); -/* - * 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 = { \ +#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 = _init; \ + static struct ddebug_class_param _flags##_##_model = { \ .bits = &bits_##_model, \ .flags = #_flags, \ .map = &map_##_model, \ }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, &_flags##_model, 0600) + module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ + &_flags##_##_model, 0600) +#ifdef DEBUG +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_model, _flags, ~0) +#else +#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_model, _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 = X inits. + * + * Declare all 4 enums now, for different types + */ /* 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); /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 = 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 /* 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) 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_submod.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" From patchwork Tue Jul 16 18:57:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735564 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 649CAC3DA60 for ; Wed, 17 Jul 2024 15:02:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D1C4A10E295; Wed, 17 Jul 2024 15:02:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mKlKNrSc"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E80510E2C5; Tue, 16 Jul 2024 18:58:46 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-816d9285ebdso1233939f.0; 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=lists.freedesktop.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=mKlKNrScMVU5iaOiO0uh/17fEfXKn/mhAylTIgX3i65Zzl9hhCr6QagrMMKwZ4hnPo RClazYrmeUiTD+8Z+DkHvGqKp4ANhAqZziUE2/9ByMwPrgbiq1IkAKNgS1HwCEdUmLib bKcOhfSMJobb4R1RyOvg8uMsIMp+gLFNfYfACzLpzGEll4WOeCikT31gVHG2PphJWHnY qH9PPnO1T9OYxnFKlrAtaafuG8R4KIqQO0YRcZSSUY4yFSoxjIn1U5QHod58iiB+oiX9 1xgAYn34O7SBwG5N4a0zpghUYgIWh+RHhs/Jz0NLXHA6AmJZSNuUK1/rQ/O2d5C1cHuX ZFlg== 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=aWz88XAIZ1bavLJ7Z7a09HJvd+Hc9Ss94gjFWPFQ1ZUX6V3yikXbKnYP8k5w0dwtwM uuoZj3nHfX+JUHDWYvcJSNQFHsd5E7W2B4W1vNc2a174ILCrWSFeeirOYi94kxRFD7LQ wi8xt6PebCc8qIQWOjLA+3aV3E4Xb/e37deu7vg89VBMw4okQ3HqbETqes1DLOQv8+YV fSSjUD6JIj0gxyhTPhi2mmpApmAhTCjzBg96/cwRPvq1WR/csiyypz1BIXzoRt13X0yi g/P1uqim1jVOSYyUazZHl9OwCL9KnyaSHD1+ncvNHARCs1h+pyCwHGTij6s53N/1nJMA /gyA== X-Forwarded-Encrypted: i=1; AJvYcCWeD7laRxax4CdW4lfW4mQffkZj/34Aj7ahjZnoEN8zTF/ny3HfQPaZh5ViCU7nNn17z0CKQBTKKzeBt/WDgIgPLeBato9tQn/0Zr8NCKrRSRm1QJ7HjR7tHzWEeYa6AMXTyU1egVu1CjQV/irud7v/XxQh8jp4LNceZezuCebtcSUnUohYuC7GUqKyxt+bbOPhLEOLgNms6hBReBVZoiylCawNM6c1vZtc+ZiPtHZvsSr24t4= X-Gm-Message-State: AOJu0YzYb8w4AdFSbA6CTCw7dRuh/rziLhF8tqUuVHTofpTTiavV1eZW GrX4GoT7ZfWfqXQJv1ID6f8gWMMRZhcmik0KXFbWaguqImm2SWzA 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add a selftest script for dynamic-debug. The config requires CONFIG_TEST_DYNAMIC_DEBUG=m (and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m), which tacitly requires either CONFIG_DYNAMIC_DEBUG=y or CONFIG_DYNAMIC_DEBUG_CORE=y 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=2 -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=dynamic_debug run_tests make[1]: ... TAP version 13 1..1 [ 35.552922] dyndbg: read 3 bytes from userspace [ 35.553099] dyndbg: query 0: "=_" 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=class,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 "=_" 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: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- 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/* DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 9039f3709aff..1b4826d5d09c 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -22,6 +22,7 @@ TARGETS += drivers/net/bonding TARGETS += drivers/net/team TARGETS += drivers/net/virtio_net TARGETS += dt +TARGETS += dynamic_debug TARGETS += efivarfs TARGETS += exec TARGETS += 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 := dyndbg_selftest.sh + +include ../lib.mk diff --git a/tools/testing/selftests/dynamic_debug/config b/tools/testing/selftests/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=m +CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/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=${V:=0} # invoke as V=1 $0 for global verbose +RED="\033[0;31m" +GREEN="\033[0;32m" +YELLOW="\033[0;33m" +BLUE="\033[0;34m" +MAGENTA="\033[0;35m" +CYAN="\033[0;36m" +NC="\033[0;0m" +error_msg="" + +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=0 + num_args=$# + if [ "${@:$#}" = "pass" ]; then + num_args=$#-1 + elif [ "${@:$#}" = "fail" ]; then + num_args=$#-1 + exp_exit_code=1 + fi + args=${@:1:$num_args} + output=$((echo "$args" > /proc/dynamic_debug/control) 2>&1) + exit_code=$? + error_msg=$(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=0 + [ $# == 4 ] && exp_exit_code=$4 + if [ $3 -ne $exp_exit_code ]; then + echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $exp_exit_code" + [ $3 == 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="\s$1\s" + exp_cnt=0 + + [ "$3" == "-r" ] && pattern="$1" + let cnt=$(ddgrep "$pattern" | wc -l) + if [ $V -eq 1 ] || [ "$3" == "-v" ] || [ "$4" == "-v" ]; then + echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}" + fi + [ $# -gt 1 ] && exp_cnt=$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 <= 0 then otherwise +# $3 - "-v" for verbose +function check_trace_instance_dir { + if [ -e /sys/kernel/tracing/instances/$1 ]; then + if [ "$3" == "-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 instance \ + '/sys/kernel/tracing/instances/$1' does exist" + exit + fi + else + if [ $2 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instance \ + '/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=$(tail -n9 /proc/dynamic_debug/control | grep ": Opened trace instances" \ + | xargs -n1 | grep $1) + if [ "$output" != $1 ] && [ $3 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not opened" + exit + fi + if [ "$output" == $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 <= 0 then otherwise +function del_trace_instance_dir() { + exp_exit_code=1 + [ $2 -gt 0 ] && exp_exit_code=0 + output=$((rmdir /sys/kernel/debug/tracing/instances/$1) 2>&1) + exit_code=$? + error_msg=$(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" = "0" ]; then + buf=$(cat /sys/kernel/debug/tracing/trace) + line=$(tail -$2 /sys/kernel/debug/tracing/trace | head -1 | sed -e 's/^[[:space:]]*//') + else + buf=$(cat /sys/kernel/debug/tracing/instances/$1/trace) + line=$(tail -$2 /sys/kernel/debug/tracing/instances/$1/trace | head -1 | \ + sed -e 's/^[[:space:]]*//') + fi + if [ $2 = 0 ]; then + # whole-buf check + output=$(echo $buf | grep "$3") + else + output=$(echo $line | grep "$3") + fi + if [ "$output" = "" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO search for '$3' failed \ + in line '$line' or '$buf'" + exit + fi + if [ $V = 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" != "$1" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error message '$error_msg' \ + does not match with '$1'" + exit + fi +} + +function basic_tests { + echo -e "${GREEN}# BASIC_TESTS ${NC}" + ddcmd =_ # zero everything (except class'd sites) + check_match_ct =p 0 + # there are several main's :-/ + ddcmd module main file */module/main.c +p + check_match_ct =p 14 + ddcmd =_ + check_match_ct =p 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 =mf 21 + check_match_ct =ml 0 + check_match_ct =mfl 6 + ddcmd =_ +} + + +tests_list=( + 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 From patchwork Tue Jul 16 18:57:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 66C61C3DA42 for ; Wed, 17 Jul 2024 15:02:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F09810E268; Wed, 17 Jul 2024 15:02:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CMWfAfKr"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id EF39F10E82A; Tue, 16 Jul 2024 18:58:47 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-8076cee8607so4703339f.1; Tue, 16 Jul 2024 11:58:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156327; x=1721761127; darn=lists.freedesktop.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=CMWfAfKrPlfi3qkOn0s260hzOwO9BetL6G/HQNRXSKBAABO81xj07ML3wu6TB1wU8Q EUxKTovfplMzG6ctOYECnGlXIrUjYgMA2R0DSjEy5UJ1nODH+rKzMUenL4xuxo55JxaR VdDJRjSvowuz36PTtyMHW6vmjXi9iLinqR0lGxAsa8Sv8zhK40bwFYyqVYxp3V6ynqeq 8rqyLIoMOxgBB6C0m7DXytEgGYoJ3MU3fh5r8Qs6QA/EeceNAlpMLBH+6z4VBu5J5TJz Ks9hQwHrhgnkjhvA0adMO/8VulafwITbiVrVRKikSnm/MGojpfv6Cyl8+CJ0OonmX8hS PL0g== 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=Tw+c55LoGTp1+AmHmilWglPujwwIwnGQcG0V+SOGNup26MGbTU7df5Bis7piwhoG2R IwwkLs1nTZUQrHvQJHrOwXJszvXCyYtpnWgO2HKpPJwhywwwcodqpMP4MaPuuwKHhmCZ VPXW51Z7f1PCrTuG9GktPLgady838kB7kSgNCkGt+PLPO8b/iFF5fECO6k7VKKlm+QYO dAcbp+fp8EY1x+SXSS65mCi2stkq1F98gB6fOKPwiRQanpnwC7LAckPGOzZd06tu3c2t /MyYf4cQViYN+e/wYfE063w08BjjV0dXPXg4+4qZ7mGFFVytkKV+QBy68PclaKHroFJg 4PdA== X-Forwarded-Encrypted: i=1; AJvYcCWUQap5MkaJyf3Gt+YssVT0ke+HD5EbsAOLIU3VULpzOw73z0lyaYU8evCfSz5XD2tCybSl7MWy5EgtfXmZpMrVYuQH2+crv+iwPpX+LpbnGfLn9H31l6az5ssDHtM7438ZXmS40rF5o29oDSHYVY8jX7bCMqYtJh17qhxRd7GYFDVTAe3ZXGKzbLuYN11K20tGBkt3MCnQM+U98Mw2OoczGlyYdIl4jxa18dLsaldGFC01yh4= X-Gm-Message-State: AOJu0YxcgdsKhlX4MvmmQp26KpJWseVsYXjHLg3b5RihTOU5zu3ch9yh rQb0mQU4HGJqNSr/bGdY+L507jwGOeCsYO7G+P/Lcz9WAapWgiSa 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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[] = { __VA_ARGS__ }; \ + static const char *_var##_classnames[] = { __VA_ARGS__ }; \ struct ddebug_class_map __aligned(8) __used \ __section("__dyndbg_classes") _var = { \ .mod = THIS_MODULE, \ @@ -164,6 +164,41 @@ struct ddebug_class_param { const struct ddebug_class_map *map; }; +/** + * DYNDBG_CLASSMAP_PARAM - wrap a dyndbg-classmap with a controlling sys-param + * @_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 sys-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 = { \ + .bits = &(_bits), \ + .flags = #_flags, \ + .map = &(_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 ddebug_class_param *dcp, #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) +static void ddebug_class_param_clamp_input(unsigned long *inrep, const struct kernel_param *kp) +{ + const struct ddebug_class_param *dcp = kp->arg; + const struct ddebug_class_map *map = 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 &= 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 = 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); 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 &= CLASSMAP_BITMASK(map->length); - } v2pr_info("bits:0x%lx > %s.%s\n", inrep, modnm ?: "*", KP_NAME(kp)); totct += ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, modnm); *dcp->bits = 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 = map->length; - } old_bits = CLASSMAP_BITMASK(*dcp->lvl); new_bits = 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[] = { ddebug_classmap_typenames[_cm->map_type]); \ }) -static void ddebug_sync_classbits(const struct ddebug_class_param *dcp, const char *modname) +static void ddebug_sync_classbits(const struct kernel_param *kp, const char *modname) { - /* clamp initial bitvec, mask off hi-bits */ - if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { - *dcp->bits &= CLASSMAP_BITMASK(dcp->map->length); - v2pr_info("preset classbits: %lx\n", *dcp->bits); + struct ddebug_class_param *dcp = 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 = 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); } static void ddebug_match_apply_kparam(const struct kernel_param *kp, @@ -1185,9 +1209,9 @@ static void ddebug_match_apply_kparam(const struct kernel_param *kp, dcp = (struct ddebug_class_param *)kp->arg; if (map == dcp->map) { - v2pr_info("found kp:%s =0x%lx", kp->name, *dcp->bits); - vpr_cm_info(map, "mapped to:"); - ddebug_sync_classbits(dcp, modnm); + v2pr_info(" found kp:%s =0x%lx", kp->name, *dcp->bits); + vpr_cm_info(map, " mapped to:"); + ddebug_sync_classbits(kp, modnm); } } 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, 0600); #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 = _init; \ - static struct ddebug_class_param _flags##_##_model = { \ - .bits = &bits_##_model, \ - .flags = #_flags, \ - .map = &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_(_model, _flags, ~0) -#else -#define DYNDBG_CLASSMAP_PARAM(_model, _flags) DYNDBG_CLASSMAP_PARAM_(_model, _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, 0600); * Modules with multiple CLASSMAPS must have enums with distinct * value-ranges, arranged below with explicit enum_sym = X inits. * - * Declare all 4 enums now, for different types + * Declare all enums now, for different types */ /* numeric input, independent bits */ @@ -83,12 +68,15 @@ enum cat_disjoint_bits { /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 = 14, V1, V2, V3, V4, V5, V6, V7 }; -/* 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_LEVEL_NUM, V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); /* - * 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); #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); @@ -180,5 +167,6 @@ static void __exit test_dynamic_debug_exit(void) module_init(test_dynamic_debug_init); module_exit(test_dynamic_debug_exit); +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_submod.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 @@ #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"); From patchwork Tue Jul 16 18:57:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735514 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8019CC3DA42 for ; Wed, 17 Jul 2024 15:01:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 518F710E1CD; Wed, 17 Jul 2024 15:01:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SJ5oqHMH"; dkim-atps=neutral Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B15310E82A; Tue, 16 Jul 2024 18:58:49 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-8063553b837so4000039f.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=lists.freedesktop.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=SJ5oqHMHnezQZMA5/iehiJvuBQ6KPcCOOdkSIUuOBk19grC17IodBVllo7rAFENsor rGkv0Na13s+gnZaBmGfdYz9/d3+KMW84FyBhWC84VbOnwukNl6PDaDx/8enKEClWlkFC AaBQ1ZuUYPdSk9t5J/QJRfHTIiK5isFWLgN0LhVnuwwG9g0TL7URmhjc6GKgPZyYAE/u iwP6X3V9jgNy7HLKuoqDZ671+TVNYrNrxPGo6aj/kcohohUNsYH3vnnnN7R04/+G/U9d gbzjybGnNfuMHLIAuitu76XefFbP5DD4K4r0UTviuensufvhRW2Ss5ZLkqC3fTlD0iK/ 3wjA== 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=fus+HoD62NxIX7iqLbGpyaDXrhnzXo4AKOz4Xv9CafIkoAUF1R9eygOxX/DbQF8M28 vYxI7oDVrq7/hBPxCAfzQqaIJWI3uHFuAkBmPBvy1uH+ADGjr7gxVbQCR097Yf6WuXRg Fg1FC5dpxqZPyW0mK+uFM0q/itw27dF9iyaWGEQO1IOeaQNwr1zlRr3Uh0sVSRwSaxsO nfwY2H9DDeSzJcYLZI5y2mnY8n6qLWdWTVouoFMAId+Gr2ow1aDTLHpS6Y4jnPhoOaBC /u6GVv4YLoBvE9p/Dv7b9Bw0xRjpXDDoQ1abUGKgrhoYqXBh/PfLcEoqqkppXGVV/29k 4gwQ== X-Forwarded-Encrypted: i=1; AJvYcCU5DThk4VZbNfcaFkrvu9Xpac4nIWDFZu2Sb1najq0ws2U///XP4iPo1L8XSEmQBS23tRRTcxnYPwTnSrwe6C2lN1+63sl+jMzUmE1JnykcATtilY4undcrX/F/Uq/yVXf7hZNkK5SM0UAKOjR9wz5Bw5yoThk8rqCK9qAo2G0P4sDAXepZMt9rMHJuLMoMkIMrCkijn0gjIUWRacxFYpc1V8ZT2/qSxxnQzWRFPpOTc6rnffc= X-Gm-Message-State: AOJu0YxoKK8v3CDm7bTKSCtm0SxWeLTs14aDEAvpTaNcZTonuSMcsTV6 kt4aZpkXrCco57pT/sn4Rqk78IJqy/tl8dY3PSGEiEMF0jmyPhtb 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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/Documentation/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 ``^[-+=][fslmpt_]+$`` matches a flags specification. To clear all flags at once, use ``=_`` or ``-fslmpt``. - Debug messages during Boot Process ================================== @@ -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 +======================= + +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 +========================== + +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. From patchwork Tue Jul 16 18:57:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735532 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F247C3DA4B for ; Wed, 17 Jul 2024 15:01:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4701710E204; Wed, 17 Jul 2024 15:01:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kEwx1dpY"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 579E910E83B; Tue, 16 Jul 2024 18:58:50 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7f99d50c1a6so8633839f.0; 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=lists.freedesktop.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=kEwx1dpYuD3RkNZUEFKCvhMXnHLnJN1OUheGHaY3YTO7KbsrNDY39M0LqME/WCUSUo 6bzWVVqvZnnjy1gCaJ+/gIpJuj48uBo7yLpDfHvfa77loazxe0U5AVIL+2tTA4h5XQxV F15qV0Cv6IBYYKURb/Dnm0B/PVRylZ84yED+coyB4JksGcWpne8kB8WbzCOUN2z9IegF M6rPbV6utD2X9S61F2glyHZDhMjgmtYL3TZW55mR8gnR+uame8UxMCU0zvL6Rxcto8Il Q6i++GaHbu9htz2Of+aHr0+MLky0I0PNDGI41GnyyXPt36UsQ9N2jJa/AZsplLdd7e09 cRUg== 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=rs0NvqBEb0AHl1xFIDtJJpHer29KIiM0y2cw5PfpdBzvK9giu7RoXtkN7qS9CKpXSs ngcRE4voy2YFJCmfxiGjv79pBKiKjo/1V8LGCdW0P9NN5ahE3nXzDKgR2/X8sdpKt4VQ fAiGp8CA2PliblLx8oZHkzC4xev1HU/Yp0qkjlrLhY1CclEVOrijAT3E0zRtOLdKO4UW qK5FF+mx+6QLmU4t6wH1CoaGz9LS3dTxnYYzQl2NtPxKo2XGFXV4IkcJCAazqoPiMfTR rBbZxJMY/bhJkGiFcwHZMHnEZIaRkbNGy63B3z+E5zyc8I7Hif7B+vx0eEOGPH/6sEnZ VpoA== X-Forwarded-Encrypted: i=1; AJvYcCWobBPFWbzVJIFZszMNSsh/QrqPsLlbEr3ibfu+O4GCEnuceyC/0sM4MOgC7hbDt38lmdjQEPTIEJ/pc/R/w7v90yFvv8+tRr6UQV9JijihuiJs7l9rFN8uTpR0GVJ2rkM/KZV+kPA1r1SsmNQdWPtsIMsJkGWxw8E8q5sMvaN7yAicDzDQKiTX2j2iLNGDPcuXDz07yWE11donRjbp/fjmUYL0zBWDLFBhNDGeM9s+QuAddqo= X-Gm-Message-State: AOJu0YyxnkfRUT1dqq1XrX8uP2SCzCYAGmVntbSvGKTgjSbpf7ZCPX33 tOymjejpxPQ/YaJ0tpx+GdkYabKrNO2Ge3cjB35BAkAGmxfqarD2 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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=class,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=class,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="class D2_CORE +p" new format: modprobe test_dynamic_debug dyndbg=class,D2_CORE,+p Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- 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 *query, return nfound; } +static char *skip_spaces_and_commas(const char *str) +{ + str = skip_spaces(str); + while (*str == ',') + str = 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[], int maxwords) while (*buf) { char *end; - /* Skip leading whitespace */ - buf = skip_spaces(buf); + /* Skip leading whitespace and comma */ + buf = skip_spaces_and_commas(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf == '#') @@ -320,7 +328,7 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords) return -EINVAL; /* unclosed quote */ } } else { - for (end = buf; *end && !isspace(*end); end++) + for (end = buf; *end && !isspace(*end) && *end != ','; end++) ; if (end == buf) { pr_err("parse err after word:%d=%s\n", nwords, @@ -592,7 +600,8 @@ static int ddebug_exec_queries(char *query, const char *modname) if (split) *split++ = '\0'; - query = skip_spaces(query); + query = skip_spaces_and_commas(query); + if (!query || !*query || *query == '#') continue; From patchwork Tue Jul 16 18:57:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D5AD9C3DA60 for ; Wed, 17 Jul 2024 15:01:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 350F810E1F6; Wed, 17 Jul 2024 15:01:27 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XS5fB7O1"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8B01310E82A; Tue, 16 Jul 2024 18:58:51 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-816b627a7b6so5622039f.0; 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=lists.freedesktop.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=XS5fB7O1Z2kl/iYW89cyHiw/IaumSHAYbLu1iio6w7obDQZNil3SJJKhD//7ALo8Pf mzwGK9nxydgAPNtxUz5oju9QogLdwqHFusEjJ3latyu4POCk8RVIv99L9OAnL20wyIFD /S2rdcdCH4XODzryD4eHAXo5Jq/BToxPTVh7/5F5HfLOU3GDdhKGdBngBkJzIIq7IwaA W0/QOqrKFXRQDrqdzagZO7Se+NsJGleHPJsY+5ZJ2ALRR6dlobRpAyN2FblImGQHuvS0 M4ly4E0/GCs0NcX2Mr+499jbCY+fw8Bi+89vpRPoh1rvoGvjG1ISXKlawOLv1gMfqFIo 8FvA== 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=FgxBwm+T8L1hoPo0FxZOKRd/ugG5ON66gPxVuCd8LcFatCmexkBYyGewjRWeWmn+jI UyfVQhYATBBSTiox+bh74PwVn0LZcw6dSa0xmSj4Vh0CMkUPdawt9BvcKIyHUXOQmh42 +p3F2gTRTjYD+b4vZaV33KanrE5FARn+bMjVBIszp1XknLh5ycf2G7Z6Orpqni4gXGDu SgNqNWbACuiIVH4MWSQsqZBIz8Lmwt9n5Ovt2jHX6FgRf0BbMm2S5K+ELiyoxoavirFE Bq2DKGUkFyc895+lmZryNH34lPckJ+IA4x7nULEkejlGKzV6e73BPyRwoNHpkD8gCUKr 39YQ== X-Forwarded-Encrypted: i=1; AJvYcCV9eHqdCeAkiQku+9mBi/z2Qya/c/7tEyEx7BGfZ18hGTQo854a3AFf2W4oHfrzHmYJ4i56/AMDjlXX6fj06XMaxhcBTLMXR0xYyV6jld5w4Xt+DhfotsA9euXPQE+Dhx+s9+RFJaQXZQ2Isa2G8YQ5ecE7O8D1PvAT9sOBN+AYhr/pONmexXFKx/zq0n7lRxc76y8piY4v7FU8fHY87FVn5rPDHQBC8fCYqPTyzmIaQAu9dSo= X-Gm-Message-State: AOJu0YyY66Xyhk55cF8Xzok2ZJ5tejfbWXvm3ECCGyOat7BbACLbXCMG y2UvxHFK8PdHjed2bnRPvJCXZJBVVegKolP5cmYzYnRfNeUBc+xF 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:12 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- .../selftests/dynamic_debug/dyndbg_selftest.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/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 =_ } +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,=_ # commas as spaces + ddcmd module,params,+mpf # turn on module's pr-debugs + check_match_ct =pmf 4 + ddcmd ,module ,, , params, -p + check_match_ct =mf 4 + ddcmd " , module ,,, , params, -m" # + check_match_ct =f 4 + ddcmd =_ +} tests_list=( basic_tests + comma_terminator_tests ) # Run tests From patchwork Tue Jul 16 18:57:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735534 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3867C3DA60 for ; Wed, 17 Jul 2024 15:01:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 231BD10E20F; Wed, 17 Jul 2024 15:01:33 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Z7ESRlcq"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id C027210E847; Tue, 16 Jul 2024 18:58:52 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-8036ce66134so4802839f.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=lists.freedesktop.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=Z7ESRlcqomx4WZJZJnMHMHLpZNa+gZxA4fjRJCgjjDUIFauYdk0ESsb8QbXubVPnEZ x+aVQ38hnvVJS390HMasnBOeCTPOroE/x7AQ/PjviStWibRBhSZOv8lmSTJVskF5mTtZ uxbzq0fzGd1A+byY0P73YSK2JJuLoxdqvFIdFsqj+J3OUP2HA6ugJjnM/1FdaL5SQvbd Ta3nWATFHNv7zlHs60bqlJBOHcbj+77X+U4aMCUvj9cD2TQHkGMMnhQrK+BNNm8MSt9S 90DOj51uF3ZtCiTMrQuje6WjPnN/YtnTFlPhmEkHYosJlBiYvVXlR6OccVVQlK8h3h/t OlMg== 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=m3CAJm7PUQGkYruLHs81fBqeJpuEL8wcmpmbnbGWOBe+Pf3EnVCJWUAh6ihfP5sxm/ 3d9ivXbAFy8JEuAsMxXStnw289w5lEAzPKYPxbGIN9dXQcc4iRLB8zf3SIMYYgyaMys1 9mVTIN4kqUIkmx8OJfOjIN7kjr5xULzIuGiIlTB6+34FPgGgcB//T+EpkdHekzV6aQ0V oEs1o7Dk/T+lNJol5eOvdvmHTyhHXEE/PmA1rcA11Tre/LIMoctXVhp4rCOOv0FI6WRv CueQhu/zjWMF1Jvbbd7SnrjSJquw8+j8W/KO3mbOSQlJYCu5M0FHEFz0YkmfAngpTIY8 Rxew== X-Forwarded-Encrypted: i=1; AJvYcCXuDqFiX7daAd6PNRis+7SH2cnzvlcpVz/RtMs+qcrGmGihuoQ9CrcQN+68BoC83MuSnU3SB5ZV0VHGSh/u13Gc3X1RjNb72NLHw9RZ60Vlw5DjX0FMP44yhvscafprDvDbX9/4YciGovq/HDKnowxdv/tByGFNPFcq8RA91YK2xTEBoX9LTky+XZRuLfSSxjWIUc2eYG8AcabZbiNJBXrgYmNHINdbgzbC8yHzErzSCgGoahg= X-Gm-Message-State: AOJu0Yy6GDUfedUwJuw/48uusnW1dXBHxbN3r4bz/ZMaiqtAZNpnzcI4 KwW56DOO85WX7jEMyrQiZ312Fp2h8ZM7gKftEYro3LXYoPIS87ph 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Since commit 85f7f6c0edb8 ("dynamic_debug: process multiple debug-queries on a line") Multi-query commands have been allowed: modprobe drm dyndbg="class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=< [ 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 --- 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 = 0, exitcode = 0, rc, nfound = 0; for (i = 0; query; query = split) { - split = strpbrk(query, ";\n"); + split = strpbrk(query, "%;\n"); if (split) *split++ = '\0'; From patchwork Tue Jul 16 18:57:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735561 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84236C3DA4B for ; Wed, 17 Jul 2024 15:02:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA04710E26C; Wed, 17 Jul 2024 15:02:49 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="MR1etboQ"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 061B610E832; Tue, 16 Jul 2024 18:58:54 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-816d9285ebdso1238839f.0; Tue, 16 Jul 2024 11:58:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156333; x=1721761133; darn=lists.freedesktop.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=MR1etboQmGKLj35r8nzvjOuKmiXDf9qVV6zZMuCi5RWNkRb0Kabg13qPyclq3L65eU pFql6rEsGO1M3WDHsFWzs7Hyk5j2IOJo+kGlxAQrD0POTQYjKHjV5Gbih89pKn+1SdoG uksDCPxc+tCjxMeZkpn0poH5vvVpMKBEO06j2ZfmRrWMVBRCvwaXRke+i9xo3mAFxR9v 9PDrb0NpQOg2+hZM97Y6vqf3piKJGjdIorX7TqyBVL3kRvfKfymsQmHSM2FlMKwjw14+ BOg6qQVjyQ9XJZ+XfVMEppl5FaBk7O3IMWhoGQumPdqJ0S1Yb8Hv1MgXw/yQanUDHc9s mcEw== 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=H3pVO44gFaKLk937OsFNRZliNQlgc2xnwHZk8/44Hzj6X1jKQFmwvwFEwHOTa9wY+1 Ts1G27xBpArLRHibXkONugx6lSd/E+x/1DQFAyM8BD2HzVZrlVJDmRWFRmEde7dBNn6L vAa3eq7cCChp78EkgTlTAdvoo3AiT/T8EBxEEO7nYBkG5oDKjSlnRLnGK+ap6xkNmaIA sFn/nraEU8OygdTr2GKsoLCOifZo9U3hc5QKCbSoqE1jHu4KyM9OxyCwyoxYqrQQtNz0 ndJhIF2G0SBN9ycioXUjzP/KIC2tofrmqN9UhIrSEsI402lGkPWMzEW8yFRSPBVmKaQ5 zdQg== X-Forwarded-Encrypted: i=1; AJvYcCUpqPrWmHBrYiYwItI6tu3Q9va5sA6QW0GwhTSKo3KbGLs5OnVLhAiP0NZ4rnarRFwvG/HFdTs+mDIvGXXAVmy9/3yytr4VxdTaKJoV0O2gvs0S4tAy4P46hlQLk3GAyDTfyYWXfu32fD8w9n7GvbzOCSQz41lFfHFtIMK2ZKzyYauz/PdO0+aX8jhPZsFP5JbBMiQUDUsPFdfhxte11qH07jxsLNJM4YhGL4XNEVbfQ6an6SU= X-Gm-Message-State: AOJu0Yx1dSmHCN1o6SPkzWh5en/Gew/V3H7DolwAipkc3/3ieXfJfhtE v47wiKNrDf1MA1tLq1IslTezQ9Tx8/DRHqTn1cbwezDzFTwEFYLg 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- .../dynamic_debug/dyndbg_selftest.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/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 =_ } + +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 =_ + modprobe test_dynamic_debug dyndbg=class,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 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 =pmf 1 + check_match_ct =plt 1 + check_match_ct =pml 1 + check_match_ct test_dynamic_debug 23 -r + ifrmmod test_dynamic_debug +} + tests_list=( basic_tests comma_terminator_tests + test_percent_splitting ) # Run tests From patchwork Tue Jul 16 18:57:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7096AC3DA42 for ; Wed, 17 Jul 2024 15:02:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D3E7A10E293; Wed, 17 Jul 2024 15:02:54 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YQNxYeb6"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 71DCE10E82A; Tue, 16 Jul 2024 18:58:55 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-8076708e8ffso5027839f.0; 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=lists.freedesktop.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=YQNxYeb6c4/F6/Z0u+yxP+GH9RDc+2VGYl96+XQCOpZp6lSyWsbfFraqqd7OphK4O6 yAfEo134x0nbBXSPHSLj4FT6v8XYehH2Wi7kMKOgIlz8eijoVDYKGQTccraguZmjiDFi tU9s0Lkn6y0dl4SCBnN8DF/UGNfwMNld+doMfpNOMP0z4UkCecg76tUkqNwf/ghvz5YV fR6BLegHeTJaqxvSK5Hs8UU78FOtEtkXObOVBLW4S5wfq6vqCKPWusPq/+2iiOe6sWun jxvmr0tdwxK6gHSTeqAwY110L55J/krBh6k8VbHjh6Z/jJ4WK9f2ChSJhHjlggKmtuqY IAWw== 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=gxE5x4Wsc89VAQM82gPuwWe99mij5upuSqEgaFHag07bDoEIsXiCoBA1k395Dgqvcj XJifIAtcQ9sLYupqnFGYJ8NGs8SHbQYmoGoMwmKN+pToc6FAZ1Hk9hfqiZb1vEU27VDa lFH0TE0a6tKm3prf9W9vbj1LrJvunyKla8H9F1G6Ajzb25zQfxEfK5gZgK2TD60gJgw/ wpiDVhPKhgzbPhxfpxBrtHBOxyUq/qppL0JKceqwmXt5Nj/YyA0kO7INFFLDHSOYglBc w7m2YwQeXpoCEErkZobjn8yVKq2W3A6NKR/npx96u6QJSyDTaDsUD1eE7UsJLOx9GKhk jPCw== X-Forwarded-Encrypted: i=1; AJvYcCX8ldwqFFMNUmu34oWIXRU/5IIK7T1WP619jaKRBA5KxLtjFfSUAFXZdHn8rC4WbcWxfGMFhcbsjQCRxDtc5DiesvJxZZMMKvwTIH1sTj+2Z8A38BIteweRGnSqI/jNzmudtW3NF9T5VLIKTkMyB3AOnOvpR4Pnp39E2uonG3qtO4Q5mJRj8I/cyHZXiY3JW33pjvlOgeW4hhkXCUx8e/qhs1gx4Cis4mYeFDZWuH+XE2ryH4s= X-Gm-Message-State: AOJu0Yz8IHWZeqhbQuKX4z/qs/vev7SqPtYnExcGzh3PyuQaV3KpM2+J 2PFjxD5QVY2m/mBBZebfhYDO/X5Lg+Lvh2r1ufq6JauAYrgLbJys 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Add mention of comma and percent delimiters into the respective paragraphs describing their equivalents: space and newline. Signed-off-by: Jim Cromie --- .../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/Documentation/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 ========================== 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:: :#> 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 -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``:: - :#> 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 "*". - 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. - The meanings of each keyword are: 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:: - module sunrpc + module,sunrpc # with ',' as token separator module nfsd module drm* # both drm, drm_kms_helper From patchwork Tue Jul 16 18:57:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735531 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3092BC3DA42 for ; Wed, 17 Jul 2024 15:01:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DF1110E209; Wed, 17 Jul 2024 15:01:31 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KKfBXGtW"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id A284310E832; Tue, 16 Jul 2024 18:58:56 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-8076cee8088so5538039f.0; 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=lists.freedesktop.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=KKfBXGtWBDn0mrrBIcxaIMsr4p67Fhm/rcVJpAi5UckuJfoAgkbpwiJZA8LgkxNMEG dh7qgiAiY2eoWNn3EgRZw/zHl1HUbN41pKApQHFjroHbaOdzdeRKPEUbrADhY2thRHXu 6ZY6JN8CApQOxDJe+Fuja9zSJsSz+pBrkih7Gi1egDyv/NXBs7gh6BuwdORRKmCliWaY K8fPYnWR4vWPMb04tHE0cY5CWf5MlQWd1+xLg/txJAZzYL/B5lD9n+huDtPEjZwS5uUw MsjECtivRj6D8drweHhama/pZVznr/4GJacUhSAULa2vXNa+CL8nXl3BMFj2sSVmESl/ ta5Q== 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=ACJ456X2Wd5eizqH5Sz71Iqx3H94UdR/3SgRVu4mZ0S+vzozaH1B1TxGE0C/X8BfYN PR5I+A+hekca3npLtE17JXEWI2Ia5vxtmN4HdgLxbq+RINY82Ed+aDpu/FRh9VQV7H+v yUZj8Vx93KR4taIuCPfzmNv4YcVAZnTVT5EgUP7mBvSbyN36eZQo9u5MshY6bmxRmJzW +0cbLIH8MYV+OKBXnctcybTjFL6AcOErnZHSTHaUtVO0Bj84aadFbteFn3OVF/EOkwIo jKEU+vz5mqlAAvJN4imURJu/Kne4ylYtCw16lfuh3SCoFM0YcKolRkYPClIqcxf1OPV9 vHkA== X-Forwarded-Encrypted: i=1; AJvYcCUDy+IqUDvgmVXb+zZHCa5C0taz+9utFVy0ClxzatnD83hem2MbkophxMZUhPOy4dIibf8saqWHFCJprNLo5EjvXTelr/+7st7Bopv18P4EdsImFVQnuchSIAAAJbvk83qK5TZYf6TLFrEaCQ5iHxBmPuI7rqYBqCgYTKW9FjR9mq9CTyJ4a4vPf4LFwBUJvv4xicBhFL7V1jbwn14bMH1omXEThly52egwvZmByYB3RsnErZs= X-Gm-Message-State: AOJu0YxR8VFI2gtS065bXTg1hlT0fRf52MYHJSsFTmtcfj4jsSaIWTGB vLZh4l4epiQzmZzxIQPb8n7eI2gFXXz9xInuOKhs2QY/ElcXr/Df 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg= 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=y failure. 1. 2 modprobes (super then sub), with separate dyndbg=class-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=setting (like drm.debug=0x1ef) 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 --- .../dynamic_debug/dyndbg_selftest.sh | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/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 } +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =_ + + # modprobe with class enablements + modprobe test_dynamic_debug \ + dyndbg=class,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 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 =pf 1 + check_match_ct =pt 1 + check_match_ct =pm 1 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add some prefixes" + check_match_ct =pmf 1 -v + check_match_ct =plt 1 -v + check_match_ct =pml 1 -v + # submod changed too + check_match_ct =mf 1 -v + check_match_ct =lt 1 -v + check_match_ct =ml 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 =p 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 =p 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 =p 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=0x16 p_level_num=5 + check_match_ct =p 7 -v + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =p 14 -v +} + tests_list=( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) # Run tests From patchwork Tue Jul 16 18:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735513 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9EFC6C3DA4B for ; Wed, 17 Jul 2024 15:01:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1511010E1CA; Wed, 17 Jul 2024 15:01:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ggIBJ7px"; dkim-atps=neutral Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1722310E82A; Tue, 16 Jul 2024 18:58:58 +0000 (UTC) Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-38373958e94so244955ab.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=lists.freedesktop.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=ggIBJ7px65BXAgcxDszfOBXrquW0X6jTltIFnMH9348EwerDD0cWkatNc1joo3+Md0 sheJ8U3fiCpHnw0VdkfxdfQTkldtnBalDcpO70UVG9ybjw9lEim0rQPDAtO2ivjckhd4 6gj/lun9Zivo+FU5dS0HfOLg/i6q/xK8PJmJDyGIGrGMtjWYWn3H8jNBxTwD+mG+ErTd oTLxyg0eQdJJBg6P7SdXICl+bglxt8IbwbxoWk9EO9uuO2ju8VKvG6Oe/kgYfRn5E7g6 6uKRxW5yqklgzMyjV+9eQP3nn6Pj3yCw98FjRKm8Cqechwdi/oqhOWsI2sxZrqw/hDTl J1ag== 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=mQA2gm77D/ws8DvsZaH+/trprjSZB8TYr4iPsfz0xd/F2xFK25krPTITXXr/lnzfp6 oNZyBCwLGnO+POtf2opJqPe7kdpw9U2+AnjfyP1+UU5Erc+ZPl3bKWLOjekwJHeR2pCV ntmd6cXg0kTKbYGkWDpB4SZjiT8JRTU0+fjbkAyHOylbK9M2rwMrZAp4QPq3cfXR4Xoi plmaqQZw89in6sNjbXMrBbsMjt6yPNgJYqRg7Y9QUnO+GPg2XBORuvOi5L75CZwahzXj t24cUMAx6NsQ1cXYE7rgF2XNGWM3GR2kA/mIvU8b9KHkRuO3Fp1/Zk6mestJ349XZWKD Ll6A== X-Forwarded-Encrypted: i=1; AJvYcCVL+ObxWyLQ+Nl9YAwns10yJjASLEX28wWNV/ewOjX5wJ1ZsfdBFkBAhgJmHUmfWqehJA7twL+1oNpOfR9C58+sa2iWWjOj/QrebD1X3A+5eTElHW1ntR8R/UGRBIEsSsAG+djIKbL6MRvZmSkTMmB0vvsUJ5BcGnPczuIvHsboxJTV833a597p4ip1PVB8xhQ7QyzqVhyiz5Eq1MyuvfFmSvScDsecz2n7jm6rKltTyG4t7s0= X-Gm-Message-State: AOJu0Yx7hikf+mYCO6nCTYNhc+SUwcURDmtwGHCuzXL/oFLZ5ehitzHi /bthH1OR8HeKYtxeiBb80zyJy5gdJtoJv289kky/pdjsIBZGMD4M 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- Documentation/admin-guide/dynamic-debug-howto.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/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, upon which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". +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::: From patchwork Tue Jul 16 18:57:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735549 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47ABAC3DA42 for ; Wed, 17 Jul 2024 15:02:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A17D10E25F; Wed, 17 Jul 2024 15:02:05 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XfQldDIf"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1804410E835; Tue, 16 Jul 2024 18:58:59 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7fe8d029fbeso5422539f.3; 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=lists.freedesktop.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=XfQldDIf6t2WiNTJlUJkT6VIsi4ijSU3SUjjPp13XUv+CvhnnXpw8FBC1HpQ/+ZQJb 7jsbqnqErkPKu0sqnmvZa5YYC9SCCv3nSo2eHdhaITN5FDjJBMt5iRziVg77ikvdY+zB w8LxOXB0UbzHUePH8dwleACWwcCx1BMm/XBy20UyK/chKnhhSSRVmZHTxo+YKwVg5NxA 7sh0Q3Vv7OA+Aexh61bYkZAXapMknVVZ/MFkLl2d70yhkUE2EiNZfTxiL9+iWyhlz5Oq 13+7L54t8iW65RH2IpvBNH0lxLiz4q2EsqdUzkn1P5Qbwc3l0wC8ycMvDCoYQoXlXfK3 ufSQ== 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=U4PeH/ejWLNYnhUVKwJ3IUQ7z3zaULRsdbl+2ojRFfk956CLEJ+1mf8C0j+e3Gk6u0 isehk9wElfg8/ZjjnbWXFy/tluZy/1pVRzgGf43GumIYZ3anSGzUMGGl7WVYR3mltoUF zkOtVZFX1zjldbOIj8TWUZpOqTTfY2UZm+2p+sEHGV6Mro7hX2JOCZrFaWgc9DDzHYS5 cGFTZ+xA2N107uy9Myxdqw8won2B9D337qSO+yPDWogTTfLKwOsOLnjKWKQ1OsyUCgAC Nlx856QsJANomvm+656y0cInHlRglEWNPaPakUS2fwHLawVB7AleZFdtONMO8kJ9iHHk JYNg== X-Forwarded-Encrypted: i=1; AJvYcCUO19l3PznSGz+wMuw3K9xcT/qh7vnZw/uvQT3OweO9Aa05+lT9j9AfNOonzWnK+ul39n+KCMLPI3hq+KbgKoTmIWDbTAMytiSRaoArMFFP6Ec3OiauyZxOE60ALjUWJnQ/9Lus/cCwmxFMnunOtbN4GBDouKX/P8SBGLUxGt0I9JKRFeXN9CUFsmIba5khhX8lLhONctoy5rzca8XVw6Sc0V1z/J9kX21GmNSkhfTsZ27EVFY= X-Gm-Message-State: AOJu0YwrMUc6DxDC4EX18hi0DCEYRV4OmzWqOs0Cj3nk8dsyxtWJyJ2+ nesEge4lKHxCuSSxCtiEHJAzzfQZNmOs6m22OE2/5j4FxeTlVQlz 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=y 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 --- 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__) -#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__) From patchwork Tue Jul 16 18:57:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735563 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 087E1C3DA4B for ; Wed, 17 Jul 2024 15:02:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 449BB10E26D; Wed, 17 Jul 2024 15:02:53 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bkLfXdRu"; dkim-atps=neutral Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 635D510E82A; Tue, 16 Jul 2024 18:59:00 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-816d9285ebdso1242639f.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=lists.freedesktop.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=bkLfXdRu3V28zkRpJ3DBmdGkVw0RkJzhgfW1a+i1iFeWFg6iCDgVy9BDul05y5lAG8 6ibn1Dj+CX1ZXBIsFLpT3myvZWcRIwdDMBJoILh/mYRxryBCy8NxiI+rFGOfJsmoDXJY XE6lEb+swJRhFNadzxKPRv1ZOWWc4kt3vIB7nvQTiKi3NwQ35WsZbUWFNDXWyU1FdmfD +ZYrspoGdzVnQevMM5KPz4OWQYlb4c/S9equtkfO4WscMUIHhPlos393JP20X8o7472I 8cCgznkWwMFD2ZgYruLHbtJwevxOE5QooDgXuu0YiSH/y378sRvEWK0x8pU9xhBjJYYy JcpQ== 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=dPRkT8roZrAX0UYqXhTcjFVM1bP0Atg6Wdl30rWLSAwvNDbz7mU7DqN/H/xkFYxy1c /Znu9yzKwevuKTPRpIpMZFUecmaslFV/G8df4sScymq8ShXjquAERv/4G/TbM/Xqgg+p 5F+Fsu2V4P264YM74vbtNJOWTR0phEiYn9OHfco7t9nZg6cBVR0i9R4NTbHwqcsD5ONV 77KOQYJn58ZjbY8TrL9vfSEAidQGToYAlAOmFBUsbnjVY8c3VsgKjCRJILuf0JTsXNNW 4GRCn4BB68lZZEH8EgKP2UxKQbADv0klEPOsX+ISBkwduKIQMnPlykwcWQigVWQQJdm5 wb1A== X-Forwarded-Encrypted: i=1; AJvYcCXEPSayxDcLH5WAFWTVX4K8RNoFA0y1gtLE9CgKRBBft+xYzJ1AWVj2d4AozDYpsWhqollJOIC6Sgd5fve2TV2TVxTXKNfO7DduTJPy+rwxDYOJXMkmnRQQNOL6rBhVZmZ4k9SmM1TWu5j/igXyWVuNBskDPBQvAjPokdit2FTAPEEPQWLdNMf5EjKhLfXAMvvjIGjPZ4WT8yStzWSVcVFssOW+NvhzJiM7QwJkox5smkoHgQ8= X-Gm-Message-State: AOJu0YwINaG5flbnCXaYmSl+hFoXj072BfQnz+OJgOyt2m0Y9tGJY+wn OB8BtqcImnB8gJhMMGcFk3u8F6nZd6UJ4RTl5ryYONQbt0S1bVi3 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Several tests are dependent upon config choices. Lets avoid failing where that is noise. The KCONFIG_CONFIG var exists to convey the config-file around. If the var names a file, read it and extract the relevant CONFIG items, and use them to skip the dependent tests, thus avoiding the fails that would follow, and the disruption to whatever CI is running these selftests. If the envar doesn't name a config-file, ".config" is assumed. CONFIG_DYNAMIC_DEBUG=y: basic-tests() and comma-terminator-tests() test for the presence of the builtin pr_debugs in module/main.c, which I deemed stable and therefore safe to count. That said, the test fails if only CONFIG_DYNAMIC_DEBUG_CORE=y is set. It could be rewritten to test against test-dynamic-debug.ko, but that just trades one config dependence for another. CONFIG_TEST_DYNAMIC_DEBUG=m As written, test_percent_splitting() modprobes test_dynamic_debug, enables several classes, and count them. It could be re-written to work for the builtin module also, but builtin test modules are not a common or desirable build/config. CONFIG_TEST_DYNAMIC_DEBUG=m && CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m test_mod_submod() recaps the bug found in DRM-CI where drivers werent enabled by drm.debug=. It modprobes both test_dynamic_debug & test_dynamic_debug_submod, so it depends on a loadable modules config. It could be rewritten to work in a builtin parent config; DRM=y is common enough to be pertinent, but testing that config also wouldn't really test anything more fully than all-loadable modules, since they default together. Signed-off-by: Jim Cromie fixup-kconfig --- .../dynamic_debug/dyndbg_selftest.sh | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index fccd2012b548..d09ef26b2308 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -11,6 +11,30 @@ CYAN="\033[0;36m" NC="\033[0;0m" error_msg="" +[ -e /proc/dynamic_debug/control ] || { + echo -e "${RED}: this test requires CONFIG_DYNAMIC_DEBUG=y ${NC}" + exit 0 # nothing to test here, no good reason to fail. +} + +# need info to avoid failures due to untestable configs + +[ -f "$KCONFIG_CONFIG" ] || KCONFIG_CONFIG=".config" +if [ -f "$KCONFIG_CONFIG" ]; then + echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG" + grep -q "CONFIG_DYNAMIC_DEBUG=y" $KCONFIG_CONFIG ; LACK_DD_BUILTIN=$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG=m" $KCONFIG_CONFIG ; LACK_TMOD=$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=m" $KCONFIG_CONFIG ; LACK_TMOD_SUBMOD=$? + if [ $V -eq 1 ]; then + echo LACK_DD_BUILTIN: $LACK_DD_BUILTIN + echo LACK_TMOD: $LACK_TMOD + echo LACK_TMOD_SUBMOD: $LACK_TMOD_SUBMOD + fi +else + LACK_DD_BUILTIN=0 + LACK_TMOD=0 + LACK_TMOD_SUBMOD=0 +fi + function vx () { echo $1 > /sys/module/dynamic_debug/parameters/verbose } @@ -192,6 +216,10 @@ function check_err_msg() { function basic_tests { echo -e "${GREEN}# BASIC_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi ddcmd =_ # zero everything (except class'd sites) check_match_ct =p 0 # there are several main's :-/ @@ -214,6 +242,10 @@ EOF function comma_terminator_tests { echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi # try combos of spaces & commas check_match_ct '\[params\]' 4 -r ddcmd module,params,=_ # commas as spaces @@ -226,9 +258,12 @@ function comma_terminator_tests { ddcmd =_ } - function test_percent_splitting { echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on % ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP" + return + fi ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug ddcmd =_ @@ -248,6 +283,14 @@ function test_percent_splitting { function test_mod_submod { echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP" + return + fi + if [ $LACK_TMOD_SUBMOD -eq 1 ]; then + echo "SKIP" + return + fi ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug ddcmd =_ From patchwork Tue Jul 16 18:57:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735560 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C0654C3DA4B for ; Wed, 17 Jul 2024 15:02:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2ECEF10E288; Wed, 17 Jul 2024 15:02:43 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nNn/qiiE"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id F344210E82A; Tue, 16 Jul 2024 18:59:01 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-807687b6652so6221339f.0; Tue, 16 Jul 2024 11:59:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156341; x=1721761141; darn=lists.freedesktop.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=nNn/qiiELLQ+nbG3i9pWl2ZL9wvqwelcPtaA1jbq+ApTnFWxmXlbmH+e6Csslq/ygP G5In60t6/TS3ubtUBqJ1+XNkkA6wLXJkzJVAxvCweBMcE7jS1QT1eGZx+DJKDYHlmLqV ClDbwQXXG72FYoMCiJGsHtnAWjh0Zrm5QvgJvXJbnJi+QtR6HFhTNsAATptBUUYHNJTX w4C8qYfDqtPMjnu2N+K4CdtYNUgW1cSxlZni23NotfQENEr7mmCeqeSEj56s4GDTJ2Da zn+ZKnAP2ZDTGzChQiAij/9jX3mo334/ZktLfYN8X3dlslyIgwlU04rNc/vfexInOHam mduw== 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=e1aFL781a74YEVt+BQvYIbsxV13UZtAJOvDCv9lLV3NcNPXUrVXb4o1CZUFmJWg4nA wGp/SJgo7VRQQuANHdoQcEJNNQiB6ZITGCHTl0jU3qUqfN9zlGVr/W5iM2HTckqshgre /0NK16B3U7IosZnZhpVEuKy1ny6vLF7zRn3ehaMWavpEwelvTJpsV680vhlxi0DwsF22 NM3HqTKJdjGb+3dHKXZOiLt/ATLLTOvb2egKO5Iia7FeRzPsGGuaKB1qNmRYAkmb2gkU 179quW04JuVLzMl3MU+mKFuqiQT2EcCW2NbrKrPUv0dWzferZZFJO70GLoVN+VDr5SHW Yj4Q== X-Forwarded-Encrypted: i=1; AJvYcCURoUgAFHja3X6MSpIj0Nv++HVEFvp7odyafhPpj1gMA3/gdcKtJs+/nZBZhLwfZWRloa0xzuqscEg1XIE3tFWmA4J9XqNQ/Jx9IYewL5NEAcXkUS9eKBm2kOIG/6p36Bu6lnUBaFOY0g2MV4bQ0CYAnRow1cQZO/EBB/PYTYAEBIOqfAj524gLdxSRSdc/mZf0W9PfgQ3J6gSY6nb1Ln3myfAjeo6jKzS9KpaXEu8Djq/g4ks= X-Gm-Message-State: AOJu0YzfwNGB2RCuqp0EctWKVtcEscngUex1Kf+h6/ikiUnGOJUfOwpH qvZJbc4OxELa1ENakBgNoyGxq1dvTWoEY+N0/T1ipZNAQSJSVxID 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Remove the '-v' arg from the tests in test_mod_submod(). Setting V=1 in the environment turns it back on, for all tests. Signed-off-by: Jim Cromie --- .../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/tools/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 { } function ifrmmod { - lsmod | grep $1 2>&1>/dev/null || echo $1 not there lsmod | grep $1 2>&1>/dev/null && rmmod $1 } @@ -316,13 +315,13 @@ function test_mod_submod { # change classes again, this time submod too ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add some prefixes" - check_match_ct =pmf 1 -v - check_match_ct =plt 1 -v - check_match_ct =pml 1 -v + check_match_ct =pmf 1 + check_match_ct =plt 1 + check_match_ct =pml 1 # submod changed too - check_match_ct =mf 1 -v - check_match_ct =lt 1 -v - check_match_ct =ml 1 -v + check_match_ct =mf 1 + check_match_ct =lt 1 + check_match_ct =ml 1 # 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 =p 8 -v + check_match_ct =p 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 =p 4 -v + check_match_ct =p 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 =p 6 -v + check_match_ct =p 6 # recap DRM_USE_DYNAMIC_DEBUG regression ifrmmod test_dynamic_debug_submod ifrmmod test_dynamic_debug # set super-mod params modprobe test_dynamic_debug p_disjoint_bits=0x16 p_level_num=5 - check_match_ct =p 7 -v + check_match_ct =p 7 modprobe test_dynamic_debug_submod # see them picked up by submod - check_match_ct =p 14 -v + check_match_ct =p 14 } tests_list=( From patchwork Tue Jul 16 18:57:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37582C3DA42 for ; Wed, 17 Jul 2024 15:01:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BF9C10E1D9; Wed, 17 Jul 2024 15:01:21 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="GNluKCK9"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 81A7610E832; Tue, 16 Jul 2024 18:59:03 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7fb93b2e2a3so4683539f.1; 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=lists.freedesktop.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=GNluKCK97yjfLpnxdhbhyM0iTnd1yIJYay27W2NS+mb4c76VXwZNpyF+5GLldwsClo Ib/EuYmvpEgjC+qLwi0GyTQL0t8chl9bLEaYBXK+oKdS9Yw1xhNPgORsIVbNVZOXA7zd QSlMulGhUcXKPMsdvPON1YCP1y37A4CoDXlBZxtf/C/1mKUkvdFxLk21bF4j8k35A9TZ rnOrPB5HsKnptvrm5FjPeaWGVI/Ha9nn3zB+Pk/vwk/ux14tNiZvQ1fCo1gnNwPA3+/u K0ybjCYKGdV+Ht2N1ehQjmP4ip02tAhIS6WXZLjgxFSigJzGAjUS3Zy8p0nLj84L84cU HWtw== 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=lUEteElYzgdP0uWzpvCeW9oZWgAAXgOwUFK8lg7A8LkXpAEH4LgQrx8ZFfeSbIkffP r/glyOR3cSn9qBYDdL0n1LoC4R0y3zkrjr/B5nu7ey9Xzu96t3QFXDmyqzik+lC0xByk 2EHLB+72UZCxfrRmfwkOb863HJw4zJMuwgzansLWgrh1YHS3hHkVVkeZWPLB2A2VDtXi 1FkTuGnGQRUCQ1jmcTVvyuy3Oge9KaKI8OglAsDbEeuLEUpcdtavLCeQWaZ+KClhgMHO E1ucHLoybKFPaqCgEZO8YfxentmLnZBHsnpHYLNF2tEA/pkqHDt9f/3lP0OvT5oGwVO8 DVSA== X-Forwarded-Encrypted: i=1; AJvYcCVvYWhYVaAAXq/p7nGKhmD9wBV5Jldqx86kiQzDyU6Vmn/XHFGQqvcO3qdCqPdRUsCaiP2xFYgJu+V52BFfMs+dyZrCS37ZKrvfOGaJQmRusXxWP1g6pLJZcMUPck3uUpKENSFGOc1AmV1RDTkyC3e5kPe/cd7y0FsCIW1Rn8tvjnjsMnrNLnyzF9Juy7NIJokhATVp09pMZ4d3rD124824vImmmWagzAxnsgToe0YFSnW/HWk= X-Gm-Message-State: AOJu0YwUTRZuaqsgg4jmRxDyzZIHwlg1nbA+M3KQl49GxdfUMt+4J3Yw JthcS9X4ORaNlOHnL85GnwPLMJ9IAOZb5MCZ6+wV9diSUTefGjSQJ4vcFiZ0 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which broke builds with: CONFIG_DRM_USE_DYNAMIC_DEBUG=y CONFIG_DYNAMIC_DEBUG_CORE=y CONFIG_DYNAMIC_DEBUG=n Also add subdir-ccflags so that all drivers pick up the addition. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factory macro") Signed-off-by: Jim Cromie --- 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. -CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE +ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) += -DDYNAMIC_DEBUG_MODULE # Unconditionally enable W=1 warnings locally # --- begin copy-paste W=1 warnings from scripts/Makefile.extrawarn From patchwork Tue Jul 16 18:57:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0500EC3DA4B for ; Wed, 17 Jul 2024 15:02:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4A27910E270; Wed, 17 Jul 2024 15:02:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aWDxb2QO"; dkim-atps=neutral Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id B8C1810E841; Tue, 16 Jul 2024 18:59:04 +0000 (UTC) Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3737dc4a669so443795ab.0; Tue, 16 Jul 2024 11:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156344; x=1721761144; darn=lists.freedesktop.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=aWDxb2QOEhwc4TDu3j3wcAlfDru0WmjBhtn1HUoGysZ9cTI36GFidAOiOwVPQYGfjA IAlPVlgjvY3KgdGKtMALOXKP0V0MRMwVWfJ27jr/kI+IYqWbG+wGmC88cYAgTkq7gv8y GyUME883tQSrm5T3g2XAhFfmQ+2C1MB3IoawX9Sxp1BFvEglrTfvql5oYaqnoalASj2T IgIMWl0nCiWK4L73GHcxusULs2TLfx6khNHbGKqAl98opAHJKZAwjo+eqFaU84VyLutW WcsLPJKy0o67bgAc1yV9ErUgy6VZdn4PtRSD+teYzQNf2k+HNocxJDZAvD9fVkZ72hhA zpSg== 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=h9EjXe6dfyN7XREcAjhV4U/0K+7l7E6Nf+vPzPmaukztq1H0soy+sTQETAQxHU8RYl xHXoNH4vn+Fa+tkVLA9jXXCYPwb0OY1UuiTTPU7VONTbROTmSaa5qqcOJA5A7P726Qij KAaEObit+KPx/MgBoBfEEp//Ixyy9Rxe24qpS16YdQIicsqiTcXBNZ66DEYHuOjUX0mh dEzbswMztcp/7Ck+l0MgisHKckQMNjHJzmzAM8vztioNIVEnsJFYe6NhE4IzEijyoA8C pwMn/AQalS0YqnkMGNLlW8hCvCdbI/WHT8bqKPbeHGegflQ2BCkhwfrYNVs50tHrueU7 vtUw== X-Forwarded-Encrypted: i=1; AJvYcCWhRmtqOQwSdqiVqX4JKLi6GTiHzFyLzFTjefekBfip3rKMAByRsnbMkaMQb/6lPYWeJs0BO2oJHEhV31x9VU2BfwrlwjyJfJ7cGpK53O1NJS88gK/AFl0iulnyXM86kPFfy9NzMvKONYmmZPRnI33Xkuz/nnvQLr+PrqMQ5lxciF8g//H1zrMqkoleuIeAJwSC24rrx525Ub4SEFEfpNy/FjuxHxdhnEZeC4mo1NeiLrXv6/o= X-Gm-Message-State: AOJu0YyYjTpnJ+6JamcWtlfPsooRw7g++v24r+Zs+HjuqgLBUa7O7mLb zLR4iFWzChcjMWDRKzbUOsENh3YNHZNPpVMfU/QuyuPNpCUDwROm 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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=y, 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 --- 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 each 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"); static struct ddebug_class_param drm_debug_bitmap = { .bits = &__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 }; +#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)); From patchwork Tue Jul 16 18:57:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9FC04C3DA42 for ; Wed, 17 Jul 2024 15:02:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0DA010E260; Wed, 17 Jul 2024 15:02:26 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ceUxbTXJ"; dkim-atps=neutral Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id CDBBB10E82A; Tue, 16 Jul 2024 18:59:05 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-8046f65536dso6071739f.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=1721156345; x=1721761145; darn=lists.freedesktop.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=ceUxbTXJeWK8qSxp7MttHauEyrx1z86KkAtXzTNBis/6aI/jpSlKYUjl6hbVvZpIAz oQGz+LgGMFnIfStolHVYMiaNV+p5lQ2VId/jxIMmj5mzrYH0BKvEn7D9bHpLgP2WZDas fOL1H7s4HbwbcGb9C1IYk6Cn1EjmsqVlEhRCo5cNTgOPrZo15M7IWfNLA6cRJk3HBmgk mlS3CjBAdFrwnPv93kNepQt0E7bk/Wij2kcT1uKBhp0wyI7J7lyTSmGYSUv7kdpOHRRZ elbJn0l90QpWjb5PWqxivDfKoaF2U+W0nETH7nRLnb29HgjqaTKn0BdWAYkxj6lmd8xN FDMw== 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=XQtbUxb9BKsoQ7xuR2MuVuAvBtv35mTgeV6rJx7U8JCEmsC0fgN0Ar83NWbS9tnyjV 3NrqC6o0fy4ctDGR2bp/X+K6xFsGCWLlEebo+qj32NQlTqSAV+QcP1BKeNa/x3QotKLq rpcaWufN0r6G6cgYn7dwDIL/sTGI2B4uLmx4T8WCoOPmSUuTSJ2zCG+bI8Qi4RPmzFEc Ibkbvs8toZoQrlOV3cmu5DHI9Mp+Bb+AZXg6pz1/OiWeq3qd4qwH7ZBnAh9sZiWMwNJK XOKweOjnzWg2AlMezsqCetNcykB9pupxYChQMQFkfueQDc85+jiVi0h5sni3qq5PlNXj NwOg== X-Forwarded-Encrypted: i=1; AJvYcCXRVhOffbeh892Args+u+fdLliudKLFWvyypBxbAs0Z0InqATeKwRVeXuL+3BIDYzrfWiiXZAzToPDiCYOj/zlxJXXyv19FbMTTimBkPThMyYJmsms/z6oaqQo8zEGCVHv0niUJ2t6vDuNtIL/7kWJS4NJbSC25JV6iFmOsTXwbbw9uDcI/6s+PH27gzARe/hpIny6l1BjAFmg+JTE3NjxxcOCKfQCUBVDaajnogB8qvOilwiU= X-Gm-Message-State: AOJu0YzSVFxrR0w2zTkIxop/mTaBxl9EWbI2/IUhuvkg6jj6COTGaQGu kl8yyO6P2N0a2CPEXgtcON8obfsFgXax6SxT1nm+5pqXiPH/lshB 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- 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_DISJOINT_BITS, "DRM_UT_DP", "DRM_UT_DRMRES"); -static struct ddebug_class_param drm_debug_bitmap = { - .bits = &__drm_debug, - .flags = "p", - .map = &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 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 { }; #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 static inline bool drm_debug_enabled_raw(enum drm_debug_category category) From patchwork Tue Jul 16 18:57:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0FBF6C3DA42 for ; Wed, 17 Jul 2024 15:02:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5AFC310E271; Wed, 17 Jul 2024 15:02:39 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y4c67htu"; dkim-atps=neutral Received: from mail-io1-f49.google.com (mail-io1-f49.google.com [209.85.166.49]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0CBDB10E839; Tue, 16 Jul 2024 18:59:07 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-7fb93b2e2a3so4689539f.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=lists.freedesktop.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=Y4c67htun//cMK2tSjgt4HR6pN+cnzND8Lqh8nukiHaDOiJx4Ja0c8V9eQRGEukMQr m9jwtDWBPe6bxcbvPmg/WtPXve7fODjp5aIHacSb/5Aiji5S2+0SQPABojU7MsicdmHs 1PqMN9xVk+6WzLX3dftTtpy96LwzI9w2TCDoceEJ2/nLqRDPPPLZUVPnNzvUaYq2RpRh F4mKpKzWLbsqreVfScMUYov2PuBX2OXIjrgP+7tm9n1I+BfGyudQePZBUhXpkIza1D4j Lh09aKBy5hA7ET/O/2/2cCGE4dOVXNkzNKnqUklDDTAqok46eJylX93JUjrTU54J3ZBY 105w== 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=mxXFFkV9/BmDFhpeaxoTa9i0j4p17u1nW601k9CNpRSt5h2DTdPbHnydW+xLHNDwDR /vzLvvMBeR0Y3OA1YZ4qEwv87nqi7RWF9o9iulsdWUn45kV1kNFp33VcKjRCPYx7nFfk /TYJOevOiBPoxt591tmD0YjrICPUypUCLHedL4M5GuECSAhNwmB71ND2b27y/dQGT2MK uR3WTXcf6uJXgukvmQ9Xrxqe6oOu3b+JY6zSj8CAWIWEV1KXpKLLKzdhg0See7bYWeNT LroGyz7nqn5+N8DSe8B7R04qvRVc29pLDC4yqcfilnE11AWMelynL+U3LBjI5IpJ4dWU rnaA== X-Forwarded-Encrypted: i=1; AJvYcCVEeLLC9Z9bHznSGZcWY6C4ymaNjAM7kmDweOXjx68F3fTK05kTclTSHX8rTeHDKNTLv2w6Is/ZKXgJhXE+zn2PzhggaGDbA1b8d8Uh/hBo9VkM2NJXLDnZKZ4iRglT4WnGLU1epoPUQHtMs/bkHrm1pYF3cudZEFNFNdZgJe1zTi1IV6Q9LzM0gHi7lGDnwuhbnLFTxF6ZHtgR8bVKMlGLbltpYkCa4LDuudFkbjfJ76i31Wc= X-Gm-Message-State: AOJu0YxS379pnWRe+mWBa0tyVzqtpMQtuXSk9665A244s/PLNzHtOs6b bxBD4T5fQUk51r7HKTjRXgDz6zCgpVLXAjjcXwfYU5HzxZkF/hlR 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 drivers.") Signed-off-by: Jim Cromie --- 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 = -1; /* auto */ static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); -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); struct amdgpu_mgpu_info mgpu_info = { .mutex = __MUTEX_INITIALIZER(mgpu_info.mutex), From patchwork Tue Jul 16 18:57:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735546 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BCD46C3DA61 for ; Wed, 17 Jul 2024 15:02:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46AF210E250; Wed, 17 Jul 2024 15:02:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gOXFsKwA"; dkim-atps=neutral Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3285710E299; Tue, 16 Jul 2024 18:59:08 +0000 (UTC) Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3856b7be480so544175ab.0; 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=lists.freedesktop.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=gOXFsKwA6su4eW/CreO41nPeFMFQn0K0bed+/xQBiNfqTZ9G15+KM36YV6lG8Zg5mx FusWDhbQXXZyFD6nGc9f4Z1oWzGu3yFBPZ9kgvB1KV8T0uxDTtZJr9llPp0O1VTaLFeY K4PgF7xcMw++SxY7sY2tdrHRUXBTgR3q/cYIW3/6t8klmbK9J0ZCs5pzk1Equw5ogKq8 kj5RiVl75iSs912qlhw7JRdP6bP7crPWO4mk5mTT3PUFh/vlpIxsr/CIHH2phKH1zoH/ atwufghdIbiF56GCFuVlp5/p7L0MOPeKCjQF1cA+jTPBtRPMJI3+30IwCxSe7zCH461A 4LzQ== 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=RHIV3YfyWVcPiJle32Zls9ox6uSEnqpL35xpeyzB4cbrp5QWbxDp/b46bwhoM3Cbe/ dIDTUuNzbxYd2x/VDgEpdb+jF8XPFUGpx08TFQIFuIfB10fCZeO/Uv+9QkAs5WvNlAhe t22pesGbEYJJnXHgeelvMgDcXhH+6rolwWYnKI7LEUAfbp7G9r63Z4l+5azt/B8YhKJT sAo1v7zmnkkjBIfMDiq2v85119slnvlKD7oMfR29OwM+I+4eSCYvpSVsQVVkOKKOcPHE NctTg0co5/HfIi2TfcgjXjBQBj8MZUYDsedi1p73v3BK4jlWSTl7KFFLYC8USAQaFe20 Ko/w== X-Forwarded-Encrypted: i=1; AJvYcCUkxmXyNcmwYtcHswDt4Y9aSPDcPqYNbx3UyyKhcyM50oWIO9k5jf4xsKoJ0G88g0txsYk1SuLf7Gi0++kCyMwNneunlrk5BwPU7r+lo65ot5w6CREHeZT7Qc90hcb3l5bkqX6A6KVDABUzV1YO1HJmmHFg+XSFuMgDKl4blkKPmK65y98HepAB+bL17E/ADXs2Y2sn6ZxfdJrrnr3RMfHwRLzaZlONZSbyPZ+BmhTPuCR9NY4= X-Gm-Message-State: AOJu0YygDbUChKCcZlmJE6ltX/Au/6gg8iFpw2PeBKnCf7QbJ1oXJuWB S8zE6qQ5c9rswAH25qnijGjYPiXgdvhLW4iA/c4+5zEbIAx3Sg2A 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 drivers.") Signed-off-by: Jim Cromie --- 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" -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); #define i915_param_named(name, T, perm, desc) \ module_param_named(name, i915_modparams.name, T, perm); \ From patchwork Tue Jul 16 18:57:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735525 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA4F9C3DA62 for ; Wed, 17 Jul 2024 15:01:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A12510E1F9; Wed, 17 Jul 2024 15:01:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="aWT7BIEQ"; dkim-atps=neutral Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id C609610E839; Tue, 16 Jul 2024 18:59:09 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7fd3dbc01deso6040639f.0; Tue, 16 Jul 2024 11:59:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156349; x=1721761149; darn=lists.freedesktop.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=aWT7BIEQ8x1VCgBwPbdpbUOH8z7eawU+3zQ3diZ7COZoKr1DvahHyhYRhor2XLDSDD L5/N+dXZE45yN/xu/5W1BWaKUTjf076QwnnV/Cn97FkLqDfQEWkrBjXiBLjxeZB9cjEO 0qelpueX8pcF1Vt+Mm2/5YYaadbPmldF6GwWjZc9Z2fv4Ivb2g2LDt5Dmibgg686Tr6A 0t3zQlG+6ewBWjZd8+bkAB1nYzVws//Bs3iyAxrAxReOs27bm4U7Z1YtMLIip3rCtrvW CLsJUa0SLw3pMyY0x6PZ6LrHyNtSq0/dLvcj5xDykOi5BuJ6z7nwSggKJM06pGeXvMU/ gTZg== 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=vqX23F9YcIjQhWymwa0VGs3LRrhspxLov36Q1yUOWX2ANWmHaf7Py/xooJ+qrFcL7X 41w7b79LFmIv+qL86Muo9nswi73d6k0ppVr6r0jErZ/jSkKcOaYsTJnPWcG+x5cRxH4N Uj7BexVJJ3gXGJtQjf/98lOPDlZU02K14GSQkVMe3/mIJh4gKev0FVhl2nTEoVycA9Li 5h1tOMVX4hz77Qe72wmKasXIOmZv4+s6s2u//GWOn0SKW9j7rn3rRjmUyq4lkkJ4Kfm+ /Bj8LIZceWQ77uzQ5UX/I1t6ms/9AZf7l+L3nYME+zZCHGaJ3zWRn21ECc4Z7thoS1N1 2/ww== X-Forwarded-Encrypted: i=1; AJvYcCVR9WwbQgfBV0Ha+TQ852+H5kjOoDqv+mDZwklQ8PybQQyODwGX0LLODXfGYyKybqSeUBJe4YAvZEKpPGb8dx8mwPvZXh5Zi/rKGaf//ppsCNzROq237YJ8gsCkNPC2tFq30UZ5xcGLUdVy0dPfOONqekBio3MHThX0CWUOo2U0gyOL9J1r6Z6T2VHvQkSLZa1rL04ZktwI/iZwn4P7VSUiM1yr+1Qumx8p4zEdRUhigN/TaNo= X-Gm-Message-State: AOJu0YyPd1p4lskxkUfRjiRoLkCD5NCQCBGFGWuxR0IJ7BXqq0Eehpic 1l/Yg1jVqzdaBGlAsg84voXaBhbTo+/LJtBMq+pSoN8/79TbgM11 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 drivers.") Signed-off-by: Jim Cromie --- 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_helper.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 @@ #include "drm_crtc_helper_internal.h" -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); /** * DOC: overview From patchwork Tue Jul 16 18:57:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735521 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AD5E0C3DA60 for ; Wed, 17 Jul 2024 15:01:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AEC7910E1E6; Wed, 17 Jul 2024 15:01:23 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="CnPa57Vt"; dkim-atps=neutral Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0019710E844; Tue, 16 Jul 2024 18:59:10 +0000 (UTC) Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3815aaa2ab9so247945ab.0; 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=1721156350; x=1721761150; darn=lists.freedesktop.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=CnPa57VtHwclfyyhg/wEvdEgqcf1/msUpDyLGowtbASyzbgobrwR1EPQq3v/oD+r// 5Gh/oKqC3XOe2V5brCJS0hzFM3K3TcWbf2UVoHOtCNvtJaI8MWh4Kktzx/eRnf032d8a apo9Fc70eHGCYoux/cSxFK/dRg2PZw7HAaANm9Kn/hbL5VX0D56ujeCYAmzG8i1w53hs ObQMhM21NQTlo1bYZr+pQ7Dql66h3i2TQ2RAz1LCcAdGS74xySO08jr9d7s1+hCV3/qB MV+QGuvTUDLbj4vl8eshxWKhGfBF51AoyqmoyOFuXRccel9Rq+x8BCmvRExOE8mhl2v6 pX0A== 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=FMWqvUC2G8j/mDT9oNF0QTKCVm/ubnnRBOGcxov5jcVV+b5+M9gGAvNTew2ZGrW/uH h1/gjiCKmtypp08O/v742pTu2TzLoB4GjsBKmOZlf4PSc/rKdDR5xuadbm/DkyIOs5P5 Jc8o9t9qPgx87Gj321uKQDGaDnoZ/GWnoM8OxZv39g+Zuv06GTPP06rOXVXD3P6+dYAk CGsWqJpGRRkHlvHg/g+7PbHBPuNPxvjNWDKijgoR5dz7bKLmzvHh+QANiMOUhXKcqgd+ 6qEN/amAYZ8446sXpixvWG9p6wte6tUTDD5KkYVpSye/uIoXY3aroDl3ikn+2BTxJ2Xs +Ydg== X-Forwarded-Encrypted: i=1; AJvYcCUfIEZbwmFn3MnVCy5MusLBbsIw4k9ICWbduof8yr41/r/nkZTACSTDwvBM1pZX1KCVmT/vZ6z1Etk2y/DMcGyTouJJWu+WQYa7uTPHxO2rMtRCdtQrT9gR3riL7EUz3NaQyRhCJIRQ3WK+F9VgwmnP5AzgxhBptuyHAh6fT520rTrfRVNu7Lju3j36nRjRm3QQA9B0EBMSloutZaymslPYC4+P2AJ2L9jhE2p1hrj/Y+m3yRI= X-Gm-Message-State: AOJu0YwJvCuP7xxw0QoeS0i9So4KFugF2kIaMGRT0DcCSDn13rXMRLN0 vIGpDgb7hGyr23Vf01lx8Hk2JpEOkzFrVpOqGVF6ud+dbmWeZkKgkicUdgx4 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:13 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 drivers.") Signed-off-by: Jim Cromie --- 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/display/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 @@ #include "drm_dp_helper_internal.h" -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); struct dp_aux_backlight { struct backlight_device *base; From patchwork Tue Jul 16 18:57:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735543 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2BB48C3DA42 for ; Wed, 17 Jul 2024 15:02:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8156A10E247; Wed, 17 Jul 2024 15:02:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Svquqb/r"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2D9FA10E299; Tue, 16 Jul 2024 18:59:12 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-8046f65536dso6077739f.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=lists.freedesktop.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=Svquqb/r0XD9ndeS9kJZT5r76kjZrtcPlIqiZ9Kx01h9fSvI5Ktvk/l+MemU3g8dsk sbu71kc9Wj08BRj6cBgsJtR/tq9OfEFKOAukEV5L/cQza23ybWG0KSq134YO7uLOOE5T LmK8Rmni7goG3VVYSvyNIbMEFejJROsQ7IISX95vRWLGhLNfq55Sy5X3+v1HYFiND9KX c9jKQ7T61umSAsqQQfYWwvXR/DBQwIpqqB+tdB85Se9wiBk7z5BDiUMw6DRmAT+KVGun wxAq9asGla7KeGgNhkGojyQ/wqxWr3R3X2vRlwxAw/iCXBfbrzz65JaVIJAC0fgEHwHz 4b0A== 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=WW7YW+DK6M5OH/bavXYwnIozlagJTshQ6xT9Y0ZQra3Dq0AElR3WUIsVUVAbPrswgJ J/T5Y9TuGCVOigDM/p+6saSzkdzAPQdxktZOXOLTlatKwek9X29wm/kI9rso4ICkRDdQ t7sqiT11ONkRkNSUrbabPCri6NYnmzPivppp/a6jQIin3Z046eLVrIWs00CsrJ+6fLFG rmO2+K6IFp9Vl94Nj22fPADkEt65j9tHs03GdjPVhQ8QNEQlJE+gF98v4b2XkSVgxlmV BRw84B2xDujv5KxW4bouj5HMrS/zashY/g/gy9/lpPiWXqrZQvn7/TmcgueGJ8n6/+Pc 6DmQ== X-Forwarded-Encrypted: i=1; AJvYcCX7OMqSRPuQ26TSOlZ16/h5rGomJmD8U5tEDfN2nY37lpbCfoOouQb+AKeQidwzsKZaB+wbhbgjeWZhtdO1bid6vTcfBis4fzqLCY85IRFhSjeDnnUfAffQWoEBGRSEyvmr0E9+0pbMVW+FLs9QKXatJW85KFxZ5lvNBtstzUBI7idzXn9STc4w14cSf5FLJVhsrJ5CyQ3aVlOlq/z7CdFI31pyk8u/MN2YPptKUO8UGLl2DcY= X-Gm-Message-State: AOJu0YzCLr5JevZrmpNBbWcxnNKYFhTP/sts08DkdCySUYFYzcljwJ8G kKc1Avdfz3cMAnpCN0SELMzu2pPD8YaaxNtW1iCz45wajApvm8li 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 drivers.") Signed-off-by: Jim Cromie --- 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/nouveau/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" -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); MODULE_PARM_DESC(config, "option string to pass to driver core"); static char *nouveau_config; From patchwork Tue Jul 16 18:57:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735544 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A4FA8C3DA4B for ; Wed, 17 Jul 2024 15:02:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 103AD10E24A; Wed, 17 Jul 2024 15:02:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SW0yTHSn"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5ED4E10E839; Tue, 16 Jul 2024 18:59:13 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-8036ce6631bso5970839f.1; 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=lists.freedesktop.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=SW0yTHSnEUFIMD7Ld05Ewk0j75J4uXBBkT0AhCbdcYfX5Lxje1SFy611BtG5LAub2w hewMmn7qPkOZaYfrbCjwRrwKfWjEJ26gDNCOLqL1mUNlBplYhIwGgXIbe2/ksCtQTXL1 A+Adrd1NDYHVyatZrXz7FhlnD+Rs0JsU2ylDZZSCqehM9ZaUruYlK/6WuydgI9wuoj8z jiVCwZtamvQCq6hyD5ouJQLphfyg0G+bTGZp1TDRoWwYgoAY25HnPsmS2oo2lBIIVX6U +3i5cBbMUaqpMTCh6l6bHQUNgskofBNdCa0BNGuQZApUTrCu5wU6a8mfQcyZIxdMiulH UMYg== 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=CZEZhI06ctuu4qa6rdTRa1tIfNpSmyUOHunnWdfj3Di8WbUUG1u4Cheo6c98M6JBlq lRxjAESbLxe5KMQHg5rXjfCn5t1BBGs38Xoppa/9VwYQTxFGcArrwwm4+DoDe7JwwFS7 Jtmix7Bu//c4vkz2mC59UFmbEalQnP0Voj8ZsfOULx2VDmgc0MqdXkmEH0mMEO9JwiDZ Fc2pVRJxctactD5YUHwUZtErmv9ZxjviMD/y4xVZRhrdBsRomvtlL5NHDDfBSFpkcMt5 QqHzwbLn7vMwcPJ3183pfcNVXkZuWgoGR4BQUyfPYWfqCJYjGnUl2sjHIjKjqe2MODlW +ivw== X-Forwarded-Encrypted: i=1; AJvYcCWWxaS05XYS9i35wjtyHToKhjK/qfGC6F+6FzVi4lsw1z8PLEBH2KD/6TgvYNsP4Zq5n2VZso/YpLtulNXneUCQKn3iGCFVBcg6X+jrcgycFi36rJZNyU0S6vt6Db9xZcyLwr2fVj2Td5Zx/6dp5YTxXLBJj3ALU7dxazXfbwlr0g/jJ/xk/tIddeNmDJ5Wxfq7sQQrGtgfuPzn5STLBV58NlA8UixaMWBEozeD4+Nzw+LgRPQ= X-Gm-Message-State: AOJu0YyvKU9vLWieOB4wf+0yuXfr3uKdyr6lSDbNQljQIg/2Dbu8pWeg n3w463MuWO3I9a34wJOLXfFd1vAvlV013ib4Qtif6JPPRPlhzqZc 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:16 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" With CONFIG_DRM_USE_DYNAMIC_DEBUG=y, 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 specific printer") CC: Jani Nikula Signed-off-by: Jim Cromie --- 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 = p->arg; const struct device *dev = drm ? drm->dev : NULL; - enum drm_debug_category category = p->category; const char *prefix = p->prefix ?: ""; const char *prefix_pad = p->prefix ? " " : ""; - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; /* Note: __builtin_return_address(0) is useless here. */ From patchwork Tue Jul 16 18:57:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735555 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF6FEC3DA60 for ; Wed, 17 Jul 2024 15:02:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4182E10E272; Wed, 17 Jul 2024 15:02:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RmaAW23X"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9094910E841; Tue, 16 Jul 2024 18:59:14 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-816ca307407so4163939f.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=lists.freedesktop.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=RmaAW23XE5fOULnjZEVXtFn6TY2gCDsXa9jdzEY/gUhxO2T29tlYF4lZPNgPTULYSn 9g5OkuIp6jlL35aIrZVUl5Wn7zAESFuo5q0fCpYAR3eTXmf5qrJhQUlUyB5b8pVCTQFi lbuqptJszGsuVLLfXUrYIRFd7+REEVS5Ng982E+XK94CU5CCityn+duDTZbbuFWlswih eJ2x9/PZ7jCRc/PbexhcI4WMTwegK3xKCGgMDA5nPk7qh1jqtcFy4J9EgFhHh6OVbY3A T1iVouCjTO3SLZ6vFumnUkE2mznAqI1O5+qUctdwMhhNVwjEcumvusqo1TGNeQty9GyW XjIg== 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=PdNnjbl/N3jmNQ8e5jy2dZMQ609yBDudtzQs+eoERO+yIArQ4oV9K1MDV5QbDCu5rm NpvlzDNXUO+3BbFdUFWpn1d8TXsBZS4FHA2mq7E6EwYx6O9Emk9wflcl5qwB/Gb6GZAS pZoryAQA8tENnUgfzEJhZT2jGjEvD3Qlijsi8UyKrGjS9B00Yo2mSwKK3ih423fYGHvE e6y1/wqjMlEgnPBGSXefYXyPWNeNzKu8E4aHfrnb6V0N3iaOdzTu8hhWcqSts6/dvf+W Vsu//xNrCUgzOY34ityeu/Cw/Qb6eTn9NM4rUeGsjL8PabQpVHsGHLTDzNEAPMT2as5X kdZQ== X-Forwarded-Encrypted: i=1; AJvYcCVr4Km7Gwu5Azf4pgWZEsRmmEkXLHdk8lPtdL7iBKTOnH8xz2GGEw4ysqRU7PxHN1mBzrZgl/fRkcKxZe8ZUt8DxB4oZsrtcpG3rUy0tiz2z9DupfJlE442mq7fXkarRnYlxzVprg/Y8fTvHHGwOefvJk93wx+dyazBtB5GX4snk3DIj8UPfYjLiNBX/zRyH+ni0iP+VNqcGfMuM2vRNFzcEdWEQodPJnmpsipQWvuDSses+3I= X-Gm-Message-State: AOJu0YwZd+QUlZcgROjBagesec6iHFhGPYvis1qsyeHq2Jgb4mPGTE1n MuBeQne6EkjjzTaJDMcZwGxeNAeXbVHJgpNHEwdw2yYgCihtRH9b 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:16 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=y, this tells dydnbg that Xe uses has drm.debug calls. Signed-off-by: Jim Cromie --- 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" +DRM_CLASSMAP_USE(drm_debug_classes); + /** * xe_drm_client_alloc() - Allocate drm client * @void: No arg From patchwork Tue Jul 16 18:57:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735526 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5602EC41513 for ; Wed, 17 Jul 2024 15:01:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 96C1B10E1FD; Wed, 17 Jul 2024 15:01:28 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kwz2S2PY"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id C293610E832; Tue, 16 Jul 2024 18:59:15 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-804ac219676so2496639f.0; 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=lists.freedesktop.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=kwz2S2PYBdIy4XhHWL1VrdsQdb9+1o4AmTWblYcP8WuBjliguWc9TJfnh782TQIiJO 5tr1u2uSERYNherQsLjndyrcvB9oK7MjOF546CxL/k1hGXzpK0V+SJND0y+UHzZPOHV0 c5DFKXRie03cT0J1MOggMpUHjNPdNg3Nzm26k4Kblk6NpmdJFMKhziCj5lb2JsetUghw sXg/RkKfPMqGQiNpAln6hToCp5AejDMk6BH7LasSQM6FCJWuSlCd5fdg9QdnBnT5F6s5 DLAkByUU4DRtBOByVTlicd0giv0IhZ2PWL8SVAwuvQzKsLIfHLk9G7xdQhr5OTmJ+R+E duyw== 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=jeI49VL/1LkSryHfSKKYjc6n7Twjd1XaXnwxQd2DKiTfuTxqGzYZdRXXbdN2/ef5tu iC5HyMZT6YnIPrMQh5BexiRGw/fe+wE9bJxbnaXOsYpUIwNVMM8yvqgDXdRGW/aDHKP2 2gps/KpYiopKpLv8hUvp4a5+KNalb2uUKEz1UCi7HQ1iK5/aZhcQUHrmjrMTq6kUVxAQ BtJrJBuOhU7wQ8kejgDpBA+YfXHVLQUlmJ9Ix3waY632v4QPFLt9EUFRGiP6PS0rsmU8 1IJlWPfiOrUKSn7Y557GOcP5lNDFO2jftfeq4WiDcZnGcdepUbNNeaDDyQuN4Pk08mer mYIQ== X-Forwarded-Encrypted: i=1; AJvYcCUmqWt9OAgKhwCaao/yGq/wd4LBeDnaApClNZpR53PgMExpnSis8+P8FQogtw+NXPJmyudmWZuG4yUNmn1ic224xAGxTJdVV4HxbhAeve4HZC5v9Byc6YWNMnK0mFLkqrbO+8hzfFuzSplZcgLaEeonWkjzDNra/8WZbL9Ok7rDGev7JY1zW6n4ZJb1Zgr6mrIRrAruU8ZCFB2C76vWVDBY0XzQA+mcg9iW4OZ5WhH23PxkRIk= X-Gm-Message-State: AOJu0YzcUTrEGpA5D6UkOfFoAfNay6jHbVy78d+/FdjMVjFtau0/z+4z FHoaps8G4r8WRtgL494LUT0e+1GbBC6xnLoH8DgWfJEeARNX6fZJ 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- 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; static int virtio_gpu_modeset = -1; +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, virtio_gpu_modeset, int, 0400); From patchwork Tue Jul 16 18:57:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735545 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 254D2C3DA62 for ; Wed, 17 Jul 2024 15:02:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 98AE010E233; Wed, 17 Jul 2024 15:02:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PVYvRL+B"; dkim-atps=neutral Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3B37710E832; Tue, 16 Jul 2024 18:59:17 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-7fe8d029fbeso5437339f.3; 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=lists.freedesktop.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=PVYvRL+BLzC4aCa3CPgIlHoRN1BsOhgNtmFodeKC0ZCIkIKi5zvTYCWbSw7TPaFRWk vu0ig0TZhKSP0uQn+yKTYyYgjc0LQeKIXxf+Y6AOnNZtGwT6ODinalAY5vI0HNbRi/jL 4AU0YKDMDiXvtQ15xuUZ09p6Hu9zvtrovDJDOkb2AOXqkPoqyFNhL6OLa4U/Jraz1C+B Od54o/aC0I8F5r+fLUYtQ0H8yO4xR5KqhoL1oVtPgDpWw/ap1bXgun6R1fqDxSk3LVA3 1biRfgv3diKuQhQtzI321dRsgnnBJ4rIEfSyVYiQOkJVra6jRmZQk7AETGEpYAxu4g/X KqGg== 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=t1rE899CJTTYuBoFkjMGwbzHEezjB0vHk2TCPxnkNy4TOhRyLYuLgto1vrm0h3vI2V NRVchcrow9i8VrlkmMsd/EL79u5+695h0u2h+pXfGR8MDpKH1j0PmAMEC949Dhjp7ulb d9GLNrZaC24uacuhuxY7/posDrIJxHdkO4FZyQpezfBx2hJtk0Cbuy3jne32cviygl3v 8UzXE27VQwSFtdU0V1TdPYyo9eor7dR1b0sVlm0ICE0hThmW+0sGMdqDn0FVDnO7mv3q 8eQz9+3AXYmg1XR00CPHR+zkfybmPO84KEVfalXGHVyQcTRt70Zts5KDc+1fXK6MtEMv DTlw== X-Forwarded-Encrypted: i=1; AJvYcCUHoyGpVJP+sNl5Or3gKEThrG78BjfKq8veIPYHxkwqvcRHx2Bzed8cGXhJfa/u8VFHXxZEKCZb3Ho7MOrdrVfy5zihiOdoAJTNC7GcFY+tspqpX1gZv4xdgqFQsTP29qvrrgY83NZ0GCalfwmnVKg2zAu18F+R+AgWbmY4Sknjfw4Q7SP8c9gkUwpUnq3sfuZGh6eEDn9eHyX3GCGv6x29w7B2xQd9mNSQ4OSwOXVlyHTvwKE= X-Gm-Message-State: AOJu0YwR4SFKleP/fbNjuJl7xWz7D0f13wYdWq6Y7Oi5h4JgvV0SVPPr QH3wNZDNubLgH1zGaDKwUYjHQv1iKPe5BOg5Bw627HBEiVL5d0IW 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- 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/simpledrm.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 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * Helpers for simplefb */ From patchwork Tue Jul 16 18:57:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01FEDC3DA4B for ; Wed, 17 Jul 2024 15:03:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC3E310E292; Wed, 17 Jul 2024 15:03:06 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Je6fm/HD"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7468510E841; Tue, 16 Jul 2024 18:59:18 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-7f70a708f54so6569739f.3; 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=lists.freedesktop.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=Je6fm/HD6CBreDfcngkvHy0dRJwdQKKPlLfkh4rmj4ws4SFl4CemWl3SGOzB41Zb+A BjueVL6FVwaxAOkr6AHUnRsc1o+XqG79tRP1R8EX6rYr9Bxnq65rMeb1AIP+w3CJY5bm jH2L1zF5SunDmpWCvwXUeEvIDKFEpDgi+GxvpFPFL+6sobSIxfN3mMycwGhBeFg8idHY k8wmvOoSqNyjkG7s7vf2BMUbuBW2+wKF4GsIbH0cNCIq/79z6YOXYYJQ1rs3METLCOdo 1owRYOb9dqTPvY4gn3MYQjJ1tO5hK/izb3UIa2CTkZJmsiAcxK2o+VuhmemJfm0D/EBZ iSYA== 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=YZhCqRPcaoMuyMkIRunhU/xOyxdtSKuPvtSDAeZ4rMGWo1hb04ER7QFDMivmVDff9O KqZ3UqGVnDUzrZgvVZidoMd/9mDaptcdfyNIQRgoo75sbThTe12SC/uki3PiveQF/Tjp qOGqpCT6ESLkMjUy8NAd3HvrPLndwGZo8jRobZETn6566kvehtpBQulN9Xz44W2H8Tav m6+Q13wXgTWnhJ6rR03Ah/yLphyhdOxWQHTW9DGUDvKyUc4Y3k6HJ12vsuu57Hfwgssa xfxf/gHv2/TD7Mfqs9eTk0BnUl0pxDyhbIJkOExHJMBwYvuMQX2OijuONCJciDLLk2eq 1zAw== X-Forwarded-Encrypted: i=1; AJvYcCW1+oNu0GKg2laj1oYImW3SFqzVH/5p8yxms1Wha0fRRSMT2usKePIDBasibY56TLJ+Uq/G5Q/3trGY9SZPC4T5OdEVFqO3yZmKbKn/yRMXgvh1wRFY45vVe20R5NS1VNSHFlfhin/AGIK19MlZ4tKaminBgmScQ6paPPZ6AHJKgyqH/sfBaI/ZOao0mLfBP8JxD0pwdFSv3fhAq5i0bFoQHERvNnCxy1p4BDEoLnViUEqz01k= X-Gm-Message-State: AOJu0Yxp9jgfg//eEZwrk02/N0Tij605X3g25sOgSFYaoSLIfJPgknPv DqM3jNgW27p2/REN1TA39xTepSekrDV/oGWGkfM6+pcAzQhBn390NpK4mpOC 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- 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 = -1; static int defx = 1024; static int defy = 768; +DRM_CLASSMAP_USE(drm_debug_classes); + module_param_named(modeset, bochs_modeset, int, 0444); MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting"); From patchwork Tue Jul 16 18:57:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735536 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BD02C41513 for ; Wed, 17 Jul 2024 15:01:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CC4510E222; Wed, 17 Jul 2024 15:01:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BPIeR3rW"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9946510E844; Tue, 16 Jul 2024 18:59:19 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-816d9285ebdso1261139f.0; 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=lists.freedesktop.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=BPIeR3rWK68sWLSMzXgfVzHEOQDHc2D+s9i5or/ljWms9NFkUqSLbXZEl3dAK4NFal mvYgUXef1fLstj5CfHhiz/2V5raY9Wl0+F8rumTrQz5ZSfgClNGyEYb66zmg9y8s44lK m/kH+4nf02dbhWZVAZD5TDHFMkDfJYARiE5f8QbrS9NEeZCQz+/S8LouaAunM7CwvU/0 MMmgR/zQ9QNb2jaIsSt3WlKmNf2KD6uIn0M4Wrbih7D7PvBu+mb5cAh2rx+1h9tWeDLF dyCdEsebulHn+5iK/hwcTgyq+bsATFyCGfu9t5ud07AQkDjK201ep/CDHkzV0js2++z9 esEw== 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=d0BPZL8nsbgaKaGz5tzqlvt8nusewoQzr4PBweLGjv9Sw2uc6LqFdHeQAlGdBnQ+lo OFNRnUiHWTOx/HpWDPhvuB6OZQCqSW0w7w8DsusYAPBWDYvFNBpIZ/kGPEUQJlQfjoAe i0qUN9wyuJpFI34qe0cIKQU6ZVH5BHR1BykfnX2SnfNkqRHw2aXqKVt1v1ot5baB4U64 5ZYY/XiGXW1Y3Hxj/wh4HIguZlh70Hp6Wwbvh3HA5KgBSHalg7UsY4/Od4TRZG4AATkP j/Mr2FZ+3hf9fF6RmoFT+KDl4kWg9+atHatKNFaYoz5+G3VERhUsU+Tt41b5vZGCbg+n vrdw== X-Forwarded-Encrypted: i=1; AJvYcCWFMazxP8+jlO1H/CYEoJ18v9XElYu+k1CRZrDSt+9M9APFlMrjheGKpjZ55VlC+M87Gh/4I+qCvgC5/fp7M1pyCW/4Fiwa1Le4+tPjkoBwYvG2f//PxraQLKEzkh8ivMhTgSugevsp/vJpmDk/0TuwRmS25kDi0zcpt0OMNS6xtRb3SU7JcktUSAWl/hTrLlKdzrkv+gTQs2qZC32BjuL+zLk9FUczc2v6jatP6Oy/FUwsq1c= X-Gm-Message-State: AOJu0YyP91pTXzcz9iWVE7bVJBqn2dC4Z3Yv0vKtDr80eE39OmO7hgqY yYfWj17FZ3QAQwSYmbWgJryvKcBoQj2AvMqlQ6US8DyY4IKRDa9p 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" etnaviv has 5 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs as well as plain-old pr_debug()s Signed-off-by: Jim Cromie --- 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/etnaviv/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" +DRM_CLASSMAP_USE(drm_debug_classes); + /* * DRM operations: */ From patchwork Tue Jul 16 18:57:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0575CC3DA4B for ; Wed, 17 Jul 2024 15:01:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 480AE10E201; Wed, 17 Jul 2024 15:01:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Jsj7VbcK"; dkim-atps=neutral Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF13310E845; Tue, 16 Jul 2024 18:59:20 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-8152f0c63c1so5470939f.1; 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=lists.freedesktop.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=Jsj7VbcK49i5QsdNLiXz+T/u0zxTLPlfNaMrhfGUcaqVadnbeXtLdv09bsf6XKjr99 YtIlRTbfLXFnP3TS0Jp/I1p7C/gtSrjQieLMt/oV1cq5ELAJExmgaDpgo2IbEa9QzfTP qhWyASCEbrwQokaJqo8czvXo/eC7nfIqd3BdePXnD2X99DD56GJWXoB3tDzIzH3iTOFb 8P4f8dFgsfuQa4tSdeO8reanIz+6ipxg0wApQlej9WkEFjWOc7cd9VCE10c9Un96fT48 DUNzQ3q3ZEQvDr5XMukzntq7CJPzb4cjrIkUQHdWzrb4MsF//sgLPYegN+gTQqRCWXqZ io3Q== 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=v1N0YhCfKON4gRSmjxjdbh4myLZ+U9QCU74EI4lb8Vg5WYo4oJYWzRwamdwoSp9Y3P eUsFl63hThX4ujNuOmdOqA8u2c7gGTexisFaywNJ/D0xkAsCC+YoxHhcQUJi3zT6O+2B bn/RnNTfjUxXn4BG52SY6hS2GMd4tGq3iV2B9ndd9XPHwnaLuRjD2UkhQ7KUFD6g7cV6 BjBmkDakz+i8HRj54S+lqA65TkQxjm86ImKUbHb3eefrAEPMwWqwnTz1G1HDlRtf/jkk QXcM8XP1VpA6P7c/976yr03pY/QYlZ7PDRajzz64ltSVJvjDd4GzsL60RFKf4yL+XRc6 bI9Q== X-Forwarded-Encrypted: i=1; AJvYcCWdOtPkWohyZyLIG9bgovlvoN6If6FUIE5DxcjjMBkiMDE9A8k1xjBgJDImyy3Te9UC2FiWgsUuLyFg2mhgqc8v8iAY4MiDQ4T7w0qYEemD1Y1ahcIy8sd1cx1gI1vmd6dqHKS9jcBcPn4QuUVr4BGOwBRIoOU5jh1No4eyOKoEiGJ8sL792e+1y+H2Ah0tEmBj4Pp+vUoMaEcUnRE3+6qoVc85HZ6y7voZVwob2izuFIqNWKM= X-Gm-Message-State: AOJu0YyDKDxwbSW7eHfLOBM4gb26ofa+he9hLekm5fKlzzYx7sJtEMWb hfoqVP0gSYPOYRGIKHzSj3BWy8xhld/szxPjPFQVoylMFU0H+iuf 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- 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); +DRM_CLASSMAP_USE(drm_debug_classes); + /* * The table below contains a mapping of the PCI vendor ID and the PCI Device ID * to the different groups of PowerVR 5-series chip designs From patchwork Tue Jul 16 18:57:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735547 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B558DC3DA60 for ; Wed, 17 Jul 2024 15:02:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0AFF310E23E; Wed, 17 Jul 2024 15:02:02 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hgacTuHl"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1B4110E845; Tue, 16 Jul 2024 18:59:21 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-80a2939265cso6227339f.3; Tue, 16 Jul 2024 11:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156361; x=1721761161; darn=lists.freedesktop.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=hgacTuHlcR1Yt7xD5nKRfkStgLBSBjJmrnB4DVub652Rq8MoRyf6v0qbvUbYFjzQ54 ZqTwF7MFq2NHEZC5yup+/XdxssBl8K5c6M2XKwl4kE9nf5BA8AXR2Ux9eZ0h+UWlKXGS BNnWoti0nLZ4v48cAw4a/MnSBn99k3yA+vnpxXm/ZmgFO3SipNC1qTJ2Jn3d9SFTXttA ZciAFqeaapIb9kgyBF+3BOeVaKoGiI1LlyHdkr/PoflWUD7vn2u4Aqr9m/0PFrSMKcPW lDyT2l0i29k5FMN1ivRlwesLKt8ruUHclYdYVhSUXcwm1M4FQzIwIlpNimxcdSapmMeb x8ew== 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=cHU2ciMIQe21XxKeozKCTluo+K4+CSQefP0b65Ko8JiDGejEt5Exj5TSbxHVtEmhfi blgpligEq6t6DjUdOMby9uRy37J4MG/Pptfz2RCb/AYiV/TZyl+hKn+5PN3kKThXiMTL vVSSP0OayYYHhiM8+cU05HA2Uob9Q5WpB52fukg8W4V3XqEQmBvn7V0uxdfYide3Fayh s8O8AdVnkvxZVOg8NjU1xPRr/rm5ukWI09rtg8bXHBANOSct4+C4V0T9e4jcXiqAlDxS Q4H/dXlKzGWoPdHsP9uX0pV1PpSSQTcBeFsxAEwSKjW2YFaj1YcTlO6SYnvGNJjQdyXh aDmg== X-Forwarded-Encrypted: i=1; AJvYcCXuXV2B3g0FrOXFoDSQX0bWyItl30r1ITiwoVeKBjSwY7npba6az6wGpBDTJnf8op3/ZQkqa/PRS8XfMS/lgZGnely+22J+gJU9mjw0JEWiXOQaK5fkNJQw+IKH6R2oW90l8JuQdKZoGFawOm965iS3uz/DctNU9RqrqNHvr9lQPkOV8EIv9eXkfsBR0P/XC/J/wF2nHK41eIAoyXtiN0CEceANbHO94eJAhHjrNjoN/WEX2b4= X-Gm-Message-State: AOJu0YyS5eJ9y3ID6TglixlJ0of4/MN4zwbqUvGwHFSL4Er0awlwxeGt mHKz1jy1eiYl7ptmrAmCxZc/Wl1KeEaHewymoDCuWMUBZug2BHVH 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" radeon has some DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg about its use of the class'd debugs. Signed-off-by: Jim Cromie --- 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/radeon_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 = 1; MODULE_PARM_DESC(cik_support, "CIK support (1 = enabled (default), 0 = disabled)"); module_param_named(cik_support, radeon_cik_support, int, 0444); +DRM_CLASSMAP_USE(drm_debug_classes); + static struct pci_device_id pciidlist[] = { radeon_PCI_IDS }; From patchwork Tue Jul 16 18:57:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735548 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A037FC3DA4B for ; Wed, 17 Jul 2024 15:02:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B605210E255; Wed, 17 Jul 2024 15:02:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dJKy8Hmy"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 36B8F10E845; Tue, 16 Jul 2024 18:59:23 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f99d50c1a6so8661139f.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=lists.freedesktop.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=dJKy8HmyoHgzhJiGDOBdbhOrDIgrcJ1n1agOAU5Ibu4wdSFdHvvZ78F7sQJakq5LlC 0Eo48cmbhwGb/r8xv4lQvyX3pwpMP0tc9l8G+1Kf7HVSvBXGizQ/VxMai03zv6N7RFd/ FqfMJziSbh9gkfW7thDdOnlvEwaQDJ8ltekdGzuih98rS99PvZ97ygM8DHicgBn5PZiS Y8iKcWy4YW9ju9OlayV4z2iXfaURYRCm/piefjpTTkHImXE2sFqmGgfe7U03XOF9FhSQ hDI78sUNpg31hL6Kuy1enJ8xsliWz6ubBFGYRdS5TYe1ohrAU8wFFzpmx3fqB7KPcvth duLA== 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=ZV9vmrN15Yhu4bSAFBseHwBKIVL8vK2KT/DAUUytEi5pbr0JW1ro8vxf8/Hhve00ke Utmh6l+Z8nrOEh3V/C/lFNn52lvdE+jiECmCnK6AOC4Etv5ZAiLVN2I40Ski6SIfGS2h BRz1T7RYc0dUeuIn4UEcx/M3FQGbWatGdqijfoXo9yq86bUwlAhj848ZBIUYYsOKfekh vnhp7xLQQhFhCb3jFR/nNqWsB6ZyhEx8wqCbYAg8Z3bhqM023JQ63+J4ZHKmqnHzJn4O sklJR1T1k1W5W2viMYWgkvp4AV9BtDgyo+B6ldg/7VysXRWiHMT7m27zD3dERz33okYP inUw== X-Forwarded-Encrypted: i=1; AJvYcCVzUCn5oNb6qSqnahkEYLj3jJt6lLpbuaAPxiej8+TWoek4RZuHUObu5Ff3/n5X1L66L4HUs4eTKQwkoYFzYLT0YLsYo3wPJTFQy1u7Fw3IbSWOtHQ/igdBkpqR/gkRY7ZihaG7WoHiAcMF0bkUTOOA8rDROW/6yQm7FeRkTdpAPx+PFhABl4s/4IvucVz0syUBowz5zGZUSwLFme7NqExVjPCcjDuBPbUk2k6pRQqxi8zXX4g= X-Gm-Message-State: AOJu0YyqGl3bw7pjZRLv8vghm0CzuKIoE9qbEnq9J7MaK5shong0V/oP 7cCjHgm7f0kP0JKIpe6OYsD3q2kP9joD7EqDxbNsDIsDMaJNjb2r 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The vmwgfx driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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/vmwgfx_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); +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"); From patchwork Tue Jul 16 18:57:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735562 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE09CC3DA42 for ; Wed, 17 Jul 2024 15:02:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B47410E283; Wed, 17 Jul 2024 15:02:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZQPub2WI"; dkim-atps=neutral Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0F68E10E844; Tue, 16 Jul 2024 18:59:25 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-7f97e794f34so4357039f.3; 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=lists.freedesktop.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=ZQPub2WIwsQH+ZDvvlFWSGAiobg1oXqNiaJWgE3UPMEUKD4hhDhjLKkMvMjHD2OJVP ZFf3gH1BATE3sjO6mEupKEjUrrbuzTYfSMHWZdizi+xaIXxTaksDdwF8OkEii8wirxIP 0d+yxwzY8gQo+87kkE2zndP35JUezj99QLQ4N7ADUiyTKp6lm3ezsJrNtJjcPYz+p1rA 93H+Ey4ljOmhzVnp9+4N8lUo3Je+37Bg7sVnMtxdKGfxU5j2nqVUnuyLYEu9B9y2Ls7G feoXWdlJqCPSAic0WlFHOIPF/M8sHiuPsfueNyFb2Puk7dhFRduP2HCu0sdOtg5EC+FW 6scg== 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=i5XCjE0YuSD0XJ7eazhG5ZEzjw3dCsxag6aSlu9nAdC/g93+/5pU/eRzgQpyaUDKtu jgacwfYvD35tImHTw2LHON/dIfhUFG2NLZGmHIt4CBBZIxrJyRZ+wC9r/5Euk+qUaAZG 4dhHKT4ue1CGzBtHS4PwzIgpG4OpnYLMALIddthVVMwFrBGE7nzBDfQFIWEfYshFbVn7 jrrclRmRnB9cLtrB6Sax59uh7rHuyt/C/jiTBS3LGXu1b74iTK7uNtlp/aNnHqr5mS1d KNoJXgPy//2GUlA7w2lrSQrLu8tKyjU7mwLN55T9Tpgs8Ynxw9f9JotZRBMnDnZKYZjJ DjcA== X-Forwarded-Encrypted: i=1; AJvYcCUB8ByQF1GxhBM1mUzve2odeNu96T89Q+vVgytmZQqTFuoqceYrTlHOziDD2PpNQYTZQCdroIRiT3PY+RLQ4m4LtzM2JwaZUsYnaIl77pmM804XzS2TItu6zRKP7b9Ohura/HLa5HUKGACW6lp8rdkmIcXd43KvEO3eaK4208DXuJW6B7ClIIHCrtDQcoeaUaYde+Cn66/QabpzRj8Am/aS1ECcItGLZJkZN0pvulFs3gawP5w= X-Gm-Message-State: AOJu0Yz6cDB/ZPcGQQgUy4bR9LaLeOxQLcDNFMNk1N1aLUaRDzrC68Dg w5hza+Nb2UPcMid4gTgmCYlzFg2Y8LGiFoh7IBU/DYsFfID6/R1f 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:16 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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_drv.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 @@ static struct vkms_config *default_config; +DRM_CLASSMAP_USE(drm_debug_classes); + static bool enable_cursor = true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); From patchwork Tue Jul 16 18:57:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735516 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30EB4C3DA61 for ; Wed, 17 Jul 2024 15:01:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F3FAE10E1D5; Wed, 17 Jul 2024 15:01:19 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LL7U5mG6"; dkim-atps=neutral Received: from mail-io1-f50.google.com (mail-io1-f50.google.com [209.85.166.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4164C10E841; Tue, 16 Jul 2024 18:59:26 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-8076708e8ffso5048839f.0; 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=lists.freedesktop.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=LL7U5mG6zEUZuSmYcrIK30HR60bqorOB5wdFy1+PFERL8lyH7hEFH3B2WqAI27Clu1 setCSf0Gb3S6pLJ7SJaeKlVmWMKJ829myVqRNCtjTfXQV2QF1GGyTlSb6AeaKmjvaCVc M00Aw+Ye1X2ZaCIPhAtNgQMGsBq+4tiX0w5imUar9Hc5LH23JYLSyUCSvlVguYjA410t /2L1N0mp7Vd/MTiWAKUmoNByVLSdSy4oYYENao3D2B0AT56hDUGDQZooP4Z5ss1/+oBW vS/rcxMSbgI3tBZxVe2Cyij61jlZKvyEbDC3Hm18fa01LLGv/V2RkbutwPGWAXj1r4uH WvvQ== 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=M6tIlyxMOB+hwHMaX5rJZfwbsoOcjUjqUr18xY0In0ux31w0luJEDHgi2RnvHJT972 ea+DaUMydOHK+Q1ZcqaCZZwnIwiMa0LRY/g0fSFu9qYCxuUG4o9G8/e2dRSt7F6uOhU/ gOC52Ldsho3NKxhno/xfwSXkQGcjo4Ff/EMoiGFWgXF8V9Hyoy75G3z240A399GxJ2me M7SNX6kirW4ERafw7n6QyrnvO/qyuxyUtXrhDozjr2h5/KYh9Je+0faIVIm0KtFhUC9i hchlDHSThK0zJVCfSKoPHxoBNTwJ1EjUlKA9/WZELFFh1bRu0Rh5hPQjqLBvExirkLU+ hJOQ== X-Forwarded-Encrypted: i=1; AJvYcCXJBv6DQ+P0PsPxIF/IcE4qgllJGOigdGWH8XIkAbB4QoLoEZ8Y7RI8e+NxQlF6ZjQFmiqb8R+tUor0vLTt/J0M0x8Ht7Nndt4w+dQGHD95OYWD+XV0miIVHx454wZXDoGlFO8JaCQM2zyJXqJEwlF9SV1cly7AiJFeiZ5T6TECMjSjdQdiiFcDIjVaaIBr47PXIdBV9gegDxByrM74slMh635lePWw3Q67QuFHxVcKCiawM4A= X-Gm-Message-State: AOJu0Yx6Nrn6JWw4sPUOyj9jZEyECTmwIKyOB+K5vc/1lsMwc1KTkm/x 5xoSz+F29aemWRux+Dq47RR7pbVLsYJP6c35kfSHPdpDyw5Vr7cd 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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 @@ #define NR_USB_REQUEST_CHANNEL 0x12 +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 From patchwork Tue Jul 16 18:58:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01634C3DA42 for ; Wed, 17 Jul 2024 15:01:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1348C10E21F; Wed, 17 Jul 2024 15:01:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="NeYo48qe"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA30010E845; Tue, 16 Jul 2024 18:59:27 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-80557928673so6067739f.2; 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=lists.freedesktop.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=NeYo48qeXvZb1rN4HdxWI4lKwm98RCi+k8EZ6nHkL1wOIDJ/ZFatphk1jiNCswo4In KO3keLvqT/qwFwqpPJe+jx8X4OAgfHZp42hbREB2AuIwAvINW+GM3Jbrr5SDdJ3Bk/Z6 JVYoxjU9VA5+GH4BBoawsODopZXthSCpyGO/dO+8e948zUP2jFHDml2xwFS80u23L/At 7weSAzQU4vF70s5sa6qpy4dzhdYYsvwMwf9Rgnnar9QQMEWMY8xml/HJP+5a8A7ZmkDU Y8ueoYdePsLuDEu6eq1ZkyzsES4fA6NnoQAp00qT4DXdcXqKzDoBppE6jNgBTsM0tPvI DK0g== 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=nEUsImSzyCPmgkS1wwUU5jWxwNovS6xt35dhEPXtTB8s1Med2EMnLiWk/RnEaDppbU LdZCe3Ap3Ndnls9kPZu3S9FB1LEdeYcxzYAUKMWoMfKGIVKtbKCfcZ4CAkCeZPAawssy w/DqA6F0dVW7raW158bW1oolDewTnVHltW1R60gN+hTpjzgZAc07aK6Alkvm1AOkFBCz tz62SvPQFkmcs6p4e3q9xZyKP+LPVJSkki+IzBA33tBfo0SjiuGFmeqSjMLUmsiMsnHl TOlhXBc6DEUn4WJrU+KGKvQ8eW9jcGKyBBu4K3XyXGk0r2bqumT56DhdrEzF2IVwi451 exzQ== X-Forwarded-Encrypted: i=1; AJvYcCVj7d3p0mJXvUFABZlP2sgpbUf2b199VMKMr12W3nSKrhPmtGrQ0oh3QFdQxgcvBwQo8UiyTZJffUPTAi4hgEjegGyn1wJ0zz/wt2Tguq7X5uPV0Ake3DmjTqL1kO2+roZpLpGb/fulsXOhFmhqrr0wsEII3h2zcWnciqTlBMJ5VkEEgSOo/Xd7n3dhAgLyXFPzf2bDB764PoiH13ezrhQNYGjcb0+xx467GdWj+ec5uIbXz9c= X-Gm-Message-State: AOJu0YxsupXDyzJow/nsJ5Dd/J+A3e6yOR5St4+BicOhQlJ/CalFN63V qLHEXlGzn6WKccKNwiXoDbLa3MOVRJ9+Rm8nQS6+6oXdGpgWDAND 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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/mgag200/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 = -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev = &pdev->dev; From patchwork Tue Jul 16 18:58:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735529 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 93A42C3DA61 for ; Wed, 17 Jul 2024 15:01:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6C6410E202; Wed, 17 Jul 2024 15:01:29 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JjGWFg7D"; dkim-atps=neutral Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2C5210E847; Tue, 16 Jul 2024 18:59:28 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-7f70a708f54so6578939f.3; Tue, 16 Jul 2024 11:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156368; x=1721761168; darn=lists.freedesktop.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=JjGWFg7DL1MCp72/hg3E5VkmidgQTDlQcf4pIujN9Y6XmVuG4cgG5KRYv/LbKaxmgI L72NbuqRPc9xfEu5AAA1DWvP4jPAL++tnJtp1kyBnFPPgPPkLh9J/UkQg75SjgAwkpbV Im3QVnR74j+bL4V+3Fi9EKU52KAjnDC421iXwM/N6LFa7YobKRjHCLK/WNcoXcC0M0bW 1n1bxghnJhk4HWmFaJyj7NdlT/VI1CGfZP4UGSj6ty4kncoqfKi06SHXfO8yhjje8436 MUJIX7Ri3eVtW875vW1iaXKMJKTpHpXlp8VMcT11T0jmTbR490KZBKY7L6jxTjyOKvzx Pn+Q== 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=n2rSF3G2oJ3qW84vFdiWlCmyNVyJ78afExSU/Gf+bENVeKZuVCKVj1tXHY5AN3nYyg ajz4BT00pdQTWv9fg8War3wX3+z+r7yStVJPg0n50miiOUVOUoCGJleQ3c8ipyu67BfW jcIf+ERzvd/UdmMv55C2uxv31n+YogLodMkVvIJDjT21MXXP24uIzvHNp3nbNmLFc01j cQ8ff29QPVscOfA4sdRSR3ZqaqHaxKP/U+4GErLFz2ekmTe1xe4nZmQ32lImrrDt0nut BLCjfP0p199AzM0sw9xF3nLBjuIKKCJrtQW0i5aRtGn9L06vn6sey8c8me5XPaEbzF+S dxcQ== X-Forwarded-Encrypted: i=1; AJvYcCXoE4sAi+kqbjWdBUvUh0gXGt95dPeC9bnAAecgmbgDQ4+jnn9rxclZDQaPh+nqrezM9xaIjOVpMcWlm6WLygvUn6Fwy9+X8XhM516oN2CoUcVwCCEq3OVacfRGImSnBxkeaRhpJCO3Rh0m46jZjZ3lSK9RkRHEcLZSd47vCeAEHdCeZ+4S6joftRlPloZ4UOd2zlaLnufDsVAadBNzj9yktZxNfI7paRkdxP2v1gVyxPp52xM= X-Gm-Message-State: AOJu0Ywf8UcAoZ11uscVe6P+ATVX++gbZUhVP6HetuiOhafsiGu4zZcm UVs7WADa72mYS1Wg5hmzo1wU0+yy6/tzwWGzrKuHeAczuGGwd10b 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:16 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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 @@ #include "gud_internal.h" +DRM_CLASSMAP_USE(drm_debug_classes); + /* Only used internally */ static const struct drm_format_info gud_drm_format_r1 = { .format = GUD_DRM_FORMAT_R1, From patchwork Tue Jul 16 18:58:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CA00DC3DA4B for ; Wed, 17 Jul 2024 15:01:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 065F910E224; Wed, 17 Jul 2024 15:01:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="bc5St8RB"; dkim-atps=neutral Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id F1CA210E851; Tue, 16 Jul 2024 18:59:29 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-7fb93b2e2a3so4708539f.1; 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=1721156369; x=1721761169; darn=lists.freedesktop.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=bc5St8RB8xqnl3ER1XRjDv7ZSkDW9jhv6udCD/C7oFXvP3uZuXGITU93VzSUD4QuT5 opszjD/3VfBGRsL5YqM+AMUUF1V+GSdYt0LD3XhVUeR+FwNs8XFM7pxCcEIEoAS08Tcf cerHs2PxhH5UshqUvdBIe9cwe67HXPP05rsSdzYAQlVTVidVyFVlL98pMzEEmCTU9b1w n0ue3Z8BC77jpuDsbwDIE2XkCWUDiz79ZU+Q29EXL0crCZmJUeG0kQHQZog6sO6Xh+oW N3c1lxeGZsh10QA0QoS4rzsEWAQLNm781wAdbIPHArB2+rFxJurQPnWlYQrfy9ec6ap6 PsIg== 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=auaUCjSbiylbftlRJX1RqKnnSWI1/X3pTeFU5K0FkIH9oS7CHpL51Dp4S8B6kfCbC1 pKg6Z7Ozh1hAnqHbLoKlIVCrDkcCsRpXHoXAcg8K+BaqGj61fCdx+djzA559j660u4UB jjBCIKGxd3E72yXx5mjvo2SQlF6LU5AVHqvvCIQYQuHFum+yHiEzBhBjSYGaBFGOPI+D JH8Fdr1N0CubaLuuTK7qnmGpkVGshbrWM79dA08/Z0NZt2cq+5J8ppRy+blZEqmZjnTf YYbTCsENrTilJXPc8iskwkfkuhyqUMOHHdjy8Gr2h2LnYJhRuv0xhigAFpLIE6PeVh1F AGyw== X-Forwarded-Encrypted: i=1; AJvYcCUV1BkpJR89v0E0weh8k5k687JezMIUKm9Y1F7qzgxhDZZGOmj/1pA3/DnUF82rsN9Zfja4kI32+SFZBvWjmHFcSaiW8+/C2RZwj8p+ClmzDwZ6nmsw7kJTQC7Va/BwSVvLTAiaJeMkrTSANcN7zblyqx64C1yWJZbMrgPdLkYAT/D29UscSfpmVJfq6ULrfqXjfHy6LmStZpEr3YnJYXoibhOgpnN2VU+HC5wxoQ64YDbfml0= X-Gm-Message-State: AOJu0YzC4Nl/trb7k9HrRpSrCBfwwWPUZ1foloVpoce+O9oSursWQ6RK 4gvEz2QwLZMZ8lnsKA9BXtUseXeu6/Wy9MexTIfuxh7QqKaoTY+u 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:16 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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); +DRM_CLASSMAP_USE(drm_debug_classes); + static struct drm_driver qxl_driver; static struct pci_driver qxl_pci_driver; From patchwork Tue Jul 16 18:58:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735538 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C5822C3DA60 for ; Wed, 17 Jul 2024 15:01:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B70AF10E226; Wed, 17 Jul 2024 15:01:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cGOEo7qy"; dkim-atps=neutral Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3944810E845; Tue, 16 Jul 2024 18:59:31 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-80a2939265cso6233539f.3; 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=lists.freedesktop.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=cGOEo7qy0Iee4aSduEpKXyiai24aqo/958FG7PCTGDYZePJiFhAfVSm7s4PmZIW0W8 Sx0j0JezrYYKl12cGge1TUd9ACywTV1+dPEVLKE/9NM9apOASmT2TEfG4qd0ki5f9Zn+ 9hsKoaIRduP+0LtVOCSVtiCQf7PWWLApXsIVgopVAUK/yc1kP+Tv7OeBYginLA6+pXPz qImh05qAQJx0up9tPyAS7CYkbKipr6e7kHXZDLE9DYMt11vZdPsnAH6ekVwfdZ1SqgJH GshkDj9FYbVJL+IyH7FEwDZXO9B87ENMLl14t6CJZHgOKUePXNp3Hc9MMiGr3TJ7XXyn TMaw== 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=PbxOe+7VWeSm2qObVZH8Nbu2LLhZhBF8o8W4QKlP32mGk19jqpt30SZLJQC+p2ohRG oz0CTUoZiYnsK9qQG0M2GSPMFIjuTQYFewywPDdfQYaOKua0lBmSF+K/LW1IHckWUTDx nRL0Oa8XanENjrzb8crUmW69JCmOOutRgMBX/AqHzKIS4ONTd1INS8tBCbDvos8KFzlH ZrZWDmSZO2wGhcTmkuFq3OsBneihMa7AKMi6GBreNiJ/kJaJ4ATeJO+c+fLQ1c8lXFPN KPR63uN1Nq5WOUkdRkXzHbR9P9eESb9AS+rSaofWFQX9gVuT+aFJDIjzMXuxTru6MZml XkUw== X-Forwarded-Encrypted: i=1; AJvYcCUYgv43l1hb3qzoUliU7yRnNKZgs4811hZUhidbf1dZTsMkB33VWpnexlXeTLtI3z4y97bEzfV0tCvUN+GcwUsFlzOgYBScvrvOB6uu/Nxc4izx4vSeMzWPEyiWTyCdKyImJwbO6WwAaXvAG/aSRmZVnLnEGEv53c9EUHyPtHO985gooi6Q6qVH/3HfQMBxVYcUjm3+GsY3I8g9sof3jS9FQiHuirtZfNO9W15x0gy7zr0aXmA= X-Gm-Message-State: AOJu0YyyZOCkmrYOD4w81sd6rOOfp43lNavwo81h966tWpaGJI7nFFFE rVeADibxTqneF7hVzGL/h3mksYgBBMef3TS+CeJlgFWT4bz6u62p 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=y by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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_gem_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 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_IMPORT_NS(DMA_BUF); /** From patchwork Tue Jul 16 18:58:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735557 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C3C5C3DA61 for ; Wed, 17 Jul 2024 15:02:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 00E7110E274; Wed, 17 Jul 2024 15:02:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ET9UCIJl"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 567E010E845; Tue, 16 Jul 2024 18:59:32 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-7f99d50c1a6so8672639f.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=lists.freedesktop.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=ET9UCIJl5QUa40vE1g4O7e/yrVSKC3yjAy/HF6GcFr4/dmZluPxi7saTX3qYo+2tSh giHUKTa9xO0d6ChAXE3evKCNSttdeA/Gl2LD7Vn63ZLyFn71A4rgtlr/Lrc/G/HobHZt 7ja0l1A135YSgcX00GJuSi6mJDKMO45p4TUvu9EiGbQeCvrCLjSu2v659DFrizat5FXX BY92f7Q+/gnooa121N/k2Q3j9WUvZFh6DZBY/an47qApMnaeUaLA7xdEhJUywWJNhIQT gc2FNzQS/yyIRriukZ0hQ0aKBNEWMX8APB2jRmZ4FmDlubwOh80eqG/k10+25dGV2bbM WNmw== 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=RHbQ3ZEOqWpgjov7UtBgRp8pdT7tXeXZ0+nnPEpizruqis7wsRKgUiJ7b7Us5Z1m+a F+nxYA7ouYa1cX0QJ2rIgu8HRi4eQts53neUJAddL1PIB7DOUrD/ZY5/MZDKYQCtTzwH cAbaZowfeGwKczlG0Es1gcHxe1iTUeUWgGsInNYgoOfqS3NEli17UJ9B5gVtjdnP0u9/ oDmcSnKZWpTrcQBd9FuKQI4f52PVsh7NamLmIWFs0qYDK3ufzGI8ur+nd0NC9TGxZ9cy gnrjF80tbGEb86DmmOK+ZbBQZVL13y9xdGe3kxSIfV0LnVcujVXUVUk8WvR6bTRiE0EY Yz9Q== X-Forwarded-Encrypted: i=1; AJvYcCUMHDc5O4qwKi9sY+8qY0R513fVD1LdF6d+/b6LgHfS9IfXrqtF/ThIaGnEzi02Ypq/yv6KGSmYKpGmWQ0zMtmV6h5k7cR/E4s+ZIBiZ54TlgY935Vjh5mWKDgTmeAtlY4s83KGAVHA/Jo2H8Sl0cF9dXydebp3iDQ0N3nb/vfvmM3MlZbZJFoMKlR7KMEBA87xyMVKVxKCo6iEsAJLhycBGFZIAOgd86661MYjvpXcSlFbCm0= X-Gm-Message-State: AOJu0YyOvgpWJ+rvMyrjq/+OU5BlUjAkm26G6PmDVlX+KbblsMF9vug9 41jU9hK0br9KBxm9ZGBkXimHbt9skmHZxrsXzHNqWeGrieDeR+dm 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:15 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" end of official submission. Time for some quality CI Signed-off-by: Jim Cromie --- 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 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 From patchwork Tue Jul 16 18:58:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BF26C3DA61 for ; Wed, 17 Jul 2024 15:01:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3227E10E20A; Wed, 17 Jul 2024 15:01:32 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="esE2N+ZB"; dkim-atps=neutral Received: from mail-io1-f51.google.com (mail-io1-f51.google.com [209.85.166.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9614110E844; Tue, 16 Jul 2024 18:59:33 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-8036ce660e5so6279739f.1; 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=lists.freedesktop.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=esE2N+ZBjMzyLkYgsrZ9SZH9Lf26A2IyUyzqj+1WccOUg92THGUt4j28LiYjOQgGUO z08jgXsvGYmCy4p9FWmaTQnGym2VM/wf31Hpa24P55y9yyhSkBP+IIeOt6sfDjDA1lu6 byzaRe52ty3zQipZoKmdwhOAD0D8ATcYij7IDnbn3HN/B6b8QAz2bhE1UueXZURaHSQK 6xOI3X71bM/eZUoxTrDEhSgcYRWTPpqwLNSqDXDwtLHceLaB1WfOgSMxQdhVrO9ACCrI HpHQUZAWr0qgIXN8IkMsPbLxwbSrDkaqxRxsUP836hg5ukB69B0YfzC/UDE4wvXiu5p8 qImw== 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=VgAdgeG6oZHFUvSQSezbzxIsj0v+q6731LmBLUZmgyG7wheriyqTnsDp6DXOd/YrZ4 nquCqRDVW/Ibfvi/H+NfG1zj+kXbWOca6rT4OJ2uzzwCkB/LbxECtabxA1NBrQr/xvJG cfatoAUQU5LkUKbYjyQSI2nYD3wFE1g0xK/URXSYBrsFGkrXntvBtStv6veEe6z3PDNi f/jVeZ8tobqkF0YoNpd2HBHSZmxUQFa/QWbJeGhdHcMxJFMKW4uSjmlicaqYVncnoJRk ELbP2qlzrhvbg0c5UMrL2mGO6Gy7SCz4JraDytWowMnb6hPX942EIAG46GNN+7uE/oQa 7obA== X-Forwarded-Encrypted: i=1; AJvYcCWpBEFAiNahMYIIKjtcmHOMpUX3Gb5IaWSNHvecLwQo1YtowvcKtWYaRKginUQgl4VST7DhTs5ZIFOxu0Ubat4/Xi2SSuoV5HNEWTUIkSQZXCzBr30BwN2b96ZNMnJRmETvxY6/ghd3QcDIk1mQIOXdUVu5L0oKPRL9Uwxk9R1otJVqXjRWL6Gb7r/Wu/zKdNF49Xgg2KQuiBbBzXdVQAlA/Sg9zNOY+J534lduSuUJKlHGn6Y= X-Gm-Message-State: AOJu0Yxl28h0AUQdvCd7gn2+hp4kxp6+XtnLf8z+VIKH2K3VYRfSISke vESOa4bfhHwNLmPUZ0zsy0j2tv6/GKAqC3skvcF4LYAiKA5V5TQ8Ft+0JsvA 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:16 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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[] = { __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 --- 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; }; +/* + * 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 use. - * @_type: enum ddebug_class_map_type, chooses bits/verbose, numeric/names. - * @_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 space + * @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[] = { __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 { }; /** - * DYNDBG_CLASSMAP_PARAM - wrap a dyndbg-classmap with a controlling sys-param - * @_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) /** - * DYNDBG_CLASSMAP_PARAM_REF - wrap a dyndbg-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 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) From patchwork Tue Jul 16 18:58:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13735539 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 80EFDC3DA42 for ; Wed, 17 Jul 2024 15:01:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED58210E232; Wed, 17 Jul 2024 15:01:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="HTHPzqPq"; dkim-atps=neutral Received: from mail-io1-f46.google.com (mail-io1-f46.google.com [209.85.166.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id BAAAF10E841; Tue, 16 Jul 2024 18:59:34 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-7f70a708f54so6584139f.3; 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=lists.freedesktop.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=HTHPzqPq+4ko6CRDqc5KGGx9IfaOE+I7SKV/lti/ZKc/jaUS4xHepzZHymfE+qNdo8 oDCDrRo31Xm7LTaQtN6H6DX/6EcJPRl475h9368yW8jtPcy7k2nYDogrKJTZb4JoHokd NE6gm906Ch9g6rl4K+b5a00iDheLqEjz7uQarnfWgGLSwJEAitmssz6m+ftPTT3gjs0R ukdtnNasdshybU8NZQxZTXSf/EmXrfoGEi+ZiuZK++Z542uYGr/qgWA0JHEbXdEtniE9 jCwXnZQ7h6ouhzRllJofWb5VNXiPCYQBwwIicajAhWECFm0dZi9S1+J6+HY1dKi6Dm4n 8ARA== 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=LU6KBLRc5BbfjEdqW8rAUkcXN82mJ/lHPZJxBmGEVxmi/C5yST0/Mc4ACjRxN2QFHF 77Y2dMbZbT0BESSJMDznx4ZF9b7hry3jIPIxZHy/gcRJBQph4ftWUoUvjjqgIpEWAN0b l7rertgA4nRSs1aqG8hy7tVSKBzGiCxnwByogkl/CGmEv8Z0Z9dOx90xbTbOQ5CxPnCf t9aAytUqVhdlenLCjy9HULRmYcfqqTC1jkWT32pY8mbYXMYMChgKo0QCdiAWp7nifGy/ 5mfqIdYjkwlF1zgb3qHTHNty6yWd7DcmiQZLjTQjFxmnL3aOAAf4eUGoYtUpnc90uzv+ la/Q== X-Forwarded-Encrypted: i=1; AJvYcCWF8zQRaIldkH/2bzeSldeq2Pu4KrcmClP2wYWHcKRXBU0oR6UxbsN68DCQRte1WqZYe9Tjf/30C1ihH8RsbVNNzgQTIfDoE6UsZB/UcwfWfHNiniTQkhJVBBvptYdvlDYuELYhqQHCzACdXJyfJwfpFzsRj4ha7WDVvNHjG9zXqc5nRydIDhUwdbz389VROW5cWohGGQzT8Fz75wfyPh0AiI42NFDmQSehjS4MM3us2vC/s+0= X-Gm-Message-State: AOJu0YxoGjWSYBt4/DSPYm4q37wRFwkFx/jpv5Rzmx7Pu/hwijjIID6W tlOZ33XbLoqlUhqiuIhJ1AU/nxVjfKKgmW7ZqaB+G9bK4Jd+qAuE 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> MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 17 Jul 2024 15:01:14 +0000 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 --- .../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/Documentation/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 ======================= -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): - # 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 +Or the legacy/normal (convenient) way: -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 Dynamic Debug Classmap API ========================== -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. +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 === 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. -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). -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. There are 2 types of classmaps: @@ -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. -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". Modules or module-groups (drm & drivers) can define multiple classmaps, as long as they share the limited 0..62 per-module-group