From patchwork Sat Jan 25 06:45:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950794 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 D4D51C0219C for ; Sun, 26 Jan 2025 16:40:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B075A10E46E; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="SHTw7X2D"; dkim-atps=neutral Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id 549CE10E120; Sat, 25 Jan 2025 06:46:38 +0000 (UTC) Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3ce873818a3so24590735ab.1; Fri, 24 Jan 2025 22:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787597; x=1738392397; 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=AU/BJVCrYw/L98CqP4xWM6IdTrod6CaHL5wpnn7zk9I=; b=SHTw7X2DXqBHpSIX/O5EttJP7Ntw6RLuDvFAy4g4NZAWRzFFKw9mucp+10xW92MmNW ZnCpoM/jmOW4iV8W6gAefSboR6HvBUmK3uuduwhnU3NWsBjQXdnFQKctHdcC4Jd3969h E3cyoNnky44dfYWhR6tb8cb8FlLVAPqGr30lAYSAeV06QyFo9BYlHgZF26dZmK9VzN2f I2ma5DmhmQims8DfGw/I2v40OGsdbFSYxiKdWfCPButVhX1Qdjr3paeWf+KdwQz7W/P9 8U77xAK9QgCFNwq6b9Rk64bgNKlJpVdzj4CeNge4oYmIKp+42d5YbPYmk/ElSNR0HpZI QeXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787597; x=1738392397; 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=AU/BJVCrYw/L98CqP4xWM6IdTrod6CaHL5wpnn7zk9I=; b=fdS5ow2Ermji9CwQD1v2J6dRegg5SRBCkoovRb24EoFWfWD+sNjL8JWm8v+G4m/Tkl yDP5ygaqlpzZigiA4w/+bP+hiOmaxhl1jhNc6Qs8EOHvY3edhQR4Sju2noqPFs4oIiyv KL55zBcKij21vvL+gFnz7UCZu4ME0Qc/WTiU7pDEZfuoAfa/btnBRXQ+aCdlQHPOj170 1HtL6Sa0oW+cwFrwUs2tXJeQq5wwRM2G6loyo0E7MHoW2b4q+eme+LUtyKJI7ZV0yZAD MhAJQoo1Th6HhBBcP5CMxOekZyfw0ygHe5w4ExNtX2nQ6xsj5pou/PPapuLNrFjbIno9 2xyw== X-Forwarded-Encrypted: i=1; AJvYcCWSkQLSJeZ+UpLBYt6XO/HFuUkVa3HsuALtkHYflgw2onEkFy9I1O45ZSfoegvHIVviJfDv4Jv9@lists.freedesktop.org, AJvYcCWTUOOh0jq5lgxueNm7bSvpbQJUgEV8Chu1ElWfFAxZiSGDY18wabMvrHaKAIjlZmhzPyecQAA1L3MO@lists.freedesktop.org, AJvYcCWuKGX5QOqtQj0RBFQUSiGeX1ySjn2dR4Cwiswm6hzR382GyVmgcdxGOBDIW3QD+ti4aE6EtIMjcMd6@lists.freedesktop.org, AJvYcCXvWpFE8D4WQ3Igj5u0duZcLmvk/mlzIN3KloUMBzbLzKb8pztrmAT+n4XA5HqZ0sLllvJ7osf5bm4DsPOhaQ==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yykl2bXh+6xoGfC5Y4h8KGPW1HoG//6Isopi8ksf104CNDYTIiz rhFUVXuYtj8/HH8qTp1PcbP9Qi2CGRuPUTr/OvnvAAPCSDQljius X-Gm-Gg: ASbGnctr0RCysA5XS+OkmhSuM3kiZA+kFw9Xg53O3YKz+5XsW9ZXVZYfc3e3Mzf3TdP TtCJ+/O2LGCtIfhD5kQdn5IkZS20QpzyGqXCX8ZqwM6OH9KYXLqffMjO/910727sriYr5INQHCT 2XooGn0wam9xtb3AvvHnk79Gf1I5ENbgeejGkifP41sAQ1fOC+HrWpe2xIXbPjg/48WDbNCWzlY Ge0xhJoX8JASEM1uN9mQRhU6jbUwPf8ZbC2ZYyHugVdQQWu5En15f2vBGe5cVn+iXsQ3tGbgbk8 /Exyn8c9lFI7C6GoXOz01P8pIRYjXZ9Nvovh5Q== X-Google-Smtp-Source: AGHT+IGGQmsmMU4LyFcc13bApx7ltT6qUdG974W1OcN8PUVNTeEuTSdgnGp/+eHsAuANJUqP1kdN+Q== X-Received: by 2002:a05:6e02:1fe2:b0:3a7:88f2:cfa9 with SMTP id e9e14a558f8ab-3cf744386c6mr233064305ab.11.1737787597495; Fri, 24 Jan 2025 22:46:37 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:37 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 01/63] docs/dyndbg: update examples \012 to \n Date: Fri, 24 Jan 2025 23:45:15 -0700 Message-ID: <20250125064619.8305-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 7c036590cd07..691e0f7d4de1 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -57,12 +57,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 Sat Jan 25 06:45:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950758 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 76653C02190 for ; Sun, 26 Jan 2025 16:40:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 90B5C10E44A; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EJMpl8mK"; dkim-atps=neutral Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) by gabe.freedesktop.org (Postfix) with ESMTPS id 560F110E27A; Sat, 25 Jan 2025 06:46:39 +0000 (UTC) Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-3cfc8a2415fso5390025ab.2; Fri, 24 Jan 2025 22:46:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787598; x=1738392398; 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=Ft3kaHf3s63Qx64Oiqt5pWkoJOlyyMIiN2I4om5s3ck=; b=EJMpl8mK1q/x7xI91ilSQyMbwcg/zp8KnXALvJPeXdVUWuvNjJB2a9e9lvYtbw/hNv vcA4NYI7s+kr+sAD5EphyiK5ZjLnfls2krBQiyA08wDZvzHp+Zj4V9mO9+yRvyHJO/hl WF1s+LekPBrb/Raum9RZeD13PKX4H9K5KBWrSwIETENKVi5jceIZxXcVmeZY8fF6S4iu imzg8Hx50O9ARbBTBbODCBPPoGW3KERebXHtI2XN80tVbHpRrAgqWCu0wgcFWAnxQ1LV 2pQQ+jA2oX+mJTlag/5+o86HpaGDnD4tg2VYu3YT6SZwuCwlKw+thH76WADgRX3mNfNL dPTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787598; x=1738392398; 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=Ft3kaHf3s63Qx64Oiqt5pWkoJOlyyMIiN2I4om5s3ck=; b=nj4p6pyQ1cZABJinobhxczZ0xssbBz4v0UadOoZr3GmOZWvrKsc9k6KgnylcghoQ4m XJlJu5TluPBbC7cAQMTe/in2jXUjwVv+juFCwBa5/ZUETOn2QlrKBs8wdn1xlaNdB5SS ljMQpfypaIzFNY3zd/4cS55DY18HTJfhiz0kZKzcd0LzxyhqTdjTr69ud89KdhtHknnN w4KLkBC8y17WL7/o9SyDa/PO35a9/g53KM/z7rAqEYnRJLEftvNfEUzdFwepBvNJRcqs AUbn8AVbYMUybfp0jx1KvTq5Nz171W1Wqq203gsmfEGFdlZkiB+a1fLdn+e96r/csQgj HJZg== X-Forwarded-Encrypted: i=1; AJvYcCUVsZbNuPzvsP5vw8MWojB8lmHIwDGT5DWXf5xwbjdIwEJz4iLYrLuIEbzd0PiXWdyqf660Gs4+@lists.freedesktop.org, AJvYcCUu7Q13WrYINITVlWBA8DyVious53C4/sslxy1GGtnrKWBUKQ2vMt38MFWrH77pHrdceLZlalSk8srx@lists.freedesktop.org, AJvYcCVwGkA+Dlp0NyK0CD/yr8pSxjEC+qPJ+iIV00/3LmqLJ+QxeEX3AGiJBP2ECMRctARcieanPIkIMmbdgsdOsg==@lists.freedesktop.org, AJvYcCWLj2y28uEqulhRZqcdOw92/JF2dR6Pa5fMECxgaluDBgpp0F8l6gGAL7UQPwbnxtA6s1Jh+R9pFRDP@lists.freedesktop.org X-Gm-Message-State: AOJu0Yw+y9HzQzIUL98V3BwBT60Z7smy0DqrAEt7e1HalYmwIcZxh4ub MMT02e4apjrsgYv+Hy2VYoDIvATWqGvPpTlce4OkDW4igsp9SASA X-Gm-Gg: ASbGncte/k926EytsbiQZMutH4newhIS7SZCYL0EWp52+NVkiSM6CMC00T6DbkULXny 4uQ+DIiojGlvUpjwFBIIxzXf1W07exog32bhqpvSHR2040ZkXlSWMhge4W1wZWxLUyCtrVyl3gQ Grqgm00CvGGPgfRin+ttNe/fQ+3kU717mfEmKeUgAp/qIExq+JUcYtwvH0ko+okAdz8xJQGAtvU behsxD/SGGMLrbZjK1o7B0aS4r1TMkc294y0LKLDMbeBvcAjObAlW7JcAGRg4X3w/qRkfk++GWE D8ogNjKvPNPnM87wEbhR5HeSYS1uf1X0SBaRDw== X-Google-Smtp-Source: AGHT+IHVQ3SPCoXjVUywLVkrU9R+6hMn47R/0EYJi/tmo6RYCSpS/s01/z4ThGKSbkXCoFQMv2RC9Q== X-Received: by 2002:a5d:9f04:0:b0:851:f176:9827 with SMTP id ca18e2360f4ac-851f1769e4cmr1422016139f.5.1737787598471; Fri, 24 Jan 2025 22:46:38 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:38 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 02/63] test-dyndbg: fixup CLASSMAP usage error Date: Fri, 24 Jan 2025 23:45:16 -0700 Message-ID: <20250125064619.8305-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 77c2a669b6af..396144cf351b 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 Sat Jan 25 06:45:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950754 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 7B85FC02191 for ; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 429D210E448; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y+3x+eGk"; 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 3F2B010E296; Sat, 25 Jan 2025 06:46:40 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-84cdacbc3dbso225254239f.2; Fri, 24 Jan 2025 22:46:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787599; x=1738392399; 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=lC0bEfQkqUFUX2DEnhyRE7tZ3eJxkUlfRX/DOTIhCKw=; b=Y+3x+eGkp99FB/yz0zHWN+OkQXswDhWBl552D1lpxGTFQaGWjb6nt4VjKLKjDlNMXg o33kggs79qn0ziLDhkssS2J5yJ/TYSeEJA+R8UFiqOpu8I3//k7HeK0X1Sz5FwvXTfPW pnDt9Bu08fLq8CT/3VB9NoIUbCN9kgw1m5W67iJ1Abp/cdt9IC1rAl9Cw48xr/xPvoR/ 9/aRorSlAMkDUS8ExL3tGZk1uVT+SWCc71p1RekJvqimIsXnIzfJ4FOS0WYAAmbDfeqm pg9ginR/MQaNG5paYET6MniXvMXE3j8s/Vurw0cY56sZkzClLxEX7PIxd6TayUugG79H pdxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787599; x=1738392399; 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=lC0bEfQkqUFUX2DEnhyRE7tZ3eJxkUlfRX/DOTIhCKw=; b=qS4MBDRoWHc57juyNqiF2PJ58P7U0DliSVKNDPNByD8gPLbi/CJbYKCJcYu9sIkHTL CoEJHp190cJ4p2HhxEokBiSWn8p1unf2LS0pcJOsV7c6QbjS1FlLtC9DAyP2lbUigoND CCaVb6EkjOgSWZWUz9rT1Yjz2tpgSfSiu6JZRvHM1JcbWYyOAV7xcSrWJpg7+eo+D2cO bCr2LCtMntsuTicqDJaZxAsxhT4C6JZ+0YQlPFvhfv8ARyLT7awImHIU7uOL9WcA62y8 aldJam7H3hWs1shdxO+RZaQfGqzM5tyKjcQAUWKu98rfKOuOmEugPflevXX6Msm+5lQ3 +Y+g== X-Forwarded-Encrypted: i=1; AJvYcCU8f+1a9UjHqCl37kNQ9XjKlN+tlE0wweGlzQCgMGG33DUpAE5STFRH9r1rXc1x/fKl0h2+LWypVs+a@lists.freedesktop.org, AJvYcCUPVB9PaCg8INSWkVCYVl/1K4Ikx5Q5T7ELfTpn38aPyiYDli/syvjcy+XAjSSohaf2v7NG+vbWqp+FNcccSw==@lists.freedesktop.org, AJvYcCVVWTFhsVUf2VibROhsYKAK9Tr++4WPgZ/WXoredXPJJUtFvpbpjNwZUkjY72IZx2TFJe5lB2f9gyEC@lists.freedesktop.org, AJvYcCWdMpm3eZqwoQyuXwc+kWalexW2+3d5Wed2a/xhZlwAyJYb9tONru6Yu8DSaQ6sBjqqn/Wi0AZp@lists.freedesktop.org X-Gm-Message-State: AOJu0YzkhcVOyTDLwhAjs/rm83u4c4TECrDsnecNDethp+HGtT8d9myO 3jafQQqZbYFLIuRP0xUkqlcI6E+4vrEC2h4lshxMkIYNi9RBCD0e X-Gm-Gg: ASbGncukvLxO3MaNAe31Ur0r5JrITnaP0WTA7FrHMivU3vNtY5Tdas7z67ZJPMxNEp8 IUPOfCxDjLyx1gIC5peddOlU2l5TKTuBYpfRbHI1SDS2qVOs0v9COtsrgcCbyKcSzEL2NSbnYZT X2c4UEaqrSngCDb6jJCFgx3/wJbAcyaD0+HTZN3Y6ES/QQ0TMFmzoseXjqsYS4a3wW2r3WHtJdu 7qFP43iHbPZ0fy2BxYnhQBh6uylBPclyuPNCsxnRVyIHV7hxiNZ+ZSM8s48hIrSI96/aJvOwJGV p706E1Ro13p00cz8V3yKnZUKGciIzuBrm0TUGA== X-Google-Smtp-Source: AGHT+IGCJkMDi6QJz04QzrJP+6InsJu9u2vONXpHhIfvz9GYsm9WZO74SuyY8vqfLEAfr6A647uPAQ== X-Received: by 2002:a05:6602:488d:b0:849:a2bb:ffdd with SMTP id ca18e2360f4ac-851b618abd4mr3617977939f.4.1737787599462; Fri, 24 Jan 2025 22:46:39 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:39 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 03/63] dyndbg: reword "class unknown," to "class:_UNKNOWN_" Date: Fri, 24 Jan 2025 23:45:17 -0700 Message-ID: <20250125064619.8305-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 5a007952f7f2..147540c57154 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_putc(m, '\n'); From patchwork Sat Jan 25 06:45:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950759 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 52865C02191 for ; Sun, 26 Jan 2025 16:40:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C13B910E443; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Z2O8vyM7"; 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 65D1410E299; Sat, 25 Jan 2025 06:46:41 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-84a1ce51187so77809639f.1; Fri, 24 Jan 2025 22:46:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787600; x=1738392400; 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=g9s7OD1sQ4+HufNRNHWDoATH13uKXMFeEAmrzFZExds=; b=Z2O8vyM70V/E+CNGvE2Z5t8pbaRy7dbMK42QbId9OQWSuI5PKwvWCPV+9MMWUu98qj IpAdfqGmXnbFyt2visvrb8+9smAW0rm/ML/zWLOXKVPWRTdcXJiil94Y1lq+KXAABilp rEnA+03HqRXYNoALw5+IBv7yrYkEDxgUTROO5V24cxgXKgkt12pfCGufP7Q0Bqt8wvXd h6YAc3n0wHZY9EAKQ+PeKYlKHOVXAP38WOlBap1Afr4ID0EO8f6OpZEO1U50IIg75iDL bYEHbsE3QkgQfCy3hFluuSozFyUJaaGaNjcU1rKB08WKKgz4/vVqphpry2ziut53EWyU V89A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787600; x=1738392400; 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=g9s7OD1sQ4+HufNRNHWDoATH13uKXMFeEAmrzFZExds=; b=a4WkYGKwzWCBRJGJ7qK8w2pBBxxuZ/+ho7Ym/br9arEVDbabFMPOKs3iu1ltPLkhWK VwFBAeVl43RQATieJ+oMP0gx0VQKGCPezWOuxNrxXNgkqiTsbNxaxQ036gYJ0PFRkTt5 ptw8nTwx1e1/gLKFLndboIfLIvltoNyHLb6rcmujAM0sz+FUIrgsnDwe/OBzwS0yF3nT 8BDfBv6w6QVz7sw4KiZOQUd4JgHLlem6VEeb8h5EXE4Fat5yo4SLhqmhrs0dlDnn4/QZ u3X50sUsYFj82UXb3SfPuhr1TgSuDyr+AzwtZsHjP3ic8Qe5KjNwst0By9JDHT2KagR6 DI9Q== X-Forwarded-Encrypted: i=1; AJvYcCUJ0zI+X4ItUBXs0yE1gAw4sBbXQiMAk4S6aSDbtPWgHt1w1thc5a8CRgKtUE/y92a49vBA9kDInjFibyg6iA==@lists.freedesktop.org, AJvYcCUcndZYbqc/VuF7dVCZSkjIFgRRmU/5G3Kxb7Ds4H/gwW458f4AWGD0KAPrEwnzclDlTK7oWeZ+/syp@lists.freedesktop.org, AJvYcCVLvGI7i3gwDIh1Mf9rkMreI21ySIZyj5NC9/41VUC7bbOXEm6LxscWzb1l5mgkmaUutP/xcY9k@lists.freedesktop.org, AJvYcCWmAsaeHOg8oE872Y7SzVUtxdR5fhZ/9Cj3iN0hcnLVRpyjBQV7vIBmp+a/rnh0t0UqOpbttFsBrfi/@lists.freedesktop.org X-Gm-Message-State: AOJu0YzUNtoPPUFy+FIZSXlgB27D2GZXZHv08W0LzVoEO6HuqKa7qhIs EgGwPcOUCHmlPJ5lYM9Yx+hT67yyfz1wlM42SIW91fy8pLYUaSqH X-Gm-Gg: ASbGncv4eNnSCTO78T7cTlDb26zA7J/ZHk+H2QuzaMeLE3v22D9M193xzBoI5K+CKCp XB8VpsdQxP64j+inmW78kHx3dvJxCzXOTJD2Tn+GXjq6SIh94qjVR6sBh02B/dmi1VEqbg9Rd2j gYQm9+PusuanjIbqlMwKUCkJNXJRdIvW2n9mKdoSDsPU0sEGBVOLQyYwg8pl00u+snRg9Ff+KaE CnVQRWZIsSd0mszbg5SXdezgQ1b8n8Cdoyf7/BPnHh4HZWl6UMFFBmOXRfK/jOrwVpOSqc7shJY pxQxH4kXqMpjfjYaMmdc1RbP43vNhjyxqFHaPg== X-Google-Smtp-Source: AGHT+IHgbpWAw3ToF51VNapcA24BXvqXwUUtA2PGPS4mT2XtqGWGo3JjVejPDRtbOWoXeUzU8vi6VA== X-Received: by 2002:a05:6e02:1381:b0:3cf:b7c0:8809 with SMTP id e9e14a558f8ab-3cfb7c08be4mr109840195ab.8.1737787600600; Fri, 24 Jan 2025 22:46:40 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:40 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 04/63] dyndbg: make ddebug_class_param union members same size Date: Fri, 24 Jan 2025 23:45:18 -0700 Message-ID: <20250125064619.8305-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 147540c57154..55df35df093b 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 Sat Jan 25 06:45:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950775 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 EC048C0219B for ; Sun, 26 Jan 2025 16:40:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09C6810E460; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mpHCCYVs"; dkim-atps=neutral Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8DD1D10E29F; Sat, 25 Jan 2025 06:46:43 +0000 (UTC) Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-3cfc79a8a95so4738005ab.2; Fri, 24 Jan 2025 22:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787603; x=1738392403; 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=sV/JSNgUN2kOhspoJIscYn3MOHKykltv8W9GFMXLDKA=; b=mpHCCYVsEwG+0tLFm6iuPVTVoLsFRlfEzQdFGWeIEodk0KkgSWHux/9tLocfDOcmef rssxNulKNe/FmOaBhl4L/X0pGWhAf+1rvvb8wi2gx5H1ON8j6rrcP0w+0YhwQwl01H08 obRpvPKEp2iYO5hz9ojXQNpqthLyLr+LCNHNut3usIJyMfHzWQuFWXNkG2b1vOYI3Zw1 Q+OYdTchTy5ojt8wJOUlIarU21xuT6y/bby3++MUzHBgYemq6sz/L94EIP2NG9pJioS9 72H/UrMqMKl8H1gYHbFhFZHHFWGet71ORMrkp5ikp10y0pgSYzgl4bsVSM3kKBM3OGli lkmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787603; x=1738392403; 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=sV/JSNgUN2kOhspoJIscYn3MOHKykltv8W9GFMXLDKA=; b=G6Laa9Qxzs/il7SwtSqRS2m41umKk8B5lqtpPjf3P9MHvPCo2c/th8p594nhZhrc+w n1P3LCAIuE09TM0av8Ke+0xf1gbrzfFwrmR+4igWNSZKyXYVJ0dIrRo/5kvJYLQ00qu2 qkHwl2u4zvW4Vc6HVK1fFWS6hhvgtbU2cimtj+RJ/LzVe1qcs8vjJvo5BdBk3y+GqQDQ nkbabJgV3dhUgUPVVPO7Q6TWsWDN55/4qtbzOhduJC3SU1MVNwn2WORULy3Gk5XRi+Mt ROyNjIiN4+Rf9f86Zz7zjMLCYOgm8SxxEJdWGpZrswgTX1W41VajTXan/SynnO/cKuQO 44QQ== X-Forwarded-Encrypted: i=1; AJvYcCUZCeVP7uNnHC7MqKn4ZARUTL9W6Sokjc80QzXkU+oO0riDBOs3cbJeFPXvj+d+pskN7M5QBC7VRRgR@lists.freedesktop.org, AJvYcCUatQZuBMBXHcpYYJD7XjnQR2Y13wzl187EG6LJPEEuETKRMuDWPHzNhaFiK7cTIlB6cbYNmbD76/Vl@lists.freedesktop.org, AJvYcCW8gOGtYk0fvpn/ncpgBYgCAmWlGClSej6nguN2IxI01Hr5dI0hgNn+Tgwq+Ix7PpIL6wmurdMifpzu8zkgrw==@lists.freedesktop.org, AJvYcCXlCZakiZfLNowhoOIYZF10WhVQnmm38o9o/KXMbWbBH1GQbzXxrSic1EKD9EB/lScHueNoL4Qy@lists.freedesktop.org X-Gm-Message-State: AOJu0YzT/QzTQ2Na97JwG/X5rJeh2olUH15VyJ7CsA6d3zTiJRZ2YRQY MgJVoEfQuthrkMBpnMG8FEXqV+ne7YDAsOZrO/4j7EkenXjQAfkz X-Gm-Gg: ASbGncsieL2krkIbDNw63+2ez0MSC5ZbOizmKqj4B3p9YVEk8Vjkir0K+4b1+VTuXph NMi6qz26i4cLwsHqzXFreK1NzE35vQOEb26Iv1SoHWyikqjQG8JRj3lzJAcbuY8pnt75zqccXh8 4A0jS5EyMF6M5nAs7cuMRz+aTsUskv5hIq1/b4IkLU6xMMjlKtJPIq/Pz7CKrT3/EwceXS0xQhA 3IW5t4HZ4hwXSIHxGGH33WArpcRILWenEPUCs372OLjEJXQmPRqi+lJi+54woXrRJLPzAaA28Zq AWXkp7hx+Dm8bc4EO2ALjys5Tqe3TtnXsqcwzA== X-Google-Smtp-Source: AGHT+IH54SsfpEYFO4ra8A4an4dLcvoG9wSBjoRiIYetoUV1RolCgaxWz0ul0FtpQ0GQuZ5n6MM7Gg== X-Received: by 2002:a05:6602:2d83:b0:847:22a7:2412 with SMTP id ca18e2360f4ac-851b623bb6cmr3299746039f.8.1737787601748; Fri, 24 Jan 2025 22:46:41 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:41 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 05/63] dyndbg: replace classmap list with a vector Date: Fri, 24 Jan 2025 23:45:19 -0700 Message-ID: <20250125064619.8305-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 55df35df093b..41cbaa96f83d 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 Sat Jan 25 06:45:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950782 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 AAE86C0218D for ; Sun, 26 Jan 2025 16:40:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5096B10E47B; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b1XvCA5J"; 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 AAF8210E2A2; Sat, 25 Jan 2025 06:46:43 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-844bff5ba1dso225477739f.1; Fri, 24 Jan 2025 22:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787603; x=1738392403; 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=CqVpFbHHatr/2ING85ieH4d9rnOXpZNWBvi8gxx8k90=; b=b1XvCA5J82zK00BZjapHvKYqTdfzW9N1pVvaHf/KbaC1ZDKRCWsne9GEI7d3TsWuaK kUPKsaoyHHmKdx11y+rxwG3JpAOOqI/H7bmeDUlVFKzT6pagdfxej4F5n33mzYOPI0w1 qN/gjB4jjkj4+llCHXU1XghqPOea7QCV4JMZzf+Byh0RLxar0HVTFT81OsqEO5NWUYRr 3y4oikDdVU1kVtthuE5MKaUrlHx5lHul28hrNHos/TukyQDu0ESeNQNJ9wL4UvwQEe8v QIipiR8BA5ETTA+fPHnrRTEFscZxefAy/0d6ptYBD7luXlMwpp3QMEQ+KHqkl3HnJlfG HWXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787603; x=1738392403; 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=CqVpFbHHatr/2ING85ieH4d9rnOXpZNWBvi8gxx8k90=; b=tUzAeUwoCfj652qkduf54I5dcSf5XJbajWKnhMYu4xFNhcTwM95nGVwTYtHrAP9op6 nYjcdYAfIjkMwqtPcQvSi8J53XKEp7qZ0yLVPIcqjd161oqiuoQF7YcJMH+1nqDOhCNu U2iMdlmjXj88KdWn8VcYiEtbFmFdlr4OpxATleYGaQzXPLPLAiHwx6Rh3p9m9joummJ0 dsJq4y/a1gW9EWMFr0y3mtFDXfRTQOlGR4x6LZxwZTPNs9NP4IqoyUKMRPA19JaxZNfB MU/TYk71aaOU5ubAzke3fjtmgEBD7f6SzKm1CEXqj27b9v36n7mYRUqdAPH6l0VS/0fk 6zww== X-Forwarded-Encrypted: i=1; AJvYcCVsLiILOUtJ70JHu4Gfh9Lgo3O20Erk7L7ALJaOia5mCygG+mRSBEo6/yxFCVbADxYjZI003r1NXhtl@lists.freedesktop.org, AJvYcCXOoISiCegIoLh6RdFMvXYgaQoIFqQPHnWyrt8aVqTYJq9L6//bEOZAUsM5dQE0Lu9VNR4SvTxw@lists.freedesktop.org, AJvYcCXTqVbaUawRGZXf+AktMUROuD07PbN7SjekO79Zx83fkIw2Rp3WZUhIYl6C8+2MZBHOKv/UlUTJQiXFICcg6A==@lists.freedesktop.org, AJvYcCXbv0rwMWJgvGBF89vk0NY4W3qW0U2LgXrDc1Y39zRaUNgsyWO1XXo9at1lvN3q3do5wq5aMGP4NBv2@lists.freedesktop.org X-Gm-Message-State: AOJu0YzG5eb6iLCpDaNbCPv/SPZhGK3ftKSG6Am8lBjBEbRw5q3D8/eC CUINmmTQtiZGfjzZN+ARbw/XJsmm/p67WqvdtP4yXQ3gw/kYRwiI X-Gm-Gg: ASbGnctr5lyL4uBUMY2mXJ4JVVntmHHhKkqZPkkEEXrtTOKDKJXRJGzcUz9oGyM+kqi 4is3ZaqlpxO1rFYBtZKimzUKC39TlCLehOMllXEk4/2pboqe4dtwa9/2zO5zOcCkMZweKAG88yc FEV5qyELtA4iZuF754JsJzetjwzn2WEdN3c060Y7ZXq3DXvAMrb/2JJnUtkK/uHmY+IDEji5eGA N5MgJRVts9nlaKMAYgZzPrlrsJ2x5XbI54m5+rre5WBRUgjgA2odmayKnWGiEUlG1lE7XjheYOB eoVcLgEQaaR3/3s7sxkeX1FR69KvJh7hVX+zgA== X-Google-Smtp-Source: AGHT+IEG9pcmO7ys8hwr6eegaGLDGSEioGdLb+KAZBSau8bqMWNW5dSAy4HzShNFq1TzGgbki4fQoQ== X-Received: by 2002:a05:6602:4006:b0:847:560c:e7b7 with SMTP id ca18e2360f4ac-851b61f053bmr3495732039f.4.1737787602874; Fri, 24 Jan 2025 22:46:42 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:42 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 06/63] dyndbg: ddebug_apply_class_bitmap - add module arg, select on it Date: Fri, 24 Jan 2025 23:45:20 -0700 Message-ID: <20250125064619.8305-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 41cbaa96f83d..8adb81e75a16 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 Sat Jan 25 06:45:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950753 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 40A16C0218D for ; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 30DDD10E447; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LNW2IsSk"; 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 BC63510E29F; Sat, 25 Jan 2025 06:46:44 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-844e9b83aaaso218487739f.3; Fri, 24 Jan 2025 22:46:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787604; x=1738392404; 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=gfV6PeTEsI0VgSdAZwuy1u+rsYeivbmD+1moBtyYi7s=; b=LNW2IsSka163NZ/dipNHU9RqzXkeoRaWgBwPaOjWbCxnQQkHnYgLxOy/jQUQFDGaRN ExZ5ywF6ZHQTe1SZqh1fK80suSXrIe3dL9CymjRbYmIjnOJ6QNH0e06KySAKB6EUqUv2 WzDUfJwWzVB/ZI49UMzQn24jyA6NC1slBlySQ65RpQlnOi+bLbkay8iJlIKsxvVFHrTf ROP3OmkqL/1VNgXjl+NJcJ5afhg2p8a5EtTYIg5b/eiedBSFc8dP/uzvzR4PH7z9lXw9 JwipoMTCW1Rp8VLkD45sueS4HJUAvqtBM9ac/RiFe7kTq+xYFqFQylBbtaKswayHs1gj J37g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787604; x=1738392404; 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=gfV6PeTEsI0VgSdAZwuy1u+rsYeivbmD+1moBtyYi7s=; b=RhFS1p4d43vgiGfkTO5Hjzybw8rGTu59bFRSvEc2KArij2RWtu2h3GHFqomWRmOaXk m8wO7VXr6SPVTQX/ZBaQQ0zcYzIZOc17hvfJwtulrx7SJmiFNN0+NrXswrpSrcsCkVav pQ+suVQLVQoUJQhb35NpkzCBbocHx1GuU0r8xf9UuibrGV7pPvZIyBXUSsuiG3W+vLaz i1U7Mq2wO881uGw8URlbnY/nZjiSDTcMAQF5BM0FIMt52NQCNoJ+/ysRX1+NQGkwP7kO jf1gK+NSVP32ZeqDR2aWvyPsGH3qiC98atqjTCurMTyRpGqQnzOZIfOG7fRJwMfG8JxY Vn1A== X-Forwarded-Encrypted: i=1; AJvYcCUD9Zcs7c/WPEr2GgxsKYzaZa891QT6yK3nS7hgeqroT36+k7+6HOhhjwCorlWqFlsOLHwZDRZQ@lists.freedesktop.org, AJvYcCUgS2xbQtWBzoQBSF6r8dWtCpAJjrFoE5ODFyrBmKCd/90bw5WnpaTsfGR4r3ztr2PSVob/TzFNW+xYBx6ajw==@lists.freedesktop.org, AJvYcCUohtrzYKqN0IYEiODzWiJhK30ptwFIwVt0T5gBZrvC9lxta6jYymfauZEtMxuHd4V8p8eoJj8I9tMH@lists.freedesktop.org, AJvYcCXtF2pyuyTaeTgyneeA5QplVq0Bb/8FSZkNYFfRdgONPIye9VWMf1Wu6wDzfAsZUJY105zFsaiaovzx@lists.freedesktop.org X-Gm-Message-State: AOJu0Yzj4fSoz7qkGkO+m8uJghSTOnLlSU5Elwlh9ikYJOwOVeki/if6 CBLa3TRcvR0RWr8Niqn4AlsYuI3ZekksPHpmXuF05UMsqEfVZSnv X-Gm-Gg: ASbGncvJFft2WefHdvw3fuw5kqN8+PJ0v+TwmZ/VuBM6TKxzHqky3ZyuM/eRFcaomi4 CiWCOwDpttH8pAT+f1NMh+OX35Y/Sb3tJAFGB8saQY8YgWMcbkDyXMHIZqrKsOEs9rORrqDuioZ Zccti+8Usvbju1vrlZe23sOSZwvdAM/taC/e+7/wVHn59sEBg+AvYIU1Lajuizfvb+VndJUW78H mtK52Cv9KEHNh0PKhw5oXF+vSvYhUY/L+uru0/6MrYplIFWEub7UmJQ6bkcLT736NUCmTQ045NC QHvktBtB5yOJ2rR1yc6gLA5BV9n10DnC3ppj9T+kAhvgk2cu X-Google-Smtp-Source: AGHT+IGNmawZ5H7p5nSdLzECedgsD/gX3TGGq70Fq+Pnwp8P7+wi2jDLWawGYzx5t0CkZCBiLMpQ1g== X-Received: by 2002:a05:6602:6c06:b0:84f:5634:8a1b with SMTP id ca18e2360f4ac-851b619f8f4mr2827044139f.2.1737787603950; Fri, 24 Jan 2025 22:46:43 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:43 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 07/63] dyndbg: split param_set_dyndbg_classes to _module & wrapper fns Date: Fri, 24 Jan 2025 23:45:21 -0700 Message-ID: <20250125064619.8305-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 8adb81e75a16..9adcb9fa7110 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 Sat Jan 25 06:45:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950760 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 6355AC0218E for ; Sun, 26 Jan 2025 16:40:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9654E10E44B; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mzfAcirn"; 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 F01E110E2A2; Sat, 25 Jan 2025 06:46:45 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-851c4ee2a37so198176739f.3; Fri, 24 Jan 2025 22:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787605; x=1738392405; 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=VwH01EKRazu4m0X1GohDgfdyTIUPm+sscqi9yjO/S80=; b=mzfAcirnAOuV2YTByAOxfwX0E54jNqKmMoOcqMEmFZAo4AQJoNF5LIA6xMA3s5AjPj uipP68gl9kNbUZswgyW5cE61IHaUDUfoJVUehOiFgzNkkjJuBTsqAa41BcciAXQTPAVz qWqGWNWx0fZsKNMdOQ/9W78Y743bQN17eaUXPV0FMSsEa1lXQXy5bA/p4uHQ9cooMiUy ep7z68LDu24B+jNxWa+I9SdpZvkwMVpfSh4pgN2S8oyEqU9qLnlACxfFYa23KMs+cdOZ MVugBHHuCRMacKUgHY7OI6IJcYTlU6ESTKS4n5mF6QUT3uJE4Ezjd1//bAkXt3ZRct++ js0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787605; x=1738392405; 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=VwH01EKRazu4m0X1GohDgfdyTIUPm+sscqi9yjO/S80=; b=k1LkR8FyX3L32oMe6QrQqkS5G5q5NvmySBd/qut/yXLZaHj1Cbb35Lv409iJEPdHkq bMQxVcgzR7g6UTqIb2G16Dtk1C3V4Eii8ujiu2GgVJuYCBwCM2VscoNjzCBvnXhcrq+T tMLGndfsJ15bQwluBqiaY7p/UYFZYedHhsYF1FiWywA1FGslLeLdMqxNWNxGhjYGfBWN ZAsEUGhz0QdSPnXd+/aQVfUOlJoZkMVlmG5WaOt9Ng1RkSgHPmDXlb1ukHDavdu0FMAN e7PInWvglJrsHMoQ4Us52Yl0XMw02D7e07q2uBy9Wc93MYA9IwFUV5Ha8N8EdsqlOql6 bI2g== X-Forwarded-Encrypted: i=1; AJvYcCUYnLVQqFu9BYDGAJ4Q61bQZoaQxybW0gBUUYOiJkdjvdTc+pEk7I/388cds3qC1Q89ukD/V865h2wueaf/CA==@lists.freedesktop.org, AJvYcCUuJI2ga2UcqT95B7acJt7vsikUo68S6UN+Zz8tmgxaoKGCcPVB94HspKm61GFHeusfqNIIRaDFvoJS@lists.freedesktop.org, AJvYcCUwbBMTfHV0u+eFVJKeKpMsBMNOUu/AkZeAlLULel4VNWSNF0VE4en4VNE+JZhR/HhhPAAKj6V2@lists.freedesktop.org, AJvYcCVRyqagBwMSASHDqyBtDI7zO1e0oQJzC1C19uN+MTtZ1UrRoHPx70d2nO6+XYZDpxB7+DQ/qx2nbUz/@lists.freedesktop.org X-Gm-Message-State: AOJu0YyqsxX5xPCCkMvfMWybzTspQAF7FVT8VHG7JWX2jsCD3u9sGozy hy/VDoyR7T3Bf5M9hGAfIfA6MA/Af6tMr/CZAR45d8PTfMu776qS X-Gm-Gg: ASbGnctH38jZ6aGvgCS+pFN64kPPlAfsC6f38ydiYr7HYwvJgfR14387pmhw1UK+TOK PlY84nvxB1J5QYWFsB9RHDygUQgrSeLjDYCZ6Ie5uEIiMPyfHXBQR4NwcHg7GPh8sVqTjQO2iuz 0lG1IkuMcskKGDG5L4rKKTbroaZTwRIFJg/skbirXKuCuQD3MrYF+HOV/MgAgIWSiIvf/7pOH6i jBgYYQkAD9psBaueNfbxHNrrrmOJ8jO+DR80mFOXH/VKFXB2E2bYrGoRv29IyaSwJmJ7UcRfyrd db5lr31zO8sg838vpcorIPu0OuFSKu+MICDKRw== X-Google-Smtp-Source: AGHT+IHgeLb1/OEHSiTpUB3Y4KC2A/0xBQxJHz/T9Jw19RrYDifFspA+XBrdojd9CQ+kqm6DqciOMA== X-Received: by 2002:a05:6e02:3601:b0:3cf:b6c9:5fc9 with SMTP id e9e14a558f8ab-3cfb6c96229mr126365525ab.8.1737787605241; Fri, 24 Jan 2025 22:46:45 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:44 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 08/63] dyndbg: drop NUM_TYPE_ARRAY Date: Fri, 24 Jan 2025 23:45:22 -0700 Message-ID: <20250125064619.8305-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 Sat Jan 25 06:45:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950737 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 23B45C02191 for ; Sun, 26 Jan 2025 16:39:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 23F6A10E42F; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JRmRxTf8"; 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 0FB5F10E296; Sat, 25 Jan 2025 06:46:47 +0000 (UTC) Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3ce6b289e43so25367665ab.3; Fri, 24 Jan 2025 22:46:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787606; x=1738392406; 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=crImgp1y7IRXSUD7oHrqvuelp6vlR0pAkEGBI4jI/u4=; b=JRmRxTf8ubcfT7LdPcGRXpCOOM55TrWT9p3fOeBjMXqJEVgODp/fxYbS+4EbCUnQUw +ZlZJImJ4gDXN+tdFPWdn0Uz8xScIXwu3Gl3gbrVK0twjhFpQu8OxHBpwe0dWosBwxEb GvGmpTB2qoOATck2al+7X2NSCw5zq7dmIc4s8LTCML09BIM+0mePWxvnm/O85HfQN9+L mwaWEgwJDQQmxRA5xKn0BpBoEK8+Z7u1S1kwCDoFGQW/T/LIxytUqmKSOIKys4L+kaeo 83r7HXsei6oYGWUSnuQRemdToN7Q6xaQUONC4Q0sm3zfmDzKoPZrdc8dHe1fi8iXwVVl tA/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787606; x=1738392406; 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=crImgp1y7IRXSUD7oHrqvuelp6vlR0pAkEGBI4jI/u4=; b=KeTLlOCeNW4JHrcjjc4oWLS5K0TWDbOcQj8Cv7pJYS7QeqQ/7s41+B6VHFTSngbQAv 21QIqstOEWXN/5QyxHBU7gJkz/WIKvxoVLQ/X94F2YONyYPXRjns/WSOE/tWFCN/PhHJ 6KeyVGeAb9+/mg/UF4eKWZQdBx/pcRpyrYJ+QSQnaIV0IiaoW2Izq1N5mNIwwNA6v6Ir /fST/Ll0JYYrMDStYoHSyZ3v8IvojUKkEFbMvWW1ziDSKXda7W/OE1h4/lpwtUr/Fg8l U1aokGWXEDbjMajx3wPmSxM87iM+NDtbRsx1lZsEKQQHT/cFtKRuS+pAL1yKLxUsh+9C bNfQ== X-Forwarded-Encrypted: i=1; AJvYcCUZeAg8nug+yl6t0WJqP9KUson63ni+IPV2eARsN7kqD7W76/VK2rX7SwpbFNpZNzpcfIVBhmAwNLmd@lists.freedesktop.org, AJvYcCUveWsmfAythns4qHPUG9E3AdZ9OVeie6PaQQkCRXEPNS8x7csTq5ZOC0OgrHn5vpnq1AJhxezB@lists.freedesktop.org, AJvYcCWIsA7niLMMeeB+un1q2eBBSkrmEwRLrUGqFPVRDaIaPR58epAhb+yKKioFumE4F5ATuQMvFcVXCplM@lists.freedesktop.org, AJvYcCX6Lzh7roIlTGuur7/xCtMGUJrIxh39rSxOpmm9o7WOeJrZ3sTq1YgS3dn4QCzod+jNAiMiGpnUYDeEiNgZ+Q==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yxteruy3tR2pMy2sqf3qxrufeYEASG2gP3naSRkEYqnQA71Gh13 mCCetWn5XhHxT+d+7uTqF3B2JNerP7IJSbfIgKByOsNxRClyTSZh X-Gm-Gg: ASbGnctdNJt+/YvKm2g4S59e2kAypElEUoCxxZUGQP4SDk4xITrw88emmrn6OFIVtrC yS2E1J48JBslwyQbzYuTDonUxeLSSW1MUUeZXj7E/z/q6BJJ6ZkehDEue9QKwm6iV58eYKwFOC7 mbamrrnOdITSNC6CiCsyxaz07LAae/djDSqoYtHIEsy1xZUbbD/uhnZL8GAoYJe9PgkCSitoaPt h4Pmcbr4+Ir0Awf9EUpcDc0GWJPEjW8SM7PpWDBj/WJrcG15cpqGw/HwaQi0v6lSNL+vQfWglyT MYX9qRBTANnWV80qLdD/JtfXOLZ/kqRo1Yu+kg== X-Google-Smtp-Source: AGHT+IEjjwWoWaC2eqRVAIRwzEKW3d0rVEFuGJkXw2+P/hMoxb83M7t9s2BDslJJbs0hJxkgZgzZdQ== X-Received: by 2002:a05:6e02:fc5:b0:3cf:c558:3594 with SMTP id e9e14a558f8ab-3cfc558384emr50346105ab.2.1737787606321; Fri, 24 Jan 2025 22:46:46 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:45 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 09/63] dyndbg: reduce verbose/debug clutter Date: Fri, 24 Jan 2025 23:45:23 -0700 Message-ID: <20250125064619.8305-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 9adcb9fa7110..1b2fb6502e61 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 Sat Jan 25 06:45:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950744 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 94C3FC0218E for ; Sun, 26 Jan 2025 16:39:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BBEC10E437; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kB0oSXq1"; 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 4DAFF10E2BC; Sat, 25 Jan 2025 06:46:48 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-844e161a957so209605339f.0; Fri, 24 Jan 2025 22:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787607; x=1738392407; 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=uX3l/iQikxAaQX2/QdRkr7TBe7St6PLnbGyQCN0qCdQ=; b=kB0oSXq1prfPbDNAieLUy6u5if7dZPGQHhW96Wc3b0ujf7R60yXqX3ZNzuMbYAJZ3S i/h58n++7pAYgIOOkwD7vVWx2NUuqmkcEenxn5sjyU3dpsDz9SSURAQ0/EezVbQRGZ83 JVdcz+I9a6fXhJBrh8inIV7BKrIhtCl04oX4dcmgmWeMC7Xck+NBRGoICKtTlVGLoCjH OzP9cLor3/Yf68m0ozQCRxwgCmKGnRwFkgI/8LCej9mP9dsra6VFbkmZd3paa+TyAbJq DZBGp76fPDG5gk2a6xqsS84rKWnW2HUXeQ8VWBEvPWoS9IyQIiJX/3lImqsxxVueiD7e tN1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787607; x=1738392407; 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=uX3l/iQikxAaQX2/QdRkr7TBe7St6PLnbGyQCN0qCdQ=; b=GIGm4ij/mj6u0sdtG2OMu+th+7yrnyHf5FH4wPSXqyXc8RJkZ067vxEs/TibiEJ3U/ Mybq9e+sUZdJz8G2mO0viXkH8umDAXQFl+RRaf27Y0JSpdxeKwifwBmx5s5PdSHpocJ8 rSOy0oOmqpbJdGDSF+ZNXO3/PAk0Bvh92mpk6sgjVYzRbv/kD66TZiN3AJmJ6XKgO4oS 2CKKJpuXXlzpi0tw5hR7LE1GDaVzoN1wZ4nayb37YB6e/L8naJDCES7qNRkZgO3qXhfp oWVkRbw8UJayDTbhil0JWeMuXOtIqwhRDcLU+w4ulDUieLI+5QVeFCyaz/ViQR5vCO08 YO4A== X-Forwarded-Encrypted: i=1; AJvYcCU0FkZyhyrtL3YKPOQgNrq5CWwY/ZZBj2Cdw7csuUMR/5gBTnAuiE6e2xyi3fYoV01N6hI49w4AloybNhiHIA==@lists.freedesktop.org, AJvYcCV8rrw+hN+T39U40T3KDAftHRYq9HV7Wp1w8+aQmT1rAz8jfdiP0c9QBbXKgcdzJqj7KCNx40F3td1w@lists.freedesktop.org, AJvYcCWcaLi9/Po6KrWOG04KFqOCw27n+FGy1iiZpCQAqhu+/Tksq5I7t5czchH1kv7qDVKKjNwvwU3w5Jer@lists.freedesktop.org, AJvYcCXVAYcs8GTWrU6Hd13VV3m/+sVXWE6YJ3ajjrBbdxgWrdjG3XKsXsmU/Oe7YehQb0lu2aYMKjRu@lists.freedesktop.org X-Gm-Message-State: AOJu0Yw6sGtpKbjdQqPBLautTmtJMVCW6XdeiJ7S5hlqar57aPraigRA CYXNPSHqxAnnQv2C4nN4a6szlxgz1fSxG5o1y7tALFiCRtci7NsC X-Gm-Gg: ASbGncv4IC+y3Szhe94/K9RSaNbOROPFqVBspapFVsWaQFICDuRildnXXJUcE+v2lP3 cETatx+XNr0JNALCYHq6nyiBgHAwyEJY1H6SZSZWOP/O9jzmV2tt0prGTNk9WjuDn/VCZl5SQZ1 JBzhNfJUVITyexnTuhQZWmkMqAiRrjeKtguc2p+KhRkiZMQw69k9GAY5thHf2W/uk3E9B1TIaFi 3qmYt73H4eV+JD8Lw7n0TMqOBSgxfn2Z3CWlJ7c9SKudbHYyb2rul9TpWMYBVrbZtfeTX7oCEwg Kbh2olm/S52Law8Q/vOH6fW0j6yXgMCdUj7BcA== X-Google-Smtp-Source: AGHT+IERZTxhAZxFSe1csHMGwCl8KwsmPfchqC0NaFpULXt8261DlITQ09T7azGi9+ykPl9fw06Y+w== X-Received: by 2002:a05:6e02:1d9c:b0:3cf:bb11:a3a4 with SMTP id e9e14a558f8ab-3cfbb11a52bmr102830845ab.15.1737787607309; Fri, 24 Jan 2025 22:46:47 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:46 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 10/63] dyndbg: silence debugs with no-change updates Date: Fri, 24 Jan 2025 23:45:24 -0700 Message-ID: <20250125064619.8305-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 1b2fb6502e61..c27965180a49 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 Sat Jan 25 06:45:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950788 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 309AEC021A1 for ; Sun, 26 Jan 2025 16:40:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2DE910E480; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RUBp8N7h"; dkim-atps=neutral Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id 35CDB10E2C4; Sat, 25 Jan 2025 06:46:49 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3ce7f6fdd2aso20863835ab.3; Fri, 24 Jan 2025 22:46:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787608; x=1738392408; 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=aL4TX0n3dq5vrpGI1F4EuJXOXo5OciZqJbKEL8rj1EY=; b=RUBp8N7hvgFpW9ZevEz7LJQLddEwNqqaJrnfZVWt5+13j/wJ1QOgyBaNyhWUuH6Xnr xrF05goBlVlerY1LN+O76VlNJI+zMVVcJ2KtB0RSG7LqP5fCXBpwbNMrX1/ruTW8bjQu XHfQoBdSJqa5nKIxNQLyV6Eo4YZS7R7G0o3N2EGhvoUZoDyON8ojS43NMnLPavIGrfa6 P7QTmg9A8eRD0pSKnj4mko13OuF7AjB0kJ7fAUUQ3U1b26I6g92HnTkrOeFzqz58ajKs 0UOB9A00Nxd+DQlC2PInGCZU0c/iF2oAb0LrzzYFo21huOWUskt9eqk5R8NtrC5sZagD HqfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787608; x=1738392408; 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=aL4TX0n3dq5vrpGI1F4EuJXOXo5OciZqJbKEL8rj1EY=; b=Jsujw8lPTXsjU5wXZv2qeuOUTxXc95OQ3+ls3TL4u0XIqFVW7OJ2W7FsO94/4mt/5/ VANXIrhyLZOofgzc/LUb07/rNyaGpgBRKzpdOjIKzVVta0VnrRhsqnCZavQgp8hGARC5 71AiI87h0bvh8Pw/VJYJ+MFsd0cUT7hT/kaqvTjQFfAM4N5fI1ya8s/3/86cj3cf0B6e QnNDU5XVXhQO2PtdN1poH2uzcy7UjgeCsDavPP1sU2+WwBT8z01DATWdbf9KVl8h1plv OoNhVWXIJOS6mb75/VhpIhwJ0P5ZwKC1IyfaAculWf5cAeHw12EQj7lF/jG2kJppH4UK Tlww== X-Forwarded-Encrypted: i=1; AJvYcCUNv4tcMmuFos1RVgZ/YWTw73qsj1+dBcyB45hm8xBNHCwMuDntVkzrUYxCqxs10mJxTNf0OLQ6VXbP@lists.freedesktop.org, AJvYcCUtLUCXGurvvUUr6txTkJ2ORozBSiyxadjsGNgNXFthZyEO0UbhMGZA3XDZboueaVIqZaw4kDDl@lists.freedesktop.org, AJvYcCXSrFuuUvjOrTcfF+2Wnpsz1TFrSgfwBJkp3hfeQvpJofebuckQkMCosq4gPX50L63kfkPdhBesdW+1@lists.freedesktop.org, AJvYcCXsfF6cHlFmK47jz4VZ9bxr0b8f/TCnpreew2u3W0RvJbfEwy8Pt63OGgvito6xyCRMTIvOYdosVueD72jjGw==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx3bsptONOr9UvYbDOXtcxWzaA1/N7xW4/CV4r97zAU41VlfFlw oC/uNLJ+d2aR77ZaaHYcDRxYoz/yD6Km9jDBBmOhArpyrxKbJUk4 X-Gm-Gg: ASbGncum09keXZ7VMvfcHoOWITbohmH8ptsjAZmkrPdNdTSHGu+gEwM2w/t347hNMcR qvrqRLZ8YfgUYnrl3xpr5LIw0g1s8v9bZ9ciybrUkiGKBCRz+NU9ydV3FWV7FOJ6aiYmoMIAgIh gGwVCeuS5dAiCTZ60CJwzYrSsHXhWcoI2eUUjha80ig1nMBsgKlnrwD106fukYpQ/BR0uEb3vBf ioQi3yaNuq2fY9zw93YHoRAG34Eh7v3zppaOpRUtk4CdAvTPH0Mrunpx2aa9h8JRTipUwNW8Nvc YSHVGujNOvzbWo1P0amKK0rWlGAZIM/6qduIfA== X-Google-Smtp-Source: AGHT+IHL/GoA7XbieWLMv6FyLDw1bl4z8/ZDdb9aS4OdzpNSQZXG/htmpeI7MxFcY4/KQhwkkuHohA== X-Received: by 2002:a05:6e02:3f03:b0:3ce:87e3:c26c with SMTP id e9e14a558f8ab-3cf743df88amr329669815ab.5.1737787608464; Fri, 24 Jan 2025 22:46:48 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:48 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 11/63] dyndbg: tighten ddebug_class_name() 1st arg type Date: Fri, 24 Jan 2025 23:45:25 -0700 Message-ID: <20250125064619.8305-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 c27965180a49..a3849ac3be23 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_putc(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 Sat Jan 25 06:45:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950766 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 E1B9DC0218D for ; Sun, 26 Jan 2025 16:40:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6672210E459; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PyBPJcNk"; dkim-atps=neutral Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5FF6510EA5B; Sat, 25 Jan 2025 06:46:50 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3ce6b289e43so25367955ab.3; Fri, 24 Jan 2025 22:46:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787609; x=1738392409; 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=urmnkuLrh5iZivbcnepwjXmHK5mBTPl4o7K5sFAjLFQ=; b=PyBPJcNkk3kvLQSxigGVujzHtP9ImhbfmTvIDhTzWOUaaN2wvZboVxaTr48YLMJM5o FAPsID4cy09zC8YhliiOzlKkbIcSsTLkunjlj2c5l84zLFAKMJlXg2ecQnmJKCx9CNmw HlUwq7ZHgHweFIfGX25W7f7sVsJRxcJwugV/KlVYZP9zhAL0V8pY4k2JGMqM2L8BjQrO iuudlQDr15KpkhNUB9Yu9A+rq1wynwm0prbYf6QzuZtydEIzttdeDUDb0XF5eu5LG7KT XrYSqcxddsEw+Dar6aqrb7eosS3FllsOliV6v/kM7MvpPFNtwrvTMPcaPdza6wKEZJhb pDZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787609; x=1738392409; 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=urmnkuLrh5iZivbcnepwjXmHK5mBTPl4o7K5sFAjLFQ=; b=iwh0PDuUL/+q2p3piXVYWqj0F3OdQvMMtK3e9cVRFzGvmpX1etyfukgKDa6ctZPBgR Ul6ilzU69sTWoFycwfV+40GRinryidbzI/t39YRW6QdKW9H7XdoImaOeTzAEIflduJbv bGHChpTOYdZckPr073d/u7X5Abqt+1WOYHBR5b+d3CwPT2bj4jKeBEIhCLUISqvU4khr e0lYgXtNV0OZpg8DOZYcBd179Qz4VpfyfP54aOQQMv+YP4GuE7Pji4teNiMGBOz37zki fS7T65RbGJ93w8ciGGzmYldEYLHYyoglx5m29okztIXewljeXJnPJQyLVrbbsijcmhtD 9NOw== X-Forwarded-Encrypted: i=1; AJvYcCWZqFfwdDXLZvRZsKQJSZa8WoL4ZSo2C7DkHfbtp8FSDW09Hiu/QsZWvr8n4cxUOpWULFwMf0IY@lists.freedesktop.org, AJvYcCWiSH3/LX5wHJkZ3+gTIPSSB8gStCp+HI64c4Z3Z6qZTn2yxSk4b67cuXxeiwiwsUQ4yfgC6r//Rfq7HlVTsg==@lists.freedesktop.org, AJvYcCXDnwVsSlPoNbazAaJn5qVRFbR6Cp9x9uyUxsdGruP+uxYb88eEUYrR8lJjH+BEWjZHc0La+M+ERxOn@lists.freedesktop.org, AJvYcCXt43xOXbvsnO3q9Ol4at1KqH+59YKpb+iMzFmulmUa33/8/HsZF7CssVhBnHNRntitcnVK9MC75rjs@lists.freedesktop.org X-Gm-Message-State: AOJu0YyMUkuHXhKr+PFuFLxI/TLslXyY/xdA015vlG2Q+fNxDrtkddoF mVMr9Ynm1X6Ug22pI0YsfNfLL4bQIBhntfl2HwQNzhaF6GFkU9oMj3GL8A== X-Gm-Gg: ASbGncvairIWR89uRYQSsPxCdeIOdjMPJuFA/+SXMwTcG0ABfdgTXsDMQhtJnXuflli Lxwt/lkXqkgYkh3C/WBg1fOh2f4PlOS8T6/cYs4fZmdk4Wq8JbE7axIAvSxMJi2ywS06Gr9oDo8 SRFybpF/3qu4vuJYLZwsRt/FteOMjrrmwqtCsMNIcGpTJEFzeObrV3MhWrrxko36nMW0OZkI+rr 1n38a2WHcnp/mi3BAO/VCbJS0r/DbV15/GTBSlYqGe0oaUWijntMWy63joYlUEILL9NrztPKdMM M6DbdykkESphXGpstxT2rWZEnt/0NlFQjt8qug== X-Google-Smtp-Source: AGHT+IEvmisYZlf1TfhlUiVyjFpSDJwdao+1WM75v1n/+Qb4/O1LfWsp2czciBXM069u/2UjUxgPMQ== X-Received: by 2002:a05:6e02:1f84:b0:3cf:b26f:ff7c with SMTP id e9e14a558f8ab-3cfb2700234mr145910675ab.5.1737787609593; Fri, 24 Jan 2025 22:46:49 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:49 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 12/63] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Date: Fri, 24 Jan 2025 23:45:26 -0700 Message-ID: <20250125064619.8305-13-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 a3849ac3be23..fc9bf5d80aa9 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 Sat Jan 25 06:45:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950735 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 E4F3BC0218E for ; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2086F10E24A; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="KdyBJdRx"; dkim-atps=neutral Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5B15A10E29C; Sat, 25 Jan 2025 06:46:51 +0000 (UTC) Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3a8146a8ddaso7563635ab.1; Fri, 24 Jan 2025 22:46:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787610; x=1738392410; 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=JhnbP0DWcHpdehvzPtVKNEphMptFcEvIUAWn1R09L9s=; b=KdyBJdRxMcLAhi1jtTKe+kehlFDyMSlKFiFpbeHp4aFtfltuiiVp6U1XLROJWF65Ps AfRuaopmadtUv2ZZlEkWMYJ5aHzgFTzkrhtpQQj9lae/Sw8O/Qb3xXb3F7Fy4JgwBLkc Z8yo+918eoJDf8Tihb2KOO3S0rCUYVNOq2n2svAOmy7me+AHwc3J1uPZdeYjCILY1uqo 2zkxyJ+d/KfehusYrOpA7Tf9ZEMEJ8XIVmz9YYnfQtdQdPEjMLiII9kk3PU7rMbN2qoN 1Sn0j8B5Mv44RjpiBpYIBY2OonoBuzno5yZhIFtmXAQ2+brPHthNyPZ9TQA47vtN5Niw fepg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787610; x=1738392410; 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=JhnbP0DWcHpdehvzPtVKNEphMptFcEvIUAWn1R09L9s=; b=JOV7hBDqkZEdBWgGUV8AfZEQPWZqN3HUv0CnOzG/5gOJmfyAfKptU3xPLa62b6a/7+ bFSivPNuM+Hk9uRHmU54oUJ6RmwS5lRIrTgbiPA8UQ9Qal3hpEFtDtEJIpF4eYvHPBxR C56iL1/NXE848Tcfh9AcLXUF0WdvJHKwijBzw0e95e0s7bliOy8RoSwVgtD0gbNdWyGx Kbwl7y53+CQzsJVqzY5WCSmdLYyTjxqbLtNqWYEPYyKlkrI9QSJnX921GfX1is2NPKuq JNU7j3GxdPdew3B1ThWXO4qYf4jwQHdwFJMX+urpi3n+cZ83lOldR0l0odKsWV+m85is TU4Q== X-Forwarded-Encrypted: i=1; AJvYcCU00K4YNh4f/4HovadOznaPmHb5nHewuDbDOvqNneGpzzp3jPeqyAV+tTUVTUu81i+GEA4XagyvIu2u@lists.freedesktop.org, AJvYcCWRi4FWYiAPYWcuYe52oi+Ya2QDkkYOjEx4AWN6L9DB6r1jokHIpOURdDFaeULZzZN5s1V65wFx@lists.freedesktop.org, AJvYcCWhe0t7mD0bpUE7AgseUFuxk7PDiVeWHgNN1K+0PQIp+OzBKvBIUZiVkP/uqdUaPbq0zwfBZPYPawPLUqBRQQ==@lists.freedesktop.org, AJvYcCWuYjVw26nCDsVT+Q9h2VKoCOLo9oAk1qulrenE4g+Ec9+JJUAWtXgru/H9hzUJ5cCxYG3JaqdoJRK6@lists.freedesktop.org X-Gm-Message-State: AOJu0YyWQCrRWHXIEj5lY50kGwzucnx2Ak0R/QJlZ8MAIY2sMuT3ULO6 r0Sd0d7XQPjqBQEQi6MetxyytztKI9GqQY2aQVWvvGhRvuZo6F7B X-Gm-Gg: ASbGncsocf8Yi8QS7O4bphjKCsaZNgi1OU3D3NWP08rFkK3Ma0H+8LGtTT0f7bb/xSE viWUw/9/bwRsPMH4lrsa+D2xmDnh+w8FEFwjZViTy5kG4nvDGKgJZVEd6segz/3lFGYR9huyAcm CgaciEKTMhVmCEZrtf8uon8wNcxEZQSkP9a8VF+/w3m8MH9/DckbbCCmhtdf1ma+JfhmwYAgXtL +Wp84jeBafiKaftCf7raCiKumSbD1BVxN9TIlBahmn3fPPtt2AnyTO1sN4ZEaXou11eArod0CZI ZN+ge5Dj7i34z4mFtLswfpBAjfJBilfRTEP5BjYwBCgvPl/u X-Google-Smtp-Source: AGHT+IEjwcFP/08iV5u7smlEOAHtcy4vLQNSUwAcIBZCKkDwG3GOx0o4FLASRAUuvVLtd3Cgpon0RA== X-Received: by 2002:a05:6e02:170e:b0:3cf:bbd4:8aef with SMTP id e9e14a558f8ab-3cfbbd48bc6mr91708935ab.19.1737787610590; Fri, 24 Jan 2025 22:46:50 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:50 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 13/63] dyndbg: reduce verbose=3 messages in ddebug_add_module Date: Fri, 24 Jan 2025 23:45:27 -0700 Message-ID: <20250125064619.8305-14-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 fc9bf5d80aa9..6bac5703dd41 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 Sat Jan 25 06:45:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950746 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 21EC0C02195 for ; Sun, 26 Jan 2025 16:39:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 87A9710E438; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="IVpv6Jbm"; 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 A909A10E2B7; Sat, 25 Jan 2025 06:46:52 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-852050432a8so79388639f.1; Fri, 24 Jan 2025 22:46:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787612; x=1738392412; 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=grXz5NZcQHVvB030YeciAJG8O6y80X3jGiy6VqsSfuM=; b=IVpv6JbmRgR2BQcepqeGL5qxD62aUjIJ83QpLVtSvtdztXRD3zTMQU+6rPXfeqWl4D QpMwnDuMmuUdwnu34eiUuUOFwEFlDm0/SFcvGzKXwRXhWXALTRXm3xx8JltesmlVKzVv NqXuP2LtWAUjoSH6z/rpfnPYUpj976EDlLURaI2YjxlHxVvg5DGAcE6XjB1eJHwtLYLI UjRLMU6Lq+uOOeUOnZRyxNENEEPVgf2QsnlgoMuvbsuSipySOKx1G1MK5uFaeprm9Mi3 Ub0bwlR9vsUUv96dUFyl10RW1io8ul3wmKJ6XDVseInPUwgv3ysTpSFe0Q/Dil20wrQl T0ag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787612; x=1738392412; 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=grXz5NZcQHVvB030YeciAJG8O6y80X3jGiy6VqsSfuM=; b=m1JO8PFmEnPE9Zy90wUygWFRCPKaqQ5p5fLXrdUwGisAh97Vr1alvcI6iKP+KPA/2E kgmDpUc/TneuBv1sF+qqtksm7NXjZtN0BOIdlaLxPH4YzyQrIdt0DqYwXG4o64ET879Z z6zcP57MHfZHnyj5H4pEgN1B/uK3uIRY22Yy/GiqIyaIiyWzHjDW7Za6bFWTPMV82wnW kUZjflerFA93snNDDU0YO4gdAlceFrM/qkm230rucG2i8IX6MlTOTx0WfmNlXf3gvfhB CwGeVu8/wxfSKZ430mbELvyXxstSIVuMpPB4edEVVk3xXPlN4Qu8ARM2b9KS6TLGnLuN bxQQ== X-Forwarded-Encrypted: i=1; AJvYcCUmsLt05I4YWL0QoxxENg8TEJIBID7EQn2rrBPh8Fu82HLEcbQoryrduFGcNt7+Q0fCzAcjIN/DTb3E@lists.freedesktop.org, AJvYcCVir959EqGTNDtcm6Y0TWIXwTVO5TSqO1cCxzSU3v1nw0BW7e/eV4+EsAVFvBoAb7XAWQXYEIRRBNmXFDLJ2g==@lists.freedesktop.org, AJvYcCVm6SIQVMKIwWxPcfen+g7wx9NUKynrRBq0kMm+Gf32LFyey3innw0LwxcBMtjPQyMpfqqEKV4Z@lists.freedesktop.org, AJvYcCWa+zn7kFYbu89+eUQGn8wGtj432gNdG6cdHSnRN/rvQlMGr5DBAMIgwNOj7pZ4p9a+s3PpnwNL9X6J@lists.freedesktop.org X-Gm-Message-State: AOJu0YzbMELf1AfU8OmfbxQtBKxsiZKKqTg8SrULgbKkJo0phu7Vl4Fu +Ynd6VoW0jFsVrIEbrdXO355XWh9HKf8eeZo4Nfv3L1MnfcYMOug X-Gm-Gg: ASbGncsTUv9KmXfs9ipGKxqx3leWDWe8JiqFAxIYbUQA3WUrpK978k820HBj2A2QL8a gY3ZKdqyQV5Q6QQPy1TsPS6L0/c+ycMp0X63xerYnafExfWFkyBZXZWvTXse4LEjiSENxS11cr7 Vq2tO2LM/cuz4SVxNkk+D6jznyH/1KwQy3ABZKlsXfEo9AiqDndAoGxlloE9JNEbm3G7Sk88ay6 TCQkb6G3eWFDSVeyR8cqetB/+L7Nskz6zo+fJmcQgHZhPlajJDONxqdPPiaUWQu6G1i2KeLvLG/ 9Ab1N2nZn2KyuOuZBVW5qV4Tt0VcntximJ1UkA== X-Google-Smtp-Source: AGHT+IHFKYpqpQScIfW1Vc6Xu+w+0UcU53IhYifAXcbuX7RiM3pounMCu0UgOTi+gUbfB47ggO3bJw== X-Received: by 2002:a5e:d804:0:b0:82c:ec0f:a081 with SMTP id ca18e2360f4ac-8521e32b142mr475785839f.4.1737787611732; Fri, 24 Jan 2025 22:46:51 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:51 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 14/63] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Date: Fri, 24 Jan 2025 23:45:28 -0700 Message-ID: <20250125064619.8305-15-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 6bac5703dd41..094d6e62a9d1 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 396144cf351b..74d183ebf3e0 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 Sat Jan 25 06:45:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950751 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 256D5C0218E for ; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A8DF910E446; Sun, 26 Jan 2025 16:39:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BEeArEZn"; dkim-atps=neutral Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id A94B110E120; Sat, 25 Jan 2025 06:46:53 +0000 (UTC) Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-3a8146a8ddaso7563675ab.1; Fri, 24 Jan 2025 22:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787613; x=1738392413; 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=NIDfNAZd/Jw4pBIb/8+H7rZ6KNLM9vcRA8qjI/u0xH0=; b=BEeArEZnhlzqbiouSjWmZxZI/9Z9h1Xmzn4Qol9LgET0xOvtAlQaLBoSim8tlwyeU9 DnhwZQr22MPvNA9O7ML3EQjUjTNEbwZ4j/DbTrV980X7NJWPmbdmp13gzaFI4Fwphuiz C26ejwMrGtxQ9JoBrkcY6xqPQ6GG/al86CxwEAqPRa3maIXETjOzYSj7MpQc0+iY7Y55 lRIIYT0y33wH6eip/XY9vfRFrDiVaAZRfkA0pH2V0zagpl15o4orRJdOEyjePe2JAHYx vJvGMwEU5Z/jdbW5u0ATqttweeQ99EN7rYrp4hgyg2//poSm/fTtQ+FpppW8SZRvXJOT vT4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787613; x=1738392413; 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=NIDfNAZd/Jw4pBIb/8+H7rZ6KNLM9vcRA8qjI/u0xH0=; b=xJOcjiCLXZI/JhwD4XDiAhHjJZPrzBt71UoOAcSF4xRzZPo3AjtfKwOEu79OW0F1KU 5fjlOqVAxPASjz2tmqNlFVtjxD3N0+YI7h4Tp84v8N47xxw0C05UuuqjZUA/tmGprMx5 OJgdE163V9ZpYhLZi1d/ajH7gc6ywJYdPd7ouU9t4A2f52Jdi0K8YHcuBDJsdhD0sv7w Rq4b9AIU02kOXaoqplig53GChhZRBXvEOsxuNp+JlsCEVrni4vpHIcu8Li0AaitiXWzv V2bK9xS5d3kyGVXA6RJ7Qo8ULZP4dOtaqVNZ7Z+anq5PbcqDJ4BSlPBb/NLQNh4rqjik FlLw== X-Forwarded-Encrypted: i=1; AJvYcCUvbOczE7eDmLW/Y4ftAWP0n5DitDDTATfbVjPTH8gU87A08XD3vSZEUmeidUfMK+NKfs+3VRX0lAhR@lists.freedesktop.org, AJvYcCW4x9VYgXfgrGjmsHwTfVZNoLh8n80PJczdHhpbl3nY2cc2WNl/xAn77szAkdqNlcVlGThEa7Ea@lists.freedesktop.org, AJvYcCWGC3UbrGzyaLbp559ARvB1PVgqk94xxmi9HhzEy5DaZpJP6rqdQ6watMzfN97d5A0wsuQyfPMp/i7INWbmjw==@lists.freedesktop.org, AJvYcCXvZZD0raBjGKTQUKDns/ZcNc11dAS03pqJPrc3n4HEC7VcSChb/tn9RTQmtsTq3L09sn+es881eCXW@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx7Y6W7N3zIrqkJxHJMZcjG4lX44213fLhlw+jpBqWq1XOV+NaT LNlEZp688P5afD4wJJLgU8ROI27j4wM6+MfGcTvXN4Jy/xAXBQxn X-Gm-Gg: ASbGncsYPQIOvSWFDqHI++X0m8y6zmYgXDnysK0v+deGhdJUeWks8VDhaMpSXybcqVh cjEd87er5TBozXCisyH7vBIGYJdi6uVcAZtUvP5dzBOUKBTS7U5/hQOC4nEvikrNjjfZt9Q1trn D+1y/9nRhrfGtlJMY/4qlc6vjh/I9O9JOnTDU3kfzPFmtlcymEsWjpJnpCUdo6Si/zARJJis1c3 +g1ZsA0nrl0bBU093vhH/VNtc1Xr1GLUsYPeYs3WRvBbeaFYwLaLWmcqXN3g/PtSyCd6l/nVzaG O0vzGdXfr+R7xR72BW/URXG9J5nRNplz+SamjQ== X-Google-Smtp-Source: AGHT+IFnBc5L69q2w2UCaGc8rKGCQ73xwiQltSLOxSH0uqSvy0LUY+8SurgBk2ydmGJTEx6YzSwjXA== X-Received: by 2002:a05:6602:2b8a:b0:844:bd90:d45c with SMTP id ca18e2360f4ac-851b65227a0mr2635707139f.13.1737787612867; Fri, 24 Jan 2025 22:46:52 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:52 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 15/63] checkpatch: add an exception to the do-while wrapper advice Date: Fri, 24 Jan 2025 23:45:29 -0700 Message-ID: <20250125064619.8305-16-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 new DYNDBG_CLASSMAP_* macros (added in following commits) expand to multi-statement declarations, like module_param_named does. They are invoked in file-scope, not in function scope, and cannot be wrapped by a do-while, so add an exception by name for them. cc: Andy Whitcroft cc: Joe Perches cc: Dwaipayan Ray cc: Lukas Bulwahn Signed-off-by: Jim Cromie --- scripts/checkpatch.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 9eed3683ad76..4a93b2ede8cd 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -5963,6 +5963,7 @@ sub process { MODULE_PARM_DESC| DECLARE_PER_CPU| DEFINE_PER_CPU| + DYNDBG_CLASSMAP| __typeof__\(| union| struct| From patchwork Sat Jan 25 06:45:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950797 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 1B07FC0219E for ; Sun, 26 Jan 2025 16:40:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B1AA510E470; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VEoMxj3C"; 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 6D25A10E120; Sat, 25 Jan 2025 06:46:55 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-844ce6d0716so215093739f.1; Fri, 24 Jan 2025 22:46:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787615; x=1738392415; 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=VkCP7DhbXFSZduxXgYbh8U8lijC3RzU1c78g2O1IWuU=; b=VEoMxj3Cj5pw7z3Azx4+D8kMKUSSU/uSp9MOJ58QWtKrNiOqONKO+O4aeYsz4N5/EY Sy7sniSyAhz7rrKrC45mXLSZdRL451a0T1nX9HryhlbkgX+eWOaV7z5XT7spyFOwQz4Y fz6X7jxvIce6M2brqeqjmqxUNLYHMChDFt5gJ1wU68q7Or9mjqXlQji0kFN0xC1RYKzu 9i3mK5HKSCit8kgXRhXAxAYPcFqNmuQzlfwA3jD/ztSXsVA/rZOBJR23Io+yVrDHt9Hb 3lAZO9E0wkYi9NWxRcmds9WUoE8O+NySr0fEGpM4jvgbucIUhSebd9SwpNMLSOPgNsee CRWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787615; x=1738392415; 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=VkCP7DhbXFSZduxXgYbh8U8lijC3RzU1c78g2O1IWuU=; b=lPazjE4UKTDbjqUtnk/30TuzWC5hC6hVRLkSdI1Flrq/UJcGDwQ018KvJrCe0R2yDZ DZp5xHi07ArtcBKRDy4KbNS/dVe5JQCIBsW3pg36b0T+GaNdaeOQ6Kkt7tAHSgJEzUwX HUj3Uqfr8Nj8QYlczs9m8sCszVDoIBUemA5f4pB8ZqGaj4mH17ots+wGV8gSk3HGp1y4 vnOzxpsu6H+d1alNzRoFnEUN/24GrslZ3YXTmNJfTNRfow792lAUP6nv6pqvcjf602+p DF4T1oSkHkdRHWthQjX2CB9onkJG4nWPZCVCZ7VUJKZy+/Q0TodNJyLbiwM+xZuotWRd ddTA== X-Forwarded-Encrypted: i=1; AJvYcCV7wl79UUEUoJNKq+zM6cI7cEJ+RIaNLWfRHroDFSiuIMoozwbzopgsT6uKocmpA65+P/F/NqsV@lists.freedesktop.org, AJvYcCVZ/LGDjibiaW2+dJvdsnWjrc5tEHsIF6uNwbq4sOvXtbW776vJuLH7fUmH7GiG8BrTq/QoFiSSf1wt@lists.freedesktop.org, AJvYcCW5sGqtbGvSa3fw7DEl0/gQV+6peLi+RnvGuA5psO5zjvgPow3XX96On1oVDZxu0DzxTVHZ+Bd1aUnGPyna9g==@lists.freedesktop.org, AJvYcCWI5gD8M5Ucvkre0Bb3gScDMSLyqEEGg9lwkZXfr/oIdy6kpX3ETeXAVqGgV5P9MQ3UGN9rldCKnOi2@lists.freedesktop.org X-Gm-Message-State: AOJu0YwtW3DZb6Rj6GxvQ94yLkMsDUXbkFMp3gqNq9m8izqKpCbQlSnl LrFOy32dKVcqmZR69nNz4ar/9T8v7OquMNcSmADGsyVCPDD3pO5Wv8EeLw== X-Gm-Gg: ASbGnct+YASDJQwDuvhYByHJzGvaMcc/Y7KpAOtXR5SK90rghJF/48mYX/NB14Pci83 3y/Evmxnu+kh2yGxF+MMolXCzhhxC1z00vFWpfyxeqPPw1gwai/F3ICIJengLnPOmXaNDCB3rxa 7Go7rq411i/LUVGa4yy8tAy9EiGWleLWPdGetzcQ6ckD6+Z9kQ+1NcvL2Ak6aFuNR5O9RhB+5Li J+VCloEiawVLzgGNk+EcZpRkTDHqBeOEY4wdRGLkl+sKfgol1RaPAx5zQHBkdxqCLX09r0GHZEe 5L9ZXDjRhujezg9ovK1mzvRSYRCNSytmGMHimXtbj8mIosAk X-Google-Smtp-Source: AGHT+IFEAbKqJslLISqOJfXxgdDRd6CG6f7hCTvFXUPh0fPe+eEs+KYVInCmMitq6lb5zwaZFQusPA== X-Received: by 2002:a05:6602:6b12:b0:849:d268:d75 with SMTP id ca18e2360f4ac-851b627f520mr2536660839f.9.1737787614361; Fri, 24 Jan 2025 22:46:54 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:53 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 16/63] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP Date: Fri, 24 Jan 2025 23:45:30 -0700 Message-ID: <20250125064619.8305-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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. Further, its culpable in the CONFIG_DRM_USE_DYNAMIC_DEBUG=Y regression; its use in both core & drivers obfuscates the 2 roles. So 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 just modifies DECLARE_DYNDBG_CLASSMAP, dropping drop 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" declarations fixes 2nd-defn problem creates a ddebug_class_user record in new __dyndbg_class_users section this allows ddebug_add_module(etal) to handle users differently. 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, and remove the BROKEN marking. 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 is 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 new fields for the new sections: 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 any 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. NB: this patch ignores a checkpatch do-while warning which is fixed by a preceding commit, which would be wrong for declarative macros like module_param_named() etc. Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") Signed-off-by: Jim Cromie --- v9 - commit-msg tweaks DRM:CHECK warnings on macros: add parens extern DEFINEd _var, static classnames change ddebug_class_user.user_mod_name to .mod_name simplify ddebug_find_valid_class improve vpr_cm_info msg format wrap (base) in macro body move __DYNDBG_CLASSMAP_CHECK above kdoc for DYNDBG_CLASSMAP_DEFINE 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 dyndbg: This fn formerly returned the map which contained the class (thus validating it), and as a side-effect set the class-id in an outvar. But the caller didn't use the map (after checking its not null), only the valid class-id. So simplify the fn to return the class-id of the validated classname, or -ENOENT when the queried classname is not found. Convey more useful info in the debug-msg: print class-names[0,last], and [base,+len] instead of the class-type printout, which is currently always "type:DISJOINT_BITS". And drop ddebug_classmap_typenames, which is now unused. [root@v6 b0-dd]# modprobe test_dynamic_debug_submod [ 18.864962] dyndbg: loaded classmap: test_dynamic_debug [16..24] V0..V7 [ 18.865046] dyndbg: found kp:p_level_num =0x0 [ 18.865048] dyndbg: mapped to: test_dynamic_debug [16..24] V0..V7 [ 18.865164] dyndbg: p_level_num: lvl:0 bits:0x0 [ 18.865217] dyndbg: loaded classmap: test_dynamic_debug [0..10] D2_CORE..D2_DRMRES [ 18.865297] dyndbg: found kp:p_disjoint_bits =0x0 [ 18.865298] dyndbg: mapped to: test_dynamic_debug [0..10] D2_CORE..D2_DRMRES [ 18.865424] dyndbg: p_disjoint_bits: classbits: 0x0 [ 18.865472] dyndbg: module:test_dynamic_debug attached 2 classmaps [ 18.865533] dyndbg: 23 debug prints in module test_dynamic_debug [ 18.866558] dyndbg: loaded classmap: test_dynamic_debug_submod [16..24] V0..V7 [ 18.866698] dyndbg: found kp:p_level_num =0x0 [ 18.866699] dyndbg: mapped to: test_dynamic_debug_submod [16..24] V0..V7 [ 18.866865] dyndbg: p_level_num: lvl:0 bits:0x0 [ 18.866926] dyndbg: loaded classmap: test_dynamic_debug_submod [0..10] D2_CORE..D2_DRMRES [ 18.867026] dyndbg: found kp:p_disjoint_bits =0x0 [ 18.867027] dyndbg: mapped to: test_dynamic_debug_submod [0..10] D2_CORE..D2_DRMRES [ 18.867193] dyndbg: p_disjoint_bits: classbits: 0x0 [ 18.867255] dyndbg: module:test_dynamic_debug_submod attached 2 classmap uses [ 18.867351] dyndbg: 23 debug prints in module test_dynamic_debug_submod --- MAINTAINERS | 2 +- include/asm-generic/vmlinux.lds.h | 1 + include/linux/dynamic_debug.h | 83 ++++++++++-- kernel/module/main.c | 3 + lib/Kconfig.debug | 24 +++- lib/Makefile | 3 + lib/dynamic_debug.c | 203 ++++++++++++++++++++++++------ lib/test_dynamic_debug.c | 111 +++++++++++----- lib/test_dynamic_debug_submod.c | 10 ++ 9 files changed, 355 insertions(+), 85 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c diff --git a/MAINTAINERS b/MAINTAINERS index 0fa7c5728f1e..38afccb3b71e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8041,7 +8041,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 54504013c749..eb93fd09832b 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -366,6 +366,7 @@ defined(CONFIG_AUTOFDO_CLANG) || defined(CONFIG_PROPELLER_CLANG) /* 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..dc610a12b91c 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -71,9 +71,28 @@ enum ddebug_class_map_type { */ }; +/* + * dyndbg-classmaps are devised to support DRM.debug directly: + * 10 enum-vals: DRM_UT_* define the categories + * ~23 categorized *_dbg() macros, each passing a DRM_UT_* val as 1st arg + * 2 macros below them: drm_dev_dbg, __drm_dbg + * ~5000 calls to the categorized macros, across all of drivers/gpu/drm/ + * + * When CONFIG_DRM_USE_DYNAMIC_DEBUG=y, the 2 low macros are redefined + * to invoke _dynamic_func_call_cls(). This compiles the category + * into each callsite's class_id field, where dyndbg can select on it + * and alter a callsite's patch-state, avoiding repeated __drm_debug + * checks. + * + * To make the callsites manageable from the >control file, authors + * provide a "classmap" of names to class_ids in use by the module(s), + * usually by stringifying the enum-vals. Modules with multiple + * classmaps must arrange to share the 0..62 class_id space. + */ + 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 +100,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 debug classes used by a module. + * @_var: name of the classmap, exported for other modules coordinated use. + * @_mapty: enum ddebug_class_map_type: 0:DISJOINT - independent, 1:LEVEL - v2>v1 + * @_base: reserve N classids starting at _base, to split 0..62 classid space + * @classes: names of the N classes. + * + * This tells dyndbg what class_ids the module is using: _base..+N, by + * mapping names onto them. This qualifies "class NAME" >controls on + * the defining module, ignoring unknown names. + */ +#define DYNDBG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ + static const char *_var##_classnames[] = { __VA_ARGS__ }; \ + extern struct ddebug_class_map _var; \ + struct ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_classes") _var = { \ + .mod = THIS_MODULE, \ + .mod_name = KBUILD_MODNAME, \ + .base = (_base), \ + .map_type = (_mapty), \ + .length = ARRAY_SIZE(_var##_classnames), \ + .class_names = _var##_classnames, \ + }; \ + EXPORT_SYMBOL(_var) + +/* + * XXX: keep this until DRM adapts to use the DEFINE/USE api, it + * differs from DYNDBG_CLASSMAP_DEFINE by the static replacing the + * extern/EXPORT on the struct init. */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] = { __VA_ARGS__ }; \ @@ -99,12 +141,37 @@ struct ddebug_class_map { .class_names = _var##_classnames, \ } +struct ddebug_class_user { + char *mod_name; + struct ddebug_class_map *map; +}; + +/** + * DYNDBG_CLASSMAP_USE - refer to a classmap, DEFINEd elsewhere. + * @_var: name of the exported classmap var + * + * 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)) +#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 = { \ + .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 { @@ -205,7 +272,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * (|_no_desc): former gets callsite descriptor as 1st arg (for prdbgs) */ #define __dynamic_func_call_cls(id, cls, fmt, func, ...) do { \ - DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ + DEFINE_DYNAMIC_DEBUG_METADATA_CLS((id), cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) \ func(&id, ##__VA_ARGS__); \ } while (0) diff --git a/kernel/module/main.c b/kernel/module/main.c index 5399c182b3cb..c394a0c6e8c6 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2546,6 +2546,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 f3d723705879..933f69ef87f8 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -2884,12 +2884,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 a8155c972f02..7f66fc1c163d 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -84,6 +84,7 @@ obj-$(CONFIG_TEST_SORT) += test_sort.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 @@ -228,6 +229,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 094d6e62a9d1..6bca0c6727d4 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,23 +151,35 @@ 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, - __outvar int *class_id) +#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); \ + }) + +static int ddebug_find_valid_class(struct ddebug_table const *dt, const char *class_string) { 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; - return map; + vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); + return idx + map->base; } } - *class_id = -ENOENT; - return NULL; + 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) { + vpr_dt_info(dt, "class-ref: %s -> %s.%s ", + cli->mod_name, cli->map->mod_name, class_string); + return idx + cli->map->base; + } + } + return -ENOENT; } /* @@ -173,16 +188,14 @@ static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_table cons * callsites, normally the same as number of changes. If verbose, * logs the changes. Takes ddebug_lock. */ -static int ddebug_change(const struct ddebug_query *query, - struct flag_settings *modifiers) +static int ddebug_change(const struct ddebug_query *query, struct flag_settings *modifiers) { int i; struct ddebug_table *dt; unsigned int newflags; unsigned int nfound = 0; struct flagsbuf fbuf, nbuf; - struct ddebug_class_map *map = NULL; - int __outvar valid_class; + int valid_class; /* search for matching ddebugs */ mutex_lock(&ddebug_lock); @@ -194,8 +207,8 @@ static int ddebug_change(const struct ddebug_query *query, continue; if (query->class_string) { - map = ddebug_find_valid_class(dt, query->class_string, &valid_class); - if (!map) + valid_class = ddebug_find_valid_class(dt, query->class_string); + if (valid_class < 0) continue; } else { /* constrain query, do not touch class'd callsites */ @@ -559,7 +572,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 +701,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 +1051,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 +1142,129 @@ static const struct proc_ops proc_fops = { .proc_write = ddebug_proc_write }; -static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _ddebug_info *di) +#define vpr_cm_info(cm_p, msg_fmt, ...) ({ \ + struct ddebug_class_map const *_cm = cm_p; \ + v2pr_info(msg_fmt " %s [%d..%d] %s..%s\n", ##__VA_ARGS__, \ + _cm->mod_name, _cm->base, _cm->base + _cm->length, \ + _cm->class_names[0], _cm->class_names[_cm->length - 1]); \ + }) + +static void ddebug_sync_classbits(const struct kernel_param *kp, const char *modname) +{ + const struct ddebug_class_param *dcp = kp->arg; + + /* 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(" kp:%s.%s =0x%lx", modnm, kp->name, *dcp->bits); + vpr_cm_info(map, " %s mapped to: ", modnm); + ddebug_sync_classbits(kp, 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 classmap: %s", modnm); + /* 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 classmap: %s", modnm); + 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, + const 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->mod_name)) + continue; + if (!strcmp(cli->mod_name, dt->mod_name)) { + vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, + cli->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->mod_name); + + vpr_dt_info(dt, "attach-client-module: "); } /* @@ -1158,6 +1274,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 +1299,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 +1462,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 74d183ebf3e0..1838f62738c4 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 Sat Jan 25 06:45:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950749 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 B6156C0218D for ; Sun, 26 Jan 2025 16:39:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0976310E43D; Sun, 26 Jan 2025 16:39:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="WHm0j+eA"; dkim-atps=neutral Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) by gabe.freedesktop.org (Postfix) with ESMTPS id 318BE10E120; Sat, 25 Jan 2025 06:46:56 +0000 (UTC) Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-3cfc154874eso19217525ab.3; Fri, 24 Jan 2025 22:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787615; x=1738392415; 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=Xde8rOoc7ub5IEPiyVqYWw11iutjj4hEBt+3xz2QfjM=; b=WHm0j+eAgoxalVTiWMnB9cvpt328bkL9HF1CgwQzsM5oSkZAWZ8904M5XZuzpPyXD0 nqJmC217nvP6Gw0CkCuU2ysGrdyxIZR2RozD7qfXpTCsaIlZKZr/s1so3oW9MvWOyGu+ PF96dI+ppKSjOXEBrsZyDf0/PEZ622i62T6y0VVd6xXceqIQqmQDojiZ1/yZtn0w6llM I9q/yCmdXcb+EBk9RVjMtBOVI4QtooUoB1+b4QeY/FZvqiTw4DpKeUd8O/bdm+2Dh6Ta 00EsCpij0+ZXWaA8fBgbrU9RRuy84qHfrpwsArK5lalwB9KxcDOY0TwsXfNaYqMJoj+5 S9+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787615; x=1738392415; 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=Xde8rOoc7ub5IEPiyVqYWw11iutjj4hEBt+3xz2QfjM=; b=NsJVLYKAX7WP5sx179c4fT90vKyFh7PnTlU82PzJQJTiPpsSpzSpwmaZYnCzBxV514 NO7Xyg4LL80bXtjGDKcqbdD7WolhVCgS3hkN+M20mIYbijU6d9ql9H6Vqddis/5N1sB/ ly1WpxAkBaufo6KV9E/5vtQbn+7pv1zOnRFPPhnacidouYyFrr71j+bAZYbeRrZjwTSZ 0PTOYneyiYU7W2T3tUjA6XLG4eUjGmCjFMRUyHSCqRPeEobEXQDk0EPTx8dYcLO22LgG 6G8+XY0uOK3dUEW17DHa0wYaCMhUGZ+ukDHP6ohHVZD4bQ1AGmHCExp7ox7iN9q/fufm mYZg== X-Forwarded-Encrypted: i=1; AJvYcCUx4RMJiVEZ/TUPtsMa69XWVJqmD7z0J7C5tUgJXSc7rqeoc27kUOw3N3RIt8Y6rTu310lYffT1g0Cr@lists.freedesktop.org, AJvYcCVI0hlXZYLjlikj0DKKsgBioaKz8bVWmgTLGEdU2WQeOY3K4vl8VteTJtUhAcy5I5fZqfMHypyG@lists.freedesktop.org, AJvYcCVhJHmZkaTp+7vIbA6US3G3L0FJ1YO0pWz4tKyZ01aFx5kjI0SFr9OwPfvSy+cM0Zl+eoKqSqmWFx70/ehzSA==@lists.freedesktop.org, AJvYcCVo7QpwjkDmue31zSn7HeZ231ou0MVC3uHzEUrvO6XC0QjNIKMJBLtgRgo4FVB+jRCVSDOR+WTMdWAn@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx+i/Hnq/UoOqHy9n6LkQqeo6F0lQ4QqFFylFxMalGcKBND2qGX 5qyNbbEE1q7WW0v7MQvj7CNXpum4Qa/eDVsRDkLhUXSEVXF2fO49NSlOxQ== X-Gm-Gg: ASbGnctpG1br02MwHp7ot9KabhbUVaxUSuj6c0qnF5jj+DfEuyMZS6QbU2kSQazpMQY TqSIrlYQPFMKFQsVRIxkhkl6PMbVOuTtnL8yejYG8cUgQzTr40FcqCopq1C+jDcG18IVfHQjIKJ KXgBxwNHC+lOrM1iecqz2h7ot4X2IFSW8nXmUm9DFUwH1eN3n8+4tk3mdDZqH4dig4EBgCkW2BF QEgH0ngdL/NHA/lc6NB/5AIqdcqe31qmysgwNQiI78wsiQIIw4M0DH7wD9TRRPOu4H8f+H3wgKw oB92onLsASXdEj0mwBGQEuTuVE5O9Tob7q2wCQ== X-Google-Smtp-Source: AGHT+IG0fqXZTCvCCnwL9vi7cYB4QP6opHHV2Qe7YcKfvhFM9yUxKYXJHOh6jRvUhuTThLQuLUmipg== X-Received: by 2002:a05:6e02:174a:b0:3cf:ce7c:b8b1 with SMTP id e9e14a558f8ab-3cfce7cb91cmr43838095ab.18.1737787615489; Fri, 24 Jan 2025 22:46:55 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:55 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 17/63] dyndbg: check DYNDBG_CLASSMAP_DEFINE args at compile-time Date: Fri, 24 Jan 2025 23:45:31 -0700 Message-ID: <20250125064619.8305-18-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 __DYNDBG_CLASSMAP_CHECK to implement these arg-checks at compile: 0 <= _base < 63 class_names is not empty class_names[0] is a string (class_names.length + _base) < 63 These compile-time checks will prevent several misuses; 4 such examples are added to test_dynamic_debug_submod.ko, and will fail compilation if -DDD_MACRO_ARGCHECK is added to cflags. Signed-off-by: Jim Cromie --- - split static-asserts to __DYNDBG_CLASSMAP_CHECK - move __DYNDBG_CLASSMAP_CHECK above kdoc for DYNDBG_CLASSMAP_DEFINE silences kernel-doc warnings --- include/linux/dynamic_debug.h | 9 +++++++++ lib/test_dynamic_debug.c | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index dc610a12b91c..2b0c943af330 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -99,6 +99,14 @@ struct ddebug_class_map { enum ddebug_class_map_type map_type; }; +#define __DYNDBG_CLASSMAP_CHECK(_clnames, _base) \ + static_assert(((_base) >= 0 && (_base) < _DPRINTK_CLASS_DFLT), \ + "_base must be in 0..62"); \ + static_assert(ARRAY_SIZE(_clnames) > 0, \ + "classnames array size must be > 0"); \ + static_assert((ARRAY_SIZE(_clnames) + (_base)) < _DPRINTK_CLASS_DFLT, \ + "_base + classnames.length exceeds range") + /** * DYNDBG_CLASSMAP_DEFINE - define debug classes used by a module. * @_var: name of the classmap, exported for other modules coordinated use. @@ -112,6 +120,7 @@ struct ddebug_class_map { */ #define DYNDBG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ static const char *_var##_classnames[] = { __VA_ARGS__ }; \ + __DYNDBG_CLASSMAP_CHECK(_var##_classnames, (_base)); \ extern struct ddebug_class_map _var; \ struct ddebug_class_map __aligned(8) __used \ __section("__dyndbg_classes") _var = { \ diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 1838f62738c4..b1555b0a2bb1 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -123,8 +123,19 @@ DYNDBG_CLASSMAP_PARAM(level_num, p); DYNDBG_CLASSMAP_USE(map_disjoint_bits); DYNDBG_CLASSMAP_USE(map_level_num); +#if defined(DD_MACRO_ARGCHECK) +/* + * Exersize compile-time arg-checks in DYNDBG_CLASSMAP_DEFINE. + * These will break compilation. + */ +DYNDBG_CLASSMAP_DEFINE(fail_base_neg, 0, -1, "NEGATIVE_BASE_ARG"); +DYNDBG_CLASSMAP_DEFINE(fail_base_big, 0, 100, "TOOBIG_BASE_ARG"); +DYNDBG_CLASSMAP_DEFINE(fail_str_type, 0, 0, 1 /* not a string */); +DYNDBG_CLASSMAP_DEFINE(fail_emptyclass, 0, 0 /* ,empty */); #endif +#endif /* TEST_DYNAMIC_DEBUG_SUBMOD */ + /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") From patchwork Sat Jan 25 06:45:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950798 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 516DEC02181 for ; Sun, 26 Jan 2025 16:41:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E40D510E467; Sun, 26 Jan 2025 16:40:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="g75/UTEp"; 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 6127D10E120; Sat, 25 Jan 2025 06:46:57 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-844ce6d0716so215094939f.1; Fri, 24 Jan 2025 22:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787616; x=1738392416; 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=4426qb3gIsTZka2SxcS2AqXLzVLPKaaERHnBDYOLWSA=; b=g75/UTEphoKyiJ8Z8X3Yne7KBOgxmZFkAFx3aX67VQ+W1ybrMxPDFMl10TtCsloGz5 m2a8UBy31HaIAI+pQ+bHDZU9EKOAkin7M4pUGhRwKyVCZr+Lvp/mKn2r2nUvqHP8ovqg XVaakPQVtiBoyze1x/h1WpZYIyCt/0L4XSycmvKYN/iM20vuK7FLuerivQHUf283cLHR EyT2Lty66pMgEvbVxLOMGyH25oqKzsFSNVvvD3B51IAPw7hFAlLey2rBAsKxGCdy+1Zy VS92dGv/p09PxR5swatj87F0KVPhmMYupaOVMFAuo1JAD0sSRjzTk8sb+/QAuFXlxTS0 NYqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787616; x=1738392416; 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=4426qb3gIsTZka2SxcS2AqXLzVLPKaaERHnBDYOLWSA=; b=w6a82B7M2Hb6/plnngcM8zkZCz7nOEAkVL1+HgdS+2ZuYWjJTvTGo3laQKDW8dfXf/ 7OY59QVnJ3F1cYPCfOsQ5wf3bi/8uTwZ7B5SUpBFWhUSh1F/BWpcDll/RM3VFJpINSZo FZGurnkVtKntlDeUi/rZuPyAco6f5nm5nYG0Bx6l3zinV+mx/35LctMSnvCfBUQgJNYl cwCH9INUT01KaIjcEsag7SYoGD3Dw6QmML1kb3dL8z5JISKa6AQr1+kGSUruoFSs7Da3 SwydzWAX9RiA1zbDrbl70zZwqv4pEaY+5JYU2kllAfh9ufUrlSskRzBo946zm1pp57CN z8Pw== X-Forwarded-Encrypted: i=1; AJvYcCVH8rqyjqnQFpe4Ouo++bJ0ASgC3IJsq0I1oyTTzTI2mmprbI2gqgOZNYb2EU1OFOidVG0xZE5ZGKsTdiFgSg==@lists.freedesktop.org, AJvYcCVW+9Ftkv3SIpMxAgipmrvONeaisuwiv2xKD+aPbVJH2zAX5sTXM/hUZoVmFD9/vSmGlASDmG+F@lists.freedesktop.org, AJvYcCVtQ/Ikdjd46OMDM4kPRiJigsvGhuO+q6a7NWp3G/xzPSHbRbQ7MUpVQPZU5Jx6bPCnIjPk+ZwQOOjv@lists.freedesktop.org, AJvYcCXhOlOleWPRqPZYmpAhKj5A3IrQoKfhq05sRKUq6JhBAwBz9p4vTckqvR0+fQ2jNstz0ejJsG6wnpX1@lists.freedesktop.org X-Gm-Message-State: AOJu0YwNYRerLC7GLE16bJPglCYNbE0JPwvvGYGcRgXOvBo6hHWnKVgi XoF2QwEgiEUw1LsOS+yGHS2wdYTNTHFLC5Wv9918vfEWt+jM5RsS X-Gm-Gg: ASbGncuJPzpTkQcgjYMlsvRszrCO/uFgAKaKMF8Ah52llw9KtqkhzotLfbBQA/M7vyv G1HhRmTEyDIe+TLSg7gRfzSbut+ytoDaLJSh0wg59vcQ4x8R3XMYhz4D03/vZVokyTtuhfrRe9z geY7f8UF8jqhHRIDg4ZGd6peBcgc7LXO6s+Nmj+FPol5pSjvNOJjgrrD/XpuLqwv00uZ2sis+r8 HFyi9lYpzq1tcpW6DROFpaFfHJC4KEHEzKyDsQks7Obz9ZuN6ue2t+7Zh12K/slCdDxX7tReFS0 Yoyqp8SyHOxIsJxUGyD8eOT2sO6Dph9CkNCHBCbph8MTwBGA X-Google-Smtp-Source: AGHT+IHPcwCIcEeaDfvcsC8Y0hmazgAlIp69PtLu+D2gBA3Q65N9zrEn328wJ16fD3PoHPmaHxXlww== X-Received: by 2002:a05:6602:2d91:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-851b62b1c79mr3161173639f.12.1737787616655; Fri, 24 Jan 2025 22:46:56 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:56 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 18/63] dyndbg: add/use for_subvec() to reduce boilerplate Date: Fri, 24 Jan 2025 23:45:32 -0700 Message-ID: <20250125064619.8305-19-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 for_subvec() macro to encapsulate a for-loop pattern thats used repeatedly to iterate over a boxed.vector of N elements. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 6bca0c6727d4..08b6e4e7489f 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -158,20 +158,34 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) _dt->num_class_users); \ }) +/* + * simplify a repeated for-loop pattern walking N steps in a T _vec + * member inside a struct _box. It expects int i and T *_sp to be + * declared in the caller. + * @_i: caller provided counter. + * @_sp: cursor into _vec, to examine each item. + * @_box: ptr to a struct containing @_vec member + * @_vec: name of a sub-struct member in _box, with array-ref and length + */ +#define for_subvec(_i, _sp, _box, _vec) \ + for ((_i) = 0, (_sp) = (_box)->_vec; \ + (_i) < (_box)->num_##_vec; \ + (_i)++, (_sp)++) + static int ddebug_find_valid_class(struct ddebug_table const *dt, const char *class_string) { struct ddebug_class_map *map; struct ddebug_class_user *cli; int i, idx; - for (i = 0, map = dt->classes; i < dt->num_classes; i++, map++) { + for_subvec(i, map, dt, classes) { idx = match_string(map->class_names, map->length, class_string); if (idx >= 0) { vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); return idx + map->base; } } - for (i = 0, cli = dt->class_users; i < dt->num_class_users; i++, cli++) { + for_subvec(i, cli, dt, class_users) { idx = match_string(cli->map->class_names, cli->map->length, class_string); if (idx >= 0) { vpr_dt_info(dt, "class-ref: %s -> %s.%s ", @@ -1190,7 +1204,7 @@ static void ddebug_apply_params(const struct ddebug_class_map *cm, const char *m if (cm->mod) { vpr_cm_info(cm, "loaded classmap: %s", modnm); /* ifdef protects the cm->mod->kp deref */ - for (i = 0, kp = cm->mod->kp; i < cm->mod->num_kp; i++, kp++) + for_subvec(i, kp, cm->mod, kp) ddebug_match_apply_kparam(kp, cm, modnm); } #endif @@ -1212,7 +1226,7 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, struct ddebug_class_map *cm; int i, nc = 0; - for (i = 0, cm = di->classes; i < di->num_classes; i++, cm++) { + for_subvec(i, cm, di, classes) { if (!strcmp(cm->mod_name, dt->mod_name)) { vpr_cm_info(cm, "classes[%d]:", i); if (!nc++) @@ -1225,7 +1239,7 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, 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++) + for_subvec(i, cm, dt, classes) ddebug_apply_params(cm, cm->mod_name); } @@ -1245,7 +1259,7 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, * 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++) { + for_subvec(i, cli, di, class_users) { if (WARN_ON_ONCE(!cli || !cli->map || !cli->mod_name)) continue; if (!strcmp(cli->mod_name, dt->mod_name)) { @@ -1261,7 +1275,7 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, dt->num_class_users = nc; /* now iterate dt */ - for (i = 0, cli = dt->class_users; i < dt->num_class_users; i++, cli++) + for_subvec(i, cli, di, class_users) ddebug_apply_params(cli->map, cli->mod_name); vpr_dt_info(dt, "attach-client-module: "); @@ -1299,7 +1313,7 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) INIT_LIST_HEAD(&dt->link); - for (i = 0, iter = di->descs; i < di->num_descs; i++, iter++) + for_subvec(i, iter, di, descs) if (iter->class_id != _DPRINTK_CLASS_DFLT) class_ct++; From patchwork Sat Jan 25 06:45:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950792 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 4153DC0219D for ; Sun, 26 Jan 2025 16:40:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 88C8910E46B; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="DqXd2dj5"; 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 7796E10E29C; Sat, 25 Jan 2025 06:46:58 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-844eac51429so226619339f.2; Fri, 24 Jan 2025 22:46:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787618; x=1738392418; 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=WlrfrIzuFMjHOeBtjpo3TAdP2V/LwFa19R3qLyIAfcI=; b=DqXd2dj5QjTDBY5ze32MReqcGiJR452pxPKp569Iysyag23kXWAqVQLNQmW1Bu1Ytr n9ymKKcbLHdCF5jXSrISc4qcLny3gTNBAcsWuVdejNuiOPkDt294Dm1cB6HyuCQQDAJd 3mpMzOamVzqKbdxRPchMoeyv8qpR+ucwSvJVUKgpYTu6OVghEKT2Ool+3sHkDCjPGy+q S17VfGD8/Nkhv8WU/KXpwU7NcHHF1lI1L6rOaSa0/BxD0oE+A6TMwgL294+NLJ7XA5V6 Ldd5NxFtvFCSPFVMZSuMDVDNrjhWMW3X30z/Lk/JV/mefVxq1qcOHOEdc9DIHN8P8K26 Td2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787618; x=1738392418; 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=WlrfrIzuFMjHOeBtjpo3TAdP2V/LwFa19R3qLyIAfcI=; b=Q9sJhJUgsbcXo1V1HVRIAI1BGjoJDqHFcIweOJBCwCVCS8/ACP2mIxE4402l4EJMzv ANjYr816ZxC+8yG5T05d+EhkC3Nl3df0KfLNJmEiJMntosCabLJkVh6FVsc1wPUY4NzY Tv2BgRMjs6xu/8qgh64v/4+qEpeFzPzFAK+9MBwOF6SwOXLQH/211yYUijdqJSq5wCQU 6SHjQ0ZS4Q0uvf8kVzPTm7CPDT7E+0hKriYL09RE8KTTBQTIAwpnAUJ0UHj0HxH9y9cP f9vCgc0q5CMWjvhTA4BnGyRZ2PThYYHSaI1h8lYiRn1TZf3FL6AaFEa4syi33q+k4jiH 0fXQ== X-Forwarded-Encrypted: i=1; AJvYcCVciEwVUOnbcvkMWO8bFZvVrWgwZsUk1N625uDb41mBNiz+ntFPNSQgZgSfvsDiejZDcdiAfBW8zJJL@lists.freedesktop.org, AJvYcCViNNo2JjSyMvyHz2iT5Uj146cZo29vDthOdg45vFk6S8SOj4fYODjVltVr8rQTUX0NhBK8Ev3N0+Rq@lists.freedesktop.org, AJvYcCWV8qEafmeBye2Dt8eA9jHx2oSr40TmqC7pT6HAe1S1Sr2cFQG1huwivSp42viu7o5H3rX7/m+95Dwt2quoOA==@lists.freedesktop.org, AJvYcCWxQ4UNGwAgBjRJZIWrXKH0ugGRM7z+OgmaGNnq5+AJkyZvaR5+Jy4PnNNMGUUESHUVJYB9IZwo@lists.freedesktop.org X-Gm-Message-State: AOJu0Ywwr8mBUm63EAAenx5R8X+aZosGlaSxb6SX+u2PMIkzPe4XnPqJ G9gsyKwBzmIYhBcovyDh7TfHIOcRJiGom+WCqiecrwXxirs0aDjpnGaKlQ== X-Gm-Gg: ASbGncspQNly2cYi9+b4qIkU208TlGy13JGIwjlrMfKd6pVpF+sphoiuYUtn90lawrn hiZYObEag/NnsnoPxczvub70hzgfwTJtdruCGfSTGCDnCeWXzqmBVZJ85zZJqgOL9nNrta5aRHS ruSdLCnrPntNRwWUX/r9pmym1t6+1Ay92M5LSanZRFX8d6SBPTc+DwAtEhb/OCluPLznedonkv7 7iEP2SVcTdsX8aaYuVxz0Vz8k1g7d9MWoaZigt8f0hqNH+97kkjprZbCpo+05Q8MSCdGgAiF/BT E8bjQ9SmNf9N31WgdtVNJ3ePN/GHM3uH7IAQqQ== X-Google-Smtp-Source: AGHT+IEZzUFlXgE/K28EhfX+3mIxjRYezlqmvV/Lq2x4g8vF/n8f6qQbTSewsmeaqub1hN0g7Uxs5g== X-Received: by 2002:a05:6602:4899:b0:84f:2929:5ee0 with SMTP id ca18e2360f4ac-851b64f4bd9mr2993832239f.10.1737787617718; Fri, 24 Jan 2025 22:46:57 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:57 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 19/63] dyndbg: make proper substructs in _ddebug_info Date: Fri, 24 Jan 2025 23:45:33 -0700 Message-ID: <20250125064619.8305-20-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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_info's jobs is to enapsulate the __sections of dyndbg data from the linker. The data started as a single pair of fields: descs - ref'g an array of descriptors & num_descs - counting the "pertinent" descriptors. Then classes & num_classes were added, and _ddebug_info was invented to contain the 4 fields. When class_users & num_class_users were added (earlier in this series), the easy path was to replicate functions and adapt them to work on ddebug_class_users, instead of class_maps. This worked, but made repetitive boilerplate code, leading to (other commits with) macros walking num_##{classes,class_users} to capture the repetition. To fix it better, create structs to contain start,len for vectors of all 3 objects: classmaps, class_users, and pr_debug descriptors, and adjust field-refs accordingly. Also recompose struct ddebug_table to contain a _ddebug_info (rather than repeat the contents, as before), and adjust all array-walks to use the newly contained info. This allows ridding the class* macros of the num## paste-up, and should enable further cleanups. NB: The __packed attribute on _ddebug_info and the 3 contained structs closes the holes otherwise created by the structification (which was the excuse for not doing it originally). TBD: see if this can precede other patches, to reduce churn Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 29 ++++++++--- kernel/module/main.c | 18 +++---- lib/dynamic_debug.c | 93 +++++++++++++++++------------------ 3 files changed, 74 insertions(+), 66 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 2b0c943af330..48d76a273f68 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -173,15 +173,28 @@ struct ddebug_class_user { .map = &(_var), \ } -/* encapsulate linker provided built-in (or module) dyndbg data */ +/* + * @_ddebug_info: gathers module/builtin dyndbg_* __sections together. + * For builtins, it is used as a cursor, with the inner structs + * marking sub-vectors of the builtin __sections in DATA. + */ +struct _ddebug_descs { + struct _ddebug *start; + int len; +} __packed; +struct dd_class_maps { + struct ddebug_class_map *start; + int len; +} __packed; +struct dd_class_users { + struct ddebug_class_user *start; + int len; +} __packed; 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_descs descs; + struct dd_class_maps maps; + struct dd_class_users users; +} __packed; struct ddebug_class_param { union { diff --git a/kernel/module/main.c b/kernel/module/main.c index c394a0c6e8c6..858882a1eacd 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2540,15 +2540,15 @@ static int find_module_sections(struct module *mod, struct load_info *info) pr_warn("%s: Ignoring obsolete parameters\n", mod->name); #ifdef CONFIG_DYNAMIC_DEBUG_CORE - mod->dyndbg_info.descs = section_objs(info, "__dyndbg", - sizeof(*mod->dyndbg_info.descs), - &mod->dyndbg_info.num_descs); - 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); + mod->dyndbg_info.descs.start = section_objs(info, "__dyndbg", + sizeof(*mod->dyndbg_info.descs.start), + &mod->dyndbg_info.descs.len); + mod->dyndbg_info.maps.start = section_objs(info, "__dyndbg_classes", + sizeof(*mod->dyndbg_info.maps.start), + &mod->dyndbg_info.maps.len); + mod->dyndbg_info.users.start = section_objs(info, "__dyndbg_class_users", + sizeof(*mod->dyndbg_info.users.start), + &mod->dyndbg_info.users.len); #endif return 0; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 08b6e4e7489f..067db504dd1d 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -49,10 +49,7 @@ 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; - struct ddebug_class_user *class_users; - unsigned int num_ddebugs, num_classes, num_class_users; + struct _ddebug_info info; }; struct ddebug_query { @@ -154,8 +151,8 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) #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); \ + _dt->mod_name, _dt->info.descs.len, _dt->info.maps.len, \ + _dt->info.users.len); \ }) /* @@ -168,8 +165,8 @@ static void vpr_info_dq(const struct ddebug_query *query, const char *msg) * @_vec: name of a sub-struct member in _box, with array-ref and length */ #define for_subvec(_i, _sp, _box, _vec) \ - for ((_i) = 0, (_sp) = (_box)->_vec; \ - (_i) < (_box)->num_##_vec; \ + for ((_i) = 0, (_sp) = (_box)->_vec.start; \ + (_i) < (_box)->_vec.len; \ (_i)++, (_sp)++) static int ddebug_find_valid_class(struct ddebug_table const *dt, const char *class_string) @@ -178,14 +175,14 @@ static int ddebug_find_valid_class(struct ddebug_table const *dt, const char *cl struct ddebug_class_user *cli; int i, idx; - for_subvec(i, map, dt, classes) { + for_subvec(i, map, &dt->info, maps) { idx = match_string(map->class_names, map->length, class_string); if (idx >= 0) { vpr_dt_info(dt, "good-class: %s.%s ", map->mod_name, class_string); return idx + map->base; } } - for_subvec(i, cli, dt, class_users) { + for_subvec(i, cli, &dt->info, users) { idx = match_string(cli->map->class_names, cli->map->length, class_string); if (idx >= 0) { vpr_dt_info(dt, "class-ref: %s -> %s.%s ", @@ -229,8 +226,8 @@ static int ddebug_change(const struct ddebug_query *query, struct flag_settings valid_class = _DPRINTK_CLASS_DFLT; } - for (i = 0; i < dt->num_ddebugs; i++) { - struct _ddebug *dp = &dt->ddebugs[i]; + for (i = 0; i < dt->info.descs.len; i++) { + struct _ddebug *dp = &dt->info.descs.start[i]; /* match site against query-class */ if (dp->class_id != valid_class) @@ -990,8 +987,8 @@ static struct _ddebug *ddebug_iter_first(struct ddebug_iter *iter) } iter->table = list_entry(ddebug_tables.next, struct ddebug_table, link); - iter->idx = iter->table->num_ddebugs; - return &iter->table->ddebugs[--iter->idx]; + iter->idx = iter->table->info.descs.len; + return &iter->table->info.descs.start[--iter->idx]; } /* @@ -1012,10 +1009,10 @@ static struct _ddebug *ddebug_iter_next(struct ddebug_iter *iter) } iter->table = list_entry(iter->table->link.next, struct ddebug_table, link); - iter->idx = iter->table->num_ddebugs; + iter->idx = iter->table->info.descs.len; --iter->idx; } - return &iter->table->ddebugs[iter->idx]; + return &iter->table->info.descs.start[iter->idx]; } /* @@ -1064,15 +1061,15 @@ 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; + struct ddebug_class_map *map; + struct ddebug_class_user *cli; int i; - for (i = 0; i < dt->num_classes; i++, map++) + for_subvec(i, map, &dt->info, maps) 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++) + for_subvec(i, cli, &dt->info, users) if (class_in_range(dp->class_id, cli->map)) return cli->map->class_names[dp->class_id - cli->map->base]; @@ -1203,8 +1200,7 @@ static void ddebug_apply_params(const struct ddebug_class_map *cm, const char *m if (cm->mod) { vpr_cm_info(cm, "loaded classmap: %s", modnm); - /* ifdef protects the cm->mod->kp deref */ - for_subvec(i, kp, cm->mod, kp) + for (i = 0, kp = cm->mod->kp; i < cm->mod->num_kp; i++, kp++) ddebug_match_apply_kparam(kp, cm, modnm); } #endif @@ -1226,20 +1222,20 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, struct ddebug_class_map *cm; int i, nc = 0; - for_subvec(i, cm, di, classes) { + for_subvec(i, cm, di, maps) { if (!strcmp(cm->mod_name, dt->mod_name)) { vpr_cm_info(cm, "classes[%d]:", i); if (!nc++) - dt->classes = cm; + dt->info.maps.start = cm; } } if (!nc) return; vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); - dt->num_classes = nc; + dt->info.maps.len = nc; - for_subvec(i, cm, dt, classes) + for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); } @@ -1259,23 +1255,23 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, * module's refs, save to dt. For loadables, this is the * whole array. */ - for_subvec(i, cli, di, class_users) { + for_subvec(i, cli, di, users) { if (WARN_ON_ONCE(!cli || !cli->map || !cli->mod_name)) continue; if (!strcmp(cli->mod_name, dt->mod_name)) { vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, cli->mod_name, cli->map->mod_name); if (!nc++) - dt->class_users = cli; + dt->info.users.start = cli; } } if (!nc) return; - dt->num_class_users = nc; + dt->info.users.len = nc; /* now iterate dt */ - for_subvec(i, cli, di, class_users) + for_subvec(i, cli, di, users) ddebug_apply_params(cli->map, cli->mod_name); vpr_dt_info(dt, "attach-client-module: "); @@ -1291,10 +1287,10 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) struct _ddebug *iter; int i, class_ct = 0; - if (!di->num_descs) + if (!di->descs.len) return 0; - v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); + v3pr_info("add-module: %s %d sites\n", modname, di->descs.len); dt = kzalloc(sizeof(*dt), GFP_KERNEL); if (dt == NULL) { @@ -1308,8 +1304,7 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) * this struct ddebug_table. */ dt->mod_name = modname; - dt->ddebugs = di->descs; - dt->num_ddebugs = di->num_descs; + dt->info.descs = di->descs; INIT_LIST_HEAD(&dt->link); @@ -1317,17 +1312,17 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) if (iter->class_id != _DPRINTK_CLASS_DFLT) class_ct++; - if (class_ct && di->num_classes) + if (class_ct && di->maps.len) 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) + if (class_ct && di->users.len) ddebug_attach_user_module_classes(dt, di); - vpr_info("%3u debug prints in module %s\n", di->num_descs, modname); + vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); return 0; } @@ -1474,12 +1469,12 @@ static int __init dynamic_debug_init(void) char *cmdline; 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, + .descs.start = __start___dyndbg, + .maps.start = __start___dyndbg_classes, + .users.start = __start___dyndbg_class_users, + .descs.len = __stop___dyndbg - __start___dyndbg, + .maps.len = __stop___dyndbg_classes - __start___dyndbg_classes, + .users.len = __stop___dyndbg_class_users - __start___dyndbg_class_users, }; #ifdef CONFIG_MODULES @@ -1508,8 +1503,8 @@ static int __init dynamic_debug_init(void) if (strcmp(modname, iter->modname)) { mod_ct++; - di.num_descs = mod_sites; - di.descs = iter_mod_start; + di.descs.len = mod_sites; + di.descs.start = iter_mod_start; ret = ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1519,8 +1514,8 @@ static int __init dynamic_debug_init(void) iter_mod_start = iter; } } - di.num_descs = mod_sites; - di.descs = iter_mod_start; + di.descs.len = mod_sites; + di.descs.start = iter_mod_start; ret = ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1530,8 +1525,8 @@ static int __init dynamic_debug_init(void) i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10), (int)((i * sizeof(struct _ddebug)) >> 10)); - if (di.num_classes) - v2pr_info(" %d builtin ddebug class-maps\n", di.num_classes); + if (di.maps.len) + v2pr_info(" %d builtin ddebug class-maps\n", di.maps.len); /* now that ddebug tables are loaded, process all boot args * again to find and activate queries given in dyndbg params. From patchwork Sat Jan 25 06:45:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950745 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 82134C0218F for ; Sun, 26 Jan 2025 16:39:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 797FF10E436; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LAuJjnBT"; dkim-atps=neutral Received: from mail-il1-f182.google.com (mail-il1-f182.google.com [209.85.166.182]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8811410E2A2; Sat, 25 Jan 2025 06:46:59 +0000 (UTC) Received: by mail-il1-f182.google.com with SMTP id e9e14a558f8ab-3ce868498d3so8477215ab.3; Fri, 24 Jan 2025 22:46:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787619; x=1738392419; 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=AnDsc2vkEgs5Pp7pnDF60W8zrCwME0cZq6yzmPBvEV8=; b=LAuJjnBTn96+AFWROII+Gnc8uvmRhIbL06++9uI7gOAE3jrTDKHW1CFz61lAO0ka4/ n86f8JZ46WYpxa0wvFYqgLOiQXmJAIyCX4MEc8BkxxiSDes/OOvIOxZqiCGZ1VbsL010 ULKrp9cdXefG5EpI3kQ5bhXbcLACVfZmeLvKBYXFRZCdL0Z7or4xZNiAJ7oHTVLKfvva A1w2/OycfUSFeMpULzuul1Vp+vOSkfmMQsnYt1yhufkXfrqTzH3Lz01mBTNVkwfGtBOG PVqzz/3+cIhCrxEfQ+7uaDDhlH4DZacf67xBUOs8RnNhxm1C6a1LGjRBeGLyv/B+MFgZ gCTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787619; x=1738392419; 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=AnDsc2vkEgs5Pp7pnDF60W8zrCwME0cZq6yzmPBvEV8=; b=q8rfT2sVQ2zEqiTgQb+eLR+64fP58uWmbANwRkB2qoP/g/rmTuKvs5FGROU6VJ7h0K eH24QY61Sbcd0VOO4S6Xov61PI+19Ge9TgqgRKF71JSxws7QxU6cSNpuTkdiua9oKqcB RCaYd07n4o/C/IjWPXhsEKr94QJtZmlaXUzhO4MQ/56XeBaNVxVofPLEbmSA/ye7oMJX ZqKbC8voNB5UgFhuyGCMCEWa0jt7+IU0eFuSXe8iEpFxHY/k/366dsPU+FA87FFeuM/+ SXGqdm53hRNsu2NwCYrcPKh+qFZxW3etSefSsv93h7C9NI5X9AecUUAT68GJ25GMxxDG fDfA== X-Forwarded-Encrypted: i=1; AJvYcCVnDkfOxcYsSbAJ6v+Jr9wP4aOfjaboPkkJ+LPhALjxKcttISq/FdBceAJrK2yBbAqiizQtNoOSQv28@lists.freedesktop.org, AJvYcCW5AYDxIaL+NNZ69zSzJCsFyih6B2Dd8DmhdAXvLfgtJ9cvCOx1lD9LSwVXADE/mPHVZW+M8KkH@lists.freedesktop.org, AJvYcCXktFmymTnCHRCW9zySVW+Vra0cVO4ZXS7CZ+Kxikxmst/bxE64Ba528B//Uw4PeN8Ol1zyeuHvap6/ybTzMg==@lists.freedesktop.org, AJvYcCXr1O4x+LjFk5uIAKRdYodCxeSTStm4bopZYfmKJ8M41dwz1F8fUde/4W7WBKz6L84qXUnA7eB8ZduU@lists.freedesktop.org X-Gm-Message-State: AOJu0YzfooQfzxMXXQfKfHZViuMERXlgf1S+tC6mBDJRe4tHMFiHwXjE NrAliXLYeUNhwDfysHe2xPQmFw2s1B8sXRwmq2gAzHgy7aAZfkdv X-Gm-Gg: ASbGncugALXeUAa/iRfHcD1r5p/7m6QvhugfEH/LkBShltRPafJSLuN2XtXXJ4XWE/R T3VRm2daI9DMEe6VDkDYcguM9pbmWi+B7Aea6Fl3o3IecvDErdCPkG4ydX6q3zJa0My9phf8jvA 0VAA1nIfQvSQ1JmwIN+hSoBAX/kW86OASGaL1YpSAub/8SXyUMY0oypcO69wjcRDK/LVVjaFAsK 65Z4g3w/gQgAOq5ypMjHx/H8hHJAqNyayC/yyOfPVdNCXAnqXojKfVSHk1BdPHLVjKgpVez5XXP HsSciZJXomYKnHZ1agbD2/dXHQBGjXriItOa7mV6PfL4NfYa X-Google-Smtp-Source: AGHT+IFuXVplZTOidf6+FbrRWr0dJRuZPWucGNDLvhwgjrSV8lGvzy/PXtUkpXLhq4PmLDOpeMhA0A== X-Received: by 2002:a05:6602:3c3:b0:84a:78ff:1247 with SMTP id ca18e2360f4ac-851b6286c35mr3044417339f.9.1737787618790; Fri, 24 Jan 2025 22:46:58 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:58 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 20/63] dyndbg: drop premature optimization in ddebug_add_module Date: Fri, 24 Jan 2025 23:45:34 -0700 Message-ID: <20250125064619.8305-21-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:34 +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 class_ct var was added to avoid 2 function calls, but to do this it loops over all the module's debug callsites to determine the count. But it doesn't really help, so remove it. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 067db504dd1d..16c9b752822b 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1284,8 +1284,6 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, 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->descs.len) return 0; @@ -1308,18 +1306,14 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) INIT_LIST_HEAD(&dt->link); - for_subvec(i, iter, di, descs) - if (iter->class_id != _DPRINTK_CLASS_DFLT) - class_ct++; - - if (class_ct && di->maps.len) + if (di->maps.len) 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->users.len) + if (di->users.len) ddebug_attach_user_module_classes(dt, di); vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); From patchwork Sat Jan 25 06:45:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950738 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 E4BC9C0218D for ; Sun, 26 Jan 2025 16:39:37 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 29B1810E431; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="G9TPH228"; 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 B05E310E2B7; Sat, 25 Jan 2025 06:47:00 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-844ce6d0716so215097339f.1; Fri, 24 Jan 2025 22:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787620; x=1738392420; 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=Ytfh/zV61l1ce+ov8of55te3rHqgM7GRb4D7c2dE0nI=; b=G9TPH228vaXdnfNIIEdXeYEog6UmsHREX4HYtxdjbOEEJwS1nIBvQz+mCKMPPi0jov uCrkzQ7KkROYAtufVT6QvyyO14Z0sJtYCkJeP+Xo0vEN9eeQ0TdK78mln5RO5GnZ7vlm SZWXCXlXBBTNqBAEvfGPLa5uC952jWldB+jaexzruZVRAIIHaoaB7PSFhP8reWmOV1/u AqItrUTsRxIPUzLs3Jfts4dyovdPR4Po9lmo/QCo7lAJTa5dMKPzOeUvgsgmWn16k7xO jPTMCbnHu91y7hoLE91tLymixpXK/8WuU2Onh0GtHV/VQ3IQQ42lkFJBC5KiwzZ8Drkq h/cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787620; x=1738392420; 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=Ytfh/zV61l1ce+ov8of55te3rHqgM7GRb4D7c2dE0nI=; b=VXzCwQ8A2jirv6MA8NgSW5QQn6cmdjS//LOqf6I7+BD5f4QujBDvfiENrltLRkOSt4 j5H2mY2dVi12eWbbWP79aJuIqWY2rPKco91GOEuopqGlvEELtWw9I2KvWEqmVfKs+LoV /UPw2zUsULd6Y4Bi5GEap7ICK6sJb0c0qnxWtg7M/ceOWHihqrRS+jzNl2LEf990Yvxt BW7Ub7IjBTYYgp+bSAVZGkWAgs3/nslgp0Dtok9llwU3PIcAlYJ/0ZT+PuoXZ+JntfJi /TTDjKh8CALU/47ljh7JJuEy40DMjuFGNMU2uEYmdZue0TGnsHRkJBv+xCvIjqq6TfgO 9FKg== X-Forwarded-Encrypted: i=1; AJvYcCUQA5wn/SmnA7+FhtBjDyBd3MWXLyBJCHLWTK+Ntexr2qx8VFsSJX96zv/162MI1NUxSFjRbBdVYScv@lists.freedesktop.org, AJvYcCUjgdqzG/ijvXQ6RNa6w+OqGZ72LTpNC1+90iEj5NraLGTRlwOhofvPupBcgLaHbvIKToOp967i@lists.freedesktop.org, AJvYcCVCcyp6hnKEVntBfXFpcM9xPnIuLRNNLOayBGEQmWWh+u/f7/5FKfWegACno1bQ25/Tiw5K1PVd9UxeWrxJHQ==@lists.freedesktop.org, AJvYcCVYgRwcjCKv8NQZi9odkKvLSXX6PYWDlrfcIJyG5YeyT1goJionK8JDsWnAL4iFg/rKmuR5E9LCNWHD@lists.freedesktop.org X-Gm-Message-State: AOJu0YzdEO/zAuQawljketVMSW3B7WSa2fGzKrjSVCr417HxPjJIhSGt hajxWsOD4IpLWVHrNgvAQSdQnEd9K21Mb7Ax4dXcAX1lFgP9Mx76 X-Gm-Gg: ASbGnctzM4Ab5noB6w/jxcEJCOIkka8sDfhLABEQQYNz1y3uhCAXL54GuTfS170/oCi NwXg2YR1OuH1f6lVmj/kmPfj1He3GX+i2v/Nc97sw5Gv1p/bfc3rKrz2n1U4YNPAx6DbFhMf10I l8H0xVwzWYbB3lCGTi1UKi1LXlq85aKZo1NAQd+QvHeq+SzEOp8UkSNIvkALYyFj4wAa/ySWY+/ RiFMMopbR8w/uInfz2Q1Q23pDFYIIxIJGScvUxydNnTyEMYOb7hEGU2exZbHGcDOLoWRJ2gNyUE ccUj9WJrRDvemVHifAK0WOjjWqZgz5dN1dxhYw== X-Google-Smtp-Source: AGHT+IHZ0rdC7Vd9cUI1tPpIx5JlT8FFJWJY2x9dHWb5lEPIqHartZYwqQohH5tAwYTKxuzcgozcpw== X-Received: by 2002:a05:6602:26c5:b0:83b:5221:2a87 with SMTP id ca18e2360f4ac-851b616986dmr3118385239f.3.1737787619986; Fri, 24 Jan 2025 22:46:59 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:46:59 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 21/63] dyndbg: allow ddebug_add_module to fail Date: Fri, 24 Jan 2025 23:45:35 -0700 Message-ID: <20250125064619.8305-22-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" To prep for failing modprobe on classid conflicts, upgrade the call-chain around ddebug_add_module(), in 2 ways: 1. in ddebug_add_module() add local reserved_ids to accumulate reservations, pass it by ref to ddebug_attach_{,user_}module_classes() so they can examine the reservations as they work. 2. return int from both ddebug_attach_{,user_}module_classes(), up to ddebug_add_module(), then to ddebug_module_notify(). No conflicts are currently detected or returned. TBD: This is updated further by hoisting the reservation-check, which obsoletes part of 2, creating churn, maybe squash it away. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 16c9b752822b..0ef243e30663 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1216,8 +1216,9 @@ static void ddebug_apply_params(const struct ddebug_class_map *cm, const char *m * 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, - const struct _ddebug_info *di) +static int ddebug_attach_module_classes(struct ddebug_table *dt, + const struct _ddebug_info *di, + u64 *reserved_ids) { struct ddebug_class_map *cm; int i, nc = 0; @@ -1230,13 +1231,14 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, } } if (!nc) - return; + return 0; vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); dt->info.maps.len = nc; for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); + return 0; } /* @@ -1244,8 +1246,9 @@ static void ddebug_attach_module_classes(struct ddebug_table *dt, * 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) +static int ddebug_attach_user_module_classes(struct ddebug_table *dt, + const struct _ddebug_info *di, + u64 *reserved_ids) { struct ddebug_class_user *cli; int i, nc = 0; @@ -1266,7 +1269,7 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, } } if (!nc) - return; + return 0; dt->info.users.len = nc; @@ -1275,6 +1278,7 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, ddebug_apply_params(cli->map, cli->mod_name); vpr_dt_info(dt, "attach-client-module: "); + return 0; } /* @@ -1284,6 +1288,8 @@ static void ddebug_attach_user_module_classes(struct ddebug_table *dt, static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + u64 reserved_ids = 0; + int rc; if (!di->descs.len) return 0; @@ -1306,16 +1312,23 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) INIT_LIST_HEAD(&dt->link); - if (di->maps.len) - ddebug_attach_module_classes(dt, di); - + if (di->maps.len) { + rc = ddebug_attach_module_classes(dt, di, &reserved_ids); + if (rc) { + kfree(dt); + return rc; + } + } mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); - if (di->users.len) - ddebug_attach_user_module_classes(dt, di); + if (di->users.len) { + rc = ddebug_attach_user_module_classes(dt, di, &reserved_ids); + if (rc) + return rc; + } vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); return 0; } @@ -1400,6 +1413,11 @@ static int ddebug_module_notify(struct notifier_block *self, unsigned long val, switch (val) { case MODULE_STATE_COMING: ret = ddebug_add_module(&mod->dyndbg_info, mod->name); + if (ret == -EINVAL) { + pr_err("conflicting dyndbg-classmap reservations\n"); + ddebug_remove_module(mod->name); + break; + } if (ret) WARN(1, "Failed to allocate memory: dyndbg may not work properly.\n"); break; From patchwork Sat Jan 25 06:45:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950747 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 DB383C02197 for ; Sun, 26 Jan 2025 16:39:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 762EC10E435; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LWT+GB5J"; 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 BFC3110E2A0; Sat, 25 Jan 2025 06:47:01 +0000 (UTC) Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-84cdacbc373so84589139f.1; Fri, 24 Jan 2025 22:47:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787621; x=1738392421; 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=Ke4SvBesy7HOPaleQwpGGG+LJLBeY9FJV6nhVnr7e/A=; b=LWT+GB5JyQqoh+J0Q4BMx1uuwpUizu0QxA7xrbucxbrfHSz4ayv2+WKXsJXc0i3/3s 8B15B0bNhQCcBndpnTK5NzzGPjTyBc0QhKZht7vrk19IZtUbSGo6ckUJB+necYPejD+s nBrByC/T+NBW1QNtF71l1TSuDX8VD5BW8/7IyOgkY9Uh6GpkkuQ3j5jU752/JXY7eeC9 3Tp+/BmTVUWIb0zKwCRLpcAm7kVfrVdBQ7dRX/Oh6dbHlaDdlsmynfOpKi/cnRZdRS6S cF0ygbdRXE2/b3/NALb6TxCAmHGD0dyRABfrtyX2F+m84vd85TxLM9wn6I+oe/8L+c+p HHeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787621; x=1738392421; 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=Ke4SvBesy7HOPaleQwpGGG+LJLBeY9FJV6nhVnr7e/A=; b=Pgasn7/IcxLZ9NjDTEUYMVK67zn9bpG0DBwbLS2hLVdwma1Q9zGzzb15q83xmFniLp KQ/fV6HL4efbd/vM2Z6+IDMug3TxUKoSwBMKasKRKEluDD4dAbws1+n1UsFwKikqD7wW 67rH30ZxhNjZ6mloWK01kcBK/02xJUgvWMb9SBdMpMxUtdrAh96I5960b5HSIcyYv1+h fK2zKICVrLvD6UoTc3MKOQNA+Lt/kZL8ye6d9f0VUCRkWOufEg/89d3GIr4SGzQUFH06 guBQAfKOhCA+lRetKXJ+r3ZFhOsM77/vyq01991bVh6ieSNQWrEmpXfZVrgnWUlstzI5 JM5g== X-Forwarded-Encrypted: i=1; AJvYcCUCJU9MXaEp1NhjIneSZtAyEv3URbRpl1BQZ1uJpn95aQ7+0936jVLm7zjQC7TIzgDPC3nW1Kg2@lists.freedesktop.org, AJvYcCVJ2SxBiolCbmxEsJodLZ6Jm6TZj8qm59Iyrzqe5kC0mEJeZXMJ2Mw3tisBCTM3ZArSfDUVhSdGtSVIWlLU4w==@lists.freedesktop.org, AJvYcCVWx8mY2s4iy+2nRLChNJeSNam4Sy1JwLzb8vFqyzKFp37VzRU9xWaF8QTdvmZ7TygjUv2RzpkHltTa@lists.freedesktop.org, AJvYcCX1c2/fdhE3MIJ+H0jzENw1d4UyrWlXgfvXr1dC2NhjvinKhrxUh2bxtJhO0JtA7cn8n2kO42+SSeza@lists.freedesktop.org X-Gm-Message-State: AOJu0YwIcyP8g8v14ITnNVMRZTkB9ylRsfWX97IS9dsqTLv5FY0BRmIK jJCGAv2SY1g9Mcgvz8WLOmVXtHHNz3gLdCkpmxO1dGfGGFdlBSmm X-Gm-Gg: ASbGncsuO+EWfxGSojxt4XVfNRxdaot+fxk5ZvjZW05AafG+3OBcoP9O9keN2SLPo17 l4Pk0/fDx+xAXAVZ2vfnKzz/cU8AnP7Zr1moGDgrJnYBun1vbPY7VqZaqOmQaSolYH77rMaGbAi Tqlh9gt7oZJunQP/tFfxRuYOyXELFXQ8IQ8ZoRpCS05GmGfYZvdrBZZJ73UQEo4RsA0jExlUd/f 0OYEM2pYb7XoWfc+tjIhFK7HiAYfT7HMCvZEpjEqQnsaamhOmJZMeRxfH6th9lwVXqjeQjdragw xoUA6WI995S971p7md5mNgynjrp5V3lBguAZFA== X-Google-Smtp-Source: AGHT+IHEFU3echceWmiA4eLPNghqGqyfiHEPHKsu8QESTZXaHS27iWJhMF9tECXmhlWc+hFhQTlaGQ== X-Received: by 2002:a05:6602:3a8b:b0:84a:51e2:9f93 with SMTP id ca18e2360f4ac-851b6285d20mr2848702339f.9.1737787620929; Fri, 24 Jan 2025 22:47:00 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:00 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 22/63] dyndbg: rework ddebug_attach_*module_classes() Date: Fri, 24 Jan 2025 23:45:36 -0700 Message-ID: <20250125064619.8305-23-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" These 2 fns both start with a codeblock which cleans up the classmaps arrays, finding the few that pertain to the module being added. Reduce this repetition to a macro: dd_mark_vector_subrange() and call it 2x. This macro finds the matching-on-modname subrange of a linker ordered array of builtin classmaps/users, and saves the subrange into the dt/debug-table's ddebug-info record. Then hoist those calls from ddebug_attach*() up to ddebug_add_module(). This puts the "cleanup" of class* arrays into ddebug_add_module(), not cluttering the original purpose of the 2 routines. And with ddebug_add_module() now updating dt with the classmaps for the module, the di arg to ddebug_attach_{,user}module_classes() is no longer needed, so drop it. Finally, rename the 2 functions, from *attach* (describing the dt update in the macro) to module_apply_class_{maps,users} to reflect the tighter focus. NB: The macro's main purpose is to handle multiple builtin classmaps or users, which is the only circumstance where less than the full array of classmaps is pertinent. Signed-off-by: Jim Cromie --- --- lib/dynamic_debug.c | 104 ++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 56 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 0ef243e30663..8afcd4111531 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1212,72 +1212,54 @@ static void ddebug_apply_params(const struct ddebug_class_map *cm, const char *m } /* - * 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. + * scan the named array: @_vec, ref'd from inside @_box, for the + * start,len of the sub-array of elements matching on ->mod_name; + * remember them in _dst. Macro depends upon the fields being in both + * _box and _dst. + * @_i: caller provided counter var. + * @_sp: cursor into @_vec. + * @_box: ptr to a struct with @_vec, num__##@_vec, mod_name fields. + * @_vec: name of ref into array[T] of builtin/modular __section data. + * @_dst: ptr to struct with @_vec and num__##@_vec fields, both updated. */ -static int ddebug_attach_module_classes(struct ddebug_table *dt, - const struct _ddebug_info *di, - u64 *reserved_ids) +#define dd_mark_vector_subrange(_i, _dst, _sp, _box, _vec) ({ \ + int nc = 0; \ + for_subvec(_i, _sp, _box, _vec) { \ + if (!strcmp((_sp)->mod_name, (_dst)->mod_name)) { \ + if (!nc++) \ + (_dst)->info._vec.start = (_sp); \ + } else { \ + if (nc) \ + break; /* end of consecutive matches */ \ + } \ + } \ + (_dst)->info._vec.len = nc; \ +}) + +static int ddebug_module_apply_class_maps(struct ddebug_table *dt, + u64 *reserved_ids) { struct ddebug_class_map *cm; - int i, nc = 0; - - for_subvec(i, cm, di, maps) { - if (!strcmp(cm->mod_name, dt->mod_name)) { - vpr_cm_info(cm, "classes[%d]:", i); - if (!nc++) - dt->info.maps.start = cm; - } - } - if (!nc) - return 0; - - vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); - dt->info.maps.len = nc; + int i; for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); + + vpr_info("module:%s attached %d classmaps\n", dt->mod_name, dt->info.maps.len); return 0; } -/* - * 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 int ddebug_attach_user_module_classes(struct ddebug_table *dt, - const struct _ddebug_info *di, - u64 *reserved_ids) +static int ddebug_module_apply_class_users(struct ddebug_table *dt, + u64 *reserved_ids) { 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_subvec(i, cli, di, users) { - if (WARN_ON_ONCE(!cli || !cli->map || !cli->mod_name)) - continue; - if (!strcmp(cli->mod_name, dt->mod_name)) { - vpr_cm_info(cli->map, "class_ref[%d] %s -> %s", i, - cli->mod_name, cli->map->mod_name); - if (!nc++) - dt->info.users.start = cli; - } - } - if (!nc) - return 0; - - dt->info.users.len = nc; + int i; /* now iterate dt */ - for_subvec(i, cli, di, users) + for_subvec(i, cli, &dt->info, users) ddebug_apply_params(cli->map, cli->mod_name); - vpr_dt_info(dt, "attach-client-module: "); + vpr_info("module:%s attached %d classmap uses\n", dt->mod_name, dt->info.users.len); return 0; } @@ -1288,8 +1270,10 @@ static int ddebug_attach_user_module_classes(struct ddebug_table *dt, static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + struct ddebug_class_map *cm; + struct ddebug_class_user *cli; u64 reserved_ids = 0; - int rc; + int rc, i; if (!di->descs.len) return 0; @@ -1311,9 +1295,17 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) dt->info.descs = di->descs; INIT_LIST_HEAD(&dt->link); + /* + * for builtin modules, ddebug_init() insures that the di + * cursor marks just the module's descriptors, but it doesn't + * do so for the builtin class _maps & _users. find the + * start,len of the vectors by mod_name, save to dt. + */ + dd_mark_vector_subrange(i, dt, cm, di, maps); + dd_mark_vector_subrange(i, dt, cli, di, users); - if (di->maps.len) { - rc = ddebug_attach_module_classes(dt, di, &reserved_ids); + if (dt->info.maps.len) { + rc = ddebug_module_apply_class_maps(dt, &reserved_ids); if (rc) { kfree(dt); return rc; @@ -1324,8 +1316,8 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) mutex_unlock(&ddebug_lock); - if (di->users.len) { - rc = ddebug_attach_user_module_classes(dt, di, &reserved_ids); + if (dt->info.users.len) { + rc = ddebug_module_apply_class_users(dt, &reserved_ids); if (rc) return rc; } From patchwork Sat Jan 25 06:45:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950779 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 AD093C02181 for ; Sun, 26 Jan 2025 16:40:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8284310E46A; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UnkrnP1l"; 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 073C210E2BC; Sat, 25 Jan 2025 06:47:03 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-844de072603so202525239f.0; Fri, 24 Jan 2025 22:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787622; x=1738392422; 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=Ay4skInVUyOhJHhfCYrUYPj/jftvwF5qPOXpqm+4U44=; b=UnkrnP1lJp2nAAiIHreR9adR6M0UeOwJCGCsl2dIG8hhgDxcAfh04od5OHOQ6mPwfE oo6xbxkSnxnm5f19HVMMWL7HKXJRf9HTF9RG1f1D2P1Af38vqNn3hgbzhKKGgUsR7AYI uC/raS0kuFx5C9zzJYszi/e3MlLBGeLDP10BZcVB+7ieMq7jS+s9M59FLUQ/WJYk5MIS /fFEov8vfZoGUiIjUmpFYM2jHZR6g2QH7Tw8zZ7VRVeQAo6gURZiOBszVSIq5mN96Evb oENBmDkClIWkSMB9ChC09G7bb850tVMAOk8UZyMvrX7d3mgmlpZI7EAcjkrN+a0XvCvG lWOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787622; x=1738392422; 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=Ay4skInVUyOhJHhfCYrUYPj/jftvwF5qPOXpqm+4U44=; b=C+O0FobwxqWLR28zHLr1Bnt5QIR69VURSzFsyvIZ4TBzwK66SRnpAfsJ/IDa5N55rC baa0I3lkxFD4rAJQXQ10j7plmnSLs/bwDzMiPBZ1dzfdfdMTA01O49rLtY0MggrOyhCs PlWHlgpadnMPw01D4qZ3eShuQQ8JAlBPLn9s8vY8wooBwKuUNMsRfqsQ/ivFVTDEDnxX //FZwx42hu/qY0GbUbDHrCgg1ohp0hlGzasYBI0JX/6Kiz5+zDakryxN+p0pLeBvbFN6 eYX3ACKHRIPdj1lccD/XL5kywO8gKdB1O3ur5/sFK4w+zIYeqrGrNHZMIAwOXJfGqEeZ 30rQ== X-Forwarded-Encrypted: i=1; AJvYcCUG2N15sI/RKKAql43zJbPIzzIXHazj0JGlHpFb6bmqOvDb2Jv9AbLXgPh7t/bkNM0zChk8izbj7A1L@lists.freedesktop.org, AJvYcCUGNA10zStiNVxZjJ6lubUahKljxnmuGa2boWDeUftUHDp9xIMYRQ2jKqepmoaM6inEqWBda9Ns@lists.freedesktop.org, AJvYcCUtspcqqVnOqz/47+DvDlc64bjpBET1MPMEH+YfhVKGDRhxp/M8AXSWbIFVIzsSoxbLPOVYJIh12CuP@lists.freedesktop.org, AJvYcCX1hnICQMmVRn6QSP98vkPqqMhjJK4cxeUUeAfYdzY01UIhQOO8t3MaS1RPGQzgD7SALczkY9Y7hQbnzW1keg==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx1D6cmdfw73LqVqhBsLCxtxu59O6Qi1hpcNTdkfoYSKOxjm3ir 9/vZxfW/uPpu2RQTM6HrtJvFmzcAnLFzpw/d3RgqfcoEFB6Xi5+X X-Gm-Gg: ASbGncsWFG0HQPg6QvuCMrG7D0DMliA+T5yoYM/iZoKiEV3fP0uaRIbcJIYXe7SpooK zdYixQdz2+uRKhr4TjRKekL6B/QfrdF/BcIZUiAZaAW0c4kOjU23LDvloMMlhrfImLFSywu/ZFO xWM1od5t9/zODekCFba+uWwdwj2p5Q/EpNMwSO3QVvPRF4BsQ4ogSQ6WIAD9tqKV4VfvUqOC873 mov12KpfGl5bpJUz5TVxsIksyR8sbAUe7QhcEAHFW5cCLq4R/vepWfooLr9qXz9bfiE3AzkoU7K D3hNXhOR2YP4TBogYyV7PFrtLmfEPmg8ITSvcg== X-Google-Smtp-Source: AGHT+IHwnJ59B7v8sJsE0jjHjZyiOHK16NDE06hCK0yvg1ng9VyLIvAL9ptQW3TlC08SLLFiwpxM3g== X-Received: by 2002:a05:6602:36cc:b0:844:c76a:354d with SMTP id ca18e2360f4ac-851b6162856mr2762621339f.2.1737787622215; Fri, 24 Jan 2025 22:47:02 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:01 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 23/63] dyndbg: fail modprobe on ddebug_class_range_overlap() Date: Fri, 24 Jan 2025 23:45:37 -0700 Message-ID: <20250125064619.8305-24-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" 1. All classes used by a module (declared DYNDBG_CLASSMAP_{DEFINE,USE} by module code) must share 0..62 class-id space; ie their respective base,+length reservations shouldn't overlap. Overlaps would lead to unintended changes in ddebug enablements. Detecting these class-id range overlaps at compile-time would be ideal but is not obvious how; failing at modprobe at least insures that the developer sees and fixes the conflict. ddebug_class_range_overlap() implements the range check, accumulating the reserved-ids as it examines each class. It probably should use bitmaps. A previous commit reworked the modprobe callchain to allow failure, now call ddebug_class_range_overlap() to check when classid conflicts happen, and signal that failure. NB: this can only happen when a module defines+uses several classmaps, TBD: failing modprobe is kinda harsh, maybe warn and proceed ? test_dynamic_debug*.ko: If built with -DFORCE_CLASSID_CONFLICT_MODPROBE, the modules get 2 bad DYNDBG_CLASS_DEFINE declarations, into parent and the _submod. These conflict with one of the good ones in the parent (D2_CORE..etc), causing the modprobe(s) to fail. TODO: do in submod only, since fail of parent prevents submod from ever trying. Signed-off-by: Jim Cromie --- --- lib/dynamic_debug.c | 30 ++++++++++++++++++++++++------ lib/test_dynamic_debug.c | 11 ++++++++++- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8afcd4111531..8e1e087e07c3 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1211,6 +1211,21 @@ static void ddebug_apply_params(const struct ddebug_class_map *cm, const char *m } } +static int ddebug_class_range_overlap(struct ddebug_class_map *cm, + u64 *reserved_ids) +{ + u64 range = (((1ULL << cm->length) - 1) << cm->base); + + if (range & *reserved_ids) { + pr_err("[%d..%d] on %s conflicts with %llx\n", cm->base, + cm->base + cm->length - 1, cm->class_names[0], + *reserved_ids); + return -EINVAL; + } + *reserved_ids |= range; + return 0; +} + /* * scan the named array: @_vec, ref'd from inside @_box, for the * start,len of the sub-array of elements matching on ->mod_name; @@ -1242,9 +1257,11 @@ static int ddebug_module_apply_class_maps(struct ddebug_table *dt, struct ddebug_class_map *cm; int i; - for_subvec(i, cm, &dt->info, maps) + for_subvec(i, cm, &dt->info, maps) { + if (ddebug_class_range_overlap(cm, reserved_ids)) + return -EINVAL; ddebug_apply_params(cm, cm->mod_name); - + } vpr_info("module:%s attached %d classmaps\n", dt->mod_name, dt->info.maps.len); return 0; } @@ -1255,10 +1272,11 @@ static int ddebug_module_apply_class_users(struct ddebug_table *dt, struct ddebug_class_user *cli; int i; - /* now iterate dt */ - for_subvec(i, cli, &dt->info, users) + for_subvec(i, cli, &dt->info, users) { + if (ddebug_class_range_overlap(cli->map, reserved_ids)) + return -EINVAL; ddebug_apply_params(cli->map, cli->mod_name); - + } vpr_info("module:%s attached %d classmap uses\n", dt->mod_name, dt->info.users.len); return 0; } @@ -1311,11 +1329,11 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) return rc; } } + mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); - if (dt->info.users.len) { rc = ddebug_module_apply_class_users(dt, &reserved_ids); if (rc) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index b1555b0a2bb1..74b98adc4ed0 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -81,7 +81,7 @@ enum cat_disjoint_bits { D2_DRMRES }; /* numeric verbosity, V2 > V1 related */ -enum cat_level_num { V0 = 14, V1, V2, V3, V4, V5, V6, V7 }; +enum cat_level_num { V0 = 16, V1, V2, V3, V4, V5, V6, V7 }; /* recapitulate DRM's parent(drm.ko) <-- _submod(drivers,helpers) */ #if !defined(TEST_DYNAMIC_DEBUG_SUBMOD) @@ -90,6 +90,7 @@ enum cat_level_num { V0 = 14, V1, V2, V3, V4, V5, V6, V7 }; * 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", @@ -113,6 +114,14 @@ DYNDBG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, DYNDBG_CLASSMAP_PARAM(disjoint_bits, p); DYNDBG_CLASSMAP_PARAM(level_num, p); +#ifdef FORCE_CLASSID_CONFLICT_MODPROBE +/* + * Enable with -Dflag on compile to test overlapping class-id range + * detection. This should break on modprobe. + */ +DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_CORE"); +#endif + #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ /* From patchwork Sat Jan 25 06:45:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950739 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 8A3A3C02190 for ; Sun, 26 Jan 2025 16:39:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F5DE10E432; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="BY1o/VFL"; 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 1296C10E2F1; Sat, 25 Jan 2025 06:47:04 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id ca18e2360f4ac-844e7bc6d84so90831439f.0; Fri, 24 Jan 2025 22:47:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787623; x=1738392423; 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=93jbq4Mgsj9Dng6wtNKkyeLZVZqBaH1mnVoaGdt6ywk=; b=BY1o/VFLELXiFqop10cuo1JxIk0lv9FH/za5kTyMlPgZlRY0XWdnmKALHXmFxiOslW AX/1jpJDwgo7pFHYajChwUCSgW9BBGbbcYB9G7JV5ZVKpDn3GTW0lq26GcDY+FOo+C6e YqjTGsOqf+QCiEZa6it/gSlwje5QTbqWAmXW1wK6VI0JPrZOVX3nC8HvIC8J7R6XMetX fL3IRccowd1EdvIdr6kh2FUtvZ3vvKkTwx52b0ISSEiod3iIhtHmOKldN3lcX5SWejuI NjCWImsJ1d112uxX3CzFw5THTQ7603JN2ZTm92j8K3NmVZ4qh4O2U48ClXDP3YnEUKYo ByZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787623; x=1738392423; 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=93jbq4Mgsj9Dng6wtNKkyeLZVZqBaH1mnVoaGdt6ywk=; b=tZt+6jCws3suTcp+J5lU4yRxAZtma289ll1ic4LzvXiF6wwR/nISsRR5aQ6E8A+5Xj qiu1/IKzhNtJUhbm+KP40tOhvjW1UFpH5XwyhdXCVNSywCh9nG9vWhicKf42fx/hW1dH E3GZT8WJHX16QpqXBcNObqDX2Bi36ASE1A8yZoaXuyBij970UV4hfZBAy12HdpeIhmP7 RTbtLfVZ38rlg/1yq6Is8jhnAjVETrmfDEQxX8BrDOykFJrRXCEKcjQunnvIZ6+iz2fR OhJ5VHOHaxPWQryGZJplXw2YV7ekOePKQ5pNBAWmvMuwf2iZhruT4JnlThhRnt+vREoL DAAQ== X-Forwarded-Encrypted: i=1; AJvYcCUdpgzfEG4ZLfXns0GpwVYHVPqI4I4Zyzp65SSwDvoDs3OrW5oIo3Zxt8ha9mBPrSTH3KCMsMETGkuK@lists.freedesktop.org, AJvYcCX9S9S9Gh8AmlnhI+2UNaFJJnoVzStg+Ulx6t77+bAjeOqBSaORCBA6NiaCdRsHe40D+75VsMTi@lists.freedesktop.org, AJvYcCXpB3UXT4nInK4Svf6j8sVS75NyhlKu5i6ASXnsl+sMd9GepkVGn7/GtZrrSOez/R3uC7zDA1lzvYl2@lists.freedesktop.org, AJvYcCXuTPR4jEehdFQP7py5MhXopD/5wSwvODJQHlFGhjVCMi5+AdqCD+7S/IvA5r5tyf00jp9W5y0wVrJwpGvgMw==@lists.freedesktop.org X-Gm-Message-State: AOJu0YyLSTLQiFPy1H8Jw2tosSpYpd9V3gnFu+L21pYdyqhkAXoF25Fn S5RLvdI/r0RauPHnnBca04IYXmW7ZqpKrTKnaqV1EktcosSQhaCY X-Gm-Gg: ASbGncucIv3a1HfCIbQI5HNJwjveB+IEffFZBwgjhIXSNfqOxr9xI6Qc1X/PEIATlEy TRR1CTqFcNrUDJNaTanR9UGneyrd7hPrNfSYSItVXpjdKTgfAk3+USfqV8ZWF7nrifEvjao984H k9/3HvG6H3MefxHFP/x7ZfMddO7DLISCqqhVZjGO2fbQJLGrIvRDQB9JAPQijuVfaf+1AQ1TM/j NbSGuVyNPfYTrqb0ZLOkYWS+20qVWHCqwOmB+Cjhu3gbWOdsSjAFglA3i/+Hd6cKAXSBZBqhS3P 3I9QssiSWAipyz66xS1p+TUCiu1gUkPQyfD7Og== X-Google-Smtp-Source: AGHT+IEzK3tgR4ZqscbrvwKIW94h8D8rsgISbYsYpT/OLj+GuVfcmbYBQtPSq2z1B//b7y/JBkE8aQ== X-Received: by 2002:a5e:d804:0:b0:82c:ec0f:a081 with SMTP id ca18e2360f4ac-8521e32b142mr475805639f.4.1737787623209; Fri, 24 Jan 2025 22:47:03 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:02 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 24/63] dyndbg: hoist the range-overlap checks Date: Fri, 24 Jan 2025 23:45:38 -0700 Message-ID: <20250125064619.8305-25-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" hoist the classmaps range-check up to ddebug_add_module() from ddebug_module_apply_class*(). THis puts both copies of the task together, with the other semi-init work. this allows ddebug_module_apply_class*() to revert back to void return, but doesn't do that yet. this is a candidate for squashing back. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8e1e087e07c3..e57c05c9fb0a 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1257,11 +1257,9 @@ static int ddebug_module_apply_class_maps(struct ddebug_table *dt, struct ddebug_class_map *cm; int i; - for_subvec(i, cm, &dt->info, maps) { - if (ddebug_class_range_overlap(cm, reserved_ids)) - return -EINVAL; + for_subvec(i, cm, &dt->info, maps) ddebug_apply_params(cm, cm->mod_name); - } + vpr_info("module:%s attached %d classmaps\n", dt->mod_name, dt->info.maps.len); return 0; } @@ -1272,11 +1270,9 @@ static int ddebug_module_apply_class_users(struct ddebug_table *dt, struct ddebug_class_user *cli; int i; - for_subvec(i, cli, &dt->info, users) { - if (ddebug_class_range_overlap(cli->map, reserved_ids)) - return -EINVAL; + for_subvec(i, cli, &dt->info, users) ddebug_apply_params(cli->map, cli->mod_name); - } + vpr_info("module:%s attached %d classmap uses\n", dt->mod_name, dt->info.users.len); return 0; } @@ -1322,6 +1318,13 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) dd_mark_vector_subrange(i, dt, cm, di, maps); dd_mark_vector_subrange(i, dt, cli, di, users); + for_subvec(i, cm, &dt->info, maps) + if (ddebug_class_range_overlap(cm, &reserved_ids)) + return -EINVAL; + for_subvec(i, cli, &dt->info, users) + if (ddebug_class_range_overlap(cli->map, &reserved_ids)) + return -EINVAL; + if (dt->info.maps.len) { rc = ddebug_module_apply_class_maps(dt, &reserved_ids); if (rc) { From patchwork Sat Jan 25 06:45:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950740 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 08338C02194 for ; Sun, 26 Jan 2025 16:39:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 75E7210E434; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eiyOlWI2"; 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 917D410E2BC; Sat, 25 Jan 2025 06:47:06 +0000 (UTC) Received: by mail-io1-f46.google.com with SMTP id ca18e2360f4ac-844bff5ba1dso225490439f.1; Fri, 24 Jan 2025 22:47:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787626; x=1738392426; 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=z5ZcPXriLvyDxGd2w3FWLCNh742QlHcigDxyaXJyQ/k=; b=eiyOlWI27FGCaYW7VdMMHwlqOPdhD/mswGZl3spGtAsizRFH2V2CRwqQ9U1k+yBk6b ooEETzy7tc9jcN5hkCq0qDKb5HFCedQottIC+E9d18AlpHPecTH420RT7o7lqeH937nA 8eFzk+087ZUWD4p5n15zAOEDPb+TChYjQZ7qIYnJDc0pTO8ilRcK3EC6sk+I94ePm5y6 P8n1zKQqGAYk9eGlcIpssdky6U1tnbGJpWUBmvmkFAYOYtgTyC2weEdbrSOUHxOxwduL Ol6XcfAYZTU2AqWR8vn2xT6oCXbQBLNz/oGKhzCrUrj8N00ms7xg5pE7SO81I8qyTyM+ JerA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787626; x=1738392426; 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=z5ZcPXriLvyDxGd2w3FWLCNh742QlHcigDxyaXJyQ/k=; b=RsoD8FkRdBQxnO23XGiQ598RJyLfDpkiZrkR4ylcrCRnwk2gWK+oCaQleiEYr/LzvE orcleZumV+JQNN/0UU4QmDqqrwnxzK06S4eYcEPS27/34ID2d+6qunJLSQ17lXzEhv1V Ncc8aua6dmYajflMTuWxNciKsAlfqXThgLZDGHH8BspBiI3uXigVL8KE8X6O4p/yQM8x 4U/jnexreR8XPd4L0JlclPb4h3eeGheI7RKTkZ6pjNapHV2s+6bKNoOvfqirgAk8Lvde fzgvudoAu7OnZtvYVQd+Ei+0rnsyWh0OSZKUY/v/fz056QSIp+hwsurbDZCYO87dgPF/ eaqg== X-Forwarded-Encrypted: i=1; AJvYcCUsOEFvGN90bp/O0xBZP8eg1QbY4XN1xypY6btG5E+9jWqvV9QT1DZXyxmKUwmgC4lUMCZqisINuAI1@lists.freedesktop.org, AJvYcCVCVlRh2oa0m+WkZDprT6Ert9SNzHgOe/unE7pWRwsaurOHyojSvcR4SyAQmZPT0RaRlojc3vsh@lists.freedesktop.org, AJvYcCWt4Cln2PLz3Xr64TwSPAA3rfuIyD7nqtaZBHHlb8dPjneDR7zJT35zR2aAMcdVUFbFWAbEIMgtoeewG8tFtg==@lists.freedesktop.org, AJvYcCXH0oQQC3dfPHdBkq5E5UP1YITJT/vwp1skHLbcDh7QSWjT6hNTzoq3SJyb3XVShKRJaIg/Ezi7bJ3u@lists.freedesktop.org X-Gm-Message-State: AOJu0Yzv7BTvsn2KvL6BUEtvTOkV8F0Ea7lleo2T3PtUVCTyqLQJ8RkX sIcNhrnlUF47cFPd9IpEUo44tR8cn+RWMevmqX5pRIKEKBvliPAu X-Gm-Gg: ASbGncsM9PmXBjXhIqI5lLuifAjbik+29gpLU31gUge0RSJCBq6qDwPcqoAleMm5nkf +mNwzJeM1E5tMLxGMhE/l9WsVgGQryQq/i6h36K+5Zi3+8SUgH+fjcsOg6s1WdOnAkxN4SAp+Y2 5oYccumu6/mxM74YLgV0BDQdjBXw6wbhAY0gVk4n2TGd6zCY78QHyTHNNz6sWfPG5PcDIfUmSUi EZf0xL993KdUeY7ohaWAX+tjYoycLVQdgOSn4SvLx8bxAKMywsh8ozZ3+wqIAkSFTnbCF09vMjN XbKdLRHAPDoHjYZO28w8UK/CZjRbB2gdYqLBNQ== X-Google-Smtp-Source: AGHT+IH7EX0Zd8kOjmd85jq7cPnyZB2Gxoa5M/XhjJ0tRWUuoKl8IDet9J12UuSAPni2ukC5wYaBbw== X-Received: by 2002:a05:6602:418a:b0:84a:7906:21e3 with SMTP id ca18e2360f4ac-851b623c48bmr2846147139f.7.1737787624348; Fri, 24 Jan 2025 22:47:04 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:03 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 25/63] ddebug: cleanup-range-overlap fails Date: Fri, 24 Jan 2025 23:45:39 -0700 Message-ID: <20250125064619.8305-26-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 cleanup block, to handle kfree before dt is added to list. Once dt is on-list, do ddebug_remove_module to cleanup. tbd. review some more. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e57c05c9fb0a..781781835094 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1277,6 +1277,7 @@ static int ddebug_module_apply_class_users(struct ddebug_table *dt, return 0; } +static int ddebug_remove_module(const char *mod_name); /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1318,32 +1319,37 @@ static int ddebug_add_module(struct _ddebug_info *di, const char *modname) dd_mark_vector_subrange(i, dt, cm, di, maps); dd_mark_vector_subrange(i, dt, cli, di, users); - for_subvec(i, cm, &dt->info, maps) - if (ddebug_class_range_overlap(cm, &reserved_ids)) - return -EINVAL; - for_subvec(i, cli, &dt->info, users) - if (ddebug_class_range_overlap(cli->map, &reserved_ids)) - return -EINVAL; + for_subvec(i, cm, &dt->info, maps) { + rc = ddebug_class_range_overlap(cm, &reserved_ids); + if (rc) + goto cleanup; + } + for_subvec(i, cli, &dt->info, users) { + rc = ddebug_class_range_overlap(cli->map, &reserved_ids); + if (rc) + goto cleanup; + } if (dt->info.maps.len) { rc = ddebug_module_apply_class_maps(dt, &reserved_ids); - if (rc) { - kfree(dt); - return rc; - } + if (rc) + goto cleanup; } - mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); if (dt->info.users.len) { + /* this needs to find the ref'd class on the ddebug-tables list */ rc = ddebug_module_apply_class_users(dt, &reserved_ids); if (rc) - return rc; + return ddebug_remove_module(dt->mod_name); } vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); return 0; +cleanup: + kfree(dt); + return rc; /* tbd might conflict w notify chain */ } /* helper for ddebug_dyndbg_(boot|module)_param_cb */ From patchwork Sat Jan 25 06:45:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950786 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 705CDC02193 for ; Sun, 26 Jan 2025 16:40:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D404B10E481; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dIhXxPfq"; 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 9824E10EA68; Sat, 25 Jan 2025 06:47:07 +0000 (UTC) Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3cfc8a2415fso5390895ab.2; Fri, 24 Jan 2025 22:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787627; x=1738392427; 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=K2adNnpQ1ndgxlrGpzojCmuFvxvCimDSyhOgF+7GluQ=; b=dIhXxPfq9SfId/0EsJML29fuwypruhtceooWrs0AWT2rNqw79K2BKiotngjj0DtXMk DqRE0z93WUfx6gJ6x5m9ACwwJi+PJCS6C4mSucjCJO3X8HVZiwvZV7pZfMPgQjXGfJiw REO5LMRkDuvcLiY9PI4+kJ7N4a/OkZXbcfvX2cmU0UOKpSVWNfEmNhFeGXtbN3+S4ph5 LpJkLX58zQNe2g5N9IqQYc2jECpPJfoq3Q7FBOMPJD7Br2/PNyTJcuKZi1l8kL8pQFbH ZWARY9E60ACbkVcvHdmYbCtuUZmV1ZJ84jeW/nkzj2eWynf1IdE15H7R50jDKej3gSwa lNGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787627; x=1738392427; 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=K2adNnpQ1ndgxlrGpzojCmuFvxvCimDSyhOgF+7GluQ=; b=B58lBGb1ECVd1yuNs2y3JMnXrYK5iyift3EZdibMYR4MoED7YDMRPWNOGz3Coo4TG9 1YqY0EpoLH7rpRsNX8NEU7WLVctOzfC0IelDxJfy/GjngSnlKJmLoW+R+FMMGJ8uesOz adVXBtK/o6KjGbnPDlhZlRuvMCQam8MObO+IsxWKTQIALtA6/vSLxyd+DSfEVGZygf55 dNB/FeyUI8GGraCrMYNjHpZ6RjvZQiTWTTK1x7QX89g0jS0Nd6ufDbFx/sABYeYYZdcO uqbGWLgwWGS26gnQiu6VZVclDJFxONNjgqDZTl1h9hzDjA5knAw0Cg+fW/eS5OBOold8 fuig== X-Forwarded-Encrypted: i=1; AJvYcCUrcEw8927A+5hk+X9Ar41zZnv6FHuk25BH9bXvGnFXv+gfgnzJixM6nJ3XlnwctZH7vDLZ9nBh/y0C@lists.freedesktop.org, AJvYcCVJQVV1kiAhB1LkNIwHGALnIUjympkOyC/yanAjD+4BI4uXe37WoPlnuIPvdgGTtzMJCv2seI9i@lists.freedesktop.org, AJvYcCVvQTdHWJIYMkG6O/DGSfHQMNMhs7RxvqUmS4g0XnY3z853TvPMxt3VSlX5fh8VVHzIUMGfDxz73eXI0T1+xQ==@lists.freedesktop.org, AJvYcCWT7aeH+PtLPpxZ3U30zMeywo83f9rJ5mafocUdSBTcotHACaEdKitEVpov5+lHQec1mFegNNNQGjF1@lists.freedesktop.org X-Gm-Message-State: AOJu0YxNqTw1ptjW6CgZnyRfOMdp2od7tE79iBArbqwmeXRh0SYbeTQK b0JaijZeXxKERNhvGpyH4DthUXkIGK784HQuLKzNDdy4Od0J8JWC X-Gm-Gg: ASbGnctTWiAOK/pef5xxcarQQHaRFK+t7cfXnkYAh/nvHoona7VCE+18J2i4V8f1SoH fdQp4dJ2JB5Cr0VabOlttYkJqeYKs1F9xs7Qpse+PXMLDT4AG+7dUKobJglwFOcg3tBWb7RWDrV GU/QPhrpEInAi7axpVV9+bEcChrUkntTp4UZg+3f2MeWA8a63DrN71w58rVs/2KVB7UOxPGVSxX BuaZaQZjqau6LC0SN/4ulIKhLyN89ajy4alFeXVgwbsqDBL1mrJajUm8Scg/o4faC+Zj/9ayh05 tK4zPmFym0PrUDiR03/Mik9x2AnRBZHKsciKig== X-Google-Smtp-Source: AGHT+IFvfnXx3vIA0IygucIVFMzusww6a1v559qwPHqvKV9Wy0ZpTiWPO7TpRRif5ApEBz6kamOW3Q== X-Received: by 2002:a05:6e02:3cc2:b0:3ce:791d:7f6 with SMTP id e9e14a558f8ab-3cf74487b41mr262768565ab.16.1737787625414; Fri, 24 Jan 2025 22:47:05 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:05 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 26/63] dyndbg-test: change do_prints testpoint to accept a loopct Date: Fri, 24 Jan 2025 23:45:40 -0700 Message-ID: <20250125064619.8305-27-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" echo 1000 > /sys/module/test_dynamic_debug/parameters/do_prints This allows its use as a scriptable load generator, to generate dynamic-prefix-emits for flag combinations vs undecorated printks. This will make it easy to assess the cost of the prefixing. NB: the count is an unsigned int, and is *not* clamped currently, but probably should be. Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 74b98adc4ed0..5cfc156ca4bb 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -16,16 +16,24 @@ /* re-gen output by reading or writing sysfs node: do_prints */ -static void do_prints(void); /* device under test */ +static void do_prints(unsigned int); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_param *kp) { - do_prints(); + int rc; + unsigned int ct; + + rc = kstrtouint(instr, 0, &ct); + if (rc) { + pr_err("expecting numeric input, using 1 instead\n"); + ct = 1; + } + do_prints(ct); return 0; } static int param_get_do_prints(char *buffer, const struct kernel_param *kp) { - do_prints(); - return scnprintf(buffer, PAGE_SIZE, "did do_prints\n"); + do_prints(1); + return scnprintf(buffer, PAGE_SIZE, "did 1 do_prints\n"); } static const struct kernel_param_ops param_ops_do_prints = { .set = param_set_do_prints, @@ -177,17 +185,20 @@ static void do_levels(void) prdbg(V7); } -static void do_prints(void) +static void do_prints(unsigned int ct) { - pr_debug("do_prints:\n"); - do_cats(); - do_levels(); + /* maybe clamp this */ + pr_debug("do-prints %d times:\n", ct); + for (; ct; ct--) { + do_cats(); + do_levels(); + } } static int __init test_dynamic_debug_init(void) { pr_debug("init start\n"); - do_prints(); + do_prints(1); pr_debug("init done\n"); return 0; } From patchwork Sat Jan 25 06:45:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950799 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 C4584C0218E for ; Sun, 26 Jan 2025 16:41:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E2DA10E46D; Sun, 26 Jan 2025 16:41:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S6NldZpF"; 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 70DA010EA64; Sat, 25 Jan 2025 06:47:07 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-851c4ee2a37so198190739f.3; Fri, 24 Jan 2025 22:47:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787627; x=1738392427; 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=ZUFY1/p4cwMapYCElPuw4n+JFAz595e4pdu5x+kllYo=; b=S6NldZpFhmT55EHkGhUIG6Y/MCE9Wkb8fcq28t9djO6gpwTWP4wNb7l9shAGRLamhw Bx/OGhZFQHHTPY8H7ufFSvlq7InOvSaY5/3GIrt2HL2Ihp/jjbZS10VrUV//7uQl4azb uIJSoN7jWpwvssrMQb7qcvyRkXC6awLPPusVNaaMDN+4dFfQ7tad+ibagwtIPA2koz2t b49ugQ0BuHOBHcUHs3rn23H7c8klrrfoODw3mex4iXLZfpKqTGth5iVohpXIjCA3H/RH dLqfS1I11gkSx/2Yb0YQIRCJ/tMk+2SGBiX3YnSf4ZI4bpxKDZFInkZToRBK+bB36df8 TdCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787627; x=1738392427; 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=ZUFY1/p4cwMapYCElPuw4n+JFAz595e4pdu5x+kllYo=; b=BYtjgyN33EXworOHY5tDJlRWqN5b7cRSrPke4NkYncNQfuC52+M5xhnKy4bMQJ4zos K+96VVJLlwRSmH2L8jyrpNsEXXYugxOu3BAjONqEhrzdV8JiIDhWhelZ1JYyzYD+JrA1 fWXD67AKDBR9ahOKe9blYUbaugJ7+nIHvZeH7xE+BHKd3wEwVuvJgADeUsWqSdUJ00D7 0qZf2qUl2LtvN5TmhOd0tR+U7KF5205BQZCsV3xmg+imq1/mOHaN6rmhPZg2Y92BfxCp C2aJbHeqQf0f7Y/4S7K1rMhlPluK7XF+UB/RwrSpHGAtMpoSQ6ih/9NeQ+VihbLHMYwR 0HcQ== X-Forwarded-Encrypted: i=1; AJvYcCVM2tC/NV4cAd2CkRf2eM2qNXwBUcaN50mOcd20VhKXx7/teImVgI7Lim+ZO7y+PKrw28P7mGN0@lists.freedesktop.org, AJvYcCW0dUmhfvSn2n/lmOZn2gKS9izEpIY9n7iglDuzPfoE5XX1OPTWOetfwgHrPLwcnz8aHU7mHIF/yK4u@lists.freedesktop.org, AJvYcCWTH3CyJVUzy7yl8VfzyMmZ+VYD0/Vp7PQZ8jZDjxeLO//Aea/KjnWMYI8PP6dBssgVKNxbEj1OCBsxpVIoJA==@lists.freedesktop.org, AJvYcCXNOaZBDZlKPQpyFBjDtUCpZm0B6xs0nDicX3Hr/seds7snCnrqbQ6qJCrUv53wt4m7VBOh8CmDvlr+@lists.freedesktop.org X-Gm-Message-State: AOJu0YxA7RrFDTJQPBAcYbrkvCJ0FhGqm4xzu70UYPPKBTQeHAs4KetM /xshBEO2hmhfscW+iI3ldbLzLsVTFQhepoFSsqyQTk4VsNvgFAT3 X-Gm-Gg: ASbGnculnSNyQ4/9H/QPHcnMGgKDabvOmoBeqcvBPTyrVE/6Wly/gcAIkR2/cyAnrgB 4j/iOU1VrOL2Z66d2Cb7F2fvgXlyXP8WIH/wpWCupaUIPA9PTULzn6CmSTlKhzy+C9VcKQrEPHM XSP1uGbguRQBjbMA8Z62YBMkpYFjxRRV+Q0lR5MMYOltwE96N39fsa/H9WMmNAOwmmtMBFxxjYr O1RPo90SccUyRzADWXTINSiKdvToWkEkfvz1S+gZZ84eYRtqFs819keUGzmZfzr5CmU+U0wkLJj wVK21NxbpWcT8g0KdsgEgtBrlaLNlcba7j9m4A== X-Google-Smtp-Source: AGHT+IFNi6k74yWo8JFoUX0FA2mOzPOZaMw9sxfyiZBj57HkmJfOHCUtm05G1Ba+XY1KZ2w6PJRKAA== X-Received: by 2002:a05:6602:26c5:b0:83b:5221:2a87 with SMTP id ca18e2360f4ac-851b616986dmr3118410539f.3.1737787626594; Fri, 24 Jan 2025 22:47:06 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:06 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 27/63] selftests-dyndbg: add tools/testing/selftests/dynamic_debug/* Date: Fri, 24 Jan 2025 23:45:41 -0700 Message-ID: <20250125064619.8305-28-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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(), which modifies pr_debug flags in module params, which to handle boot args/options, must be a builtin. 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 V=1 -- ./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 ... [ 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 ... Signed-off-by: Jim Cromie Co-developed-by: Łukasz Bartosik Signed-off-by: Łukasz Bartosik --- - check KCONFIG_CONFIG to avoid silly fails 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. --- 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 | 256 ++++++++++++++++++ 5 files changed, 269 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 38afccb3b71e..b707421229e3 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8042,6 +8042,7 @@ S: Maintained F: include/linux/dynamic_debug.h F: lib/dynamic_debug.c F: lib/test_dynamic_debug*.c +F: tools/testing/selftests/dynamic_debug/* DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 2401e973c359..e632f3fc97ac 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -25,6 +25,7 @@ TARGETS += drivers/net/team TARGETS += drivers/net/virtio_net TARGETS += drivers/platform/x86/intel/ifs 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..68a9046405f2 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -0,0 +1,256 @@ +#!/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="" + +[ -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 +} + +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 && 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}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi + ddcmd =_ # zero everything + check_match_ct =p 0 + + # module params are builtin to handle boot args + check_match_ct '\[params\]' 4 -r + ddcmd module params +mpf + check_match_ct =pmf 4 + + # multi-cmd input, newline separated, with embedded comments + cat <<"EOF" > /proc/dynamic_debug/control + module params =_ # clear params + module params +mf # set flags + module params func parse_args +sl # other flags +EOF + check_match_ct =mf 3 + check_match_ct =mfsl 1 + 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 Sat Jan 25 06:45:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950750 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 186C7C02191 for ; Sun, 26 Jan 2025 16:39:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BBDF10E43F; Sun, 26 Jan 2025 16:39:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="I8UiqEOV"; 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 A212510EA6C; Sat, 25 Jan 2025 06:47:08 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-844e161a8b4so77343839f.0; Fri, 24 Jan 2025 22:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787628; x=1738392428; 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=bawAVjsssmFzYPdPxQZ92OM/AJ4JZgRmMv83weXIFxo=; b=I8UiqEOVFOABCmVnxghIQY+Sj/nSgiBj/lPHPltkEnGn5gTdGtLfTGmkKtBxWqzCc/ r7XKuWeZnGKtymP8w0lLPKAgtbQt7LOBuP1iRbkfREj6m59UQPA9wATzta1lapRB+jg1 iVv9dbTOUsKW5opn5LIjI2uwyAXBLIc7sZe3U4Xm/GCGvbNFexxTP5LDSNH/cXK7Iy4L zoFqEJjHAx9N/+eZ7ioq163xhs/RDxcJMSx90JKmKIePA166c91o6OuIXhfDrOAVPf62 ydW8N9NOp2ZzpkcftRsbIuRJGG7ZRdho3r1j5V6Q3shRy5JWQ+em/gc0ERJZxyUVkaqw DKtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787628; x=1738392428; 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=bawAVjsssmFzYPdPxQZ92OM/AJ4JZgRmMv83weXIFxo=; b=saEBx+tmy8MZSu2B4g6UMfE8eMzIUVC39a3i8vNqeYKL385R0zjwQ760OaCEv/eXuy FTQMZn+D1OYWyJIwk10EEzO5NAQuT1/2OGEekDsOgqsKYqYclM3HMkIIjxTXtLygwGtT Rm+2wXNM3zWoQ9yQzPt7DSxC3XkQNpEKeUO+CiFjI0yCn24EQ0lYl4dLc/nNReEeEIM/ 3ZR8XLO/J0qTmdSoysqnDc+pRzhUjOEsVnPUPhjDfabVqKkl0WE2qypJAGtyiDK+F277 vNpVCVL1q7KKy4A7SXX+1+ZvudO5rg9ePyaAZd7EGDEQ6gBlLioCtbd3xcZR7Yt82YoM E0GQ== X-Forwarded-Encrypted: i=1; AJvYcCUmvAS0PGNvtzkJvN5PkfveTtetFtq73SMdPmVs4HT6xsOnhCzb7LmJVOkWRfwFGl6kEAxvVBM9@lists.freedesktop.org, AJvYcCVKw8f385BbUILf7Dlm+gwauRalJ2GFvOP04DtSEYbZnWb4mllQjV7sCcsOQZI+sgMHHpwWqvHVND17@lists.freedesktop.org, AJvYcCVYFMsANiskLOHl04FOehlaoz3UZ5W6C+G1xzt8GtqluFQwI4nkTBzb8BsEazar4vW2aS1PG/Y/3VPcbMT2lw==@lists.freedesktop.org, AJvYcCVz0bn0BEW4wA/Sgok/sHwZywad7RPu2hBxCc29c2z3v3DcU0jltercqJpWrL1JunM0BjPjZQhZjIaJ@lists.freedesktop.org X-Gm-Message-State: AOJu0YzHugjh58cfxNdQxx5dMLcYPCMhSJINsQl3GzWBp+BuRSyXTGkP JJZ0fnpC+rl7XjeXy2Ahd1k2OrPhTdJhxqhut82Al2pVV4vxkHOP X-Gm-Gg: ASbGnctnGwnjshIyf0PCEfwhVYc2pNgCE+l4HJVl2ozI7AaWbE3O1zOJBJyRyi3dOCn gZqjeqO58HyUfioF2c+uaeqsWzMQZFHnufnfUjJXPmhJX0lKa9O+VV7y5uvM3PScziejMPYoYX+ AFSuhOaR6liZS8Pqu7AV6/eLxHSqsF7stuQFSVp77G5xXkBkYP37AGwntrCeQFbwbUzIlTv0vUh 0GLhZm5K+Daaf0A4Qv6iFTW7HZx/rP177FhDNyB71y31buYuRFdEp17bw5TAfaVWOpVsotnrHzH Qn7JNFoWu7vjA2nyUcbXOWm6/rnQTNNvOrD6/g== X-Google-Smtp-Source: AGHT+IFTZA0vUP8lMnChoH2isprbJzAhqKXjoh/0GJGG53PQuggPKp+V3sgxX0Xc1O6ANPmO29WrWw== X-Received: by 2002:a05:6e02:18cf:b0:3cf:ba5:1ea3 with SMTP id e9e14a558f8ab-3cf743e59a7mr243410115ab.7.1737787627869; Fri, 24 Jan 2025 22:47:07 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:07 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 28/63] dyndbg-API: promote DYNDBG_CLASSMAP_PARAM to API Date: Fri, 24 Jan 2025 23:45:42 -0700 Message-ID: <20250125064619.8305-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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. Modify ddebug_sync_classbits() argtype deref inside the fn, to give access to all kp members. Also clean up and improve comments in test-code, and add MODULE_DESCRIPTIONs. Signed-off-by: Jim Cromie --- -v9 - 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 | 38 +++++++++++++++++++++ lib/dynamic_debug.c | 60 ++++++++++++++++++++++----------- lib/test_dynamic_debug.c | 59 +++++++++++++------------------- lib/test_dynamic_debug_submod.c | 9 ++++- 4 files changed, 111 insertions(+), 55 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 48d76a273f68..b47d1088b7ad 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -205,6 +205,44 @@ struct ddebug_class_param { const struct ddebug_class_map *map; }; +/** + * 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 + * 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 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 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) + +#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 781781835094..9283f2866415 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -660,6 +660,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) @@ -678,26 +702,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)); @@ -1163,15 +1176,24 @@ static const struct proc_ops proc_fops = { static void ddebug_sync_classbits(const struct kernel_param *kp, const char *modname) { const struct ddebug_class_param *dcp = kp->arg; + unsigned long new_bits; - /* 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); + 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, diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 5cfc156ca4bb..32a9d49a7a3b 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 @@ -43,36 +44,21 @@ 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 - * changes) within each. + * Pair the 6 parts by type, to show the pattern of repetition and + * change within each. * - * 1st, dyndbg expects a client-provided enum-type as source of - * category/classid truth. DRM has DRM_UT_. + * 1st, dyndbg classmaps follows drm.debug convention, and expects a + * client-provided enum-type as source of category/classid truth. DRM + * gives 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 + * Declare the 2 enums now. */ /* numeric input, independent bits */ @@ -91,12 +77,15 @@ enum cat_disjoint_bits { /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 = 16, 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, @@ -116,11 +105,12 @@ 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); #ifdef FORCE_CLASSID_CONFLICT_MODPROBE /* @@ -131,12 +121,10 @@ DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_CORE"); #endif #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); @@ -211,6 +199,7 @@ 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_DESCRIPTION("Kernel module for testing dynamic_debug"); 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 Sat Jan 25 06:45:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950762 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 56847C02193 for ; Sun, 26 Jan 2025 16:40:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADDC410E44D; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="iXII6+lG"; 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 AD6A610EA68; Sat, 25 Jan 2025 06:47:09 +0000 (UTC) Received: by mail-io1-f50.google.com with SMTP id ca18e2360f4ac-844e1eb50e2so75449939f.0; Fri, 24 Jan 2025 22:47:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787629; x=1738392429; 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=CxerCwCa32SuNvijTSel2H05zJGPetjkTO/3X/VldcE=; b=iXII6+lGR+3VeR0rV8Y9szZKX5nLKqfFNtCmdt8vL9BUsG9G4DRJ0UJEj8+rPha7PF 9GS0O0dSHbgu5njS4/BID7iCh1wx0+Q93WSklzpMKmDC4SoCu8j6MXAZBG0GgLEQnIQX I+74TMugS3Pqb9ihJDmH5rEP64hf1tZQMCJUJ7jZ61yRvLnwe3AsvB9XZaCVmvcCXSim DUGxglfhFlWzuaFib0B5lpn9gzWUms1PfBCRovwBOj8x184BeIgArBCxpEeJ3gb+uLQm PLfnQMDw4okJp/Y1qncK2/aZd9/zwpLQBpB/wwnNNfJbPia+9McuwxGvss4+ldiZHmFi +e+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787629; x=1738392429; 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=CxerCwCa32SuNvijTSel2H05zJGPetjkTO/3X/VldcE=; b=alpzMwlUjlTTXSOOn3u/sZ0KdXOsjAjOT8bUayhGZazlSgLkrqevV/5sHgUGpb8IB1 SOD/9+CTsHo/Rp9C6AC3yuoqERWexuMFHTxOZeILIvU9v/uT08jJQUyBX0HEmKkA7IWg bo6L51+R2zgWkkh4BTOzs135zchXBTXd5Yx/d8HdEa8oWM4Pq2WiMYJNp+x3PYPFSF7G ce+zxvmWZwAbNgWkzRW6v700GM34cDh+Jnw2hWMaewDR3gRGnNyi5D7SnCtIuKDFw2Wr 6b3Q/ITH4rnxTLCu2K+8tHKNhvAvK+xmf7muBgJok2DnSmx+TWDSjs0G2Uy3Q0VhnFhA oUgA== X-Forwarded-Encrypted: i=1; AJvYcCUvuWKMk3FbGIazU5ipmOQeA0By41BfKhJzeiotsZo9LEn0YWBtbqr1YH9jLAacR95bhOUhRgsnUrmQ@lists.freedesktop.org, AJvYcCVP08RBtq32pmPJjylvjlrnOqxqA4CI9YmzI3XYec+dMdZAlzO5FcdB22LlPxxxVboN0s9WaEdpt5LE@lists.freedesktop.org, AJvYcCWKpw02l6NaXdRGps8vmgfy0e6mYPp+2U9f4avYnTi9z+941f+FH/OzAI6uaKmjWHgyUwKGqON5@lists.freedesktop.org, AJvYcCX4sk3FGenaIwn9mbx49Z2kaEkTJYnWBuPg6/SP+c5QqKhgX62PUxsNXh5VyIxkO6iM01/frgiP7RwuUaQZvA==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx3mJGAuJ0vhP1X32jRAVJKeRkiLaCTv8EJOhk3GjNswoB4q+ui Vnkr1nrWARA8rWGB578h+PJlZA+lcVKGLCbA1Z617K65R8+6F+wv X-Gm-Gg: ASbGncvVgB5Li2BQyEpLlJ3AEXHIyKoydmTnVK8D7ib16k7+JokaGJoytuUXMrmbjuy zJouQ6LahwwqIgxTcEXIJ3juE4Oqoh7ofA7EldjTQbnwllz1OCRFDZXTWb+uRWeXwSct0NR1Q9d p3aDhJhCwIW78o9xeGaBq9OsYBTEOXE2LFx0UR45ykYxcCWaEyTSM3CJbsbygR5hHUBQVOk4Jnd PDjeXf+8+TCbY1xc0UgjeBSqCUhli3h0OqnCJIteEJbYMuzPpoPXUvXOI+sTTfYhAmTO2TSVD7n ds+3LXpEpiZWMSUS9u7tTb8x8kTQQSk6iNX2mg== X-Google-Smtp-Source: AGHT+IFeP81OrrwZYyhERt8IWjWebpncl5LYjvFIJ2Zw2ef9M59/qZvRErXREgk6q+sIWkS/LYegPw== X-Received: by 2002:a05:6e02:16ce:b0:3a7:6566:1e8f with SMTP id e9e14a558f8ab-3cf7447bb26mr253694305ab.16.1737787628880; Fri, 24 Jan 2025 22:47:08 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:08 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie , linux-doc@vger.kernel.org Subject: [PATCH 29/63] dyndbg-doc: add classmap info to howto Date: Fri, 24 Jan 2025 23:45:43 -0700 Message-ID: <20250125064619.8305-30-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 v9 rewords --- .../admin-guide/dynamic-debug-howto.rst | 79 ++++++++++++++++++- 1 file changed, 78 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 691e0f7d4de1..391e40a510c9 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -230,7 +230,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 ================================== @@ -380,3 +379,81 @@ 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 +======================= + +The "class" keyword selects prdbgs based on author supplied, +domain-oriented names. This complements the nested-scope 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): + + :#> ddcmd class DRM_UT_CORE +p + :#> ddcmd class DRM_UT_KMS +p + # or more selectively + :#> ddcmd class DRM_UT_CORE module drm +p + +Or the legacy/normal (more convenient) way: + + :#> echo 0x1ff > /sys/module/drm/parameters/debug + +Dynamic Debug Classmap API +========================== + +DRM.debug is built upon: + ~23 macros, all passing a DRM_UT_* constant as arg-1. + ~5000 calls to them, across drivers/gpu/drm/* + bits in /sys/module/drm/parameters/debug control all DRM_UT_* together + +The const short ints are good for optimizing compilers; a classmaps +design goal was to keep that. So basically .classid === category. + +And since prdbgs are cataloged with just a DRM_UT_* to identify them, +the "class" keyword maps known classnames to those reserved IDs, and +by explicitly requiring "class FOO" in queries, we protect FOO class'd +debugs from overwrite by generic queries. + +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. + +DYNDBG_CLASSMAP_USE(var) - modules call this to refer to the var +_DEFINEd elsewhere (and exported). + +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: + + 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. + +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; 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 +_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 Sat Jan 25 06:45:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950795 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 0D69EC02199 for ; Sun, 26 Jan 2025 16:40:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C6EB10E45F; Sun, 26 Jan 2025 16:40:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FMYzfRgX"; 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 AF76110E2B7; Sat, 25 Jan 2025 06:47:10 +0000 (UTC) Received: by mail-io1-f51.google.com with SMTP id ca18e2360f4ac-84a1ce51187so77815539f.1; Fri, 24 Jan 2025 22:47:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787630; x=1738392430; 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=x11BZKBrVuF//4sDIzHDHCm/mRQ6/WwpO4x5frMPkhY=; b=FMYzfRgXLUKQxSEJFD7/TLI6A4F7+8x1ndvMM+qSyXtgKMc7UYh0LIMOXFt8c+EmAS rDlF/L5ZaNjq5AUUcV8ZSzej9V+bJXn7SoXI6f0KHwjjDytkjWul+8K16SbHc1oTSnrk vH3Z7m1G5reXdj2bDEnRFVvbxLSdyqk5XC90V+RoH2rsGv9DZBGd4OFm/ARauONq0BYW S4NeiYFr/L8ouLusHBVh4acrblsev7BPI+/1DYa8WFczd4ta8W3gb58f9EJ10jgRS+k9 l5s4ER6aUQr49JHLSyRkQ0TCuhQ5qCffHDiN9ezuUvLMbQ/M0QEPln131MfOmWikPIge ZEwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787630; x=1738392430; 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=x11BZKBrVuF//4sDIzHDHCm/mRQ6/WwpO4x5frMPkhY=; b=AHm3GCVxhkKzoT7famQiekMXQwbBALkz6cBlZhKhj4Dn0Bg3IC35F5UWdNjZQEgKDs KXSUqKBHJA2tZ/F/XU/TPIlap29CBRJ8noyuyRDehiFYFqc3w88VJ5hO4rfZMuYIj50X EvhOCPBRgBXyyAMFP7Sv/0ShsK+w9mW5FstP5TxjBssUP2PMltGOkWRZ5bwgPi8ff7x6 WKN6Ql4moS1g5PVaVWX5KPnDTC5Vf3Fw56WR/XlMe8Mr1yxqDFV9a/sVfMiJfguCUQpF 12YDRthOcJW35CBRR7l6+AsQ/Ck2oWoGO5M3bs0fAulJLeueT2hwSOflaIO1UA73tj1w kwVg== X-Forwarded-Encrypted: i=1; AJvYcCUgBw0QmAy85M5+Iwj2Dn6hj8ootqhdErI7RT6O4RrzWwaGR22OlMFDbTGwXAPxvrFRVmDc43B01w1x@lists.freedesktop.org, AJvYcCVCoeSMCOe9UaEGxD97n8VKcqHa9EpIsk6rZNTJ9pFQELYK2p61m87eGii3ojuQpDE7kyGrP5fz@lists.freedesktop.org, AJvYcCVeQ/0+CdlyHF0No6z6MdJZ9qqIhGCcuzkBgWNBUu7Hmp7ohXizMZiGTl9U/fm5ZnP0+2bakspYRr3b@lists.freedesktop.org, AJvYcCVmdtbbfgsTwL8JTXQuXDXh2RcMMe4oXgJj5upQGsNfMNvNPYxXxg2avP86SGaLFrtLF/Y91118eresz/QQaw==@lists.freedesktop.org X-Gm-Message-State: AOJu0YznnTi5qir7fR5HUa3YrgwY/48B4V1yY4wG8fZmU2UIO+Q8zloU iEZETZS7IOLLDiALdCF6Mj8OaVdLMjRiYjnZo7zcY3sYS9WIf7tL X-Gm-Gg: ASbGncvw74iGNi3kBQZkarj3lloqcE5cbkU+qVmvBNmCwatzcJkgczyd2e0FT9a652T xodZ48ItgdsnrVFgbVcAMhZ1K4ONZzqQoqqK2CrP923NMF4rhSkaH7OhF7goUbDU/BJRgw873FV uAoJIzHjsNYv0Bu1MT8Dm9DofX1bUUmiZ9N4ptixjSF12j8SgO/XMEaMgZPgWKWmvteNEb9VLds vNn7IT3CcxkugD+3A0BRUFzH12TNfJklYIcrwAuTYGJZJgCa5JJDD7T2UOyNItnwFIBKNqSy956 2jA8JVeIbvOchJGLhq+371z/51UnvL6qaXyniA== X-Google-Smtp-Source: AGHT+IEMjfj5KPBD+MY1YnSxoaWknOFxVXF7E1RjBZMpsyNcxNDm6LNROXUaKAR5kPzioEBH7zCauA== X-Received: by 2002:a05:6602:3e94:b0:843:e667:f196 with SMTP id ca18e2360f4ac-851b61ee917mr3363869739f.4.1737787629916; Fri, 24 Jan 2025 22:47:09 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:09 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 30/63] dyndbg: treat comma as a token separator Date: Fri, 24 Jan 2025 23:45:44 -0700 Message-ID: <20250125064619.8305-31-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 9283f2866415..56e09e878f80 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -293,6 +293,14 @@ static int ddebug_change(const struct ddebug_query *query, struct flag_settings 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, @@ -306,8 +314,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 == '#') @@ -323,7 +331,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, @@ -595,7 +603,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 Sat Jan 25 06:45:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950752 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 144B7C02181 for ; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99B9810E442; Sun, 26 Jan 2025 16:39:56 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JrQ42gN3"; dkim-atps=neutral Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id A8E0410EA62; Sat, 25 Jan 2025 06:47:11 +0000 (UTC) Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3ce8a6bc715so21102055ab.2; Fri, 24 Jan 2025 22:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787631; x=1738392431; 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=419xiuPVMG3qbwGo3tkCVXoWQ5CudHQx226Ckf7XZpg=; b=JrQ42gN3gvjYK9jhjejDBuELxQVxrmeIv3+4HmwIZawKD3Im9YFqv0rc6zWu5/4oNQ B+MdA38OubyxnhWXc8lUxWY5qpILa+fngqndZ1+Xv+N/7ifSgfkT6CN7iVsWz5q4Dj28 QMpimptEyhKM/VuHc1B8dKvlD4x2YBMRCmCfbp8vLjRbqm0XcIjar0KLtxOgdhhcvNku ZIBTyUI5VQuJonE+zXnC9I8g9hYHqWE97ceIAsIBzTI3EKPjenrwapk3RCSfQa1xYAH4 Q090qY2/IMD0BtTD7eQ704gith9JPMupxq7yXfNjx/VKuWKtNqVK/5VJhOF2NiKcQV4y 4Lvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787631; x=1738392431; 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=419xiuPVMG3qbwGo3tkCVXoWQ5CudHQx226Ckf7XZpg=; b=cxRRr7SBwJOG7r3KnkN1eVDLSAZ149AkN6H9BQH4EDXUWae15L3I0z88ebAQ4iyNNf Wk4TbIHl4/JqKwQOzIa/DVbjSwHzVCtqCnNzwtnWn83qo1ccaV5p9xVOp0zJgGcxhFxp O6BpvDNfJaV1DL3/z7Vcfq03zoaFGsk1VWp+r+qOLu0jmGuusGo8zsuBwghm2/P+q1gE 0oAiXb6On60vEmOypn6JB1guX++88NvvyhW+Nl1ZU6DizYz0U7NqrhDHdNn/TQQqpUBE rRycF5PfgTape9WncFtiJ2CHc/aYiqtbE8QOxOuI8zAQ1kJH81mXRjit1Kbg4SMw0100 F8aQ== X-Forwarded-Encrypted: i=1; AJvYcCUHfMdRWA3C+TiX5SLpWhI24Bkn3qSo/dfu5WGxWoWRhkNgsdWkghUCcvDnwrNxLO5F/z+bK4LTGT6xVYtWfg==@lists.freedesktop.org, AJvYcCUV3ykRcuCfYMpb+7liWkZf+L0iI1/Nb2atIL6WFVKwIGRQZU5Xkrfbj6z9BqA4B8pp9ur6ClJ0W0w4@lists.freedesktop.org, AJvYcCWWYdCY9dBmSt+GhVEPiB9XjYKuo8V+CtNf1XPpqJ7WbB2ibPDJ/QMm0APTamEjKGlHwqRc9jj+@lists.freedesktop.org, AJvYcCX4hSaw4MvzJnY94aSqNmEwvo/sC5NoGowWy7I4iEzhDw6VD5LG9R4yg5fw3SmWUHBmnQeAF8BOWFuM@lists.freedesktop.org X-Gm-Message-State: AOJu0Yw+IDBdZDG/vntF8+BVJED9/7ZUYaunvh6wWbjv2nO7Zz1DQmPN H9VPyxNIRUeZKV8qp4a1Kcvg7OOlpZ70R5a4WOOnNkieopJNR8LE X-Gm-Gg: ASbGncsSUcJbqIhs+Na5DAV1+eDaXiNFRS7k4DJCZysfjZwy26aSF9IDhQPMQWCTtYj ebMPbIJdiPRodGbZGtmAAXgbHNm4/Yj3WnkwBuUPI4kD+aUvy1mkiVvJlfrsujbNp4amPkuRUVu iYEmUM2TSV0vTg3SrtmnMqbH+i/ahjlWbxW9EiYNDm9FlpmGkzFx8CGXIw0R+1ZFv7NgvpMHgQM I3RNy4uWsVvmTdxfh1YD7qts2G+iNSetlkfIq7xkp1aTg/Ygnk65ICvAOxStvrxy7Cot4Ahe4RR uIK3Mq+e58Dhfq8Y9GM5iZSX8V+OvClNhelnOFwwZDQACj55 X-Google-Smtp-Source: AGHT+IEdolY48jcy1d5GbnNNp6uwMS0tCY3zAQsNey2Tb/bKtSSTu+VxIC9kGp83MyjaHTPxuWcnsA== X-Received: by 2002:a05:6e02:1aa3:b0:3cf:cc8d:48aa with SMTP id e9e14a558f8ab-3cfcc8d4b85mr45317065ab.21.1737787631024; Fri, 24 Jan 2025 22:47:11 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:10 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 31/63] selftests-dyndbg: add comma_terminator_tests Date: Fri, 24 Jan 2025 23:45:45 -0700 Message-ID: <20250125064619.8305-32-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 --- - skip comma tests if no builtins --- .../dynamic_debug/dyndbg_selftest.sh | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 68a9046405f2..368d10a691a0 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -216,7 +216,7 @@ function check_err_msg() { function basic_tests { echo -e "${GREEN}# BASIC_TESTS ${NC}" if [ $LACK_DD_BUILTIN -eq 1 ]; then - echo "SKIP" + echo "SKIP - test requires params, which is a builtin module" return fi ddcmd =_ # zero everything @@ -238,8 +238,27 @@ EOF ddcmd =_ } +function comma_terminator_tests { + echo -e "${GREEN}# COMMA_TERMINATOR_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP - test requires params, which is a builtin module" + return + fi + # 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 Sat Jan 25 06:45:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950790 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 5CBDAC02196 for ; Sun, 26 Jan 2025 16:40:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B15F010E46F; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lCLJulp9"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id B7D8C10EA68; Sat, 25 Jan 2025 06:47:12 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-84cdacbc373so84591439f.1; Fri, 24 Jan 2025 22:47:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787632; x=1738392432; 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=kn9t7zpPYa6nVFkxjXtk64MWrHKDx8bG5odGszaJqIA=; b=lCLJulp9q9ssJra8v7tdQGNQmyNBKqeBkpN6NGRqjuHcebN5GB9aL3fGymlMeg5JnX /CdLn01m4x0gbNLQzOusHlHZzBg5r0+Qu4IWAk28qui6vYBX5eaUckBYFpfYoU0vuFZ+ zfwQS2vsYQ4HLFHP2pQKbydoL6G53Kc8DerCn/iJjaUhPc+iPqcMR7wpdNp5C3g2k4Hc 1eNJmel76fPY41frEezCRaL6J4PGVxTaPvQkGmuQ8Xu3HVO3AmWj5V0Z8owEJ3jm+/r/ 6rq8fEzJyI1HV1dGZmKVkQjSpLekhkS6D3MGLVqkoaLnhhzJDyR8gJ/M0nFdbpRm5AwV H1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787632; x=1738392432; 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=kn9t7zpPYa6nVFkxjXtk64MWrHKDx8bG5odGszaJqIA=; b=FYxsyZHNuZKM7ShWCYTdVXMCXxbmrVKrS/UuzNtkS9Xt4ae+jD6vCMVtim20iN6ZmC qBxSuRKdQOBsiCiRXnLMn09iZs6/RGT2GT9OXjuqYhK82a2TIkgld81p/8I+8Q9Y2gnP LsC2REAQ/jt5lCMuKB281zR1J0Mymsj3Okf+8VwYzFC1O3fpdw0z9Pkw6ExrxHWZcJL1 wl404yGkfhfocCjt2p6fEyZP3yljLqdJjecE646+qcv2F0WXNq5OygJ/7mAzzh0eyR/0 5XbNf6WcuwAYwmvmTTHD5XNl+90wye3duGnyBrsS7TcZXDGrXMeW1UXz8ZOOIYPCM0GT iGfg== X-Forwarded-Encrypted: i=1; AJvYcCWy6su4ymiBUjPYOlqlyijyV56q6chT0XYLpoqBGZLM+kNlgDj9HeCvvFmjGYvcCSrAn2PsO6WEtfc1MX2+vQ==@lists.freedesktop.org, AJvYcCX/EjIGq+dFMbHbkVFlRDusP8gWk7E2IWqPu0DRFpGBuEXoHp6ucB0eu96Isyg4GD74e/eb2CYpLBUO@lists.freedesktop.org, AJvYcCX2zUmsxcsvo5UrklM+H8538ZkkSwHxomAATSH4oRk1BpjWkJsyLSJlbcShnroYS8mIY21HI1hgsY3P@lists.freedesktop.org, AJvYcCXchvKH1CZI5IpM/3L/njHRAMba/IDHsSXmrpFpWSgL+oRQsZ5xIWdGrSa7Ew8kksGcze38i0l+@lists.freedesktop.org X-Gm-Message-State: AOJu0YyiGGtKxM+XQWj4QJlA6aDJNhBVp8K4wmu5C1ILvgsvi5AR/D9c /DJCo/wWMar4Ha/xWCAlVodJ+EEUBy9onsobiDQaO7U3jZw8duTD X-Gm-Gg: ASbGncs/qi0CSZzReaKIDZ6coPR/9xxBCeDjJXD+BXf9lo+nbik7UCtbbqPrNTl6z0E Bx5/aV+mUv6LL8/bxElZPyP2QYvkVX1zTBc87c29dui8G8XIGyMcyybzRsIC30tqqY7htRV/3ym j0iFikGELyB8Ov3OmucxQpweAPqcVABrys1/Q/dN9TZeRKiEO03U0zJab9n6TquFeyd1z+1GENA CmrvSRrlX0pAaHDNX9WNjfpRuZ7NNktTGybNm329TN+gjymaDF82eXzlHA7naGFnvC3mXzh6JVL OLVX/e+WHwA+5PCjmFo0ShEAYNluZi7rebbRUg== X-Google-Smtp-Source: AGHT+IGbYt0eBv6uLTOumt0YrUKOyuE08ZMm9674V/UqKTNiWTiUDNTl45IgSuA0rftCQLWNy6OU9A== X-Received: by 2002:a92:cda5:0:b0:3ce:6758:2500 with SMTP id e9e14a558f8ab-3cf74418e88mr205433465ab.13.1737787631964; Fri, 24 Jan 2025 22:47:11 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:11 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 32/63] dyndbg: split multi-query strings with % Date: Fri, 24 Jan 2025 23:45:46 -0700 Message-ID: <20250125064619.8305-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 56e09e878f80..68b5a77c2d79 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -599,7 +599,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 Sat Jan 25 06:45:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950743 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 344ABC02196 for ; Sun, 26 Jan 2025 16:39:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1574A10E43E; Sun, 26 Jan 2025 16:39:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="LjSiLj65"; 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 9DC2B10EA71; Sat, 25 Jan 2025 06:47:13 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-84a012f7232so114027139f.0; Fri, 24 Jan 2025 22:47:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787633; x=1738392433; 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=8Fcd0CbpeqTSAr2MUddHNYquZXYxsn4RsHtjuNfIUxs=; b=LjSiLj65Dg7/U6MYyJAJ0+ooVa2fL6R75m+v8DprKj/9mVaDf2kpJ/wPvKyL+2MaVi uJyI47UsNUXFYa8pitIqniVyawBpgGai634+o4hsxAJuEkNlnAi3aJsqpryhgh7ICmgg loxmvlaBhyMrQavCoYhZWlnpqk+dFilwLvkd9IkCOxsKVXvLLn17Wwo2QGs7eZQ5L7m9 hjc3kcK71jC8BwAK8F1Cpvh3CEok9pJPwEkdsLh3SrlCneb0MPE3iwo4FaGQ8s0geTCL 57aZirZ0thWcLKN/9PQPUGAD1oRq9bDRI478oYftHy6tPOtyN7g/ZxNFQ6zeKtB0iZqs JgaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787633; x=1738392433; 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=8Fcd0CbpeqTSAr2MUddHNYquZXYxsn4RsHtjuNfIUxs=; b=rSrkPIuGw2PGN0GY8Nv3AGygova5SvMDWLiVrTfhai9iSJaqGfsXAVHhiA4O0pUGwn I4/+CwSql+ZlKV8hBV0m2Q7pFUCT7McOyDFYD3gGxW6FyfrVbUBBGJzMyTYDWNz+CHeZ kkIlRwYNtGLezC0/hoStWLEbHRyRsx3P2zpu53C4EFENHNtIJ3Feoudd8+I4+EIgb+5A g3pQ9S+VOahVEgYYVkhTgcZLO2d9BhIPyo4QstBeqTHx6vGjdDTfMziNF4DS4YYTMZ1y OlrlaV+yCWF83KoTN5CW5C8zpJnnTE8AbhtiqLtDsG15HyTBdMbXD33F8Ql5aQlmBD2G ntNQ== X-Forwarded-Encrypted: i=1; AJvYcCUNpI/5EDIrn0RbA+TApdheJSjJF3nyTPzeYakhOWkE96DQkf1pxlpyv2T//SS+Bw2N2x+bNOAxWApp@lists.freedesktop.org, AJvYcCXuEjP1zYoMHfKBFNbuiqYi1Bq48fVKvWbMA6KzeVv4GQ60P5JT9dXUlCnXs744uqiXwno4qGjMix3K@lists.freedesktop.org, AJvYcCXwS725zbC/6B4P0XOx+Q5XEivat/pFWbl0YDk+IzucwnANqe0k8iBQsG4wVeyyCF+NTtcbYK6v3XfhA0/M8g==@lists.freedesktop.org, AJvYcCXycvmmk1/ZzbFLvw8bs6NCuXKOvJwi5k2nCTrLBm8nSg6u/y2Fbk1jqfkkdCERjzxaOJ/OoibL@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx90x+r7N9z0EZ8+E7DoQD/j7XPNV7loIO2Y365jOMnmJFYly/W 0U7B2x0tfswAjLO+xYZY9nx8TiWLdWXz3QZ42aoyOe5ZewNMO//G X-Gm-Gg: ASbGncvu1dL+5Mz+0FFeWDgt+TxF7Rs+9tZQY0X0u/SCJb+sJ1iL4FlvXB2+TQut9wx iCs/ZKt2ZydcRj2j6fE3hZp12oHxXPc+2OPb/CJ+nPuKKEkVoAXw1OeSs6FJhaWyXW1b1u8z+ps QK/RHBfOYZyWFdUyTYOvzjIEfIZ1Qe/AI6g2OzDB3NAgx3TGKJrfY5ELxa2MhexePITrOSoUci/ /cF22+amxVkYH+6eYGBlRLrqeJ7w3GuoZtVHxK0lEtkfZAR90+TQkRNTwjLyu6t+4t1LQ0eonZi YRetGuE5j9JSdP2NEdMUwkTybXy1BAiWm86pNQ== X-Google-Smtp-Source: AGHT+IFCwNCwKk2LjU+VISPtmf45oXrUgrMIIcfvyXFuFTikBwGEdBXb11cx99j0mRG19lRHebe9QQ== X-Received: by 2002:a05:6602:751c:b0:84a:5201:570a with SMTP id ca18e2360f4ac-8520bd814a2mr784672939f.4.1737787632909; Fri, 24 Jan 2025 22:47:12 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:12 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 33/63] selftests-dyndbg: test_percent_splitting Date: Fri, 24 Jan 2025 23:45:47 -0700 Message-ID: <20250125064619.8305-34-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 368d10a691a0..c97c9391d0f4 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -256,9 +256,29 @@ 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 Sat Jan 25 06:45:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950755 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 9E1D2C02181 for ; Sun, 26 Jan 2025 16:40:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B3E310E444; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Xpkc3EkJ"; 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 CAD0710EA70; Sat, 25 Jan 2025 06:47:14 +0000 (UTC) Received: by mail-io1-f53.google.com with SMTP id ca18e2360f4ac-844e7bc6d84so90833939f.0; Fri, 24 Jan 2025 22:47:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787634; x=1738392434; 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=JsyGIKm5KVw15Lrl3SAKRhPe64hFlD++7kUKJ3Bp+EU=; b=Xpkc3EkJUKy4Cbb9+/XGkxjREUQsi0MtB0sCrZJDE/IKUBGYsv4qurwZt9e+NRTi9B w20J64rfXz2secC5G0tXsPi+IIVe33opvXekSkVNVZ4wfImk9y1OVBiBPZ4oAGwI80/P smZYi7iMbCmut06+cc+20qOLxdKL9VRW3zUGS/RF22U9TbAqRM3z6EZHCQK8QPzoKdhZ Luj5zQB4GDbTCFKv9wM4U3hisTSIVlBL3+RXN2ehCJ42VLRAyqKkTsFp3tzhdYJMrMDf hUVKHbk3FyQbfKvJ3dTbAED2pxwl6rEiVAfw9txUOoOORSpnJ0blTHWM+ONfEAfeYfHY YWRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787634; x=1738392434; 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=JsyGIKm5KVw15Lrl3SAKRhPe64hFlD++7kUKJ3Bp+EU=; b=YTUaAZ6daxOfnc8mPUT+gwJw1IZ7O5qF7n0mxK8lQCfpD7XemSt7rD+SbbMXH7PcKw h9G4aQ95Upciag0lkeeXa5FpiRVfB2snGnb/gr41de7KUS6PC3+ntLB4zavqL+kbULSZ alg7Hftv5MPIA2uIqu60b2oOtpg7yYbFVMua1YRyQMrqiF73zKQDRu+0LVZLDEug3Wt4 dZg5rbweSpRwIxdaKZUOaUKyC+Lxt4a9zdGQDtvxW0NE872DNsaoSFh8WTqzltrnpJzQ 6ZsuL86zhZKL/Xz4n528+Xlghpdrc7bBkuIaKMCOR/3ucU1i6OhkVsr+waGIBK1C4MGk 7z0w== X-Forwarded-Encrypted: i=1; AJvYcCUROz5ohq3DEHoJ5c8r5lNZPMo/kBZUvvCaxnj4NzLLhl09mCNzWqXC+qVH9DXX0GVNZWh7Np8LSnqg@lists.freedesktop.org, AJvYcCUTDIYD6oxxVAna8JoZXE/CuMeDK5eL7Uqe5I5O0DEoB5AF5QBTCepgSx9e0FIoQ15sLzRDEFQKowdQWEzQBw==@lists.freedesktop.org, AJvYcCUXrSPZCmeM9s/y+UzdbvPs1t+xwarMV+2Vd0KWkCX8I1GiVQyCxbUOHzq6HimMv2Os8ILDO5UENadr@lists.freedesktop.org, AJvYcCWgDfKaeSufNYJCI6lXBBZeZ/8T+zwwO5oxwv9OZdX3tbWikhl9MFIoOxdDntwIenzAWrFQ5m+w@lists.freedesktop.org X-Gm-Message-State: AOJu0YzrY6DkCXwz+CB1bjtnLZ8KoKDQoGw1lf5sQiEKpW2IJObheMVb t9hkP/iMIIId/5lxdBxPdLgfnZPU7kvW1hpuJGMRcO+bQjh+/l+z X-Gm-Gg: ASbGncuC+G4vUcNhFHft5YZ0OruBHW68IrLTt6OiCiPq4V4wRnqXcMFHIicMyvqidHb YyRO5v+KVnfglsSSOOE/xEWWeJNp0Z6zbJeccmWWuiIbg8tIlxfin0+vAsFYFde57xNjiCQrgui SkNtBMMj48+R4GkLB8AxML+xAbEc19v+ma6PxGd6L3SpGeEMwet8iVhMwT29QHg7etNuf9HmwVU 3AvXDvCO+d3aam1cv8mOrNCAWzssUyXa3cTBLlCzo+9yJ4e0zzOIpNVs/DATR8b0+4b8UxkNLps jsPkkKITLKE8zhMdpAhr71JPOfIEUu3mTdDilg== X-Google-Smtp-Source: AGHT+IEO16ggXmzyfYHgop4tbbYRoiJ+jPn2ZC4cmvbjRlCrlzH1udV42UlgxC08+7x3doqhyHdvvQ== X-Received: by 2002:a05:6602:6081:b0:841:ab27:acac with SMTP id ca18e2360f4ac-8521e1a91d5mr552474239f.2.1737787633949; Fri, 24 Jan 2025 22:47:13 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:13 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 34/63] docs/dyndbg: explain new delimiters: comma, percent Date: Fri, 24 Jan 2025 23:45:48 -0700 Message-ID: <20250125064619.8305-35-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentation/admin-guide/dynamic-debug-howto.rst index 391e40a510c9..c3537f8689e6 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -78,16 +78,19 @@ 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 "func foo +p ; func bar +p" :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p @@ -109,7 +112,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::: @@ -133,7 +135,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 @@ -158,9 +159,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 Sat Jan 25 06:45:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950742 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 785A9C02193 for ; Sun, 26 Jan 2025 16:39:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8BA0610E439; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ACOIVEbw"; dkim-atps=neutral Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE12C10EA6C; Sat, 25 Jan 2025 06:47:15 +0000 (UTC) Received: by mail-il1-f178.google.com with SMTP id e9e14a558f8ab-3ce7a77e5a1so8061355ab.0; Fri, 24 Jan 2025 22:47:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787635; x=1738392435; darn=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=I04a0kW+UR6r9NTRsDJJoUdmO3RA+TyzEWylVuR4B8w=; b=ACOIVEbwrXd0XH5YZG2XQ/mr/ioxc8jK8zZHpphBtQjXrKQaIMIPZ6DxpbN57kwLk5 NzDOyt6JfOGtdY5HCMjvuybXp53tZInGqOvuJpNvZ2Yn7zN1ql15FSAHnXLpXSCK6vFb TJ/Othst+zEO9hqkyO2P2AIM4seKAe+BjQdRzoKTEbf/iaGGxvHimZTe5ZvJNuLO+iCW yUax9peZ10Q+ALFKSr0l+xrjkzeb01n171VbHrzzMbPw/Pq60BoMpG2iPdb9pYtfk+iF 7VmdUl4ksjyoTdg+mXwL3g/sr0YG+Tytc5LOmv5Yw3TRdUZFH03vTXoRVvWAeUxv7G6U Lpmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787635; x=1738392435; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I04a0kW+UR6r9NTRsDJJoUdmO3RA+TyzEWylVuR4B8w=; b=d4jLCj+u92iAdIPIXUhFitIYmGL6hy9/6O2qxc1XJ9m+f7UWcfaY00c7kSFblGwG96 xhAhAIgx9D/2ZTVvPemuiXBJDbKrhZsNPk+7hM3ABs4moNF2bHVqMAKJhZCLna7YfbHU 1HCzioN+W7Ngf5WV15+gZaawviQDqwLo4J0ELIGgBtMerWBcjT1l6NvaMrLF51fDCG/v D/xBsrBcT6PAKwp5DzABX77mZTrsV5ZusKaDmtfWdwp13UFvGsdEdNsB874qSrg6/P06 wJfOP1mxOlZWqXjTtSsxtw4sl67T0bsN2B6L5uvCRrM7Q9f2NgvJNrQS8/3OTqpyDDpW Xi7g== X-Forwarded-Encrypted: i=1; AJvYcCUk5ibLx4IPHd+zo0Qu7TDECl/iwGUVtxS3gMyj/yLCcnaOXMbrJ/Zcp2vmWGH83+0WgS+gmZLY@lists.freedesktop.org, AJvYcCVLv4ZiBImMyDpunPYrTuWVpv7T0GxahbllBRCa+WfexnIpDxPSgJfiCzVXAh01o8U/yhkQ+iUy8c9uh2nB6Q==@lists.freedesktop.org, AJvYcCVNUUWfaQZuBDQ+Cqmxg3esh7VY8hJ/8wlqLdF/ytjK30tcHTqYrdGa0DwT3J5pYLEuzeYJLy4NEJ7N@lists.freedesktop.org, AJvYcCXyPPMWeqEJL2MjAxZMvC4VUaXLzpbWWWkyefTlDmagBO52K8v+okD7TFH9JLrCSrLRkmrbXCfMONQ+@lists.freedesktop.org X-Gm-Message-State: AOJu0YzLXNGA0IcP7aRxw5z10JOEZQMUWWb/heBaOIx5rNskX9CQgsYG 45qbt675ZGXLsddu1AdNnyHy2NK0+mpYuxi+k/nx08HuirIAx9jq X-Gm-Gg: ASbGncvn+jHFhKawyq3X3cAw7/sV/gs4Kwv3DWS3DfRs2YaDE++tkCUMe73V7lTbunl XV9npQ0JLq95143wrNVXrw44bj76D3C0yGP+sfYDtFzNF6JydnP9B6AKcENuHziOEvLxf4DNEPJ niEFCYlH8y2tZXhF/ZYjVrzTt1HPwKzJ6vCx1oopAgz87OxbkkCRqR8kfi3jHXUzwkyMnNKnMsz LKN5w/qHr1LWVBaZkQOuRHWKCUolHkY4CMaJ1BypHG0Q9TF9CXCZHk/U4jRKQ1oNrF7y9yj1N2C ZtOWgONcm471DJ/9uRscn7g2ZbjubkpKr4lxvw== X-Google-Smtp-Source: AGHT+IGIM5csLRgdDio0MZ1C+W8ZtXGP9ro0KKbKTmSNfS3XJ37G4loIhg3hRvpEN8PltJakl5OJ5g== X-Received: by 2002:a05:6602:6c11:b0:842:ef83:d3b2 with SMTP id ca18e2360f4ac-851b6522640mr2688351539f.12.1737787634956; Fri, 24 Jan 2025 22:47:14 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:14 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 35/63] selftests-dyndbg: add test_mod_submod Date: Fri, 24 Jan 2025 23:45:49 -0700 Message-ID: <20250125064619.8305-36-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 --- - drop -v used in test_mod_submod(). V=1 does it for whole test - ifrmmod at test end (Lukasz) --- .../dynamic_debug/dyndbg_selftest.sh | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh index c97c9391d0f4..cfed79b34996 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -275,10 +275,79 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } +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 + check_match_ct =plt 1 + check_match_ct =pml 1 + # submod changed too + 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) + 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 + 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 + 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 + + # 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 + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =p 14 + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug +} + tests_list=( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) # Run tests From patchwork Sat Jan 25 06:45:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950770 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 2ED3FC02193 for ; Sun, 26 Jan 2025 16:40:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F94D10E464; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dT2FONh6"; dkim-atps=neutral Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id BBB3010E2CF; Sat, 25 Jan 2025 06:47:16 +0000 (UTC) Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3a9c9f2a569so20551825ab.0; Fri, 24 Jan 2025 22:47:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787636; x=1738392436; 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=jfhcWZrz83wYOYEIdNpEF1X0nPHND6LQ2XiKG1miCwc=; b=dT2FONh6i9L/UJjEDh5tuFK+qaIC68LE0zjizmEempmvq0dLWYYBGkQvfVrgrerlOd OFqEB5uZbRPYpWHStYv/quItvBPdy1j5JTqqTnynhiu5soN3RXno9TCCuD/ZJdsmanek RaN5uQjYKjQCzRt92Ly91sRsW93gKGSranFoZsLA0X1e0yP4CY52LNi8e0bU21zh/q3O R2iHslvAt3FftomS9dDKa+ANW9Iei7XJvn1iwbCQPFHPym11Zmx1EmQuIZXIH1T2OC5N ID2XDZRIvUAzGun0ighPJAjM8Y5+qgxC5l9enzFZrylFz57TQIroCo4SsiEnojawsxOG 0dHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787636; x=1738392436; 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=jfhcWZrz83wYOYEIdNpEF1X0nPHND6LQ2XiKG1miCwc=; b=DhsgjI+I2Hdb4si2XjMkW2ofl0JrhvEnJBPWooS8VZqz2WX5XhwhpwTj6tz5GUBwvg XIcEVVuKw6pgLAGgJpp7KNyXZbo8VgOy0XiwJ9p8buItOoEP0TqTGUbOGp1htNYFit2J LGu2DzTSY8OSAM9c4sKUEzyCvd0xjzZ9hs8pkEHHvlbuOjnuotuMblZW+LiUK6UEsb1E VL8It/KpeBS3ETEMNEDS2jo3Slp4m7jd2i9TqdGvV6SXbBOL5jUL+UnwnRg9/JCNu5o0 s0UZNrFM2TYyTrS4OFnbw9lpnMUgC6YlddlX/NH7khjs3fqjpbmrnduBEeMIOTz1VwDz 2Npg== X-Forwarded-Encrypted: i=1; AJvYcCUReo4QsQuo91CjmjbmUs8GPDKTX0OWHA/1cyKY6Lv/qEdK3hdEqJjNVSMfJLb88sUsXvEj5FnynO1hEmTsyw==@lists.freedesktop.org, AJvYcCVwbi5KP4HO0vOSLWc4elxk39PqOjI5iGCzwqKIhHzjgWjffbAYP827i89cswXZiKxvjQt5+T0Ko7RO@lists.freedesktop.org, AJvYcCWqtTBIR8uiC/dicUd102Zy4u/K3zoD82kww6c0AYT9WUEi9j3etdQ4Pg3tnYaAEOHUmgmNCrNUhDUp@lists.freedesktop.org, AJvYcCXzKDx188OKrvl9W5+3XBFEPmHvZOARVTcCEdvx31I8neVnVnphXQePUp+g+dnQvL2gxeH+XfHV@lists.freedesktop.org X-Gm-Message-State: AOJu0YyVN/EC3aobuESNGg3tOxv+M2EEwC2rBKGQKxpAeJZ+RwqyfomZ FERWM+emM+l+g+wK6ZJhBS7f2bQg+c0Jpu4JQPjGQ5u+ncuflgkh X-Gm-Gg: ASbGnctp+LZGvAtm+KuXJww4VN1Fc4m/mSltOsNnMJ9I1SIT3KGEcIZOCJpuPlH0Gqv HkJFoXJ5XwfEKqTHXWDge4hZIUiyu7EhinA1q15NbXNNPu4NjyTishx4jWY/b7Szv2z4FwnoikZ 43ITNUCqD760p/bl9d7Hk+qXJ8bVkOfa5nZnW8JVc472mY6xCfCAk12kKJ4yg9Bzb+LzUQj13Fc qgO9HFnUkfhVPVvHf9CZp2wkBnW7/H4avW42w2VJCcXcp3IZakMAMlygBbr3m0XJE14drF3AivP JBimInjWcONtB5WPRFU1ay3xVEUohEntrUx9GA== X-Google-Smtp-Source: AGHT+IEOc8EmSIZbznFHHPXX84xuy1I6pZ+yKmSAQ2gwM3rRL/NYDxG3wxu+D0E1wbsVsa/ZJEfxwQ== X-Received: by 2002:a05:6e02:3f03:b0:3ce:87e3:c26c with SMTP id e9e14a558f8ab-3cf743df88amr329678565ab.5.1737787636061; Fri, 24 Jan 2025 22:47:16 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:15 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 36/63] docs/dyndbg: explain flags parse 1st Date: Fri, 24 Jan 2025 23:45:50 -0700 Message-ID: <20250125064619.8305-37-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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, and they require specific compositions. So if the flags draw an error (on those specifics), then keyword errors aren't reported. This can be mildly confusing/annoying, so explain it instead. 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 c3537f8689e6..89810ebaca8c 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -112,6 +112,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 Sat Jan 25 06:45:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950756 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 4AE1BC0218D for ; Sun, 26 Jan 2025 16:40:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EB0C10E449; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="JbX/feOL"; 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 A78B710E2CF; Sat, 25 Jan 2025 06:47:17 +0000 (UTC) Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-3ce873818a3so24594585ab.1; Fri, 24 Jan 2025 22:47:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787637; x=1738392437; 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=R20pJusVAFn+0eRwjuybzN3XQmUoFo5g9xIXn//WdwU=; b=JbX/feOLHWePv122M5u7gl2tXq9qqLu/LRQC04X42YSWvQshkZct42k0F84ePLTfYz 6b+cwReCaSo+b2zedpifwYx6T7+wG+C0Fr7/ijrSrGTAi8iX7qy4OaR+Pt6Z/NgDaQeG 9lejJJTj6xabjwoKBrF7bXcHBo/zyZ2qJJT480MPbhN5ITrFCEWKLoFebrUGaLd6ryLr 9PgxVMaN5ZOlVmhRGS6NDo5o+w1ljN9LyLuj6HiVIT7uZb7w98xIh0+pBXR96UXXwSiZ nNNFfBA+R0Wgt4lUb9RuuxHbii5q5AaE/glm56f+KMdlQ+K8uVX4JgNjK+vrQfR9Da/1 5Xhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787637; x=1738392437; 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=R20pJusVAFn+0eRwjuybzN3XQmUoFo5g9xIXn//WdwU=; b=ph327RIyQtHSkuuZzgCwINMafp2ERPaqHlQhOqVCAAiPNV5E4QSGPjHk7N0e2gxkzH jHz6fje+n4Ydtjs8KYLruiJcsYriP3MzyPclEca3lapjobV1oUkelElC5xKMUedR15zc eSzIfFzmuCtHsb8+Px+H/Gpuqa5lmvCSLmD4KL7669VHwzgAlUytwugtxufn+SPB+OuA jEVDWJCtQ4lB7BZ8nceLDd5H8xAof2ykJz2OGsldgBEA5uWChbMAb9Zug3s0bTo4Kt5o hn7o00ua2EPEsP6UBhJlL86E4g1XgF5//frCsk2DTb5p9cY3i1DzEngJoEb4xoNNkQj8 LY/A== X-Forwarded-Encrypted: i=1; AJvYcCVN95PtVmxz+QOVEMWejPhiNI4nq9VZiSfSSg9wKwbaCjOgPVLVWN0hR0LOZK6vKMFH5yyGYEDFLXpg@lists.freedesktop.org, AJvYcCWOffyfFmKzmhRUXxmDd6qEzxYzJJdglhyxS9aW6Ft6ZjNO5VoGJTUNtD0ltMLzTIgq9HkeRBbP@lists.freedesktop.org, AJvYcCWV7u3i/pf0+sxV7Sw7UtHB3/OoEHvWxp/pTt2s0ZSwzNOfegO1smUdn8DpDnxH7GBRcE3+IBGKRQTD@lists.freedesktop.org, AJvYcCWrAhwBv9oojKJuagT3QOaD9PzlMoKPW5h8tyE+8UqNCyZRWi/5DwWaHJTy6WNt6aL+7A1ByJgwI4F/J683Dw==@lists.freedesktop.org X-Gm-Message-State: AOJu0YwBODRXsN5zdL/gWgT84sXPP1ZM64Ce+SJsTFszER/jQfV3gFHz SSJoHjz90kW2/yX3tJwmXvGaAu74kJEd/b4i1fic1EsTZXBtX+1MrFwZIg== X-Gm-Gg: ASbGncu35ZMQByKl4+K+6gOheaJu9QBGTW2+HKy+pCuf4zPz9wInuUpgYWu1/ebFDP6 X+OSZLNHqXh6cbuRScbdiYC4nrt7HGVJq/s53xdX9nrbgSO9BeRVAWOcl4MhDBTg16oUG4DAdr8 VMK/X7yN66q3sIEZ7Uu2ZQVfXTVnP9jbKbovE5XFMpdJ1giEHPCHIYPZubHP7o+4AkOZ9NMkv3v 0mYBRk1K+DPCHtxFRjysG7leBqKkz3mhpfDcnYIb9bXejOPDEU8dZK0YzEOK9YtC51bxs4l6rRr 0WjRCKdgsKOuFwOygh/DoWz7b8LrLe0lqom76w== X-Google-Smtp-Source: AGHT+IFhqHjUjw9cNO0qk0/umRlKp25sKTeEZ9PGaxIK1gOwxXhslLtN+M7fQRx/uvI7gn1cs6FAKA== X-Received: by 2002:a05:6e02:3f03:b0:3ce:87e3:c26c with SMTP id e9e14a558f8ab-3cf743df88amr329678925ab.5.1737787636967; Fri, 24 Jan 2025 22:47:16 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:16 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 37/63] dyndbg: change __dynamic_func_call_cls* macros into expressions Date: Fri, 24 Jan 2025 23:45:51 -0700 Message-ID: <20250125064619.8305-38-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 for this usage by changing __dynamic_func_call_cls{,_no_desc} macros into expressions, by replacing the do-while-0s with a ({ }) wrapper. In the common usage, the trailing ';' converts the expression into a statement. drm_dbg("statement form"); Signed-off-by: Jim Cromie --- --- include/linux/dynamic_debug.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index b47d1088b7ad..1ff7bb6210cf 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -331,20 +331,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_DEBUG_METADATA_CLS((id), cls, fmt); \ +#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) + func(&(id), ##__VA_ARGS__); \ +}) #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 Sat Jan 25 06:45:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950774 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 4BDE1C02191 for ; Sun, 26 Jan 2025 16:40:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E645A10E453; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="d+P0iE86"; 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 DC6C610E2F1; Sat, 25 Jan 2025 06:47:18 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-844e9b8b0b9so206428539f.0; Fri, 24 Jan 2025 22:47:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787638; x=1738392438; 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=4odqpWJj3urSpAKp7yVqXYnx87D5Dkk2hzn6/0RI0nQ=; b=d+P0iE86jX/MXKgaTmVGH7jltOOUbX15JQdWljpDI4EyIBwU+HbsaUpLhlTHJl5N2D guYW45RnLscoseqitcSroq2IYRxViKhZX+y98qliJCPQAGQzTpV46Zrmm6a0MUeGwuv0 Jp8KCGHHZIJcRkGE3BjiMRoGO4falZ5RPxUMxXwJlnZ8hSN/nurMZilgvJEFXWK4pWC9 eA2fVFwCO9obg5eK2FnNOTU2EJnTopn36CiR+t7pWnz/lgsJDEqKRyouwZWanXaNxS2Q 5E+nvz5OCzMMTj//pxYQmvJahQ7ZyovlVDNYvF7MOhyLtEBfRBnXKL4BKgYhIWwYf55U PrDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787638; x=1738392438; 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=4odqpWJj3urSpAKp7yVqXYnx87D5Dkk2hzn6/0RI0nQ=; b=h0ub0cOPRuq8IC3feS/elNLFQoB08/G7Q31O+KwxlTuGNhq1dy8MSBpmY+Xmsmt751 lxOFq2fJkD/6r3iJ53H6twnhM0tRGniYiQdI3C3SGtyclwBw1FrHL4Q5KE5JeME7SZhO H++Gux5VrIT0DjhRBO3wdF7m7ljadXxEHnWOg4RaJOU0+IOdQboubzJCArXBpsiUyzDx utwELN+hDlOuHfXJzaUNCCAZZdPC7JyNY3zcPZ71JwJOyp3yir4ulx+hHJI1LF8TxWS3 ohE9jdMg6QAbM1A66wXNN4AgtIqEERLcPAhTkeMDwM/dxUZszmL2pvKLVsrMsdgFc+cu XifQ== X-Forwarded-Encrypted: i=1; AJvYcCUozYHnjJocZxh8gqWDAo5QVOiky2D+9j+GY92JSPZevwKBTQanYxpIyUEpLZ4THasuuo5cF/+GP6Tjt+OfmA==@lists.freedesktop.org, AJvYcCVE/NyXt7xXHDJYT0X/jfwVPSduJf/0hhEWEkBuheM7fgA69qc7G/C6LSXeE5J0aGeYgxwTHKrT@lists.freedesktop.org, AJvYcCVEdiJDCUnyjcaw8/hOwcJ54/fg6k5RklH4pObRWVFNSvBD7xk06fbS2W/RP05hIO1GWyaZb/gNR5q1@lists.freedesktop.org, AJvYcCWC3wGc9OtCOMBfaEy2D9RMUiLqc7/2aNtE5tbKwD+5qTYlvVttw+QmV1CwjxAuXLkOox+yPCNh50E3@lists.freedesktop.org X-Gm-Message-State: AOJu0YxnZEzpCw1CYbx5w1dfL3vndbH1tdbX85qhowiWPR1uAJetAOy8 az9oBsT7krVTP82F2dOGrULnfmFRxWgGbx8IXoW+kaV17Xaeit80 X-Gm-Gg: ASbGncudOmVFmghDJum4MXlmsejm3BJAUWCpeNsvTydrkxz/VLQ8j5+JpktMaPqCtob ZAxUwu3yJF777iPc9EQg1fvd7hk6MBVQMn0tfg5shOc/i8LRvWux45ZsJV41cQmgUAt4oBCuZfq F4MBHsaj8wJ+wHH07a3VeyKR1hWgnnCG1FyXxI4WGABE1OyD10UARBI/qUYNzMHk+i2KhD5KhgI vEi2ZoMv9hwBaUT0t6n05ZG+AvnPU9WxmKCN27/DYJNZ5jehpS4cTDrN/qT9NG2ZrIfaW9/Ia4q cUyD4FbeiOPqNDhDiMzB3MuetQfVFAfW6M8kog== X-Google-Smtp-Source: AGHT+IFIY03EaHMd/D6gQtTi8TOeZoophYBCZcpKsV2aOF16dKNLKKSpMulBpaJn1LdTAQ/2EmMthA== X-Received: by 2002:a05:6602:6c06:b0:849:a2bb:ffde with SMTP id ca18e2360f4ac-851b61f90fdmr3893348239f.4.1737787638040; Fri, 24 Jan 2025 22:47:18 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:17 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 38/63] dyndbg: drop "protection" of class'd pr_debugs from legacy queries Date: Fri, 24 Jan 2025 23:45:52 -0700 Message-ID: <20250125064619.8305-39-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" Current classmap code protects class'd pr_debugs from unintended changes by "legacy" unclassed queries: # this doesn't disable all of DRM_UT_* categories echo "-p" > /proc/dynamic_debug/control # name the class to change it - protective but tedious echo "class DRM_UT_CORE +p" > /proc/dynamic_debug/control # or do it the subsystem way echo 1 > /sys/module/drm/parameters/debug This "name the class to change it" behavior gave a modicum of protection to classmap users (ie DRM) so their debug settings aren't trivially and unintentionally altered underneath them. Afterall, __drm_debug is authoritative w/o dyndbg under it. But this made the class keyword special in some sense; the other keywords follow the rule: no "keyword value" given means no skipping on that criterion. Jason Baron didn't like this special case when I 1st proposed it; I argued 2 points: - "protection gives stable-debug, improving utility" - "class _DFLT" assumed in query is not that special I thought I'd convinced him back then, (and the patchset got merged), but he noted it again when he reviewed this series. So this commit undoes the special case, indirectly. The difference in behavior comes down to a choice on how to handle class-mismatches; ddebug_client_module_protects_classes() names this choice (and defines it false). On class-mismatches of this kind, it is "called" before skipping the legacy cmd on a class'd site. So this makes it a policy-choice, and reverts to original policy. Later, if any user/module wants to protect its classes, we could add a flag to ddebug_table, a means to set it from CLASSMAP_DEFINE, and check it when applying a classless query/cmd. Further, runtime mods to the protection are possible via an exported fn, or a grammar addition to >control. NOTES In ddebug_change(), the 2-part class code is mostly unchanged: 1. query->class_str is validated once per module, and maps good ones to valid_class, now renamed to slctd_class to convey non-boolean-ness. 2. in the inner per-site loop, site mismatches are now 2 sub-cases: a. a class_str given explicitly, and site doesn't match it. skip/continue. b. no class_str given, _CLASS_DFLT is inferred skip if ddebug_client_module_protects_classes() else fall thru to site-change CC: jbaron@akamai.com Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 68b5a77c2d79..9a278c7ca365 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -193,6 +193,17 @@ static int ddebug_find_valid_class(struct ddebug_table const *dt, const char *cl return -ENOENT; } +/* + * classmaps-v1 protected classes from changes by legacy commands + * (those selecting _DPRINTK_CLASS_DFLT by omission), v2 undoes that + * special treatment. State so explicitly. Later we could give + * modules the choice to protect their classes or to keep v2 behavior. + */ +static inline bool ddebug_client_module_protects_classes(const struct ddebug_table *dt) +{ + return false; +} + /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -206,7 +217,7 @@ static int ddebug_change(const struct ddebug_query *query, struct flag_settings unsigned int newflags; unsigned int nfound = 0; struct flagsbuf fbuf, nbuf; - int valid_class; + int slctd_class; /* search for matching ddebugs */ mutex_lock(&ddebug_lock); @@ -218,21 +229,26 @@ static int ddebug_change(const struct ddebug_query *query, struct flag_settings continue; if (query->class_string) { - valid_class = ddebug_find_valid_class(dt, query->class_string); - if (valid_class < 0) + slctd_class = ddebug_find_valid_class(dt, query->class_string); + if (slctd_class < 0) + /* skip/reject classes unknown by module */ continue; } else { - /* constrain query, do not touch class'd callsites */ - valid_class = _DPRINTK_CLASS_DFLT; + slctd_class = _DPRINTK_CLASS_DFLT; } for (i = 0; i < dt->info.descs.len; i++) { struct _ddebug *dp = &dt->info.descs.start[i]; - /* match site against query-class */ - if (dp->class_id != valid_class) - continue; - + if (dp->class_id != slctd_class) { + if (query->class_string) + /* site.class != given class */ + continue; + /* legacy query, class'd site */ + else if (ddebug_client_module_protects_classes(dt)) + continue; + /* allow change on class'd pr_debug */ + } /* match against the source filename */ if (query->filename && !match_wildcard(query->filename, dp->filename) && From patchwork Sat Jan 25 06:45:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950741 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 B9B83C02181 for ; Sun, 26 Jan 2025 16:39:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 953AB10E43B; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nX0CVOzN"; dkim-atps=neutral Received: from mail-il1-f177.google.com (mail-il1-f177.google.com [209.85.166.177]) by gabe.freedesktop.org (Postfix) with ESMTPS id E7CE910EA69; Sat, 25 Jan 2025 06:47:19 +0000 (UTC) Received: by mail-il1-f177.google.com with SMTP id e9e14a558f8ab-3a9cdcec53fso20128925ab.1; Fri, 24 Jan 2025 22:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787639; x=1738392439; 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=7okjdo4kzf0n9cj5qoEk7NZRKgM0oBuQJfNPebCfII0=; b=nX0CVOzNDT72G7+Un7lC18JrRvvohT7pA1bUqmPPM4hFBaVGHL+O9lvvzW+Bb/euFz 26xLakncBe096FwwWegluOH65ASeodtznBhQJ6KeiakeS7uI7JJ/O5L8bkxoZa4PC9Zg FZZIVYtrNVNoMgn7cqfzWtmwzWj5yjKx1vdx7/t4QAZJIiIg4Yd70WjIc2qFgSijxg7O 4sV/cq7ZSNy5mu9mq0yBUoHyLSwjCKyGTgbcRodiakgyexl6rvFoLuGzU0D8kWmi4FFh eUoIdYz4U3tjPN8v58PvcJw+KfKd04bdu7VaUP34UotfOI8dkbPlv5H+gR3J//jhM4Bp FvXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787639; x=1738392439; 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=7okjdo4kzf0n9cj5qoEk7NZRKgM0oBuQJfNPebCfII0=; b=OPaQNBV3ptBo+s/JEhHY7RiB528ToUIsSnGchBUH2iav55qoUe7R2+ibbdV5p4QBek hG3eCN7bFvqx6XmTGMuw3KSSj6/1szWCJ5tPNSoVqpNRgnDMuOz9U2g3aB4tkvTQn+o4 KQ/aSNzfdz41R5BN+HlpRWhm2j9BqmOlhmBwBripddoRpInarCsUQuE5smcW/IdgkMmA VM9DFbrotcMhn1wceCQVNkLIR/OON6na43/XCtQYtkZSQkXL7Sbv3VLUf+TcQOTSc47x OzmoiwXKYwgGC5wxL0W5S7rJSpy4VyVoE8ogqbsqj+DPGgoXfCFsUl9mZSSm3VhBU2Pl 7qlQ== X-Forwarded-Encrypted: i=1; AJvYcCV/EKF3HC+qn8Pnbo2wC9D37KU4EkgsTQWkwTk63gMlDHDvT9u4jNuig4gcVbCm5+sZGi1UOI5fXdZcR7Z2SQ==@lists.freedesktop.org, AJvYcCVHyh0OGVl/YgjSYuKFBs+lSVF6S5tS2ylz460viN29XTTvDA4CpalYeodtvq5Cv8ZDXhSqqe7qmsdV@lists.freedesktop.org, AJvYcCWzGhzt8bJO7VP0vPG/Y/8D/ZGCjh6Hiry4x+3QmIgR5xY1Qv0BqnE3D8TfBHeYeSYxGcuuXiDW8HwG@lists.freedesktop.org, AJvYcCX+XsCuI6lHeRmKhAHAmoASQW58lYtOg15ltAdJTfX+Y5HGN6quu7c5Q/ra6q4XDxAPvEhR9njt@lists.freedesktop.org X-Gm-Message-State: AOJu0Yzkel2eW03LVOM/6E3fn8cHZE5IzLKNjAb6cHJLzos1hR3kQjWi EJ4Q1UvrDtNtHBYo0Kzgq0Lf5nmyUAMDM3z2hTwMS+If9G1vhEqW X-Gm-Gg: ASbGncttToJ4ML0ebCGhuE2Ha8IXLmIXUK3RgJ9fLrmQAZE/lpWsro3uht91BD/QSIs JHidYVd3nJjj1fq9fq/DSaXwkhbPdmPFvvYhdgzd5PVOuKqP+y9g7mKEQZdgmhpINJ0zTWnXzMR hsy1dhf3k6pwstvMdEsI4UkBnD0NFX/zJr6aahqnZZ8YQij/xEZvXhzTPNxdrwZUPvyK7PuqpjB GUq6HaDpVIH2JPSMBjX/hg57ATdx6FDcriIiH1e1afzVjJpWUGSBo2n8tkwLyVkxMxG/US3G+4J 6xgk1X5VTgB3SxAlJnvWvMx7JzSg/HIcBIJQTQ== X-Google-Smtp-Source: AGHT+IGSUM1TcDKPGhb3XRzoRxMh1RMpP2YSvbe13uSEF4aIKxZI5TTMJsRkfxieViI/wN1pm23ceQ== X-Received: by 2002:a05:6e02:1c28:b0:3cf:ba60:e2fd with SMTP id e9e14a558f8ab-3cfba60e6f9mr102334885ab.12.1737787639218; Fri, 24 Jan 2025 22:47:19 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:18 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 39/63] drm: use correct ccflags-y spelling Date: Fri, 24 Jan 2025 23:45:53 -0700 Message-ID: <20250125064619.8305-40-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 disabled dynamic-debug in modules built with: CONFIG_DYNAMIC_DEBUG=n # 1 CONFIG_DYNAMIC_DEBUG_CORE=y # 2 CONFIG_DRM_USE_DYNAMIC_DEBUG=y # 3 NB: this adds the flag (when 3) more often than strictly needed; modules built with CONFIG_DYNAMIC_DEBUG=y (!1) don't need the flag. 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 463afad1b5ca..2d68e6841cde 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 Sat Jan 25 06:45:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950761 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 B2021C02192 for ; Sun, 26 Jan 2025 16:40:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C717110E450; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="V4D6/Kb6"; 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 33E7110EA6E; Sat, 25 Jan 2025 06:47:21 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-852050432a8so79392739f.1; Fri, 24 Jan 2025 22:47:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787640; x=1738392440; 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=LhR9o1TqB18h8Gejof58ltJDYupe0+A8Qxz5wplRn78=; b=V4D6/Kb64hGT7hXqDIPXBGDjI0Zll/nAIsKGCDgH+/NreH1PcFoOxiAar+t2yGvwBA N2Jidb/VTBwYL7VDafRHONevg/hRVWmV/6dHroImGMZPlvpMk75FDu0Du0B2TR2YN5Sz 0NwrF58DlYJ47TCa/Zi+EJfmgWkTAuL5CfKZKa0s9HeTlrFGDYOVqVid+6+0ddC741fq JQ3AWlzAq8T5ptCATmgOjeLkmsruSAm8c24qFAtkaoc8CMNDcfWAYjREh7eZTwjUhot7 bz+XgEj3mUuc3Ep88rj0B/wZovEG7Dt4mHJcpp/wIZ6j0vgNqRvJuQEVy51zW2ILsU0A sBGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787640; x=1738392440; 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=LhR9o1TqB18h8Gejof58ltJDYupe0+A8Qxz5wplRn78=; b=o7Rhn9cSdwI9y+2yEPVpv1EQFQldlRlSUJ+zQ3GvUqtWjlTPMPaKh17uy5o5PQ019y 8EXfEMwzbiR5/leKu1KlcfPc8V3EGG3lbeYKzCiZz4ahAYF/Sahuy+tF3E1s4nqqQUlz 7jp82bLWhuapTt1y7LlKkHfSww8aiAW4CEFyppD0GX+ipiTmkdqX35uqgBrbTh/JLs2+ L3tlP7gKSCTAEhjmD5Zb45DZYYCwJIOhQ2jm5td1ALfNaULIQavSAyYHrHNICo1bvK3w fJekbCIRuM5p449EFyUmHJGOBpZ3CRxPjyDnsymFvhBl9qMqPCiGXiUodCee2ihpMpY8 vhaw== X-Forwarded-Encrypted: i=1; AJvYcCU18mvy4xvY7eFGFplKgcAvVc+puBXvY4/ou07FSWv6m3ettC1N+CCzykbFwiTZUwP4PCxyQk1Vjhcp3pQaeg==@lists.freedesktop.org, AJvYcCVYilPk6amP0hc7F9aoiBT0yxJ0JFqts1mpLheLioj5LaHLhul6gupJV7lN3f/8TtzI3dHRe9X9@lists.freedesktop.org, AJvYcCW7R8ZX3u5RmNnkd9DVzAUuNMVaahnz2JdvpsJwjEXlYUlODSaOvMrUdNq0RpwO/rLovCl4l4Y1eMNK@lists.freedesktop.org, AJvYcCWlmVZI45T6UiE8P9AlrVKiuKnJqlvcximeSltFwvyhfS++XiiCAh7yd2MzCLOx8wbr/Bi/NWlAIxcx@lists.freedesktop.org X-Gm-Message-State: AOJu0Yw7fb1AKsB9cjTZHV+sW4mkFrWmI7Ktbo6z57rvkE36QGL6bvh2 h7LtusqkjHnlu6BWce3WWXUp5GS5W9XM3D3Q26qpPfwBYjpvCkPk X-Gm-Gg: ASbGncss9HBS8PmNAjtNX0rwQg31ferlzUVib3wxp9u2T5EwGFtIt1UQFRtJ2kbbZdL SuJWBGv0VsiXECaOAZhmG8CKNG5laOcij49UYhKKzEhLVl5UcSIoRwIzfHOZ4MCJQ8hnUHMNpWa GjwOQdSQf7oqRU17tC4Z43bPJ9DADxIIVwBCfR+yVE8dnTEa15NITY9pMZYLUOzFXyaDwObiEZN B7GJpsypTmQd6dGG73xDPHN/weRBKT0DgxeAxBn34+sVbAq0jYEdwTqcqsn0ZU5Uhk0nyoQwPQ5 qzdYWoxSWFwx7ptD+WcX+PXajYcNhxox/RaR8Q== X-Google-Smtp-Source: AGHT+IHZEzBNBYNOEBBToI8KiDl5Tsa5XkYH0RjpgGMIymyYt3NOZibANggXDZzgs4FwkUSL/FRdxA== X-Received: by 2002:a05:6602:280c:b0:84f:70b6:d827 with SMTP id ca18e2360f4ac-8520bde410dmr633621439f.8.1737787640439; Fri, 24 Jan 2025 22:47:20 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:20 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn Subject: [PATCH 40/63] checkpatch: dont warn about unused macro arg on empty body Date: Fri, 24 Jan 2025 23:45:54 -0700 Message-ID: <20250125064619.8305-41-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" we currently get: WARNING: Argument 'name' is not used in function-like macro on: #define DRM_CLASSMAP_USE(name) /* nothing here */ Following this advice is wrong here, and shouldn't be fixed by ignoring args altogether; the macro should properly fail if invoked with 0 or 2+ args. cc: Andy Whitcroft cc: Joe Perches cc: Dwaipayan Ray cc: Lukas Bulwahn Signed-off-by: Jim Cromie --- scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 4a93b2ede8cd..8933bd30317c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -6046,7 +6046,7 @@ sub process { } # check if this is an unused argument - if ($define_stmt !~ /\b$arg\b/) { + if ($define_stmt !~ /\b$arg\b/ && $define_stmt) { WARN("MACRO_ARG_UNUSED", "Argument '$arg' is not used in function-like macro\n" . "$herectx"); } From patchwork Sat Jan 25 06:45:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950771 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 C23ABC02192 for ; Sun, 26 Jan 2025 16:40:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0B4510E45E; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dsWBCTQ/"; 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 4133910EA76; Sat, 25 Jan 2025 06:47:22 +0000 (UTC) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-844de072603so202538939f.0; Fri, 24 Jan 2025 22:47:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787641; x=1738392441; 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=28x5d6xbEGUAT7PLrsu8ZHGSSAEZicMzeP2EW9a2UNQ=; b=dsWBCTQ/Ohai7A5n9pFsu3HAslY5m29QK+NKPW0u3Ksyd/6MtWfsUvL/dE/YcgtLZf g4IiDNbD+HPUSw9TadsFLV8A2NLyo2OyoaN6fAb63TD4XEkLZjualUXbXADIunDWniQq M+wS3JT+JLCA/Kx/JYGhQd6qnU6w3y7D4sXxOw+xlRSIzoykxP3JVkAQBcoK080hZ3Oa jwaFJ8hJXncQpoQxM+XU/hrzf2kODzWFLFzr+dttMmjDb57GdN9AC9txOLvJvrPcXxW/ WLHC4ybvgDuf9PkFXlxs0DLVzyM0LSJe4jaNpfNm5gRRkqOp2TojkfbOuzwoNxGipIcm bduw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787641; x=1738392441; 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=28x5d6xbEGUAT7PLrsu8ZHGSSAEZicMzeP2EW9a2UNQ=; b=ria1/vZuFAvIaTtbo7PFwPNqKU7JYEY2E4f9WiVLiUocXPP6kbUyBJaPsjlUJNmIsz HiDODxCGMsg/EvFG5A1txQv8mbd6R13aA7yImrKnsDQMZ32OQ+2PBVlU1sVD1v2EbuR1 hQPRox2cxHh0JiWAvMnshdZhyJvrjj24vlIIYXUmN9AvDPASsMLy0A8KwI9TTSWCYyjl OTbEwvAf0nRq1kCt+zzEY4U6AYicyjurERZPLNwew8zMxdiSyZ7FCIhaDYAlBkAPcaZl 320lC+aR75Ro3GHAhHYHxyuNjl1umbDhXUHqSRGaZoMiDv/O8S9Zh5PVr/qTOBxCdgzq QVlg== X-Forwarded-Encrypted: i=1; AJvYcCUfojH1AybIOOsNvEwV3Yh4Z3PuEKU2yHBZ/TiBdoluPTLu/+ZmlywH4ApSHywezYey7eB5nT4rmGTA@lists.freedesktop.org, AJvYcCVZi8SkHOHW2nngnZXg+NwCNglH1E6RfdKafOFb7PedqmTikYWCUFovxluwclKNh+/bMC4plV5tvNG+aTlJPQ==@lists.freedesktop.org, AJvYcCW2e8uYF+8ZP/1ACrV17RNhb2eHj/kpyqQ0a2j5bDfXqV3wv6mKh2vBE7TzBcHy6UiEg/tSRSTn@lists.freedesktop.org, AJvYcCXMbH/UhW9/IQAjrYEEevw7NklVemEYlu2aypMLOSYvpj9sAbXKcFG9TorIHmKXxUZL4EGlg5fKOa4X@lists.freedesktop.org X-Gm-Message-State: AOJu0Yzs20D4eg8QNJdUx1QPdGzEkwDsz8Ekl9yh9tkvdxGHknI+P5h9 28iK/X9n6x2M5fjhdlVX+brl/A6MXfl1EMNb/UeMnhT+Rd34GP1j X-Gm-Gg: ASbGnctsVcXhqDtJx5q9n5cKJt9skR2JoAuQlxcVl/hQz5l3Qhgf0vXIUVTUeX+7j0t tNrtT+J7WZtEb6gSPwKCx9fbpH3zfZrnuCBUUgrMCcVn2gPY74a51bFj9q3GC2Lw5098W9wjBKq 5V0Hb+4AUtbXrSob12Q41ZGjLG2N+6qmBzDrFt24d/IM8nzF9Yj/Bdt4oJGL/I+Xk82h0O4A9MB dS0JoeKqpaYLrKi1RjrIV06oxSLnquHBmMN0nZG4A7VQNSMefUQHWQ/WqrcpKCxGVb4X25mCISo TQPUGysYJMurhrqNQLFkokhHWDQDEB6fwl8qxA== X-Google-Smtp-Source: AGHT+IEMKrFEKpi5SUwkWWCosuXW3ioEVtU6ebYP4sTFzqjXc9Cj2di/duqbptCHxcYLBwKuqsDHFg== X-Received: by 2002:a05:6602:2d91:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-851b62b1c79mr3161244539f.12.1737787641477; Fri, 24 Jan 2025 22:47:21 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:21 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 41/63] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Fri, 24 Jan 2025 23:45:55 -0700 Message-ID: <20250125064619.8305-42-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 a classmap (in DRM core), and DRM_CLASSMAP_USE which refers to the classmap defined elsewhere. 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 --- this ignores a checkpatch WARNING: Argument 'name' is not used in function-like macro #70: FILE: include/drm/drm_print.h:148: +#define DRM_CLASSMAP_USE(name) the macro is empty, and correct. only 1 arg is expected. --- 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 08cfea04e22b..8f7b2aed81ce 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 b3906dc04388..46aa1bcee1a2 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 Sat Jan 25 06:45:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950757 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 AE647C0218F for ; Sun, 26 Jan 2025 16:40:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C263610E44F; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VTxm6LCF"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1EA7F10EA6E; Sat, 25 Jan 2025 06:47:23 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-8521df70be6so138813339f.1; Fri, 24 Jan 2025 22:47:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787642; x=1738392442; 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=CdP+5ahFf+s27dJYZ4lT8xt9OBauCFRo3IWsY0YnyjQ=; b=VTxm6LCFf0TExJB5Nuu411xymikZBDuk6/5w6Fn3i8XJkWYXNBC6XM3GHwLC7QnlzT 4qgVqbR0g0R05PYO9u5csATDWl1woAt80ramFYUtUWBZ0W1r2NIrvBt37erhnM6U/9HI 8U9WWCxc6noQ6mQLoUP93/OGRMuj5gx2mJYygBb5fhZd8MQadjIurgguXTjGtXDAJSAm G70Su1LkoVuB6SYNel5z25MzdKJXAnOX14YQMPjdX6bdZUS+peltoPUnEFJsWDg1mCjV KvEAZpzzpVHC8/MpTng5PQx4ff5IF2yAOlKTByUOk36IWalVcanAVhL0pI4TyH7exp4p RRQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787642; x=1738392442; 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=CdP+5ahFf+s27dJYZ4lT8xt9OBauCFRo3IWsY0YnyjQ=; b=JASYzlEARqlqtCgxdSVcY6GnFpWEJPKw82EqeeO9qtAtTe5et+qkkJsaX9tQxgm675 rfBmdQvDPJyt2QPFCmd5OxhWNFmurxLw4rFjtr+DrS1rQSF79auAXhU+J9NrwHsF9eFd ZXK0ke07PP2Q60uWq0hgN7F8KoRQ5LktXbTOIm3YHpq6IXmDZ7Rb98RosKmV6vqOYFyJ X7QI1IPpWcuiJUsZ96qhEvnmr5DEKhqziFcnIyPoJe++Ki2+aR7R5Ou5h65DpHAilm/+ F9V9kYvzGZTREgF7rtjXqmlv2d1CncRfXPrQyuqDqUViMLrV9WaXuW1OsAIaMOXNs1s9 l9Iw== X-Forwarded-Encrypted: i=1; AJvYcCWDkR32aCSwjeWi4Blu51eRHZ569mTJ/hrVJ7YwNWLqOUjdPE+VewjVL7+bRDJfO7JGtWTcs0dOCPst@lists.freedesktop.org, AJvYcCWPxbzYxE172NiQlZ59aGdL6DppQy7QlJZp1cq+fi4mig/z9vREIl+wFV+gjLQM505hh5GMdbtQmkFU@lists.freedesktop.org, AJvYcCXIQBC6YNZ/8D/pMpQ9zvKkzUVs66i+z3Hy84KAPVGR6Mqb+6gAL8BMZR4iJE6sJnpuqxJ9tiVuXYcSpCpYQw==@lists.freedesktop.org, AJvYcCXg8RWgO1d4e42rTuXGRaoSahlm93yBZKT8m4EcQEBHSyyBYy/d+3F6Qcc40ikO+0ODfNyIknbr@lists.freedesktop.org X-Gm-Message-State: AOJu0Yx4fSQj3qXnoXSAAhKhHKJd9udl5A8mg8neFLPPj4GmFxtR507a MH8+ep6LyOHaC7fm7xYw2VLXafePxNgGFSwfYyXob6s8vxwGO1hy X-Gm-Gg: ASbGncu8kQsVWbdPZZ1ylor6PU2T/ENw4B/dcJIhz4Ua+FpY0fQpJPMsviBX1z6AjHu T2ESneXsNjp7v+UJk3Pac7ovycT5ZJkm5RjXTAoAe5CHhwtDg+aYReXtzPT5y1Eff4mfo7awqnA oCGrqeosjQr0mSUSelWshZLckDxyWgaxco3Qm75c86dReYYvdSCWlKKaDpxDCNjgIKeolkPrk0e 07gEv9Po93j7LgywWlZF82aZRIoiKeDcr0rXZwC+Lkb5T0wBLL/bWeyIAqTPZi4zVwnsvMlhp/R N6w+90/C+0oF0T2QRq7nWyjhQaPD6I9GcFxZ1Q== X-Google-Smtp-Source: AGHT+IGP0GWDKG4GMuUlLSKsdtYWo97WA0h3IFnQzW7R7bdxh/A/DFPj3CVg43yxHZDS7JI/Popefw== X-Received: by 2002:a05:6602:3c4:b0:84c:e8ce:b547 with SMTP id ca18e2360f4ac-851b62b1e17mr2865443039f.13.1737787642440; Fri, 24 Jan 2025 22:47:22 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:22 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 42/63] drm-dyndbg: adapt DRM to invoke DYNDBG_CLASSMAP_PARAM Date: Fri, 24 Jan 2025 23:45:56 -0700 Message-ID: <20250125064619.8305-43-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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. Add DRM_CLASSMAP_* adapter macros to selectively use DYNDBG_CLASSMAP_* when DRM_USE_DYNAMIC_DEBUG=y is configured. Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 8 ++------ include/drm/drm_print.h | 8 ++++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 8f7b2aed81ce..b5fe0c37dcee 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 46aa1bcee1a2..53b62b6459a0 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -141,11 +141,15 @@ 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__) +#define DRM_CLASSMAP_PARAM(...) DYNDBG_CLASSMAP_PARAM(__VA_ARGS__) #else #define DRM_CLASSMAP_DEFINE(...) #define DRM_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) +#define DRM_CLASSMAP_PARAM(...) #endif static inline bool drm_debug_enabled_raw(enum drm_debug_category category) From patchwork Sat Jan 25 06:45:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950777 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 89A30C02194 for ; Sun, 26 Jan 2025 16:40:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38BEC10E465; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="X9uKx2WK"; 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 3348C10EA76; Sat, 25 Jan 2025 06:47:24 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-844e9b8b0b9so206430739f.0; Fri, 24 Jan 2025 22:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787643; x=1738392443; 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=jK0UrBy056BGUqJ1ryqJN7gZOTsk9pTFsv0ec8+B0yU=; b=X9uKx2WKf63SRcHRiE8UDBihoGaKKkquZWvEzzZsL2qolQcFOriJa6JRUckjnBTewm Ka/OK7aAaaG/DPcBgA7+VouP72JvG3v+TAG8YkubN/iwqQpSTzufAaF9SHFO559GuxWj R9IQcJ2Kqj2mXLJXNtGjLNn5QtpBl1fGHW1d1FkYQpN6dAxGSlEL3MlFDKdm29qGlM7u 7FhopjUzSgLLvqMCcN0PqlcWM13TXrkAKV8eIKUHa1T6JFpHgO5LuSlLnz1BoWYKy5At fnZerpvdYJnMdeturzy1gdBkRjrdP+hwR4vMCdyczvs1n7iL4C3yV5Fgs96UlJLh4qGo zefg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787643; x=1738392443; 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=jK0UrBy056BGUqJ1ryqJN7gZOTsk9pTFsv0ec8+B0yU=; b=wR6TEYqUg2AkBeNsFMtg6jOiyO0LudidrzeTqdNDJ8brH2LCzoVkRAU/dCAZfvO1jS AKyn5YD2qpsrBcsZE7X9nYrZBm8tasL8jtUqtu1/6AJ7K1Ada600/c7+NiratRZn6hVF GrufRdw6gOvvqCtTlanJ/UnRax48CwlxFMYGe0oq39ZXIDtz5kLjrcHdTXAY6UPlDu6/ Dqf2RqYBlFEf+qxc0JMqFD+AIrRNNBEYTN8gYpL05Wt4cv82C0JWcAiNgpEU9Z484/PS fVzOSfPp5lMqjGuNtX/v6+chAxv8wj9GpyJrBArFqYN4mSBfZCwmtXzPNRXiqX29VW5p UAqg== X-Forwarded-Encrypted: i=1; AJvYcCWiGP1JdfQqZGKDgB62XfNFz79ml9PUuj+tE117rCWlS0y9aTUo/5yJPQDj6PpABigcJety86gMGrp2@lists.freedesktop.org, AJvYcCWogUU5NCQWuPtAw9eisRXo4ZWvaVwEZtnYGUjIPoLVQfxlsWrXDeQNg/ZU76lQELgP2hRZNdOgBrbY@lists.freedesktop.org, AJvYcCXFpy2ckIlKmSlrH45yqIoov99kZSC/91JuafowUxcBO8PT59/M1fSojUtB7ypapswl0GHYdb1a@lists.freedesktop.org, AJvYcCXn7DvXET5Sm6Up08yZYqtbnIxVrBDW0Rp0cf3ZABOBxQTgyfLecTzkI5ywer5LsgyeZ4JjedF292coIsJr6A==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yz1S+Okq8w01fpDNP5r7cjC9uFWI1ECTnuwB5Zb7QxR+s0mcDvn LKL361k+zHyUPk222YtdmJdCChIWMZK1ZyxXYe/gXaxDnhL8QmjgwOjv7g== X-Gm-Gg: ASbGncuUBQVISOEcH13Re47PNvkPovjL3ZHRUVptjwBgEOjYNszoIKzWPpuKQb5bwGl kiD2XtVqdHmfBVdzQzr+MHcmLhzGLQJ8Xe3OjLRyHOyzNw0wjcHMhZwTcsDTmO6Rgh1BgEWo7pY a02jiUN0vXuqDmNQI1/vAXLOc+qOA4xFApfr7tdA2NdsTrgH1uoLvTvnfTW6a37TgU+wfSI1Had VKx8naWF4KBhcxIAGtrN7TVizeyg8qU+y8iwjpJIzT23h7mZ+A7cNhCsTCWZTQPZF0NAIlGleBU hUXoLW1m+LKvA6W93kCsPGZiyi8BLFZUCyyrkA== X-Google-Smtp-Source: AGHT+IHayxOMJs31PstVOcXn+82f63fxvtyYlv8CLQzhR0Q1eGOVyp3qvY9W6qSZ3tkYze4hI3v78g== X-Received: by 2002:a05:6602:27cb:b0:83a:b500:3513 with SMTP id ca18e2360f4ac-851b62426b6mr3493044439f.8.1737787643439; Fri, 24 Jan 2025 22:47:23 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:22 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 43/63] drm-print: fix config-dependent unused variable Date: Fri, 24 Jan 2025 23:45:57 -0700 Message-ID: <20250125064619.8305-44-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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, __drm_printfn_dbg() gets an unused variable warning/error on 'category', even though the usage follows immediately, in drm_debug_enabled(category). For static-key optimized dyndbg, the macro doesn't actually check the category var, since the static-key patches in the proper state. The compiler evidently sees this lack of reference and complains. So this drops the local var and refs the field directly in the macro-call, which avoids the warning/error. 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 b5fe0c37dcee..dcdf21eb73f1 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -212,9 +212,8 @@ 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; - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); From patchwork Sat Jan 25 06:45:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950789 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 BF8CCC021A0 for ; Sun, 26 Jan 2025 16:40:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4635810E47A; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="USq6Ra2V"; 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 4A2C610EA76; Sat, 25 Jan 2025 06:47:25 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-844de072603so202540839f.0; Fri, 24 Jan 2025 22:47:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787644; x=1738392444; 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=p0te6VyEocxzJeuDOCxt40TuU8GT7eXMxXNwkYWCJTE=; b=USq6Ra2VmqFjbOBc+1H6HYLlxHzWLBsALDVDT7klSvkifioqbp43C7xFyDJvrMMT+T +YeZO71Qge+tLETLMVeqmsdBELkWHF4hQZr9ipRbtBPUrFzbZRhZ7JBdmxp8GsDFMK8N pxykN5ijSg/4sPA11jnNv4wxGq1OJpD2h5o1ZJ21vVRhOAa0Kz6jvAFQQBlD7aH5rH0Z CjHhkPBSHS+mYyNbw6A+oZx6ATG7PLiKyjlV06NfFQ9KmImwFpsT7WGz2yYtmWK9WmtK PTNZJhHI8niLfnGAT78I0VqrG/CE0BRjIkNKQyK80aN3vJus9g/NAUOvhiuJqew5Ha3B tNGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787644; x=1738392444; 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=p0te6VyEocxzJeuDOCxt40TuU8GT7eXMxXNwkYWCJTE=; b=LogjYFnJbuPojkOd8QgxA25FmwwC3i5lV4jRtdV5uAppi4BNnmTmm+bf2Hoi0tUgxy vApzBF6IDQh2RNg95brgV57LQXR9+NabQc1wpkH6od5GN6kRJKItuo2Isee9Ny7+Srpz ggc8jsUZuKnyZwHa1gFGbYPOdkB/ZTeCHGmwKanQ1f6cdQlluh7S5tqUOjCbU9tNYubQ mRIk2PjmYOadtR7wvUzcwNTISMnqbPU80DlMWNnMbvtp3TXxZhPt9CYnPWXU1jC9TH91 MocN1W4H1TVoT2y2Mmw5rwlGAETmfMSS/VJWaGJDekekvAy7+6HkcIDhyO7q+0y4fLqh 6cnA== X-Forwarded-Encrypted: i=1; AJvYcCUMqzWSsupStTF/C0o+QOV6JNNKZwq+IKoiUnwDeVhQM0fNrBX6NQpd4gdiKjwUf6rX7cprw2WcLAZ0@lists.freedesktop.org, AJvYcCWo6RpLqEuEx7D94aALnb85t5eXFYS//N237kGJqrqmkDg7M9pQ9hjERxcU+BlwuK4q3xoQy0s8J1TN@lists.freedesktop.org, AJvYcCWvl80ILOq4Xyf7fAdUIZ8P1AEa18f3DZ1Nvh2bVsBdb6ho7SJaus3oA2urDNjRQw/k2zzqv8MzThRlwswWgg==@lists.freedesktop.org, AJvYcCXSx8R2BTJwO5/QmQZeM2b+Oau69weepmL4l/snnxE5vPRDElUe4tVY+zEqKqydmRNlrjNrgZuz@lists.freedesktop.org X-Gm-Message-State: AOJu0Yyme4/9WB0lG2iSn7Piecy/OyO4dumOt4laUNG/NYBV+Pbcsuah KC8TVnFMFexdgEs385g1+n9vJtNEoqiRkQn6YGSGSbEYdhaIQkLg X-Gm-Gg: ASbGncvh2nrWdAAnst/iQHm74Vtw2oxSzQAhXEc9vJIk55Vlyj7e5Yd1qy3v2hVRTAV 8FTykdvPYWxznLZzCCjyKz38lsbCy+u5mhe3VLEhVRq98XnRNdJpZCahCipsdH3TsENd9lzxc2r GHdJS0d7RhYmUKpuUgkJh00J5ShsoJgV5L1iIM4r0IfN+3N9gV6d87jXrOqXYo6n6CoJVEBHtsZ zEU3D8hhm2CunCvoXYfdB3yvgoiNDEq8UXZO20OwgXQerpPus3voXpZU1W3HhN4ajUwegvNTN5A UJbwd6tCaYeENX6HWJJRaQ/3Xm2Db/X5QLSQ/w== X-Google-Smtp-Source: AGHT+IGCmjf2GomlIQcJQ2AcpeuD/T2jw/K/OqyuAgfExaAaQ7nIOHSuZwo9+1fzmZ8pVKiyG+cedw== X-Received: by 2002:a05:6602:2d91:b0:835:4cb5:4fa7 with SMTP id ca18e2360f4ac-851b62b1c79mr3161252939f.12.1737787644534; Fri, 24 Jan 2025 22:47:24 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:24 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 44/63] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver Date: Fri, 24 Jan 2025 23:45:58 -0700 Message-ID: <20250125064619.8305-45-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 38686203bea6..fab98e8418b4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -232,17 +232,7 @@ int amdgpu_wbrf = -1; int amdgpu_damage_clips = -1; /* auto */ int amdgpu_umsch_mm_fwlog; -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 Sat Jan 25 06:45:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950772 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 1A6B3C0218F for ; Sun, 26 Jan 2025 16:40:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1F0910E452; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZMLvLiiU"; dkim-atps=neutral Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4C5AD10EA71; Sat, 25 Jan 2025 06:47:26 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3ce7a77e5a1so8061635ab.0; Fri, 24 Jan 2025 22:47:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787645; x=1738392445; 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=OqtI5matOTmKZS9P8ui2u3cYOkCmkkFj3gRElUN8iAI=; b=ZMLvLiiU+iw0+zfbwF3yYVbk3a45nFqcNZxEnOdZT4Xsq4HARMVulQmh4vtkemInKQ 46Zp7KS8G4izgP3U5rX6zWxWh+F/XbOIghBZ8XAymenTsQDlXrzM0Tz6gY+U2vlJH7uh Lv6TRTRTe04d0cOy4r3tZlukNMigu1QBFeib3Rs0Oel70oednD1PA+1fH8AqjBr9yQ8A TK/I3Tk0Z7iodQaT+c4xOEvwMp79zJ7/X7J+ShxPTx6JJp6evOWkC490s6uQHlVHJDOY oSRA1NqK/9+N2BML2/1p+XEP80zyJgblgY0VN/qoIXevJzSSOQ9FS1yBJpzo4fRXoWlC BCpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787645; x=1738392445; 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=OqtI5matOTmKZS9P8ui2u3cYOkCmkkFj3gRElUN8iAI=; b=rRxfAx8jxUWmTVDaslcyGRaZtmcnax2fjskOkvtH87A8WN0MmGnRgPv991X5hHiO2T s8k65OT2vt99hhLvvg+u9d+ygntaDQUq534h3eHyIU4iYluiulqZe0LQyeXW24/fPp6c rEeDjJyqHNOFduKVroacgLpg1shlJqQZHBPYKQs/FzdxTPg0msrNSeNkwIbYHL+b/bLN AYiE1LAUocCvxVJjq4KufEmL6wbz5ojuAcG2+slovVfCZ58OxDaxG7Ib2P6hvK3Tp781 R6r5LLvEuTpVI5YvV4OViuihYa4JfkPBdKMzPPqo+o/dkm6lt6FlslwF9RBSLOPHlPmV IDtw== X-Forwarded-Encrypted: i=1; AJvYcCWG0NK2WJP7HvOWbfboOmm9Ai+Vpf5jqhl0kAsd8EmTUyyQ2xpY+RxMqFMzP0uNJzlEWC2ODML9rKBT@lists.freedesktop.org, AJvYcCXZEcBFkqG+Pag2Nf4kQT2dCjzHxIroKcpcf7GJZduxiFd/VJTaGEj5XmLDdc30FXYuCJikcQ5Sx9TB@lists.freedesktop.org, AJvYcCXa+Q+R+t+evqBSqkJPuorPh+gJvdMZvH5AsH025LIINis65av9H0zmXuvdlhOCeZa5riguPB7a@lists.freedesktop.org, AJvYcCXgDPBIECVm+cz05bsKycacL2vC+K05nVJ746l3oeYe8f0xAvR2tl+VHHQQFKRT5mvbwaHXgWN3AVJbykIjhQ==@lists.freedesktop.org X-Gm-Message-State: AOJu0YwckLhzpVSzweD1lYa/JVb7hf03zDJfDWoMKU6WUOCnFNXpYHTH c7MgJ8QLagPUYxyIOmAukQQAEZcrvc584xkF8BzVNPVf1Whdfkvh X-Gm-Gg: ASbGncs9GyKtNH/Kq9uIrKBW2CrQi+8DubVfghU8JxmrhSnkTknac7J0+vXJnqHoNxB MB8U3i/9zz0MCqeAy7EEWHCBelsjVsk4e2KwQz9g9oXcdTU2/N4DAqJ9fbBlAZGMZrxaVYw0ZmW r3izVPo65HU/dosX2a+MqEy9ejjNNvQ5iDP+gRnftLSBFyafBeGcOxl6QKluvJv3OQeIgDqJusx NKFPD6qG/xknG9Rh8OqhIMf+QC1HCgdMKsBAfb7f5v7AfdO/eQHSlTUekM+XZZkCASh0k7uqF6J +a2Z9HRXxgRgMS5PNYFs93YSc/agESb4pYEctQ== X-Google-Smtp-Source: AGHT+IGMtD8RFeAK5aJiKHyxksBNSACUL6L/VSDumbjMDcMZoOolvucD5p/b7rkbhCRrZuZ1NimS2g== X-Received: by 2002:a05:6602:2d83:b0:847:22a7:2412 with SMTP id ca18e2360f4ac-851b623bb6cmr3299854339f.8.1737787645553; Fri, 24 Jan 2025 22:47:25 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:25 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 45/63] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver Date: Fri, 24 Jan 2025 23:45:59 -0700 Message-ID: <20250125064619.8305-46-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 37746dd619fd..2dc0e2c06e09 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 Sat Jan 25 06:46:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950765 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 7C519C02196 for ; Sun, 26 Jan 2025 16:40:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3AE7110E457; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="XpMabPHE"; 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 9AED510EA71; Sat, 25 Jan 2025 06:47:27 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-844e9b8b0b9so206432539f.0; Fri, 24 Jan 2025 22:47:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787647; x=1738392447; 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=fLfoUWhaMiEqDFRkLf7kMowFy2bNs5vWxblm6ukXD0o=; b=XpMabPHE7ItQFPi5zlL+M4iS3GCLBVmbdIc+PXq9IARtOswZFJdD1rrAOusfpJLSHM mrhKAQAA+WIzSTPMZ/GE+aeDNdenuuFjAR5ddqiDa1lhKPKxu/5NS+w5s7oCr3PC8o7L 1vTf2nK2/fYKJUzYCdaRdXSFSTrL4qRviFeFA8Ubj45468IPPhfmQnLzdgERD242LCgJ HMa8RwMO8cLxvGL9+CWctNZP+T9KoiZwhjS45arDTXeiCBdP6w8oQe7BPPx5OgSUAwdK UMEM+PyGWDjOIq4EGIp+gTDfz1xrh37UjyhPhDTjfSbTb11BYvs8hJjcmZB4sv001MI9 e8yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787647; x=1738392447; 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=fLfoUWhaMiEqDFRkLf7kMowFy2bNs5vWxblm6ukXD0o=; b=nM+H2OCNPQffvPdeWomnqzW3JP70pWlvw56zYOF62FYfkK+8ssCMrIvKeOLC5NNUoC 9uU7WF85NGaDp0jbP6EjrogUOjl7JsDt75FAY7P129pDkqv4+bWAqeB8lBV9Z+dq7XT/ fYCUefeACtowpKxRQuUAn9y/YWYiRsvnFljIIdPVbuJ0cK20AzGUDin5ZPij7+fty/lQ upXglGxoDRjiaKMfAlXtXR30ebg+y9VOGg9jR9QELuE6gv0qM7pmJpDxQsh0CeUGaAyK 1yFp8i/pnwX8KaOmT70HC5egLfpxqdGKYFyY4MSL4WfWYIJYq3cHRMZ1z8MCiLT8wMcS sVEw== X-Forwarded-Encrypted: i=1; AJvYcCU+CsB2hz4dJ7LvAypqJ494nr0rTm3L3ouTFoXn9H2LRI87QBp7Cy1ErSExf5RnkseZ2bIM35hNyO6Lkl7PZg==@lists.freedesktop.org, AJvYcCVSWahA32gocmbpsFYrZT/QG+8k7WQTq5era7mJb1OZnopkq8xWs0ZxU2xzgOUS1G+BBkqUJ0RY@lists.freedesktop.org, AJvYcCVZDATwkHcn/Baf2vsBU/3rUvNk6A1xBoSunCCUlyOBqY2A31DwqKxz1VG317IGPf8tRI0nW8AGWz1y@lists.freedesktop.org, AJvYcCVbFuviROw0okjDILGU9kjpzzXzFhl2ZScv6tcxyplycelt8lHxw131pO0fOGXLB564sS6LLj5t7FBT@lists.freedesktop.org X-Gm-Message-State: AOJu0YwX9HR8xssvfmWbMX/+0BNGx69B7DrD9oIqnpZd1z7Quo61VulT VBRK0MrWVM7QchBLwcDtKiKzNYEKo2vcVL1gcYmQ1gP/d4DwCV/F X-Gm-Gg: ASbGncuh8EwYaevuu0owWv0deNklGxqEfTaExI2Ey1IGIpky4uwGx/aFVQ6s/5cP6mY 2yhJ65MG0pQlfb9IvoRhoG3DSaoghU3QNJXW7inlY6u1Qh+ELMTR4GbgcMCm707eXR6XvGwet2o vhQth6o0/4vuMC2fkuMn5wXiE+s3zxx+6dBortybFQ1jWV/LvSBivFE3vHhq9t8DrVr3KlhY2lm dHn6BXGLFe9+hjyQD0+WhEW2ZBO94LY1Ggfom1DKzKqmMOPC910PhmEYbMLQBXlfph9oZY3mfmj SlUOX1UTR3cI9WTJBHjyjRu2dD3aOCkZHAMv0w== X-Google-Smtp-Source: AGHT+IEdJ8HqnmoOBBNAqF1bYkKrvE24cFN/Ts8+1XxohrKoBZ7Yps/ZVEmmHpXktmEoZ+ldlGFBXA== X-Received: by 2002:a05:6602:4a0b:b0:84f:44de:9c99 with SMTP id ca18e2360f4ac-851b61f9123mr3214701539f.5.1737787646929; Fri, 24 Jan 2025 22:47:26 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:26 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 46/63] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper Date: Fri, 24 Jan 2025 23:46:00 -0700 Message-ID: <20250125064619.8305-47-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 Sat Jan 25 06:46:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950787 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 1524EC02192 for ; Sun, 26 Jan 2025 16:40:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3082610E471; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TxuQ59UQ"; 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 9376510E2F1; Sat, 25 Jan 2025 06:47:28 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id ca18e2360f4ac-844e10ef3cfso218974639f.2; Fri, 24 Jan 2025 22:47:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787648; x=1738392448; 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=a5Fx4vD8830ygmwK/CbGq51e5E9vq9b3i0UwFgjm2S0=; b=TxuQ59UQpnJ2bS97t49h6zkGapIlu1WCCxiajBv8MJQ5BHMjZhaxE+ahsW495yV87h 1vk3oiEmdvuK20zV87+yApnfBHbY4l/XJC4Gp/stQBoPHl5mPWIGAI48Lkxt+IH82XN6 F8BGZmv6OutdbjLgVCs9yFpKieR6iLKgbxOtSHAF4qzrhWzUVvqEbql8AO11XBjbuPW2 1YbliNXVuUD0TN7qFNor5zk73mn+nyBXammIw6qvEjp3fFFsfS+/EDU+YsobgG/NKqg6 ne8LlvlMqTfWE92dqQkBfI8I/B025jwcOtWrvnIMKUBTGZzGC6IHDuT9jAHxLWILOaQV GdPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787648; x=1738392448; 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=a5Fx4vD8830ygmwK/CbGq51e5E9vq9b3i0UwFgjm2S0=; b=J+/NXtaLFdAVA+EeCkYUM5ttPvlI4V3GFJqgt8VgfVzjcfhR6DqnQDbWSGZDZHZm1o 6oPcE2w53X2+8kbzryh/aCZ6QJdbXj5x6usu6UssxzfU73xT7ArvOb3h9TvpIMmQRBym zjbT94En0pmXJhYxlym5r6dx3m9QTtEWSACaC5rCaAZqbZ3+KTEXcBuKSUwqGKQPpCcw 0p2++RxTLci7BZeLSCaY8IUUIGKvn1CcJafUyTrLAWcHm2EAk+e8q6IPKoQZWQtuzGx9 sh7026Zm3vwaeDojWoXRY0MMNLEMBIcBZHIk9ffueZ56GwCvq4p3owNWMnLcLjOClnWE Tr6Q== X-Forwarded-Encrypted: i=1; AJvYcCV8AhVpTcanlC81NDxmmPiUBO8xJdKBgzDs2Kf0Oa4Cwl+LWa5lYVSe0jIWQpfBRwAUP7gWMwgHUUSd@lists.freedesktop.org, AJvYcCVodNoh7g3s1pvypUBsOFBD34uyuIHrFUoF4Pv2GAo7fw1tGX8WmpBbIk1otLurCUeDLIGBsugN1iZ/Jr9t4Q==@lists.freedesktop.org, AJvYcCWxWx5R1LBNxv0W/Gf+lxk5DU8H9UT0aZjatxlHSyw32Pc+eNjJXEJxXPK7/zlmeIr0TxZZjG8u@lists.freedesktop.org, AJvYcCXGuyer3OcEq7GRZku3o0nzlXCAfa17SZd1Ks28KK2KqwhAq5R/+Ae/tXkdctgLwpW4li4XaQV2QAOg@lists.freedesktop.org X-Gm-Message-State: AOJu0YwyK0HVksFhRmGCZbf94q9DaBZW7KrgmFk6halO6QaFAc/2pRYh Vd8Uj2NPfBPmLKHR1k5xCBsnGTYkpV/AgwkDojbyeWuIz+Wie+BJ X-Gm-Gg: ASbGncvhn1d7Y5MONPRnFhJ0/JMCsIcd5AEEjQmuS6JXGRjxFZG+qvcaM3bzL7JPoYu nyxSWyldqbVefGz09en8xBO31hdZ5a1MbeBEd12DXXs13FWaCxPaveUpBwnX/wT8NcD6NeTYrDW ZyQxjQE+1MWcnGsM7akHid4zmmkdF+gn8ewdZaa3wBd3uRtUr9snichiTyILHb5bejGYGhvwjez 329t9IIN7L5SNnTP4cX0y8s4C1yb5VEVKH/Ku2CqBrQMDWRSKMMM1xSwGYLRKCGC/5Q3qHtBOc6 2r6KWeG4BFUnNUpU90iBneQGr4qHRLb22coDeA== X-Google-Smtp-Source: AGHT+IFRDe2KcxcBNECeYYJdcgCZVcjRpFlIg8aq2/iCR1BiW/gFQkHcZx8djmRi6ashMmRnx1PoRw== X-Received: by 2002:a05:6602:418d:b0:844:bb0c:b899 with SMTP id ca18e2360f4ac-851b6170923mr2710428339f.1.1737787647828; Fri, 24 Jan 2025 22:47:27 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:27 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 47/63] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper Date: Fri, 24 Jan 2025 23:46:01 -0700 Message-ID: <20250125064619.8305-48-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 6ee51003de3c..04884ff96c96 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -42,17 +42,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 Sat Jan 25 06:46:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950785 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 E5606C02195 for ; Sun, 26 Jan 2025 16:40:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6A62110E47C; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FpdKhP8t"; 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 A44A710EA62; Sat, 25 Jan 2025 06:47:29 +0000 (UTC) Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-3a813899384so7145435ab.1; Fri, 24 Jan 2025 22:47:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787649; x=1738392449; 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=dejYp+eKN9WKMrqw2DFywvLty5rdJ1+8alPM8PzQvUM=; b=FpdKhP8tC6IZ6kzJwCXqQrzeu03PDbn3HYvAjvP+RcySNXyQAWlWe00jd7bpVuHFKr znZvxQPpQBffrNzdxwyOwfgptaBTaqmTvNPPKS8r2dKsFQdTK5LJBx0tNR2FvQBNdJkW PE3phXYn+uG3idsBTBB8wJq+PmCUndPAwQ+W+bqfcCwj+ee4iOAeVfVergrPvXnG7DZN OImxyY3RxRbRLkHfazke+3yjurp1+tS3k8k0tSTH7IYIQi8Lr+TIwKK69ry9CIVqPOoC gMW5fYwaa4et/vWfHBeAUAIQE6RECIXcYmvl0/W9NLkQB/ntY9AtBH+6uQYtCu2dfCNR wdRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787649; x=1738392449; 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=dejYp+eKN9WKMrqw2DFywvLty5rdJ1+8alPM8PzQvUM=; b=rUT9DI0LB5KuRnMu0xxy0oe17RTN6fEDfi8QuH2kTp6c7aoF/Rfj/+RneqQubVkPF/ mdrrKH+miaLUrJaz7D5DHeE8xT2DUgSL8MF8QZyuyBFaEVW3HkYGtX5uvw0clWPxdHCx 68q9D2ItCi4rqY01clHHSP34EwNg2ikGiRZHPCjOvINKPcJJ11Z37Nf3Kak6z9uoQeKO KLxJdFs2nyJsTy2FoN820S2nLuEp3DEYtj+OYLFIHPimg78LHcNl+NBpAwrm1KKl6MTA tUtUscqA56ZbpH75F6UknV4pCC9lEvwyBBNGUVVMP5ox5auK3uonvK4PCSeWcWGaQRrQ EuCw== X-Forwarded-Encrypted: i=1; AJvYcCX5ak+HP+ijskBlQWidNxvRXZ1lJV2w1S7lJ7SRVW6zT4FTs/bZAT2QI/J0dMo23LHu7IWwTgzQ@lists.freedesktop.org, AJvYcCXdhmEvtodpeJFTrUvDSDIKlT6KBKNwHyJzIJd/Eener3nrVF3u+ZAwvCXsfc8Er4dfOtQrRjlbKked@lists.freedesktop.org, AJvYcCXib1H8SxzqDv3iIOCpZTLnrFxY2B6MerA+fHwr05yeBPxZTwIygGT4rI0LyNaiq0eBszeYZ7xWbAlo@lists.freedesktop.org, AJvYcCXt1gpVsf9EZMeDtLAvmEeP578gmwUT754Fm3O0VDTrziPIX6i/R1j3+iIkQ+i/71KhqPpV8qRw6Yrp8jF+jw==@lists.freedesktop.org X-Gm-Message-State: AOJu0YwNjteAmCKSydbJ/0scsHXCceEdiWWJ8YKp5ZiQivCRoi/EqaQ7 +6SRMAIsD7js6A9Niy25dkpllhvo2AtjPsN7EofZAcnbyeYTUtjB X-Gm-Gg: ASbGncsFNB2Y1Vjk84i9DYDmweo9X05CmQxTdogkzjPKrsSCmfYJZeKJn8V0IW8H2Xw ejeaCP/idN0MYyOIQw/Zf1gp1n/XfXWs+cbGKgH3iThEK6kKvxxrlCpVkGlMCY0TLfaAJG4Xb7X 0yiGynU/iU3XdBNzSEfuxvFDGVbBmzp7WoGalOsDJ/Yh55j9Ioke9gYvttbAJc1+ER92t4f8Da0 AFltt48qKN9gNgUTVKfidf16XwFPbectASgbhHiDyaGVc8xKkeQjl4wrr80QZEQMkKWfnI9ipMf gfJC+rkWO4mKB3xQkLQJeySIZ4X8SWwiGmkuMw== X-Google-Smtp-Source: AGHT+IEAUiOldW5NYz+yhWjZW7GY3yrwC5+bdXLqQ7WliEEkiuhkttZXPlv4GP8R7SFDqRQg9KT8aQ== X-Received: by 2002:a05:6602:3e88:b0:84f:41cb:1895 with SMTP id ca18e2360f4ac-851b616dc39mr2912096739f.1.1737787648918; Fri, 24 Jan 2025 22:47:28 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:28 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 48/63] drm-dyndbg: DRM_CLASSMAP_USE in nouveau Date: Fri, 24 Jan 2025 23:46:02 -0700 Message-ID: <20250125064619.8305-49-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 107f63f08bd9..416e122fa58d 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 Sat Jan 25 06:46:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950769 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 315FCC02195 for ; Sun, 26 Jan 2025 16:40:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8D61110E45C; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kd8M6YcM"; dkim-atps=neutral Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by gabe.freedesktop.org (Postfix) with ESMTPS id C0EB910EA84; Sat, 25 Jan 2025 06:47:30 +0000 (UTC) Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-3cfc8772469so5194895ab.3; Fri, 24 Jan 2025 22:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787650; x=1738392450; 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=jU6LwNcJf+1qCGpisTck4NmcFzAnLgO+JmsbcvhTW5Y=; b=kd8M6YcMVaNJHwc7QtJvrui47QkqKBZXq131adbNmFRPKCYAGrwDvA6WJB6wPlL8eW fIEO8y4hZ21KPNePq5Q4f5A4Ro4vQRx7WI6UnSlKdUjCRl5MxMr0C3jb9ZaTcyZVrw4l LrnSFZVmaF/oE1wUWqSaSiOYXooe7eRiQQ1G9iFtn/TuiDFnwKZ88bl2BrQHPNMW8vj+ rkQenuzGzpXwdQ1MX3bcm81s1XCY+J5WVFGemPG8iwMkIlbRw3uY/jppwZJBHXDDtyaQ YcgcYyr365cATrp3RSaBhpj5mnbpsvXQyIsvCRrLad0rJ4pmtiZUcanmzOCEum/OAkZ4 XN3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787650; x=1738392450; 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=jU6LwNcJf+1qCGpisTck4NmcFzAnLgO+JmsbcvhTW5Y=; b=NUwqW35eL+2qBX3QSLoJTbi8TDLhomvoUTDmsIZgYKh5Rn30/7uGZnNRLr2byI5dDz 0UztpViT4CABFPDEbmOKJumnv21ek+uj4fJJgQa/Il5Nv2jqN+Ya4s3VU3cs+hFdsORk 2GRk1YMzgsnJWyEaXFeSqsdLOljcE6EkF4H1TeTrNQOdqkeYeNCuMIneqIDG3vCbScx+ HspA7/HTDeO44N839vJrkQDEa/HdvJqfzsayXbLSgYo4mtTRCJkW3k+1b5cFcvGnS+P7 63kaQw3a8pLK+D7zcQSzxBBHddhwyH7fGNrB+ef4/RITgOS2N2qBCwqU8G21kNJS8IU2 73Ig== X-Forwarded-Encrypted: i=1; AJvYcCUx6vE3XkcvbgZAunemYS/rD2p5iWn8fP/L+jgA7tA6HV4mrn0P+vxM23G7SIeXRE3xL5KuQNDzI5gGDECabQ==@lists.freedesktop.org, AJvYcCVOOaiqQnVeB5MmKF1qxR4k4GoRFJGxVBpKOHkj2e+MI6/q6kFFyjpK/QtdKzyMdZsrhAsjpmt/@lists.freedesktop.org, AJvYcCXHPWMqRX4UQtqTso6VEkSeeGUgYdhs0y6x+DppnO01GApYp5q9KsKmTkjy+39g1KmcJlWxv5ZGdZn/@lists.freedesktop.org, AJvYcCXrp08knF9ohrXJgl4yqhS5uZ/wESkgn/NkIBukSD5R2j2UkkLmVL9J7fgHvXD4i6XEA67ncMlAWWkj@lists.freedesktop.org X-Gm-Message-State: AOJu0YxI5ISksyC/2QoDGrZGU+vJgmHKmm8BCQmlBVrir6dtfkiKw8I6 DxvFUT+xPcDEGNWihhITkhH+4XV3EnSJH/jZQH5Wk2sUxukLggzfB7rQjQ== X-Gm-Gg: ASbGnct8iYzZAJXJngpQ09HI3jLSW0Rc7lO9ooSOhq9U/5FcSaDIqQJ6lc1cSZ8i0PN RkXN1dsB52gfX0YIQgKKW37d/mg+y3l67qybXvKgooa/JgyQDoaS5ALGXL5j97/hecSlv6MUncM QkBztzAhy3KDhTzCSKt9JZDP22n+6RYArI2n1GTjz7ou+yJ8jCtdS6TvV6uGpfi5JtYIHbR2ggc bTLDpIJIxaKiNXMzNFiiGnIzshnZToFjqJU9a+5vj0Z7yh69kTrLJn/lGisZuWM8fffRggi3JDw +dhFrjqLuFnb64xwS7HeQWIxztKItzg6Ka2IQQ== X-Google-Smtp-Source: AGHT+IHa2Qexgyp2+jWWz3OzYTEauOKi/oF88Wv+H5AMShMh8gmnOOv/yeYeTqHTM89uZp3AjCMbVA== X-Received: by 2002:a05:6e02:2383:b0:3a7:be5e:e22d with SMTP id e9e14a558f8ab-3cf743c99c4mr293832725ab.2.1737787650054; Fri, 24 Jan 2025 22:47:30 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:29 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 49/63] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Fri, 24 Jan 2025 23:46:03 -0700 Message-ID: <20250125064619.8305-50-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 22f0f1a6dfd5..6d36c2ae4f93 100644 --- a/drivers/gpu/drm/xe/xe_drm_client.c +++ b/drivers/gpu/drm/xe/xe_drm_client.c @@ -21,6 +21,8 @@ #include "xe_pm.h" #include "xe_trace.h" +DRM_CLASSMAP_USE(drm_debug_classes); + /** * DOC: DRM Client usage stats * From patchwork Sat Jan 25 06:46:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950767 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 B9948C02197 for ; Sun, 26 Jan 2025 16:40:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BE7010E45A; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="O9Oavc4M"; dkim-atps=neutral Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by gabe.freedesktop.org (Postfix) with ESMTPS id BA80C10EA69; Sat, 25 Jan 2025 06:47:31 +0000 (UTC) Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3ce915a8a25so9044525ab.1; Fri, 24 Jan 2025 22:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787651; x=1738392451; 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=bLkPNu2Q5EYmviVwXAixj7ZJhhmJ3xs87XYWfnwbjNs=; b=O9Oavc4MybZ1Ww8EJNMEYWP6hmMhmxT9CgYs68eyDKHy8fa88TMycvFaAGIBVb4xlb 3ftdMxbZZaUWNouWrx5mkmSKSfUs5Nx89TR/fhGLpd1ZU1qvGLOzaeSVcn9x9DNtb+IY mmOIuN4ciS/wF7ho/18eq+AvTveDWz9NC6yyakGDSAOL8AH4psHywhfF+BIBghp3ERfe B5nim5elsiqO4kZCGt7ykAcudbJeWoFiQzT0xhah34E/iIEK19RfREKlJLi1dLQzyKMI PBmhugNfOgp6h3JrXzjF8xa7I0mo4GzR9oezRtk16BCCMv8kJ196Jy7oWkCkkWkgkQHI COJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787651; x=1738392451; 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=bLkPNu2Q5EYmviVwXAixj7ZJhhmJ3xs87XYWfnwbjNs=; b=AE7pid/VkAqWAVxxh4wxJ1n2mhl81+4cBmbtVRfeoKVlkneu99HK2/l12aW3jRMb4s Me+s8gxr8UiU4fxE3CsP/ahQuzzltsCpM56luVFLgRhG1UDCN9m7MF1LNAiGQmPsi5pF oz64/4HXSvNxYK4lALMhmD/FCC8wKZoXm427pcdTYwl7QrGSi6ATrlU7A7hLkvjnq05U E6/coBLdwOVKrPvTEd1Bj0S5bGgNjx72wEjlcgVBTofbcKMdlyAym73EFvirhLnFxzzN OS98+oFYSmnfV5WzKKXMgNd8tLba8xmDUivQiTzhxNTOsU/V3bCFPZwa6mZxZT9t941J UFEw== X-Forwarded-Encrypted: i=1; AJvYcCVWHp+cCdGfvZ8jdoCb1w1bPakyj+KtvqHJkbuudBXhJj3hV5wfwjzfJYAMycaKyqKNF788TmE4BN1Q/3em/w==@lists.freedesktop.org, AJvYcCW5DlVlfOPx4Em5LICUHCIRAGRC6wbbGL47k6330Ixa6LREpHE2rwa83UnDMKOFXigIEw9eIVik8Mq9@lists.freedesktop.org, AJvYcCWvjMgt9h1Ao4Zowo6degSfZd3XjkDsiLr5+sNQwQM0L21SHVEVVRV63cNTwQPcqjy4HoeAnEwm@lists.freedesktop.org, AJvYcCXC7UFMRETPvtomHe115rCRSQrd+p5yHKmVYpgos8k0JBqm7CQUzEMP+L09pCuLmCT5PHaQv13eXWyl@lists.freedesktop.org X-Gm-Message-State: AOJu0Yz0OlsYVvd7G8kIVABsp2CcBXopCiYTF/pf7O5696xUa0+lD5ta SKaMDSZ2ZUVGgHsWw4xltZmPkEBSoTxqTiH3AB1ikjdY4u3aaWx2elORhQ== X-Gm-Gg: ASbGncsabPeHfP9N436pwRT7+3atUUvpiURjEm0i1oDRjzFqFconh2s4m/QHW9j3PTl BXp0wqTzCpx54pYoXZ/276JwvHY4o/5IHxQLCYY5NHfnAgq/GJHrEjVU5eD8Ts0Q5URcecyiDmg mDekCa8X4p1A10Ib9/fz9duFk+irJr75xapyF12/uicbqLGhw634yCdl6f8zjQZUKwc0Rr5zZUe VJ/F8k8lJf7n/hTCwJ3dNJQMwu18F6Miz+/ViXHVnfCmfK5q3MQapfDx31t5WfCLv8Ys15utLVm TV7CLcn7u+X67J9TB88ySN4R4VGtO/aco9mNAg== X-Google-Smtp-Source: AGHT+IE+1sdA59rvtPU5SkxEWaRpr0NIdPh+RV46664Rr2xVtF4kdC2MMHfvNMK5CKli+LmN1bSAtw== X-Received: by 2002:a05:6e02:170b:b0:3cf:b365:dcf0 with SMTP id e9e14a558f8ab-3cfb365f19bmr116839155ab.19.1737787650985; Fri, 24 Jan 2025 22:47:30 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:30 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 50/63] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu Date: Fri, 24 Jan 2025 23:46:04 -0700 Message-ID: <20250125064619.8305-51-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 ffca6e2e1c9a..fca1a1250161 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -45,6 +45,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 Sat Jan 25 06:46:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950784 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 9A14CC0218E for ; Sun, 26 Jan 2025 16:40:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74D2B10E47D; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dOV07QWL"; dkim-atps=neutral Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 87B1610EA89; Sat, 25 Jan 2025 06:47:32 +0000 (UTC) Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-844e1020253so73050539f.3; Fri, 24 Jan 2025 22:47:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787652; x=1738392452; 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=9nFXwDpq2Q3SkKmn7wq2mLhcg7oyd+q4sRfSktkILp0=; b=dOV07QWLbeRpfHNZnHF5wz2VkaYOAkThDF/4ynGeaSc1cO/Eq4fDUX46l+DWAGZEy3 1mfAS0irxN4OcGfEqnqIA1HQOBu+1gFBzptsaZjBziiPZTtFsu1peKYGJ4b/9WPsw0Cs GQwHTwwwS6JlSeyuN3pHUjiiHlv3COs2+cdkvcPVer/1QLSIWwkbXAJn8hnFpgvgVaEx zQgfWIf8pTXXROCQm0tJE0zILqH5RT9iK80IeYDdINts+exTbwhr/uSgdyilseEbQBjk E1s82onJyytwvaL1lfbzA1a7jGLJt8RbKLLLj4QoDGe2CJQN0UabiJcZSH0cKXDIQuK+ yxew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787652; x=1738392452; 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=9nFXwDpq2Q3SkKmn7wq2mLhcg7oyd+q4sRfSktkILp0=; b=T1g0AylYKlriQNIp7uNSWGrAAqY70UGVYtJSQsekSMzV6OX/Fy6vEoaTBdd92vasQy VgkDs4ZqsnIgX3OSaLweO3qFSCsDH+xxnBo1bJIC6+jz1w//Wsg0eUhvpPRDYqkAlq4s +nyGg5ivMU7t7iWHDXErBL2nMBerkSIDBgOzYoDVV+WhqDUEFIWx0YBTHJgrq+IS1Yt7 pZimNMnZCTAIW+MCGWa3zaPFXKNA9a8+IU+wI3sxvTCj6Yp+3UszOEFkZTIy+E7jBA/l iuWJTv8KcxQHrakvGk2gg8Ul6M/MBICjAkUq7thMl08g3Zk6qy0mljkBoVrQtaEnRkpW GbYw== X-Forwarded-Encrypted: i=1; AJvYcCUgsmmkRY2bs2/fT3ZblDDLifgkIlPs7cJCmsnxzwRI1zzva3Pe2TvN5LmWSxZK5lqz3lKeSk83@lists.freedesktop.org, AJvYcCUz+2xuvUEqVYztZwLg0NM7rpQKJw3rcZ8N0uRCuS0qtXO09Tj5ob/hzYUfmpZmGn4mWfQ7pqFOJFrBGxeN6A==@lists.freedesktop.org, AJvYcCXk08eIGkmXGlPV4UCYBvqcIT0sWUvBqgodkJFXJSLXDBq03ujDZdZn6N8Tks7sBpdXsgYvviWd4aFp@lists.freedesktop.org, AJvYcCXsaiHDzfAwZlYuRs3Dizn/gH+6mrIopUws0T9xA81ADFtm+8fGTmta7mBAOExMkbznE6gZ9CZl0lLS@lists.freedesktop.org X-Gm-Message-State: AOJu0YyKxyOF8biJpHRc6orLygeob6gxR0nNpFypzWpdrZ7QTVtUxorw E2ypXtd64BasOqfDcmalPhfES9aZmsSCw+JBMjnvExYsFAbRVC0fi/cJIw== X-Gm-Gg: ASbGnctuiRfZb1UW0EEdkKZjoIIcx8DA3qYdmy6csSzWqpXokE/lvM1KFECt246CXjR c1VJu+xBPmO7mYNb/dZ3juA+JNhcpRveSzgdgrEeqO9lVJHp4/E8HqoFjZwbFJ9GS00FCQYvudp pHeBSglc0uRTCdf5lA56m1g6u/knO/GT+SRofoPwcRINZxsydr+m2eDCJouI2gdVFzKN5jqQhpB csNY+IOcD5yrlBqi/lTcnN+Nv3VCjkab/mYX6VhdUyKmb1C1vcTsXNmND0O6ARCP2GEuX7Cz7bQ NoG6/Tx5pN7COYDv2YqgZ9iNt7HVZUo5ydRAdw== X-Google-Smtp-Source: AGHT+IGdia7MRs+Xca+0tVgRbyhuswJTIMLLqTubbBnEVp0qZ3vKl3vZA4F4GsGhK46lRDAVflURPg== X-Received: by 2002:a05:6602:600a:b0:849:8540:446 with SMTP id ca18e2360f4ac-8521a727564mr600091039f.13.1737787651864; Fri, 24 Jan 2025 22:47:31 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:31 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 51/63] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm Date: Fri, 24 Jan 2025 23:46:05 -0700 Message-ID: <20250125064619.8305-52-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 4d4f05dee244..7d9e7420d85f 100644 --- a/drivers/gpu/drm/tiny/simpledrm.c +++ b/drivers/gpu/drm/tiny/simpledrm.c @@ -35,6 +35,8 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * Helpers for simplefb */ From patchwork Sat Jan 25 06:46:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950763 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 0D087C02181 for ; Sun, 26 Jan 2025 16:40:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9CE5210E44C; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="UNfKCgwP"; dkim-atps=neutral Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id A210110EA84; Sat, 25 Jan 2025 06:47:33 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3cfc8772469so5194985ab.3; Fri, 24 Jan 2025 22:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787653; x=1738392453; 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=QXJvwkX5dMWwVOOB9k5iDyJ+DvIudVbZ+A9Ut3PgCsY=; b=UNfKCgwPKXyK2QDToDx0l/NJSkPysCUOl9zFLyGmYQVOegdFJabWysP7IIcSdbm81W ZuglG3mR7ND0EJCcQgKLdtxFYPh2wnppZhtE8/EIhN6IFXuqKgDJFiqzr6Pi4OvzyFIW dQRhAATbCY0xdVvC+kRZWUSl41aT/wS+yCaRK5vCSraw2KiNLTd1cqor0igw1ragVaZA oEt6o7MJzg5THkmI9pgP9Z/JWZlZUqnCb0lrBYRsbrXWRvrfkncP5sWHUhkoCEX+WFUI aWqx2kyuF3W8Wp5eLSV0RNyXlVoNcFamnOUQ9lcv9R9mAlCcwXb8q3BsjH9mO7VJ07HD BNMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787653; x=1738392453; 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=QXJvwkX5dMWwVOOB9k5iDyJ+DvIudVbZ+A9Ut3PgCsY=; b=X7uGxIIM31TjpQapHxFImfanNeCV9leIUAORQaAh/w0vk6B4khEMvnrJRaqq1FfSja 1mvVkPocyhV2uKlp5cFVFlhyYxbsiySyzD2phFAuGNfQDJ6Crq2gOz61Iyh5lbnmG6P8 kRBISXMnB259nv2Ao/b1vbO0luFz1ONilwDnKHhpf4/6h6nYfCta48esFgRjlOeTnspq s5iViHLTSF3Yt2jZqrwFqU2azm+nV1T3JiIW6LYqDJdkdazsvf5NIUCy6Hy7llFi2v6G LWt00w0vnOtxAvHlvX+TV2fE3JS6qxfHUPU06zPqJYdc8Le2hZ0F7nJhPXynQegzI4xY bOfw== X-Forwarded-Encrypted: i=1; AJvYcCUG4E1ZIzXnjB0V1X9flF2PzSOY3PPR+2JZPE2xymZqTfpanrY3eYxSuugEmZk4SCl0hybH+OSsuVgz1cq4yQ==@lists.freedesktop.org, AJvYcCUq+MNKkzERFR4Y3dEZwiY1JmzMcJz5R3HiS3YeX2iFLCed3VnV4kJR4KnYQ2qYgCyFptvoyAK0eub+@lists.freedesktop.org, AJvYcCWmJLwJuMaIhZ5J77E4mkQoWswhFR7WJ8NG3/F5sKpWk1Afdeq5zHlQptTxht+UcxYiGHTIYL+pGDyr@lists.freedesktop.org, AJvYcCXPhaOHC/Px/66ZtF5lqkgG5kdXg1MCQCpcAPlHARMg65XtjMVTACp1PFSA/FcP14svOyDYAT/b@lists.freedesktop.org X-Gm-Message-State: AOJu0YwPR4obvCVyIRdG0rWLUtUAUr94Nozkeb4PMqFKz/XPjHcmX6JI lisftU2+cKLvbC7SbR9O4pPos8tg8LJ5vNh6fhmn0EHe8KNl3Yf+ X-Gm-Gg: ASbGncsFKuNHjey82RT8rTl4rh1AzAaseU/I9sQ0FG8siri7uR5qbMlR2tdBKPO8EPy zZ+aoWIdhZNRYEuLaZOjNk5cOBj9Gaj2i3pysCLXKz+q8nEFRooTphmcQc0rErWWYzig3tzgi51 lY9y5AsZpnFl9cD6cS1sbmfgqxZ2nFmqYpH9Ny89cFeQPUsT9HpcRUKI5/4DBQOW7B/zKd9hvc0 wo5hxj5PeNxg+A/aUuTs+9bCNDZ5c8RL1SdakBzupEyHYFH3ct4+YG5wtqDQiS/C8yDLD5DKrhG dNco6F8cUqnkk2i6VtU+5U9g9bN08z3TQ4oYTA== X-Google-Smtp-Source: AGHT+IFR8c5S4HlnxAhhQQrNs6VgmiPrwR9vlqdXV98OhQbNPjVEjH4OwoZZHaDBKr7qyvOeA3I8Dw== X-Received: by 2002:a05:6602:4881:b0:84f:537d:b097 with SMTP id ca18e2360f4ac-851b62b5a35mr2857317739f.12.1737787652958; Fri, 24 Jan 2025 22:47:32 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:32 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 52/63] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Fri, 24 Jan 2025 23:46:06 -0700 Message-ID: <20250125064619.8305-53-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 6f91ff1dbf7e..d29541aa82ab 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -59,6 +59,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 Sat Jan 25 06:46:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950768 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 99144C0218E for ; Sun, 26 Jan 2025 16:40:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF91C10E458; Sun, 26 Jan 2025 16:39:58 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="eJOgrGwZ"; 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 C26A110EA76; Sat, 25 Jan 2025 06:47:34 +0000 (UTC) Received: by mail-io1-f48.google.com with SMTP id ca18e2360f4ac-844e1020253so73051139f.3; Fri, 24 Jan 2025 22:47:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787654; x=1738392454; 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=QcpavcUXYAdtW417rxXVfrXu3Dd8GPKW+FYGpTZrgBg=; b=eJOgrGwZopbBhV3OkXrh787IQLjxLETAeODM9KdlpVVzJLnSgbzigdbXoQVKMI509g tbkV4Iy86KkBSGsxG2mLZBieRJ38zrCwgRo+Yer8YS3CEsv2xx5r/bMwsckTAvppWlyo wwA1dK8hhmlG0kU6gLG5yM+basR1OsC09JLIGWkI5qKDiKKLPvEfItUJqiRDPfItRXsr 6AIkGEcFuT8KeiSEL5ETyjOtGRr1z4WX+QFvHLfWFnmtNT9qpjhjpNYsjdUbrKi0A9OK vwh8X+HsNFchUCbIStZoa7rQtnw4uC6Tu0JvZGf6Ijf45Nr3cfKyj2UebpcXMgUPijoA QRYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787654; x=1738392454; 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=QcpavcUXYAdtW417rxXVfrXu3Dd8GPKW+FYGpTZrgBg=; b=KSC63VtzelAlW4au1vntg+RErn4a5/D4vPrs1/MZnnREHpBPsid1jwSwLGC8UJUoEf UuBbjw2z7CgY5GN2NsTkRv3ANTvYpNJaznZJhxB0CazRGD7XZgEMYricW8c6AdXxPv8B REp8R5fziuOwDlpAu953EZcLmhNG6Q8pNhvEDcBNi8njUhvms4v+JI6Iulgl9Uhb4/nb EjnoVcZh94KAHt/28QxcdcnNNGNcKAH1GKLAzajdStaaREaHbsw/tUdi0ekk1eDzrWO3 Gth3mnROV4RlKn4KZO2lXifHJfvVHDADkaC1wU76azaVorg5afZJ79pIPA8osxOV7kPX ifzw== X-Forwarded-Encrypted: i=1; AJvYcCUO6WAiFy5TgTv3pYAZkFi9zEiOK/5sBGfcX9rK+ViuD/dYmYZrimWop0tBsEJf7ohDY1oxD8XD@lists.freedesktop.org, AJvYcCWnRbRYAtwqS4d3GBI4kKaCNCkoC2paHOa70jRjWhbikgEX4qp6Qk+DLzOxTwPtxoKj2+1UjOZwQVxf@lists.freedesktop.org, AJvYcCXLkBzRHp7Yf0ne9NGLyUSU7MvKN/tq0x4aqKVlUQovKA0c/SPbBNgjttSKY47BIWKdm9UaqFvOSul1U67PUA==@lists.freedesktop.org, AJvYcCXWKFovYrdb2Q3i+98RzhBocX6KheW51cSf04B2qMNsvmgHKrSGvXuScCbSolb2EfCKuc7JOPXEMIRd@lists.freedesktop.org X-Gm-Message-State: AOJu0YxR+xkB3cTvR0Q2TrvxeQ8NFebyUM4oJeFL/Iks8uKhUIK8j4Zt fdr9zToVTzYUBgNdJTZ+bh5bRXBvVsUlojxfvBbeqcLlLn205Jdr X-Gm-Gg: ASbGncv+96h9HtQmTRrEGIG6SQnQeEkPDoymg4upoluVDHCEbtmBPVj70ItbDSR0yjL jVSuQsDvEkrs9qivYYQQ3HPjaOGtrs7XiAdqRR6zxXSam2ynvI5Bt1VMhQTHZaxiaGUg+1mVzkV W6KD7LcAGhyMc7uJaS6cohhkJ4oa9crKEcRlJv8bhvKa6c1mScP61tgQlMDVi8n8tNdrikFJM/+ QOhWTFGHaDyvCAOepDqu/RzbZO6BaDkfX8gc8nYjr5j0wcAmP41I/fM7U3Y4ZDNXvktbtyJHuny ZxOZcyibhn+ggSxfnwX5GMcJz5KHh12Mk+Jyig== X-Google-Smtp-Source: AGHT+IHqoKSuGlX+q9v1Ocs1Z6z9FnMPhWaJOuL9McgRkRNJSbEYd+QYa+WkyaLQg8Ipw+FhxU4mjw== X-Received: by 2002:a05:6602:134c:b0:847:37fe:e25b with SMTP id ca18e2360f4ac-851b62842eamr2705537139f.11.1737787654037; Fri, 24 Jan 2025 22:47:34 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:33 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 53/63] drm-dyndbg: add DRM_CLASSMAP_USE to etnaviv Date: Fri, 24 Jan 2025 23:46:07 -0700 Message-ID: <20250125064619.8305-54-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 a46f9e4ac09a..9c2bf8b5726a 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 Sat Jan 25 06:46:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950748 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 6FF38C02199 for ; Sun, 26 Jan 2025 16:39:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2114210E441; Sun, 26 Jan 2025 16:39:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f2CZRE5P"; dkim-atps=neutral Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id ACFC510EA79; Sat, 25 Jan 2025 06:47:35 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3cf8f2c34a5so22290195ab.0; Fri, 24 Jan 2025 22:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787655; x=1738392455; 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=mb4Ui0ZOoqST0yf5w9jN+3KbZ6kX8awp7t6bwBFZ2Yw=; b=f2CZRE5PEz1XsMmfZbL4f5V8xU6PgtxMyrKqroJB+6WUd2A0qeTq+0f7JqNyMqVlZr KvKpnw81b2n+yJPW2Ehl7Sc2sOB1na+i3xEG61H+CNhmPRdjfQWyXxOFAywDYwr6bhNP 8Q73BphLPepIV8njq/VViKVqpht10/Ymuoly+KExIRTcZqFU4BC7cl2/AkNUb8CuZRri Q1U6/TQYk9wF4xBIDzDZWyZ1qJqtVhMcY1jhseXQBflqLXfIlAhoJ9qiZ1ZYyMokfYAr bRQIGiLCEYfH+SZx4YnWlgMXSE34c3uFzoWq0cg/auFIgTyysHE5OSVboDP8vwQaKZve 3mWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787655; x=1738392455; 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=mb4Ui0ZOoqST0yf5w9jN+3KbZ6kX8awp7t6bwBFZ2Yw=; b=kUnxI7KGreulmPSsTmhI39aUjhaaTJxT3BeAR7qXPaRRubUP+sZuHKwiBRsQr9O6o/ 6dp85k1HG+RZ79h2qEMUFePqEGu2iSxtIviWkvag4VpYKRuEl1oFdQaT4wZ3KgN0wuis lUmkFsm2yrShR9xJB7n0F07o2U7lwX0Dl51LX+7/zfuTKh68HE5FBWQXj33vPcW0GwjK ZOxaMD7Cj7cvmF1w7n6t/uuAOQXlyLk+ed97aIS2MHGe2QYbeWq5sMnaIZsaHXb2tL9R zcalmYJFDA8EFkrB7dg+FoITfV0O6h84f9ecG8jhrAPWii2AUbSgmdlELnZb7TzXi1XC 6AKw== X-Forwarded-Encrypted: i=1; AJvYcCVH98sp1I6XE3XzPqCQ8nnQb6/zxoJQM5BAREGF+hGs+Iax4h8di2/8TlbM0EbD86aEi9FFyUB+@lists.freedesktop.org, AJvYcCVI14psPjRZ2GCH3vSqzcDVHizjukCJnr6aK1fKW0rOIJ+fwVzv0nkcr3oeHN20L6l8b9uG9YZ3rK+a@lists.freedesktop.org, AJvYcCVY8shGCKqWWr939oQvY8VxFSzX3w4Cichpbb7Wz6wisWrEROwFszb/cyMitk285GOIRzzvP50Q1tVO@lists.freedesktop.org, AJvYcCW7tqEEWzf6g+Ybw41JDYKE1uUSrIjLP2K8RB/BKVZIWfuPs6DhsyS6/5SpZAcX68KOCJq4kSZDPsCWeKRpcw==@lists.freedesktop.org X-Gm-Message-State: AOJu0YxV4roItd6WIbdL2ub1kBfO3TgS9WUdd8rcxBnveYCk6mtNsqYZ M1eHIi1HzRLeyNolB26tMS3JQHxTQHmRJEoHYl21S5KGEc1iK7M5 X-Gm-Gg: ASbGncsreSy1Ii+grhPVv6TFAkXiZUI5vrEtyKmYW73odZbUDUERAalik0c77dtt8dY s7F9BCFNwVGtKaX1ZuIHyVIrCaKF4RTQWq1SHV1B91pxXnO2P1O1L9Nmi/2osEtv9SqyWIB8uDI qUepBShlPAmpV48who2y4a6Sg/g6hSeUV65rq5odYM8uZ/WihEMD8KyZ2TGODszgerM+keNjPxG qTo+6KjZxpK+gVpmr8bb0P+LJW8z1oW6PkCgKeQEAbev/Sb1ZC3mQHjt8kKX0D2QkJBvlfbNM+7 DcUT28R+pSmK1CjQv6ZabL81O6WC6Rwf56eSyA== X-Google-Smtp-Source: AGHT+IGfeKDyplrBtzVGoQ5v51IvfRsTEUeek1sQmLZ+1EABwZiHBKfjiwWPAysM1nJz2q+YUDvJ5Q== X-Received: by 2002:a05:6e02:1f12:b0:3cf:bb6e:3065 with SMTP id e9e14a558f8ab-3cfbb6e3a3fmr100200135ab.0.1737787655039; Fri, 24 Jan 2025 22:47:35 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:34 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 54/63] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver Date: Fri, 24 Jan 2025 23:46:08 -0700 Message-ID: <20250125064619.8305-55-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 c419ebbc49ec..0d53806b6f72 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -40,6 +40,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 Sat Jan 25 06:46:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950736 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 A2390C0218F for ; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 11E3710E1FB; Sun, 26 Jan 2025 16:39:36 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="i5WnFGyl"; dkim-atps=neutral Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id AD37410EA85; Sat, 25 Jan 2025 06:47:36 +0000 (UTC) Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3ce868498d3so8478025ab.3; Fri, 24 Jan 2025 22:47:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787656; x=1738392456; 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=ql8+Sd28U3OYErawdU0P9/UDn3jtrynMdSWwaBGt8hk=; b=i5WnFGylTSX90O486mpTy+uW0424hlvhmO173bRfpJ2uhKZO9mGO3NgObl13hNCXKN O2eyeq9gitYbdw5ShW4lTJFKKPjDdg09MUgohPos+jIIIqjNOiIKF2NvyDvIlWKU+Sqs YxaRbehOfbooYmSHjQ4fDs57OXA1O8takCOr+0zSlqX8K5C/x4qkPnxl2EfIGppWsKBA skwtlamP85wy/RHJB+UYWkW3zXLW/G33OjtbL+iaVSKWZOQcEqLWwv+t3VzfbEicx2NZ YULveDFdQvzCFJnTM5R9hONqwe2ZKHXn6+mwIHIUmQraxJFbUYMHTwXWLPVfcnx1Q9la Rc0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787656; x=1738392456; 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=ql8+Sd28U3OYErawdU0P9/UDn3jtrynMdSWwaBGt8hk=; b=Rv8xTZ0lKzWIJNMyJ5aN0xw6OjSjHsrV0A4w46wXuZzxyl22GBlQUpc5lbuJMwMuby vPJUt3wWFeCXpUz2yymQdPpb3pdjuN/Pg+p5DxYqZzzzokNHMe7fKDutC7JJA4E0iaFY CHR5iSdbl1jwBQB8UxRgSHI4MyEBJXWOh50eOqo2tJvY4puFrR6HsfTOx9yh8mmSmJAo vM6ebHlctYOF95AFGdKmjZTCA9CTIB3vk9KzsV3Jb9u8fEHgJgju7ppbVK0NNDhfl/po aKrnFI5+NM2KNOlBxfTLJWPpYr0oHGvGahGDSkoaa4Z+DZmDhOiO2rQdNTS2XuBibqiu cFMQ== X-Forwarded-Encrypted: i=1; AJvYcCUVu/eDXoeEml4a8osjaUlpCuLKXwYbpC6u7FXnU+TCF37otRUG5rcZHDnZReft/A/n6aerw54ksEqz@lists.freedesktop.org, AJvYcCUYXNyGi1ecaCl32XYomFHiN5mhkr07QJLjiG7cWx0WSJ3XT/eCE2EtSKxScmm6qIBe5D2W5F1pa2EP@lists.freedesktop.org, AJvYcCUfl3UWWgJFJ0P/SbVRbMufsVTRAAOwjCdIflMCotu2TGcNFWm4HTCCvqKAeEVQ5HcwxbNq9ZprRiRLaVP87Q==@lists.freedesktop.org, AJvYcCUpvmFr9MnqXno3c1InTDGpLjI258si70LDlVpTWo/LimY7Q0dnlCzg8XptX5dpi6DpfvuFeEgC@lists.freedesktop.org X-Gm-Message-State: AOJu0YwDvqU/0Nh64Cf+4wodBkFdszEBYiz3sKhzDpShpd21fr+2cJcy IW58hBqYHn5KYVs6a3ncOZzrsvWLxt/98MO6fdIq84qNSjOI9Xrj X-Gm-Gg: ASbGncsoQVUkflTWCPiAfqaJfZy2PS/np2FdsfjG7tAevO0oqmMiQguyuBHl/DcvdWA aqJGaTjC/WJmS+UtFBwYorF6+Q5ER7uyWGK2lCcizo8tB+J9IVQFlmoIr/QzRoBUfDmRZEmgWfG dl0ySjdl8yM9eM5XiKx/BVF+hFFZ/PfyTdsDjIDrQ6YRQ/FB52vHnnVer42dEGVCTs/8FWtfOgH V1uf6IIGBkisTsHWUom0rsisjQSShM/EEcoKk3MrGPv85AViOmcdN5wveNPr9wCSuI+hTECj4dM pr8cKDFlk7ynkw1e63rObtLhOMvn3c7RrX34ew== X-Google-Smtp-Source: AGHT+IH2IBog3sKmGnBbGJ0PnP3Lo2liPfO+4K6LPzzZwjG/QTxkHqsi6rm8EDeKjpBGZ1861EYtWQ== X-Received: by 2002:a05:6602:3c3:b0:84a:78ff:1247 with SMTP id ca18e2360f4ac-851b6286c35mr3044514639f.9.1737787656003; Fri, 24 Jan 2025 22:47:36 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:35 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 55/63] drm-dyndbg: add DRM_CLASSMAP_USE to radeon Date: Fri, 24 Jan 2025 23:46:09 -0700 Message-ID: <20250125064619.8305-56-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 5e958cc223f4..beea273df8cd 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -253,6 +253,8 @@ static const struct pci_device_id pciidlist[] = { }; MODULE_DEVICE_TABLE(pci, pciidlist); +DRM_CLASSMAP_USE(drm_debug_classes); + static const struct drm_driver kms_driver; static int radeon_pci_probe(struct pci_dev *pdev, From patchwork Sat Jan 25 06:46:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950778 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 58CB4C0219A for ; Sun, 26 Jan 2025 16:40:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3D06410E466; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="FYKCBpfp"; 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 B3AC210EA79; Sat, 25 Jan 2025 06:47:37 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-844e6d1283aso105645439f.1; Fri, 24 Jan 2025 22:47:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787657; x=1738392457; 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=DhCfYf7LWbGsDKgpZFGMa7Otj3zRUhvG+D/wYe+cSJI=; b=FYKCBpfpDQxmda3vyP+oWGCRbP3hL+Gkv8l9sE6G+f9t/BR9jVloQbEqj/BQBCs6Pb QCcsPl2SjwdFZzRg1Gh3yGBSvoKpuuGbXa6hUTpsh6Q+W3m95n40nk8FHWu5umPlDJh1 j41jCgjgyhL8l54dmT70/B+/Cxf5SChZXn1awurE+rTEq4xfcVUNZ5lBmxq1cB4WzBk8 jfbNYISeK/rogLhu0kmWOmw9QBUo/lJd+Zk1Z+Pq4gtjZaCqFFtdV8w2nHtv+oZlBzfN e46IDJIyzFsIeTAJJDFAuKfIE5EdNOA6+ouoJkQhln/OvVTicvSjZdw2aOPBwtqtD+fN YPJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787657; x=1738392457; 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=DhCfYf7LWbGsDKgpZFGMa7Otj3zRUhvG+D/wYe+cSJI=; b=mgMz6jekgZ9+wMDXPn61WLvSv6lduoOr6528Nhoyr84bgAtmNOENNxvEkT61l1R3NM nVgwnMBLIydfWEjFqNcc1DLTTpH2fdwof4QB8u2y0ufml4efhEmz4TMZE5EvGrjP2Hjd uJgUDs61inD6oozDQBZn8eERbEcv6sj8m/5U6E2pLCyw/OkAEXvIG1OdJAmdcwcqCrS7 E1mZT7UuuKQc5DNMxDHFaEs4hjf//QLtgmhqoLJKpi4AJO5FcG6Es7BCHpb0q590/0k0 ta+9lr2IyeqORJJKe3uCIys7aLv2GY8dKE8YOXOSp622PEtrbouqM+eXcK8DLXQrc8wc t7nw== X-Forwarded-Encrypted: i=1; AJvYcCUNE3M0qej1lSmDZlucjE29MIfgm7cifZWxkln5M48heaMAds0Mc0+sY000y2wRFFfUEia1fzn5hOu6@lists.freedesktop.org, AJvYcCWKKeyxrg5MCq9yUIhvfr6KP0YUCuSXkupwG5nxKNGW1DaHbyV/+F2xnKogWb1c2vMPaKB60HPw@lists.freedesktop.org, AJvYcCXbbPoAiiGY5HoFRVYxF1FWb+8D/bgEG7xIkn5L6E5y8rmy80fOTuCcFSCbIwOpM9HsJ6T7jGmrykYA@lists.freedesktop.org, AJvYcCXtHQIJ5KVrdlc8lkGEwnrrZgvGYm5n28ra7HcDMVGk3KHD2OS9pHAB2l9TPsmRpdvtPMw0MTzUD6QjBwrX7A==@lists.freedesktop.org X-Gm-Message-State: AOJu0YwOTInv4PpUaoisY3yy0cf/6Aq7tXPsvn0oLTNKUpgEyxVtFaq6 P1Kx2Rohj3NKYbHjbBe4A+s1tId218U7ofeIh3vSjjBHNTjJBEI/Z+44xQ== X-Gm-Gg: ASbGncuKUJslrVxJbXCKB9fFPgdU2QTS45MhpJ3HBdco5BnHqmqYBoceqWuUcQ7Fx2e HdXEzy2wP20QTqIqWLLA4OiP64zQOChGK9ryoIQCZ80Y801j5Mui214MUW9Q1oV3qsWWB/oE8ri Q4019a2uLQ+USWlbFeGj9sEFguu0SK0UXyXumyaED9o3ScD5fqpjT0f8tyBJWD1h1D0oDebs2h9 qGjWN9n4mNNZtEVcJAyHsAsC7CwK+sa3iRTr/CQFGftv0cJj+RKw2QmKdsSQJTsAxe8bFp0Wevi o69uyDRiQVqmFq0SwOUn1c+y5uMo/vzood/m8A== X-Google-Smtp-Source: AGHT+IEOsWBfW6JMMeblHf07aDl8IvLJQ8Aif02FrLV5eXAYXXOlj7T/wgGUMmZxrrBFRXc4sTl7Ng== X-Received: by 2002:a5e:c302:0:b0:841:99cb:776f with SMTP id ca18e2360f4ac-8521e350512mr486421539f.6.1737787657015; Fri, 24 Jan 2025 22:47:37 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:36 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 56/63] drm-dyndbg: add DRM_CLASSMAP_USE to vmwgfx driver Date: Fri, 24 Jan 2025 23:46:10 -0700 Message-ID: <20250125064619.8305-57-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 b19a062592b0..20ad48f3efd0 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -279,6 +279,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 Sat Jan 25 06:46:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950773 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 1DF9BC02199 for ; Sun, 26 Jan 2025 16:40:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBEF910E472; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="RxD4QmWQ"; 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 BA8AE10EA84; Sat, 25 Jan 2025 06:47:38 +0000 (UTC) Received: by mail-io1-f49.google.com with SMTP id ca18e2360f4ac-84cdacbc3dbso225295039f.2; Fri, 24 Jan 2025 22:47:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787658; x=1738392458; 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=Ml0f3Pd8Ka4iU5aZCXEGIrryKcpgrL2K29uQN80cdi8=; b=RxD4QmWQ6SvbrUHpgeZDZTBcRW6wkqmPIok82xofMSvzaeFitmXnNRbL44sPlMvk+D QgfsSn15B9gRnUdL3Fd4aI0Fs4KCZq8ID21DyUWSn6Yy2qTPl81jM9Odgx/N6+2JP7k5 /nmPjhOVZh2F9EzH6lG+Na4Z93RVynIWVC1ihZQeDYe3Ce0/jo6crYgqvrXDZPRdL3Pj 87DgTEiVBc6aKgy+F2ARx4alxB21gABbAuXVQl/U2koagL41rNdXFYt3jppy6DU0pW/F MJV2UqeuVSc4hpv3cDb0J2R44Xo4Mup+9uk4xX67ehUD+TbBsnv3NxUREL/Kd0rf2jvZ tWYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787658; x=1738392458; 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=Ml0f3Pd8Ka4iU5aZCXEGIrryKcpgrL2K29uQN80cdi8=; b=XAZKEB7V4teSP4TeGl/DWgFnZq4/Vfp2989AKNXgmnVnll/WkZ0wSFLcOE9d8P5uxW ddo2+AdHbq9A7viQIxas6xUNz31S2C+gQflVr2FPeMyRC3u8JMSFgafpW58PKLPmsuX4 GWpgjMrfpNaJw/yCtEdnmX8AeZt7QnmMfWkxo7e4VFZsIaPqjYKgnMFYM9HtnCnb6lAW 2f1AA7OYqnzHGJuiRqjjtZLFj6wmo8WnC4aq7F4NUJxJRujqQOlmEjFZchsJv6q69nIp olmSRcm2w/xBhhgBI3g2f9JErx/jO65KtrrcFdrUMxeAajOHcLxrB2hPXyqZcNwT/NKN CLGw== X-Forwarded-Encrypted: i=1; AJvYcCUNoumw89s5z7+QOEeppy77r0bEQcLynezzSwSIuYVX37DjUMR1w5cnaNCuDGNfoYl8AK6FS9aRTDw4@lists.freedesktop.org, AJvYcCVID6HEbv5iWgTfooDA4sIbI4qDDxEW1/8AonO98BBBC9wfgvXRG6LLXweWcb3Q/LvcHvjmv2dr@lists.freedesktop.org, AJvYcCVblgJV3q3IBlNp62x8awGImZn4i6+iwD9vCxvVjTTXCa9d7bO5w2xVY0dxzDcAyIlw35Ye5+M79RNpH9QRjQ==@lists.freedesktop.org, AJvYcCW4fBeRHM8JPC4Kgd7/V5tGKZLWyQlyTSXb64ohW58MTbJwUiHIB3ZQtM6x3gbM1ntCszxc/9Mi6smB@lists.freedesktop.org X-Gm-Message-State: AOJu0YwC3XBDEso5qaidZbRrkNAWEsDBlh6BpXLE3heKUZiBKi3620Go cKRNXVIGxi7ehDxIF4pScPh2PNtLVumpFIVpt05EZOLli+afHnD7 X-Gm-Gg: ASbGncvDyobk1d415ayirXZddgd7XdmvaCnr9Hhp/Qwq80cLtmhMR3JwHEV0jP7g0OF ckPD/Qi5ReI8HMQ48I0K8rJWbvdSGbzn3/7PF6oCvnViPOublpVduNbDbu4aOTcpKW++PHyg7uW uRBdLEhMTo/Xus78XkvOKvseLc72jA4/cECCqw+14fCvA8dAkZ+twX/9N6bH8edi0HJGh1of04W KtEkZ5B15/GrjDpz//00BwBIQSAWh6uUKue6i6fGtdceZEBqTYNwsOaMyQQwBay82W7it2nLq3b PBBPC8XjsxkcY1yuDgyaE5Grk1iVLKkHbKyEuw== X-Google-Smtp-Source: AGHT+IGce0KIu/cX2IH/rWl8zI4G4c6laHe0V/hYkyUUaTQ687Q3YC1U7XADmcyJKObXxSVBExI4fA== X-Received: by 2002:a05:6602:134c:b0:835:3ffe:fe31 with SMTP id ca18e2360f4ac-851b61cad45mr3108696839f.8.1737787658078; Fri, 24 Jan 2025 22:47:38 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:37 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 57/63] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver Date: Fri, 24 Jan 2025 23:46:11 -0700 Message-ID: <20250125064619.8305-58-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 2d1e95cb66e5..4d6b525dc5a0 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -40,6 +40,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 Sat Jan 25 06:46:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950783 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 00902C02197 for ; Sun, 26 Jan 2025 16:40:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D373A10E475; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YX7Hu6Ib"; dkim-atps=neutral Received: from mail-il1-f181.google.com (mail-il1-f181.google.com [209.85.166.181]) by gabe.freedesktop.org (Postfix) with ESMTPS id CA5A510EA8E; Sat, 25 Jan 2025 06:47:39 +0000 (UTC) Received: by mail-il1-f181.google.com with SMTP id e9e14a558f8ab-3cf8c7b2dd5so8339615ab.0; Fri, 24 Jan 2025 22:47:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787659; x=1738392459; 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=VU+OXKhsA8muIGMedhlu9SK76WVthVv8XHWCwBdRt4U=; b=YX7Hu6Ibm/RjIwEFJuGZUo4sklr0sKAJ0b5mjzMxiWtbAveRKmoDw1umdS3RKoibFF +FiG1oyrYn3lSceHgEpZoBLll81M2hCQYikpfV8MXhmmWoA4cuPMS6krIyy4j1Q2Jld4 uVleUSMUNG0zG7VL+TCUIZhEV/Z/5dAX1F1v1ZiVKFl6j4Mz9FvmWM/YX7yhJkbVXdR+ NhpsQ0bqlfwaES2l0cM17OjzI+OZUZ3cMryRMwJiaNMZXZznnwBiCCg9POkTFk3bwCGk tyrvvhw/Ux65P04Dgd2b3TlMWACADo1Jna3zhIJDx1movgG1iHE9fciC58tXsfADQC6/ pt0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787659; x=1738392459; 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=VU+OXKhsA8muIGMedhlu9SK76WVthVv8XHWCwBdRt4U=; b=nDNq+UzI6BpqF6Zp7j/glLYX2uL0r6yFL4oxZFnfV2z8e90ovR61glwktNE4GRqJn/ Vmpf74shPWKm4/0l27zGXzlfWchglQze28VloU8Zk+U2Xje9/PVwZ1+W3e9DgYicksaw 7AA3i3DfgMYilYDZcEJD3WnqG3VTI7Q64OqCKdc44fheYXJZPRfqbc0ZLWwdkCePNLHw AxOq38EJlpiSMsSyaRk1i6Pm2popnMwd0C3qpHCUMCa9e9ExNksysOmq/vAHGdoe6+mW SC+FYAzuCfSRRJuhNZayx24VBJGIBKXaO/1jqqOQJON/DwCAA+iztou/FPzuIu9ujFL2 EBaQ== X-Forwarded-Encrypted: i=1; AJvYcCViZqijZeLaYgLWyvfdAvcSf06VVXaWqMC6IFtoW48/8i7vGTQI5EeON2KHy2bETLPBrclYzprC0QxS@lists.freedesktop.org, AJvYcCWMFiIC6xPUYMocO97J5wZVrqBDsdcfZOAbztMnYZ66RD31deKEBfl9lyz5m43nYEdJy7/oiYBH@lists.freedesktop.org, AJvYcCX2xhfY1qij0feRt1m/FNXjI7/293VEnxm5QjFPbK3ys9rwp7aZwPgIkPpWl3reN33K569bc7U3vAXG04HD2w==@lists.freedesktop.org, AJvYcCXoUW2LiXYAHXrYyvjUSQ2qfFIPT/ORbSm9d+XkjPWV4ssuaUEAqVOKZUynCRJ7A+UWjZxlzLdqCjY1@lists.freedesktop.org X-Gm-Message-State: AOJu0Yw7U5GV12uoB3JSRs3le/577d4PqwZo2RR4rkvjQ+ebKpgWj2Go L+hIz4RuwC/MmIRa5l/LUxo6LnDPy+VjWdnVanMySHquoyo2wV7H X-Gm-Gg: ASbGncvJcsRhQaVvj6t7KSDuhbqjlu2Jam6UKbUk14fTj+7ln7s4//ucMNQp4VeDs7/ ZVzZOlA9BuVVHNWj41yxOjwaep30SgNocoMgdE1L/gLZ+1rhN8BHIVHY+ePL2ExMIttI3e189PP NzzO6gwCp8Hpd789MrbTMEs5jQ5w4mhaCZSoX7Vwf6Vix1VP/UJl5pOGDeU7DcPMqmSWd76yFbk B5tyDE9Wk9DyLPboxnZ4oHCO0xR4FBFWnMiLAav+PIkSX9eUU+3wtL+RaUsaLksDG5afMFWP7pa HzbEoSaEzEeqkWYf6qkPwyZdpNWbGk679Eioiw== X-Google-Smtp-Source: AGHT+IECxSnSj0BufGaooCZEU7hhYKuc1bJycu0qso/Y9YV8tt4jSwt2j7TpluNjluBnY0rIhk9i8w== X-Received: by 2002:a05:6602:3e88:b0:84f:41cb:1895 with SMTP id ca18e2360f4ac-851b616dc39mr2912118739f.1.1737787659133; Fri, 24 Jan 2025 22:47:39 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:38 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 58/63] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver Date: Fri, 24 Jan 2025 23:46:12 -0700 Message-ID: <20250125064619.8305-59-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 Sat Jan 25 06:46:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950796 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 53074C021A3 for ; Sun, 26 Jan 2025 16:40:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B350110E469; Sun, 26 Jan 2025 16:40:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lYNYJk1C"; 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 CEFAB10EA8E; Sat, 25 Jan 2025 06:47:40 +0000 (UTC) Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-844e1020253so73051939f.3; Fri, 24 Jan 2025 22:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787660; x=1738392460; 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=/mUFZ8Fx8Uy3QqB/hbqxnrTn1Tk9spmVb/f/WA3FR9Q=; b=lYNYJk1CvS3BzqD3oVOsmfUZxe7pm/AggrZ0qpzv16zMncBIHMP0jF2V7MwV6+F/kZ /+VMcgJzZXE6nPpL8q17rPm5MXX8zUTP0M1d9QERG/GlH3+XX8/EcF7p6+9X4GI8mI1Z leGuy+HGwvfaXBdEW2TXSrD5OzurSGCCCFG7sMgGuT1Jg1cwoTAREP0UCdckD9bMWdFV iJzFZ8PnJZQrlH5sX7FnzuAbpNgDO8+AF1FvtLWCen83FJ5PhWywnp0m8foEBvtNHesZ e38BWULbAQxmePKeanF0AyC8PMB807WiF7oYKozLkUglXEj/RgbrwwmzsTYfgA8B/yvJ cj5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787660; x=1738392460; 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=/mUFZ8Fx8Uy3QqB/hbqxnrTn1Tk9spmVb/f/WA3FR9Q=; b=OVawFSf2DKA2VWYG4uFFW2YLTdtBmEThzdIqARszZirgkd3GsULDLgeeH01+F0Adwj 0Ie+Vu9bW9PKhBmXB+m7BFWSVm63oIygrpRoz/WGZVWevN5w4werTsWJ9Q5esW9SNtMs cqx6TRROlDj6D1UAEkBxi4cqNRhz8c4Yd4l6vxTeX42nLAlJTaXhKWMxqQ3ZP5Dptmhp j+dYiZt6cP0Or8SDdPiAAGuBqfsAN8b7sttkmunluhd0rt/PdJUn+zuXtXvn2P7mFwFE HribBWhoXLfuD8qGUUbIBE1y4eOycRdr8GfcUiclkS+TV9ahbY80DO84GkFFzyHY54hN TLCg== X-Forwarded-Encrypted: i=1; AJvYcCVjXZtd7SUZEm18b+n1F1lF7Ui7pgoXAVlk+/AvO0oWuTz41e5Fu2gOAEwL6uZHTTUgTtWZO6ly9bSJ@lists.freedesktop.org, AJvYcCVo833oufDwlO/WwytvzDUOlV/pUbg0mIRm2QhIK+CipkftYZD7a3bPZnK64bNeHCbwxEHjKz/nog7pG4CGNg==@lists.freedesktop.org, AJvYcCVzexYSgs13D6aE7UjFOyTcqxqhPByS6IjL/n49c5Zc/aavAYBfFOJJCwejwIK1N9KsK7BfDneE@lists.freedesktop.org, AJvYcCWAl1WVxzoy2aW0YuCOjKKV0Qxdl+bZNyeeSYSz+jLhqb83wFQtdmwIeqi00WUdQUmrhLcTg1qAYuc4@lists.freedesktop.org X-Gm-Message-State: AOJu0YzcTrhuuIyf2gXlIJXBC4jjp27Ok3E3dsVHRuvV3Tz6h6cWRMR5 kduUv7wH0APuVtFkE85+tuuDX6BvATHb2nrq5dBA/3c7BGZKREc9 X-Gm-Gg: ASbGnctHOAfb1flwIhOJxSjeGUqaTXTWfbTMJ/OSX3+ptRJTl3DmaAY+QYT2cBUJa5N TvrpyTn2ys2pXnSL7Zme/M1Ri4T6cRHzC47Oma0VJRCfC/rZUCDmFZfsgGGHx1l4xCCC3CzvlVq GL26cbEBF59L3Cb12DzHfKt9uNUOG+rAJjHQeiJaCX2ROEyKBPGwR7bX6jRGZgJ/g1U4Mosn3EV 6hfsgsHo7h8m7NmZa3uqVWHtf9dDDuZ3pm7n6KfrEIoA5UWgPI5aV/vuyCQRaUgW3jKyTiUiGUO 3xm+BpNV9uEzdifsBSTEcDsZZp+BpVyQY2RZiA== X-Google-Smtp-Source: AGHT+IE5SydaMohjo2fPiL9Eo34PldUnXG2CByWM5igrHsaDbtwNWE8E1i65BN9D+ZF5lfplsXjZ9w== X-Received: by 2002:a05:6602:4186:b0:807:f0fb:1192 with SMTP id ca18e2360f4ac-851b6169a31mr2832582039f.1.1737787660094; Fri, 24 Jan 2025 22:47:40 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:39 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 59/63] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Fri, 24 Jan 2025 23:46:13 -0700 Message-ID: <20250125064619.8305-60-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 97fd7eb765b4..c6000692b5ce 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -27,6 +27,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 Sat Jan 25 06:46:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950791 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 5DE2DC0218F for ; Sun, 26 Jan 2025 16:40:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF9FE10E47E; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mqYXlZDN"; 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 B17BD10EA91; Sat, 25 Jan 2025 06:47:41 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id ca18e2360f4ac-844e7bc6d84so90840639f.0; Fri, 24 Jan 2025 22:47:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787661; x=1738392461; 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=+bbcbstf8Ee+MxLJpu3h+uVTQLGeXiuyn2e5gcDq12M=; b=mqYXlZDNkxZkbFrliGYdz8huc7eGiwedEee7Ldsl+NHrkzEYJ2lQLluPE1C99pN6NS Jsqnfu5xasBrsduCUwawr/BYmaOssCuSfgRfxbxeB/vPMvCvFI6RtfwjxYUCPxMr/b+9 7Y6tzE/qf0ge58ExqyhhChjuywOELMHcewmS74+KPncDJ0HABeXRMwgY2x8MLaOeeey1 p8G5dEGrkkbh3dw0PBw/uxddhp4g62sy1/DbsIL67JdHAOjfTrKYoJ1sq3toMZeL7qoa Gp+N5SOqWDDDv5K2ngOjctMWKbn260pVidCEX+rKjSfS5abCU/7aLQj87c4eyDWERqsD C0hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787661; x=1738392461; 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=+bbcbstf8Ee+MxLJpu3h+uVTQLGeXiuyn2e5gcDq12M=; b=ScftDLik+mvZhty044UJpawDYcd5JEAg3m+hTVUPjIGn4rlG0hSdD7l78YI1C8ce3Y zAYd3mZf/jtp+RSFxKq7ZsY/T/YnisAe5U8VQSoFE6LdKBGlk/dLYRpZC38TX0KGFa9z 7XFAPzx7G367Lhh0VnMtLvFgLQZkHQTzyF5N361a2HB/A5BuRWwQ1H57GwSF2u63EXaA /jiurvHnsJxGM91eQFwfMmBxOKQO8NEHt3FLKQRnUFZ8cL4JSOef49/fusEobajd2gJk uV3AzOMDw6be3VHStHD1SMMGzP4HE5pL1HyX5ev+2f9cFkrP/7lQ4mhzrSuS3um1W9Ru 6Ppg== X-Forwarded-Encrypted: i=1; AJvYcCVISG5baV9Ze+u29rc1pNvGmlK6x5eUW6uOOTFsq16F2lUzb/leXXYm9sZk4FTIifrjMdIPGnz4ivY0Eovxzw==@lists.freedesktop.org, AJvYcCVXZruiyMQL7tzDfMaI5dgsozHLAk0rFF1/Otxq4aHZDk/eR5H08kHFR9bkAbluQV2XelY6BKFR@lists.freedesktop.org, AJvYcCW20k+gkD7TuaeuCGVrnkujnqd0OESYMMoYHyC/d78+j963zpI0v4eccyXj58NuPX+i5TKlq8yqDVAc@lists.freedesktop.org, AJvYcCXX14DJokAkrL9cT0g8WAYkxsNynoSwjvytwazDNHuIFwOewDjTSxQojtJcHchZku0qPREqv5P5pWNL@lists.freedesktop.org X-Gm-Message-State: AOJu0YxRuTubFRgFtK1d+PW5FFFq8oW1EyIYCHuaGxs+5z+A0rdV4IuM p3d69uVdowTYwxR+mdU8nj7ltVvV/WbOHZCpXgfZ9mpgRqQRGaqi X-Gm-Gg: ASbGnctKX8oh6lKafeGpiMqQoLAykj5n7ADG9HXSCDoUqYd3CuLUthF1lAJOX/1MBAh CjvLOSe8UwfoaElBoIxZxEv9OzSQZCLY8mDy56jMC9VxSrq/tonpnE1Pf6gjmobZXx/SE8MK9NM +skju9U+MuTfwio73Jj+UTPo6jFYjKH/G8IrkVPYjgJ78+avpG8NpoWRSZTc1JAL13yHmnu3Fry TypIp++lUA4TARQtfuryaMDEXoDVdpR6G4j1f+kUxkOjCph52APP9GtFxOWVqpQBglgd3nQ2aty LKNmXBGd55vi1gNkZ12nla6eUIDCZU6ZwOrGfg== X-Google-Smtp-Source: AGHT+IEYJEfd8pDXzuBkvGlPdRY1WjVugZUcIO5koXeqdz2TVEIoZMex7iC8QoXTB4/lAL5ptLR8YA== X-Received: by 2002:a5d:9649:0:b0:841:9225:1f56 with SMTP id ca18e2360f4ac-8521e32b3camr488498839f.3.1737787661025; Fri, 24 Jan 2025 22:47:41 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:40 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 60/63] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver Date: Fri, 24 Jan 2025 23:46:14 -0700 Message-ID: <20250125064619.8305-61-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 09ccdc1dc1a2..20b526c39392 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -32,6 +32,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 Sat Jan 25 06:46:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950764 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 9E18DC02194 for ; Sun, 26 Jan 2025 16:40:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E7F6C10E454; Sun, 26 Jan 2025 16:39:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="krRQRkCs"; dkim-atps=neutral Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9408510EA91; Sat, 25 Jan 2025 06:47:42 +0000 (UTC) Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-3cfb0ed6ef8so11168705ab.0; Fri, 24 Jan 2025 22:47:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787662; x=1738392462; 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=p0Zd3BfiY3W2vF0LG5AZgUdYISO6p26vGoDy33af8qg=; b=krRQRkCsav9BdavOZwbxi73yUJ411sO61C4YyC8p3WXBAFji+j867HjaPGO78D4ykj HU7Zm4APK7M4upgAuZ6oibkGzVpUJHvEj4fh7qJydtaNvLbbsJxrFq4gVxeMK7CSNbJc fZnPwiGa83gTa+MEFuT+VR7sc08VVq+GKVXDYLEpho46sM6wOo51gUFrD96iQ0hS3z6A HVVascFsEAB9/5MyLmrcK3olqOgt16leXPJ4OZtJRm43dtWzHtLQEEBZobclrE9ZC9ol 1lJ1PU0wLqL6wLUeEhTVg7OyStUwv0VlIr0XnJ5bjsrLEhPnPaUPmoN8eZJnWWaQXwo/ RlLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787662; x=1738392462; 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=p0Zd3BfiY3W2vF0LG5AZgUdYISO6p26vGoDy33af8qg=; b=BuX43gQZm0QoGwca1WhXoTPuuU7Yf2kodZvhSxAupVcsdZ/jQcw7Oiwwwy7VOy859y y2H/ZrXtP+I35+R3gCpAQ9GCM6w+3mcmyLuoUdYkkJFBOlomsN0v1nGwXrNMJYOSnRys NUPkXvtEQsOJc6L67A9Ske09kbkpnrV46N97YIVycWjl4+K8PemVvj7OH2FUiUX4dZF8 a2zU9IEPT8O52q2C+XM1eqHKo+gSDeSdIeq3rspRVpYFsjrFnJT9DHllwPxxOeP0OkxZ DePJXe5uExWJQ0h92mleRD1MSrfpvd+Lr0Jcpfd4l2Uv6naDDhEOlXWAHMFPr3VbdiXd OtzQ== X-Forwarded-Encrypted: i=1; AJvYcCUG0KUtqFEm04AVmlIHnCd2beU2xxZdJ4DJlEdjY+EZCUsEuS6uWd9wxKUZtpBPytKCJllAw4AMOCkw@lists.freedesktop.org, AJvYcCUdu6ae0oc7G8/PyvfjLqCD6ecUy2N/qBZ1fmmXaY+VuaAXZSzc6JPx6TLQvMrIjYISDdRxkqUV@lists.freedesktop.org, AJvYcCVDI/OadU8ZrD1QA9gCeGUS+R81x9S770QaQ6WujXbhIa9lwg806UZuzbjT71BiihJuPxGmvvjSwmfU@lists.freedesktop.org, AJvYcCWv42mJueOWdYiZAjNqiCzLw3mHwkOLoTbBwd00rAHtI/qip1jZ0fQGdRbTDWi4oF8RrhpK7LbDyREJNTXpAQ==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yzk54zjyJkYDKMU2wUl4AHSCszGYQ0E0/61QD1Kvej7b0r2onEQ aUh6prt7kmN2bV6jZ+p4ZgrcBka96qMVQBY1j9ZN0LgKKw1sbNJy X-Gm-Gg: ASbGnctcc1EGeNSD3F78nVE2eirNMxu02aYg/8dnEZZHqYKszLwefAooGTiymt9V0co SMLdi9M6ll6PSNWaMSU4Sjq3KOCyW8dLBm4EhBBNN2U23QOtp4ocgzSyFTyz8hG0LTDA6MlPv4n OdsDYLljR3wy5KuvO4B/9s1DEVuQm+0tXZYquJcaJjL4nWdN4GMOgg6OduSf4xtz2G+65SNK7Ku dsb3ksNxw9PwxocwcF6dV24SAKdW+tskYau0g0q8TEGUTBuJRYde/rAo1D5PGm+1dmnGexX3C0S 2PGGqWu2w10YcYbqM3QevUBTwuJwEPEJu3BzUw== X-Google-Smtp-Source: AGHT+IF1zMmq3tsjDiYaBlPDj34+isgHT03SW+yXHV8H8+MqeBVAiaiWzp3yJjk7UYIGJ79lbI6G2A== X-Received: by 2002:a92:d4c9:0:b0:3cf:b059:9dd9 with SMTP id e9e14a558f8ab-3cfc7a564ccmr37732475ab.9.1737787661907; Fri, 24 Jan 2025 22:47:41 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:41 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 61/63] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver Date: Fri, 24 Jan 2025 23:46:15 -0700 Message-ID: <20250125064619.8305-62-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 21f752644242..4b72ad1ac72e 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -66,6 +66,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 Sat Jan 25 06:46:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950780 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 85CC3C02198 for ; Sun, 26 Jan 2025 16:40:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2031C10E463; Sun, 26 Jan 2025 16:39:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Nc5DZJqV"; dkim-atps=neutral Received: from mail-il1-f179.google.com (mail-il1-f179.google.com [209.85.166.179]) by gabe.freedesktop.org (Postfix) with ESMTPS id B1BB910EA96; Sat, 25 Jan 2025 06:47:43 +0000 (UTC) Received: by mail-il1-f179.google.com with SMTP id e9e14a558f8ab-3cfc8772469so5195275ab.3; Fri, 24 Jan 2025 22:47:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787663; x=1738392463; 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=zMxBeI+ZLf9yVYG2cFYc0qaCJ8NkAf6XlTFRcgZVjQg=; b=Nc5DZJqVpsUnMc74Fh4s7hw8qRwTK/UZZGzD2NqzIf8YrVIEF1/7ZLM4+YB7whkvqk IRjJzj3kL45n+EsFf7xgeSoErjeTk8Qlvg/et8y+mc2V5OVT62KIUdo8h7pUqhg5Yq6q ll/c1kvOC0ugTmPnr1aky/Gn7eHhPLYQSfJ1RkM0wuw6PShozlFYalOpzeH7yq/RGudF HVyw0yqad9fZE2SfzPwtsWCHjcTOfVdg3EWNsEZWHpv8xbgcBBTKsuBI6mtWXd8j8O4B DB1UjVH0XVz55BYS7KhVBjqGb2fxmKZABVPPZPa9bce64RvtjlnSh69wa7yd8l4EBIlG cvcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787663; x=1738392463; 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=zMxBeI+ZLf9yVYG2cFYc0qaCJ8NkAf6XlTFRcgZVjQg=; b=I+12QpUzNN0qlAhmF2dmcerVLxC58fLT8cPCcjoN8uay1E4C6o6iFKBAZYgP+awvwk j/85UPYmBXZVRYma4euiiEBC/0RcSCt54LvmsCKGHBJXcCycwwBO3BaNQcE27YdbMnEQ m877OiRT7g0ka4ZfHtfcOiPtyVrtsGQ0A0lIPXXWfvVC30hp8LMIG+NpPwhIZk3ZrKnW 1s438E/FO7SLnMz0AeyNlLbqv2RaZ5ScgzK4MZyzTrduqZ3yreuxrdBcicLwveiIhwLZ mq34dzztwjeltngNu9lI0uBftixJCCU7+E9E9z9mEllThpk+47ByHcI4CH9LN5BEben/ WXFQ== X-Forwarded-Encrypted: i=1; AJvYcCU5iS5QOKgDCSqktWnKWS/6a3e6ylJo3dJz9LZURxkVqsR/7RBg7OEA2Po963DEy3qxclfHh1sgoEWo@lists.freedesktop.org, AJvYcCV4YIudZJBv5eWaUpvfIvgdkMbX5xOS7a4YpR2jhi/XervInf3TwEF6lXiElQMHK2e+56nxtuE1Q77GV42gzQ==@lists.freedesktop.org, AJvYcCVicVe2nDAhexwdZ5JIOUWrrGTQnG6ex4riUFxfeaRYU6EBcws1o6dDY1K7KhtK2Nvv6gildqj3iQ5n@lists.freedesktop.org, AJvYcCWHFB9/aBwyu6PUrBFKtpYqbp74E5JwAC7J0tNG37+tURmXzGPnD8vSpSlfjUmb2BQiZSxWPV5w@lists.freedesktop.org X-Gm-Message-State: AOJu0YzPJND6qx9FfvN1PoNS8DRs3QVVaivhTS7CFiST83HFM1o8Lpjj bD+lfSQMo7D9oa819tK3ELxsQBn6J1y8241TgH+V4dymEMF6+8G7 X-Gm-Gg: ASbGnctwu7rybhHCMrAibpnZ5ejT/88Qh10a5iZh6X2waYV72Kjxsz8So37nBRQQRmF UK5+F+tDJdSde/9552+rDKqvcEzKnLgsvVcN37mDHrjxC54xVgkwnuveCSeWP+j5TnMjK4rIHd4 8e5SlM3q6QowG6zbaWecu4F913ctyxdfFBsIQ3wfB35/z9u8vVBsRu073NDTtP5J3Wg6Jro4njh pp3WHQRrg8zxvXcmjorhUMwTHVr/ApTbYV7XR1R9WIiMej4MMtIJm54vTGEfoet7j/PcY4POjrL Zi/HXAGZYeEGq/ntoRjTJAvZH2HPMi13XM42cw== X-Google-Smtp-Source: AGHT+IFb1IYAOoDwrPX5oAD1/5R309ZYSOIrwtBkiFdBX9WxKJLvt5wVK1HYP6ZV250VsZiGsSrO6w== X-Received: by 2002:a05:6602:2dc6:b0:843:ea9a:acc4 with SMTP id ca18e2360f4ac-851b61cacc9mr2996533339f.8.1737787663036; Fri, 24 Jan 2025 22:47:43 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:42 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 62/63] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver Date: Fri, 24 Jan 2025 23:46:16 -0700 Message-ID: <20250125064619.8305-63-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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 | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 5ab351409312..481d18561688 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -23,6 +23,7 @@ #include MODULE_IMPORT_NS("DMA_BUF"); +DRM_CLASSMAP_USE(drm_debug_classes); /** * DOC: overview From patchwork Sat Jan 25 06:46:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Cromie X-Patchwork-Id: 13950781 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 5C6C8C0219F for ; Sun, 26 Jan 2025 16:40:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2850110E478; Sun, 26 Jan 2025 16:40:00 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OqlAps6E"; 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 B0B9410EA9C; Sat, 25 Jan 2025 06:47:44 +0000 (UTC) Received: by mail-io1-f47.google.com with SMTP id ca18e2360f4ac-844e1eb50e2so75459439f.0; Fri, 24 Jan 2025 22:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737787664; x=1738392464; 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=fouGDaKOIh0ynQt2BoYSXSSrIxHSbFED02bH/Ai9Jxw=; b=OqlAps6ED1shoaz1WnIfFBQtYrAymUnKAm5cTcYC5wBCobMV0d65hKGy1ErTFPkGCd gpaoGApUHwCUnD0yOx3fLuqvIu+5k1aro6YlzJNHKsb69XcYYd0Aj08dK64Wo3/MIaPu 591AKZxVyFwTTID2uJmHULR1ey5u4x1J/yBg0rXvM5z0SXnJWHu9r69fKBk1CK30cc3m RvkK7x78ber95NFSVSwXGrutOpuc2Vh2Z44GR/ZzIDW89eUCow+/ZI/1Cq/WgiqVunaD z7m2Hc/nLBZWIxEGTkLDAoAj6r1J5wtvYSRz8P17a48jNc1IoSDNCNEPISA9l0UUqu/C yuKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737787664; x=1738392464; 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=fouGDaKOIh0ynQt2BoYSXSSrIxHSbFED02bH/Ai9Jxw=; b=lDUFZlGCEkAm2xKRUE0Y0PFFqmmPEtwAJ81LJcWMzrkr3gom2XljbEunF1eluec/G4 GyGEl/qzeber1hMKOaz2bkOVwOg9KMBfAZfuHxMbf8Cu5QtPvzDv2rygC4xQaBaM14Ft cgphiuFNv2Um0uKxm+VoaqtetwaHdt5WMgnIPLQ+j993cs+5STb3JxHlKA4sXDAW6umz gpNQece62dwpZPvwVVeUC2FaPmhXckvuVSeTvOGa42Z5vrQsobmapgsHK6CUs/EYLAzP 7c8QO92jQ90PkwCG2GnLaNR581Vtn24Zx75qUGeyezgHlPSKQVgMgwFPs1GOa39cQZJv 4hlQ== X-Forwarded-Encrypted: i=1; AJvYcCV3C2DnrMuy6XQ6HBTLKV9FN1nGzXA70m6wEaiJ7I24MBa+u7vqS2m4k+twxodefFR3gAd2KxJ7fPVp@lists.freedesktop.org, AJvYcCVltPrSglES/YZvuGa8EbsEqvCk8auJzI+2VE4KaOdAsdxJOLMkws4UoXZNU6VLg/k8+tSTK6Zu@lists.freedesktop.org, AJvYcCX/pYAHjigEID1sfBqGL3Fom+/n1GiS9XTJ2zuh5YGUMQAtE+jNCTuazwhTyoL6aWiUjzeeDCw+z/pl@lists.freedesktop.org, AJvYcCX7v6K1+kljGX1Gnx+Bnhw0chPh3550KlEoUnBzymsLGfS953WRHAZ7u4H3I3cny4HkS6LR11rL2Pffk3LDxg==@lists.freedesktop.org X-Gm-Message-State: AOJu0Yw5cqZ1DpKWU/8NHUuP26gseakDoYETMuaYVfSPk50s2tgkuaT6 qGljTRzfJSzTOM1Cb5nwR/6yldYSc3dblSo4wyqMeZT4i571Xw9a X-Gm-Gg: ASbGncuAKKToDzqQETuaq8Jsq4HcNm/DQ9D0zCFaoQHkvrhuyWUb7IaFqsuPjAdvWsu NMc/EIV9X/7fYzAPw0Mw6TrLVT4jt5xTHYBLXODM09JvzNGeEps25NY1+kY9qw4V+xt7zPKHjxR OFYW2ZMNAsLkfEUBdet7QdZDU3Jg6xhxqg/V0yBAXlOIXF6qo9qhPPVja6DI4crduY3F8JyBZXH YyHyKaHfkCTTQtDEuByA/KQOHpBt4TunL/t2XthaPvDd1VmIedpIzSjytr37due2OA6uhBodPwN yz1HenXLrQhzT6ll6bnDq3SPqRGaFaJlDTnBng== X-Google-Smtp-Source: AGHT+IHe/VBH/Ym8KO8omBNYUPHpPaX/1NrJiiHCIRpffb4uvJC3io6oEswUJV0nSwe5qmSt+gVTSg== X-Received: by 2002:a05:6602:6d1a:b0:83e:5860:5189 with SMTP id ca18e2360f4ac-851b6284084mr2527651839f.10.1737787664021; Fri, 24 Jan 2025 22:47:44 -0800 (PST) Received: from gandalf.. (c-67-165-245-5.hsd1.co.comcast.net. [67.165.245.5]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4ec1da476fesm1174144173.58.2025.01.24.22.47.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2025 22:47:43 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, ukaszb@chromium.org Cc: intel-gfx-trybot@lists.freedesktop.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, Jim Cromie Subject: [PATCH 63/63] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Fri, 24 Jan 2025 23:46:17 -0700 Message-ID: <20250125064619.8305-64-jim.cromie@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250125064619.8305-1-jim.cromie@gmail.com> References: <20250125064619.8305-1-jim.cromie@gmail.com> MIME-Version: 1.0 X-Mailman-Approved-At: Sun, 26 Jan 2025 16:39:35 +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" Time for some thorough CI. Also, the previous 18 patches could perhaps be replaced by a single invocation of DYNDBG_CLASSMAP_USE, from a C-file linked into all drm drivers & helpers. I didn't find such a file, nor a drm-client linkage item in the Makefile. 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 772fc7625639..dde5a5e37680 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -53,8 +53,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