From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 457872E282B for ; Thu, 26 Mar 2026 18:54:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551273; cv=none; b=lZiKMCMoPJoFmT0nrS2c2vUQESUE5fztljdhaBJ5yycwrOIePB/9xL9xS58FrFFKUovTNgutUPIchDjLhIkFRlZdVzO0/BccyPu1dT8amOzXP9jMEvO1d8fxiGBYOTOmWpPOpPB1QDZWvwBigR4rKs7A0HUd+tgMTUMrVfPxug0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551273; c=relaxed/simple; bh=mL3eQ5I+NpnVGpIpXZD2MNW+j/Qf6zw5KKDmKMjenuk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ENlQcRcL/7MC5sHqGsyf3BV1trJZ7IIlC0gnf4PqIDIRHAJ9jWksmKKTE/cNGukhd5spYFeGOskmYSceFWlyEYoHtUjiCz963OMGkYg1Cz+OKAVgNyAVZZg7Y2shP57mhPl4mArrhvrQnoqT0dbMn4ofj3kNrPTiWCBGqlXzjXM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qu7Dmkh/; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qu7Dmkh/" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-40427db1300so818673fac.0 for ; Thu, 26 Mar 2026 11:54:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551271; x=1775156071; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gYmxGb7uQeQFtcBU/KNsuA+yly7Rfm4LYjwUpGocOHU=; b=qu7Dmkh/CB730YnANHAwVKdgXoD4DXFfmZLXvtTK7VLxfTzTWNEOVy+cPIL/cO3ES5 hFsMVGotLQXRT7SsIUrzbqCJl3G05goIuF1nBlSKD4GQkmE8yq/5XC0mF0ZDkfzDmxw1 TQxKWAf4P3poniFlPrQWPsI9BYUw5TAxKUYPXQDUoiLS3ciOFmvJ5Cddc76Az07P9Bzr ZwPA1YrwoOUBQDCQYDnHTGLwEMqiCz8svrKTQA5fDakFTacCGwoz/2RTM6VyhTCHV01l aqtAh0oBAwek08VWIEenaAn/nFd/RfNavFOISZv74NCzouoVIqr2DxrrJJM+ZfQOD9Ir 3umg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551271; x=1775156071; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=gYmxGb7uQeQFtcBU/KNsuA+yly7Rfm4LYjwUpGocOHU=; b=MQS+UZkZdHOV6JMPWnxNtD5aHoi1gj/JbaBG5ACIEYGU6vZb2vhHfWSk+jo/v7357z fyCMn1nzLTV2ii2qW7YddTNqFPRVoHt6r39ATYHHygYkjHNZw656oEoNhxw5KUoPs4vF xbGumVcNqe6+1UIs8DZFmwrLq6G3UTc2cEDEYhTqWuUooS9LN7Lwy8Luw+Me6qVWfuju GVELL9usnIcDjs+HNBy1azl2nKyHSxpAMnn19yleyEz6wBFwAOgQb7066C5FDGdneaSO 5cPZLAn5zFKgJvBVPLgsG4JT0yX0ojWAXetgbRTMeWNplr7gut5Y6s6EKExtePPVrxXc OTtg== X-Gm-Message-State: AOJu0Yxpwk4BdZGOipnn0EOuCbs9o5poT7EJ/tYsOfGg7qCcwjrN+hQL wis4uGOVi8IB9C7Qsb8o8qQW4L5sjcU9Xzxkw3HWMZQF3VO+Nfrur7RpVVREXQ== X-Gm-Gg: ATEYQzwBoGwntTmU7Um7yX7zKM/7J3slZF/Tb8zHE1cI0EyPpHzkCbVdml9KnDPbaIU BIp/b8R4LCptUgJ5sod8e/bAWXW55D6DjI+vXqDDCmCE4Lj/Ex7gMFhHsENEbUS+vECgYQr8Q+a 1pPUhq066fLVqR4yg3vYJQyWH7CS2eN7Q+RGlzTun5VhZkYgt+aT02GFfGWopoRg78E3n/KPoWU 7L3N+Yj8w2MvW5wINtQ+g0Osa495Flo2iNR2jd4LsrUP/o9PPD6zzjdaS3WW8Hk2mh2nBnX1HtP xXrrDwc7zOgpCQiCP8N4S1DHfaid7yN7yyWytFwj7iYQOlVvBfa7KVBhIEtpu//PmTH+sDw1nju xRp3zVvwEBL8/bBj/bANxeYGgNRvnGLBPEyaEQn0j9yeS/RriLH/WeXaWXPDGHF8WIMSWf/OxyF AjJUbCcxQCbtp5XBPL3MIKj7RCzsQ+FK68XwudpeKSsVb8F6M6 X-Received: by 2002:a05:6870:8131:b0:417:ab68:fbaf with SMTP id 586e51a60fabf-41ca6ddbde6mr5024881fac.20.1774551271056; Thu, 26 Mar 2026 11:54:31 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:30 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, kernel test robot Subject: [PATCH v12 01/69] dyndbg: fix NULL ptr on i386 due to section mis-alignment Date: Thu, 26 Mar 2026 12:53:05 -0600 Message-ID: <20260326185413.1205870-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When dyndbg classmaps get used (later in this series), the __dyndbg_classes section (which has 28 byte structs on i386), causes mis-alignment of the following __dyndbg section, resulting in a NULL pointer deref in dynamic_debug_init(). Fix this by: Adding ALIGN(8) to the BOUNDED_SECTION* macros. This aligns all sections using those macros, including the problem section above. Almost all the other macro uses are already ALIGN(8), either directly or by being below one. Removing BOUNDED_SECTION* uses in ORC_UNWINDER sections. These explicitly have smaller alignments, and using the modified macros here would override that aligment, which scripts/sorttable.c does not tolerate. Move __dyndbg section back above __dyndbg_classes, restoring its orignal position. This is cosmetic, given the alignment added to the macros. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202601211325.7e1f336-lkp@intel.com Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 1e1580febe4b..58daa551420b 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -212,11 +212,13 @@ #endif =20 #define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . =3D ALIGN(8); \ _BEGIN_##_label_ =3D .; \ KEEP(*(_sec_)) \ _END_##_label_ =3D .; =20 #define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . =3D ALIGN(8); \ _label_##_BEGIN_ =3D .; \ KEEP(*(_sec_)) \ _label_##_END_ =3D .; @@ -869,15 +871,21 @@ #ifdef CONFIG_UNWINDER_ORC #define ORC_UNWIND_TABLE \ .orc_header : AT(ADDR(.orc_header) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_header, _orc_header) \ + __start_orc_header =3D .; \ + KEEP(*(.orc_header)) \ + __stop_orc_header =3D .; \ } \ . =3D ALIGN(4); \ .orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind_ip, _orc_unwind_ip) \ + __start_orc_unwind_ip =3D .; \ + KEEP(*(.orc_unwind_ip)) \ + __stop_orc_unwind_ip =3D .; \ } \ . =3D ALIGN(2); \ .orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind, _orc_unwind) \ + __start_orc_unwind =3D .; \ + KEEP(*(.orc_unwind)) \ + __stop_orc_unwind =3D .; \ } \ text_size =3D _etext - _stext; \ . =3D ALIGN(4); \ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B26293A257F for ; Thu, 26 Mar 2026 18:54:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551275; cv=none; b=aC2yrPC3rMJC/DAlHG4x9i6KxcycApsC8wlDWnpXb0dn9DIImV5oQPwV8kvOQ76W3rCVOxvGth/GOetzKFFvgDLWvRi5j4B6emKoEQ7ROC137PUrNyiW0Jb/ZE4NUIoNK1zlGEIS+sgz/s/uS7FA1Dm6V1E7htOmOhMb37ZCXwY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551275; c=relaxed/simple; bh=M7qGYFcYxQ1ijPO4FPbquaFZxM7YrcQnkWktshoCzb4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xnr4LhS7v0r2yEOVjSwhmtPSN0VdBQZUKTrE0qFh2pa0lOxRARsTyfbrcB0V3tk4lWTD/a9BIZjupi/fsRCKy/SeEu3gJegsY0Gd0I1i/S0jjey9VfbLoiREPlyvBuXZcWDvyozpLifBthNQjaOWdmo1L4GrKTTSqGSBp68jDsE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VN2M7wit; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VN2M7wit" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-41708f6c3feso860842fac.3 for ; Thu, 26 Mar 2026 11:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551272; x=1775156072; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Jl0zqIzGDZsFGD9VB82Xk4qavMNkml4BIjsBRoCBMtY=; b=VN2M7witGxz4k2qE47KuRIyjnY7ilEu00FlLIBajR4ilaTaURd/WaRF00Pel4Vxlx1 de5tG/sL3bSCoqmrebSCwTJjTU2HJKXXBK3khCPhBNlAUIz8dvOUWwbj2NCxF+GwWdRg Bq0N8zq/YqFsAihFcRZysHRPjcIt/NheAgQSFM1lQGY3g3KanE3gT1bIAT+0MRz0tVW4 ysWLtYfX1ZYttsFAIancnPXV1mD3H8JOfhQ2r9iO1L1Op0EnAwOLVHKJurd96FSFRHJD 8x+BUtYQzyH+shX3rgeYDQgDNTkAPwtOs9O4yTTEqlfSbuppMH/Ue9sbyKGukazEUhiz 67tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551272; x=1775156072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Jl0zqIzGDZsFGD9VB82Xk4qavMNkml4BIjsBRoCBMtY=; b=nZvY3uJMI4JYlYKefStb/hyr7fEAKsS6qxNGWKdAy2wfHvjCLqqXTumx+ulD2g9Dxe 3TKQ2WyFpUvlnWIhLB8+vhv7tK0HIv1NPkZPAj2zRZHznrRORCXY5BgpendpYdyYc564 Zn42r1bTaCKCJGOmqQXUmvvMnKSoKiXRVb+VqVBAZPfU/kBeVCPDKSAn2KeuJhGLiXME Jikks+TyaAiD2MM3FDh18OD4XxJUgeOiFtPZ6s/NmWEV5PKH8LREkZEHizfZZ7+qXPpK HOeRfs0we7HaJL9E/Rli79ovnLNscUa58IhseFTOH3Mlqtd9DefTkIzr0ykaolBu6hhn yxXA== X-Gm-Message-State: AOJu0YyiZaDnDIO4MrCAkLbY4suIuW55+DQyjdd09jkeFWGHj8ME9nhJ ROiJ/2yurNYnvMmpHwuzltRpWw1Ci7OXSlGBggw7iMPOzsqIwT7vMc7oxzxvWA== X-Gm-Gg: ATEYQzw/Asnvl5KpxZhOviVTmkzHCOY2qftJ7WT92AoLGnhPswmWhT4Jh8zKtEyiDq8 uOSxdMl0uHkffmDQVS4eAHA+0ym4opC2AH+rbK3O6KD1FNV2kEw7DHvMfZmakcp+DJoXmZd3Zgg 3+0YEown2X5CvzXdU8StugaWRPbKbuLAfulqEjG8bJlWU9Bc6NCOeba44Dva2euRqJrSAn0rBUd 8E9Ped7oiJjelal1sCpj73jmXQS/rxjxMclvUwzmJcOo3wQRAS0yaWKjIIyCoOqo6blpyXB0DpV +nSABag4W+2KqHc7qAijGbkt8GI25UAykJQ5YEO4ZL5X0eisKLf2hsRjx1IZB3ElKIG7Se4KKUw tDQ52ot/N6zS81pjWKoq8GTa06N9OvvrcH6eJy3jiM4oNMWiH34QFNJSkPnzkX8d/J90QI0PaYK BuXa0qoFXkx4QFJwpvCvKsKFu71Ju+oF9F3s6ASxMZZ1s4Md5i X-Received: by 2002:a05:6870:1649:b0:40a:40d3:8727 with SMTP id 586e51a60fabf-41ca7153b2bmr4402973fac.47.1774551272481; Thu, 26 Mar 2026 11:54:32 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:32 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 02/69] vmlinux.lds.h: move BOUNDED_SECTION_* macros to reuse later Date: Thu, 26 Mar 2026 12:53:06 -0600 Message-ID: <20260326185413.1205870-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move BOUNDED_SECTION_* macros to a new helper file: include/asm-generic/bounded_sections.lds.h and include it back into vmlinux.lds.h This allows its reuse later to fix a future problem with modules failing to keep dyndbg sections in some circumstances. Signed-off-by: Jim Cromie --- include/asm-generic/bounded_sections.lds.h | 36 ++++++++++++++++++++++ include/asm-generic/vmlinux.lds.h | 32 +------------------ 2 files changed, 37 insertions(+), 31 deletions(-) create mode 100644 include/asm-generic/bounded_sections.lds.h diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-gener= ic/bounded_sections.lds.h new file mode 100644 index 000000000000..280a893bbe29 --- /dev/null +++ b/include/asm-generic/bounded_sections.lds.h @@ -0,0 +1,36 @@ +#ifndef _ASM_GENERIC_BOUNDED_SECTIONS_H +#define _ASM_GENERIC_BOUNDED_SECTIONS_H + +#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . =3D ALIGN(8); \ + _BEGIN_##_label_ =3D .; \ + KEEP(*(_sec_)) \ + _END_##_label_ =3D .; + +#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . =3D ALIGN(8); \ + _label_##_BEGIN_ =3D .; \ + KEEP(*(_sec_)) \ + _label_##_END_ =3D .; + +#define BOUNDED_SECTION_BY(_sec_, _label_) \ + BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) + +#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) + +#define HEADERED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ + _HDR_##_label_ =3D .; \ + KEEP(*(.gnu.linkonce.##_sec_)) \ + BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) + +#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_)= \ + _label_##_HDR_ =3D .; \ + KEEP(*(.gnu.linkonce.##_sec_)) \ + BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) + +#define HEADERED_SECTION_BY(_sec_, _label_) \ + HEADERED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) + +#define HEADERED_SECTION(_sec) HEADERED_SECTION_BY(_sec, _sec) + +#endif /* _ASM_GENERIC_BOUNDED_SECTIONS_H */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 58daa551420b..462f124ad457 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -211,37 +211,7 @@ # endif #endif =20 -#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - . =3D ALIGN(8); \ - _BEGIN_##_label_ =3D .; \ - KEEP(*(_sec_)) \ - _END_##_label_ =3D .; - -#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ - . =3D ALIGN(8); \ - _label_##_BEGIN_ =3D .; \ - KEEP(*(_sec_)) \ - _label_##_END_ =3D .; - -#define BOUNDED_SECTION_BY(_sec_, _label_) \ - BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) - -#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) - -#define HEADERED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ - _HDR_##_label_ =3D .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_)= \ - _label_##_HDR_ =3D .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_BY(_sec_, _label_) \ - HEADERED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) - -#define HEADERED_SECTION(_sec) HEADERED_SECTION_BY(_sec, _sec) +#include =20 #ifdef CONFIG_TRACE_BRANCH_PROFILING #define LIKELY_PROFILE() \ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B19A3A5E82 for ; Thu, 26 Mar 2026 18:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551276; cv=none; b=GVNd3fqICWJDaYGIfYcJAg2JlSBxcBcT4TFAVd65kK7rmKwvKKjKTYC6OQpjezc3pbu4StQtPVJI1VmIFxPgf+XQ/uCa4jTzw6eJRm6vr+8O0pRacxnGBIN0+OS3P5bzhfMzMm77ePoxT4/p0F+7YYJCs9AQXpcS1s92P+qHu/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551276; c=relaxed/simple; bh=BBEPtf+MkETNuagrJrkwWSnSZr8x+EAveVod63of4Us=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hNxXY5rUS3/YPjHJmbNHFTMjcVChQrgN9ei60MI0VVmLtfuTWkO1pQXJDfJbJZCdtWXin6cPhB4vd4epKw/T1OXtSZ7UIhrKv0g9tYmj2F1hTqxF/dButiqy/DB0BDt1bT7x+1F7lNx9NYgqOgsXavh0v8oQc2ng03eC3sOJc7I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pHhzUjFl; arc=none smtp.client-ip=209.85.160.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pHhzUjFl" Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-40ee9b945d5so939933fac.0 for ; Thu, 26 Mar 2026 11:54:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551274; x=1775156074; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OqKdylESk9B/a6b5Oi5X2s5Hl7NPYjGcR39u69Tcphw=; b=pHhzUjFlnneW3/UBSH+DFDpWdTURqfhFdYH7LcAHrbL4ZYiSBE0hLCkC5qjiL90ULR f9RsZiQzhofJqpa8Twb+0Zq86P9056/ykZS5QX4R/+GjkJv6Ne91F54eHgIsCL5ywRAN PwQ45deFivRgtkA0BKvGTkkTr3Yj28GI5D1DasdVhtnYEh2KO5tJyqrIPg95FKv5XGnB Jm0rcij1cKpYML/WdqsAwfDkcP6nuOCEIF9BO0+xbV0KQ08sEm8RWUuQz4ilxO4GX7yM nBQWwMARotOuAtxQVKCrdO+n4UD7MouPdY92Ky3OFGX56TwZ9YR7fd6vP6DvkHmvBm1n YOBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551274; x=1775156074; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OqKdylESk9B/a6b5Oi5X2s5Hl7NPYjGcR39u69Tcphw=; b=N1LoI3SG+VhQt3NqMB2vm+rQyK0qLAWOWnVH3b2LN3IQf7yxKa1LmUimdynB1qfn3O BTgVztrl26+7m5WVDd2sSYIU2MFdS4UeNCKei0KQLaT03vcImD4/Awk6wtPOWXZMqMF7 2D+ZnXH0AD/SQ1f5wMaMdXVxjjJtO9zFVL3qCz+OSfwaN1nd4kK2Gc8OcO9f6evNyc8Q BnXx3WupqmBwM3A6a6n7T1RkGjwVmorni/35IfGaTKKrEORNdoOzfWQq8J/wLcJxWIj0 Z31r6MneRpEYloDywTRC17onemjmki0ATPKTXpmNos+pJtG3Cj3X55EiZm0EdaOFPLz2 chag== X-Gm-Message-State: AOJu0YxwWkWOD2LbIsomkJQAtRcaTzMbhHLxAB6+3rg96Zzggo+nq59Y IABe/8sK7FxAzE44CqvblIeY1beK4r1bXJ38VwVcFoHLeIwnEzqRS5ddxI5HvA== X-Gm-Gg: ATEYQzwlUu7S9WI/nTVtAJ+x85KdZpCaaF6gedNjmYuXAkIApbErDD6eF1tKufNvTDN o5678esds/wihe+21YWtu4SKcgqjYJXt72oK/bKUye/DddzOHlYQBrQFvQbCW4iLfoy5Z+o11cv 1jjmLrEscLHsV7QoB+fZgYTVWcq42fZy+n0PN1XSMnIAP3TiIFp42KpXTVOXX5z+pr5SP2owj84 7xHM4JDbdwYUz8zx4vS/eNGjA9DYC07bj1py0EPJF9GuCsikMx9uP1UKvCThiHccjh8t4br6R4D J9Va4iQN9N6LHu6Za+hsIP/7AQI3vebWJEVKn0yZCjzPuSBAiK0AOKnz0Y5q+Xw0DeHm+ezTX40 chhA/Y6m+G2dQpfkqPABmZwYyDTRE4EVQHD5FlLt1ZF1+tfI2mY8ucul2m4T4VNW9MDT/n4ytqE gfinqZeCLiKPP/nQGd/wotZLsbGBzcnq8lAvF8yuTO2QnchuP2 X-Received: by 2002:a05:6871:2b0d:b0:41c:4af:7f5f with SMTP id 586e51a60fabf-41ca6fcdc85mr4146349fac.28.1774551273959; Thu, 26 Mar 2026 11:54:33 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:33 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 03/69] dyndbg.lds.S: fix lost dyndbg sections in modules Date: Thu, 26 Mar 2026 12:53:07 -0600 Message-ID: <20260326185413.1205870-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In an (unused) experimental variation of this series, I had trouble with __dyndbg* sections getting lost in drm drivers. While it didn't happen in this series, it exposed a non-obvious weakness. So fix it, by following the model demonstrated in codetag.lds.h. Introduce include/asm-generic/dyndbg.lds.h, with 2 macros: DYNDBG_SECTIONS moves the 2 BOUNDED_SECTION_BY calls from DATA_DATA in vmlinux.lds.h, which now includes the file and calls the new macro. MOD_DYNDBG_SECTIONS also has the 2 BOUNDED_SECTION_BY calls, but wraps them with output section syntax to keep them as known and separate ELF sections in the module.ko. dyndbg.lds.h includes (reuses) bounded-section.lds.h scripts/module.lds.S: now calls MOD_DYNDBG_SECTIONS right before the CODETAG macro (consistent with their placements in vmlinux.lds.h), and also includes dyndbg.lds.h This isolates vmlinux.lds.h from further __dyndbg section additions. Signed-off-by: Jim Cromie --- include/asm-generic/dyndbg.lds.h | 19 +++++++++++++++++++ include/asm-generic/vmlinux.lds.h | 6 ++---- scripts/module.lds.S | 2 ++ 3 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 include/asm-generic/dyndbg.lds.h diff --git a/include/asm-generic/dyndbg.lds.h b/include/asm-generic/dyndbg.= lds.h new file mode 100644 index 000000000000..f95683aa16b6 --- /dev/null +++ b/include/asm-generic/dyndbg.lds.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __ASM_GENERIC_DYNDBG_LDS_H +#define __ASM_GENERIC_DYNDBG_LDS_H + +#include +#define DYNDBG_SECTIONS() \ + . =3D ALIGN(8); \ + BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) + +#define MOD_DYNDBG_SECTIONS() \ + __dyndbg : { \ + BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + } \ + __dyndbg_classes : { \ + BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ + } + +#endif /* __ASM_GENERIC_DYNDBG_LDS_H */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 462f124ad457..b59f343818b0 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -340,6 +340,7 @@ /* * .data section */ +#include #define DATA_DATA \ *(.xiptext) \ *(DATA_MAIN) \ @@ -353,10 +354,7 @@ *(.data..do_once) \ STRUCT_ALIGN(); \ *(__tracepoints) \ - /* implement dynamic printk debug */ \ - . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ - BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + DYNDBG_SECTIONS() \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ diff --git a/scripts/module.lds.S b/scripts/module.lds.S index 054ef99e8288..8a7b0741bf8d 100644 --- a/scripts/module.lds.S +++ b/scripts/module.lds.S @@ -10,6 +10,7 @@ #endif =20 #include +#include =20 SECTIONS { /DISCARD/ : { @@ -60,6 +61,7 @@ SECTIONS { *(.rodata..L*) } =20 + MOD_DYNDBG_SECTIONS() MOD_SEPARATE_CODETAG_SECTIONS() } =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7B1473A6B60 for ; Thu, 26 Mar 2026 18:54:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551277; cv=none; b=Y/WtyIW9DR5Lxx34BIgBgnPwy8ndt1qeUFBVQZk/2Vx16+1jKS45absngT0cicnSkXjodsBWd1Yc7pYV3BmKnEhyJjCxMK+zNhyocxPgLM6qN17tujo99jC3cdpsJ4Xpj3ao1JatfLl1BJ+Aul+6o6qqQcrzExojRqcCK7BYoFo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551277; c=relaxed/simple; bh=Rpykejp+/jHMXqcimX2Kxzi0M6+Sc3B0AXTd2qBRqns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TSJ17SooICziqEs2ggRYh5mIYlBM/ANrUXpn5XElbM24TJs1snbSRfRsudBOKWTtPrb68Vv0lo2A3u1aPV9BCcM8RYToKvykceWV5xD53RAOio3I1qVcHY00kLeLjtYoE0DAuJjSVzkeW2G+Hw7NVA0uEs+6wxXHUxJRcchbU5g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W6Da4Jxk; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W6Da4Jxk" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-4670676ba03so500724b6e.1 for ; Thu, 26 Mar 2026 11:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551275; x=1775156075; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TvJTZGwFnKZj+neDJ4vh0DEg0/Ks/7VePFt3kMjVxDw=; b=W6Da4Jxk+PAKnMeyPZ+crBOgg3/lgERsaFGftklOk6o5z8g/KNkjnttUWNNybOiz7Y zqk8gCGbOAua9a32WnkUJ/muO3hGLHHABvIIliSFIlBDfRW9xftfHhFHdVvH5Nokp9Zz a0z8/u0hoLfVKI30pEKdKm8mEBCVeQWvr1FJIUHZhNdaLTaFPPSnXzUTiPEBA5GZPNFd E++p6IcK8wIgp/CZ8lUiE6V6gOc5dhe/TjHoP2JiQ1qwhLXL46IDHLdhWjvR6/mSzd5l A2G5mk1nAIB9Od0YMhaEWbkdNvb87aVnVTT7Sv4xNgMM6PszdKOkUfqfeVTOvlvhMKnj eU2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551275; x=1775156075; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TvJTZGwFnKZj+neDJ4vh0DEg0/Ks/7VePFt3kMjVxDw=; b=fierSwAnBr8i+gbfLTh6qO274UUcI9HGBA4Lt+JcgxeD+TMZw6JsULAndKfMTDH21X TEvHoVjXi0uzu4cZUCbTGiZnYI7y1dLZSgyZrLBbw66gccl+LL1UNWPr1mKWj1Y3TwAk 4GPLnOK089lYrOU11tcWFOMhmXjq6cvPgAHoCBtPQpy7Cnb9vU8Ma6KVuJJZMUifZvLS HJa3h58ttbhGuOqhFOPNzW7Sdg9wYZ3+x6kGc4P7VvG34aIGeeItvj/3iLrE8nxS/D1w W1vrhelQfo9TcNYhCYX7Cyl3syCeZ+9mkawUmkQ7M4R08LfuAgOCJzFHCdgpwG5avCi6 ZYYg== X-Gm-Message-State: AOJu0Yw75lvEATssTovG1WdMbAalst98H1CKzwKfX5JVh9+LJSSh5MhX 2lMrtlPhTvgbtTd7Q6hFirVqqKo1aJO8f8+HVoXo9heI9QdQ7oHNY7+1E9g4/Q== X-Gm-Gg: ATEYQzz2nArKaBy/JWR1hWX7fJrw7BNGnzE0vUoDTxlneMFlOObYbirq/aF1EvZmfFZ pOt4C/WEqaWRgmRYig7JElXVUB0mzZ6ydA/HIPQPKVDvRSeI8RxtsBNB5SrdhSg3DOmqF70lXOD GmbZ9yuSzkowPZpIRx30QpzVIZfNuSHAwiS482xSe/dxuQQ7j63oTQ9tqJlcHgdR3NU9RrK1PE+ SzZ7ayzW3LAHLvkdbXvFp+OhpWDCFrB3GSB/2cRCKVS6uVm3d5dJBKRUDs0dZpdA30HOdz6Prnt sRqBcpf+6a8C4uk5oPyH1X+ZLihprNyAtNB9s8IEtaNKcDAcFj1AP248bS0paV4VE6MnUuKBt3x Dl4/b11YoPGZ3BPUlOY3YuHU6lPeb/X0hLD9Mgf/7Va7sv+ri6CcuNuoOZx2i2Ifn+DCkPh6QZO wF9NJ1VpylPwxu/CzVkherTwtb+1VSQADJl4yfrk/WQpxYKgp6 X-Received: by 2002:a05:6808:1995:b0:467:1c6b:ee14 with SMTP id 5614622812f47-46a5c708135mr3630668b6e.33.1774551275278; Thu, 26 Mar 2026 11:54:35 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:34 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 04/69] vmlinux.lds.h: drop unused HEADERED_SECTION* macros Date: Thu, 26 Mar 2026 12:53:08 -0600 Message-ID: <20260326185413.1205870-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" These macros are unused, no point in carrying them any more. NB: these macros were just moved to bounded_sections.lds.h, from vmlinux.lds.h, which is the known entity, and therefore more meaningful in the 1-line summary, so thats what I used as the topic. Signed-off-by: Jim Cromie --- include/asm-generic/bounded_sections.lds.h | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-gener= ic/bounded_sections.lds.h index 280a893bbe29..416b2e6f6788 100644 --- a/include/asm-generic/bounded_sections.lds.h +++ b/include/asm-generic/bounded_sections.lds.h @@ -18,19 +18,4 @@ =20 #define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) =20 -#define HEADERED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_) \ - _HDR_##_label_ =3D .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_, _HDR_)= \ - _label_##_HDR_ =3D .; \ - KEEP(*(.gnu.linkonce.##_sec_)) \ - BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) - -#define HEADERED_SECTION_BY(_sec_, _label_) \ - HEADERED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) - -#define HEADERED_SECTION(_sec) HEADERED_SECTION_BY(_sec, _sec) - #endif /* _ASM_GENERIC_BOUNDED_SECTIONS_H */ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 971C63A6B97 for ; Thu, 26 Mar 2026 18:54:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551280; cv=none; b=aSwFJ+Ync6X3gwT98+Zu1DeWs5nZj99InZX6nyjODGSoQWYWyXPz7ZQJHgBQFuSFVs6dQU6EF7lVCFJELEip6gJb0r2zdMsnJSvKEn7Z3Lh41fYRM3Ywj4+Bde5AbfYYFF9hhFAbF84lx1ZWxhjNZF/CZTRYz7Q6TQvNp9j0Po4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551280; c=relaxed/simple; bh=aSp2tGGV4u70JIzjXLhhj/itWzrqvlxUbbmMGC8eIxY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TLg31jG/fkq56leUsEUAEo7ksH3t9oST8npbgwZMXmTz32FVJDeFV7yS5k8p4cfdFHGnWz+nGTrESkqj87/T1qsh1OeZfjrdVJ/4EfltKYqKnaum1jS1kDSZTjd8pAuj9PtkAYzFnb1EYdV6EEGnQPA/CvslK4J0riQ7eTQ2SGs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d0t3Lopz; arc=none smtp.client-ip=209.85.167.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d0t3Lopz" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-466f1c3c627so782764b6e.1 for ; Thu, 26 Mar 2026 11:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551277; x=1775156077; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aHUGvvDPJX5utgpnBEa/SBdGHOtXvC1eEVKqa9t2R0g=; b=d0t3Lopz3K8DnwVs2EusO/StVctA46Dj40QosyIbPefSP0lt16HEQy9LR1E0NSbESL rWtXwtd8LfJWzhiXMPh9aZQ6/1b2kkYtsNUpeWJnpts1P10DgXXxNahTMvr3c8Rzi1O/ wgsqnbr7f1RKWSEUNPmGQO+wSRM6Bt7peOJgjJmKApEAY27U+bIbg5n9I51YiqLPiivV mBuKqivnHia2FHDgWjrUz2W9pOQ4uox3kuJ3xs0/T2Vf4IutBgTT3IvksqWly7NfEx7C TpwvavgC6RbhfFoLoBhaQa6tL9kctTOX0/G4mGuWqCt1X4UjKcL6pQ/Vt6lHsowROMe/ pYJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551277; x=1775156077; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aHUGvvDPJX5utgpnBEa/SBdGHOtXvC1eEVKqa9t2R0g=; b=I5RPvpiJK48DvGk6QzQ72iCXksH+f5SsMRS87hNMJJIJAXIToGoKI4v0f4pWaXUjkv +LeUWMnhy+AleL6PFuEGr19bl9cWTrhp+Ay4zRLGEfLxschmmnQSnmp/MterLSCawxf2 gfnUkMiTz9vnslbmTlmqsZlg5oponZBqUry4s5FZqusF77JtKuNEaFk+9ucY2oZH0XkQ tNnMY26HFFsnB5hl41Yrz+N9tVhCRtnUPo+x4omp+LBFjDyqv+X7WH5UdRcX/OmzgLQX z4+3z/vqCONBjZXlRJigUsNQdsnIqY0QjmD1++S1dv3VCQ89cGA5BUO60p9X0SeguMUK /2+g== X-Gm-Message-State: AOJu0YzhzvmwVPEYJGpUN9IAlqLdUG7YhsbXSG20MC01on9q1BAADJb1 iqg/HYR2ptTzoo86xUcaVBD0XqXaCCG91FfaS4fpjMMjD8xl04eitFGUSxZUMA== X-Gm-Gg: ATEYQzyyj1QkRKy+WJjh0y0xteffK41NW/fOqTy9MAcctIFWmjMq0Eoz9MRI9pXaAhv +0vNn73nzvq92oJlBKT9nxoaTKH3K4ZO0Ash+YE6/ijefbDHTBiJF2MEWgk2RP/GJ3BkYEwrbza gsvDWE7idBQKsphWPunr5yrnwhEfSrmWfC2ukmM6sj3AhhQR+E/GvySmM45X7spLyQuLShJK9CB NTQ75dG+E79mBbSijFfkt1SlhhfqHAGXLFx+45p8MKuioh8ZzOUc+rnXfVinLsOfnnzJQSkRc56 nPzqIzSG+HfFYb3B2mJVlBlobovN0/PheVQms70lSMOSzdcvfA+rGFdEvZ8dGUXM4mUlvlGFwOl YpC3fbNxGfAK+e0+c9bJC4mZAGT1bJX5uka4j+KWRbS6wXwhsUoPtdSh4B3evPiN99RhHFrS/kt R6gBDXgwc6H39cCJvS2XIECUGcM16XHHXanoR/eS3sIlX3YOQn X-Received: by 2002:a05:6808:17aa:b0:467:bfa:bdae with SMTP id 5614622812f47-46a5c61027dmr3861126b6e.20.1774551277359; Thu, 26 Mar 2026 11:54:37 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:36 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 05/69] dyndbg: factor ddebug_match_desc out from ddebug_change Date: Thu, 26 Mar 2026 12:53:09 -0600 Message-ID: <20260326185413.1205870-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ddebug_change() is a big (~100 lines) function with a nested for loop. The outer loop walks the per-module ddebug_tables list, and does module stuff: it filters on a query's "module FOO*" and "class BAR", failures here skip the entire inner loop. The inner loop (60 lines) scans a module's descriptors. It starts with a long block of filters on function, line, format, and the validated "BAR" class (or the legacy/_DPRINTK_CLASS_DFLT). These filters "continue" past pr_debugs that don't match the query criteria, before it falls through the code below that counts matches, then adjusts the flags and static-keys. This is unnecessarily hard to think about. So move the per-descriptor filter-block into a boolean function: ddebug_match_desc(desc), and change each "continue" to "return false". This puts a clear interface in place, so any future changes are either inside, outside, or across this interface. also fix checkpatch complaints about spaces and braces. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 83 +++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 36 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 18a71a9108d3..6b1e983cfedc 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -172,6 +172,52 @@ static struct ddebug_class_map *ddebug_find_valid_clas= s(struct ddebug_table cons * callsites, normally the same as number of changes. If verbose, * logs the changes. Takes ddebug_lock. */ +static bool ddebug_match_desc(const struct ddebug_query *query, + struct _ddebug *dp, + int valid_class) +{ + /* match site against query-class */ + if (dp->class_id !=3D valid_class) + return false; + + /* match against the source filename */ + if (query->filename && + !match_wildcard(query->filename, dp->filename) && + !match_wildcard(query->filename, + kbasename(dp->filename)) && + !match_wildcard(query->filename, + trim_prefix(dp->filename))) + return false; + + /* match against the function */ + if (query->function && + !match_wildcard(query->function, dp->function)) + return false; + + /* match against the format */ + if (query->format) { + if (*query->format =3D=3D '^') { + char *p; + /* anchored search. match must be at beginning */ + p =3D strstr(dp->format, query->format + 1); + if (p !=3D dp->format) + return false; + } else if (!strstr(dp->format, query->format)) { + return false; + } + } + + /* match against the line number range */ + if (query->first_lineno && + dp->lineno < query->first_lineno) + return false; + if (query->last_lineno && + dp->lineno > query->last_lineno) + return false; + + return true; +} + static int ddebug_change(const struct ddebug_query *query, struct flag_settings *modifiers) { @@ -204,42 +250,7 @@ static int ddebug_change(const struct ddebug_query *qu= ery, for (i =3D 0; i < dt->num_ddebugs; i++) { struct _ddebug *dp =3D &dt->ddebugs[i]; =20 - /* match site against query-class */ - if (dp->class_id !=3D valid_class) - continue; - - /* match against the source filename */ - if (query->filename && - !match_wildcard(query->filename, dp->filename) && - !match_wildcard(query->filename, - kbasename(dp->filename)) && - !match_wildcard(query->filename, - trim_prefix(dp->filename))) - continue; - - /* match against the function */ - if (query->function && - !match_wildcard(query->function, dp->function)) - continue; - - /* match against the format */ - if (query->format) { - if (*query->format =3D=3D '^') { - char *p; - /* anchored search. match must be at beginning */ - p =3D strstr(dp->format, query->format+1); - if (p !=3D dp->format) - continue; - } else if (!strstr(dp->format, query->format)) - continue; - } - - /* match against the line number range */ - if (query->first_lineno && - dp->lineno < query->first_lineno) - continue; - if (query->last_lineno && - dp->lineno > query->last_lineno) + if (!ddebug_match_desc(query, dp, valid_class)) continue; =20 nfound++; --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07ADF3A6EF7 for ; Thu, 26 Mar 2026 18:54:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551281; cv=none; b=puDOw5n4A6Mf9qidry699nQ11u3rdhvOicX18M32qhoPMp6mmsED0WyLlWrOQPlS0Qlz+OmMIbmpD+fUqtedhdPSV1d241XCbPF5vqoKyNHZ4SeHYALwIIiPAGmcLk+rXTVZeWPprYTvHYzAq0zCQggxsvp1Ukk2DzNfn6djJ+8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551281; c=relaxed/simple; bh=+qoPaqFMZANZ5GO9HKrP/DwHGbD+bYFDH9gWrXYcZT4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o6lZ5EPZF9cpIoL1QFWKLV958RUKQT5VgV+ruX8talyy5ShVvClJFTYBSj2v9Gu17lHVonm9967b5DSdpf77cWj/HLWOV1QjDW/gOZlOvK/l3qc7VFKKhEZ2cZhyfCsHSE82Km5q+tSYcyeI8lO6Bq01AvQxLNvqpViVE9UD3YA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VBuSw/qX; arc=none smtp.client-ip=209.85.167.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VBuSw/qX" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-46704177543so884650b6e.2 for ; Thu, 26 Mar 2026 11:54:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551279; x=1775156079; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AAl9+PvQAj0gWNHtBaTmlj5ZgTYMrxMbOjBXxAyMQwA=; b=VBuSw/qXlQ5EgdCe4curR4WjgPpTH03zMgh9vaFsSLHyZSKLCkfgsGaB92IXxO7Fmh aZ2iRwwBPZzpLmK8AwQP3F7G2vwJfcapT4ydwlT9DBsnCxt4BWP4ECfIi+RGeoBozwWJ gAK7/xac+HqKo6RU5rCQ9VAHRBi/wlbc7aF6BzPdKDheaMnIuN54B/Rxsoqo76+uf5Cu KWmeZDvS8KhTtpvZVg/BMsPqSatkZfi80dfWHHP3f/jWEBN4ypFpeX34JNRH9d5aJNHI 4yjwIc8kvSI2n9UelB0apU7qCfLcAJ6uV2o7/ZLTBZ1cNet9vn/jRTSQLefl9QEXOq1U TT3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551279; x=1775156079; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AAl9+PvQAj0gWNHtBaTmlj5ZgTYMrxMbOjBXxAyMQwA=; b=o/WU2U29AYAx8967avkgeKAZWkyW69yM8A9o9VrJYnYpKu/X9nNk1ULlqhqgK534YL BXtGEfQljOxL+PPc+DGtpQOmRWwKeB+ny8RnJpmZ22OdT+2JY+4TSRL3+uW3Wuk2eAZR IXLnEHwGscEugkws1gPcLwSGLJ8v2dWP/nV/iB931gpqxRszP9temEN5l/mIMaP20Yg0 fUOyp0CHDHCu4kclQ6NM/E+IC+oRWBtocOlRTVDcZ/oa5A0PAcUhGDPuhw1gpg5d7q7b S5cdqXLERSeeZlKW4kqV6O5rWWtzXtyRChgMb1+217ejTTsw+GeLM1P0z3CDlgLcI28q ZHpg== X-Gm-Message-State: AOJu0Yxm1BBCb6etUV9ilF73Jj19LFXFpqqho9ddQOz/V/DMLR3tjYfe YE5lTWnpYyzJ7YrYffrc0g0B6Hn5uFtMlU/Z1RSzhXb50+S+fpkkAz++6dpJhA== X-Gm-Gg: ATEYQzx4kGLTCS1UZyoG2dhmCnG5G7NmKTxw7zk5grjSA3H9A/kAMG1CXAAWnqS/cHB U1+Ylh5hRZITEtRivt5RXvCyw49JLpZXLqgX1E8w8hrMhvmnw10Ia3nBqHeJDRyH8YrVXiH5OAO iojYhzQfCH7YoUuxTyvLv2+bfBFMEBRB0FT4F0IWuJKurFLzYzTTrndcFiiekMPl9e1PVV6F19v lsTJ6e2v06G1ZpZvfFRJ3gDME7JR2+fIZNNnCEsbRH2eHDyYVoRs32Yw+8yu4QLotOBaqsydM3S 4tOq0r+4wML7vvWQ/aMuyZy9BMsGPQd5hHU1dcCsljLaZPAWSVvpG9JGra4f3MQUnUgPAKLPpKP mqTLY+5nV9EzSFqGt8la4ZqlcC5xK2B99qY3CYhymyvMRRykvEFz9gGF5szQ841YU/YtP0EvCc0 o2shOjCngLNQswK+64nLTQ8Xh6zMm1uEJpX//gsD2WCnNpR5vUKeGRGpXj8iI= X-Received: by 2002:a05:6808:1a07:b0:467:1633:a1a6 with SMTP id 5614622812f47-46a5c6728ebmr4492539b6e.13.1774551278780; Thu, 26 Mar 2026 11:54:38 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:38 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 06/69] dyndbg: add stub macro for DECLARE_DYNDBG_CLASSMAP Date: Thu, 26 Mar 2026 12:53:10 -0600 Message-ID: <20260326185413.1205870-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the stub macro for !DYNAMIC_DEBUG builds, after moving the original macro-defn down under the big ifdef. Do it now so future changes have a cleaner starting point. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 43 ++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 05743900a116..a10adac8e8f0 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -93,27 +93,6 @@ struct ddebug_class_map { enum class_map_type map_type; }; =20 -/** - * DECLARE_DYNDBG_CLASSMAP - declare classnames known by a module - * @_var: a struct ddebug_class_map, passed to module_param_cb - * @_type: enum class_map_type, chooses bits/verbose, numeric/symbolic - * @_base: offset of 1st class-name. splits .class_id space - * @classes: class-names used to control class'd prdbgs - */ -#define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ - static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ - static struct ddebug_class_map __aligned(8) __used \ - __section("__dyndbg_classes") _var =3D { \ - .mod =3D THIS_MODULE, \ - .mod_name =3D KBUILD_MODNAME, \ - .base =3D _base, \ - .map_type =3D _maptype, \ - .length =3D NUM_TYPE_ARGS(char*, __VA_ARGS__), \ - .class_names =3D _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 { struct _ddebug *descs; @@ -138,6 +117,27 @@ struct ddebug_class_param { #if defined(CONFIG_DYNAMIC_DEBUG) || \ (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) =20 +/** + * DECLARE_DYNDBG_CLASSMAP - declare classnames known by a module + * @_var: a struct ddebug_class_map, passed to module_param_cb + * @_type: enum class_map_type, chooses bits/verbose, numeric/symbolic + * @_base: offset of 1st class-name. splits .class_id space + * @classes: class-names used to control class'd prdbgs + */ +#define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ + static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + static struct ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_classes") _var =3D { \ + .mod =3D THIS_MODULE, \ + .mod_name =3D KBUILD_MODNAME, \ + .base =3D _base, \ + .map_type =3D _maptype, \ + .length =3D NUM_TYPE_ARGS(char*, __VA_ARGS__), \ + .class_names =3D _var##_classnames, \ + } +#define NUM_TYPE_ARGS(eltype, ...) \ + (sizeof((eltype[]) {__VA_ARGS__}) / sizeof(eltype)) + extern __printf(2, 3) void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); =20 @@ -314,6 +314,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, =20 #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) #define DYNAMIC_DEBUG_BRANCH(descriptor) false +#define DECLARE_DYNDBG_CLASSMAP(...) =20 #define dynamic_pr_debug(fmt, ...) \ no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6575E3A5E86 for ; Thu, 26 Mar 2026 18:54:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551282; cv=none; b=A3YLbrgq6af2JGDLV9PSwD2PNTDnLGYnLlxrMjjlsUDNOc5uvSZokSq6q7XCuJwJ8+JnZ+JtIlA30n7sqLjqKs6MkeEEZk5rWhOeE/mbbUZySjAK5UvmkZ9jajrXrpXT+CdHKBAoEIfDyQX45rQynO/Fpzawy0Y/oyA98gDmhKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551282; c=relaxed/simple; bh=cyuCHdINxAxB3Q6Ll+XuNXFb67j/pcTpl5AcamKnQbE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JSFtKRURs/EVkqa1ZoBXP7JN3VBlGmQfb5KWeFCSONpxitwF+ZFlcx61V+icaYMs2cudczvORKfqJ31BBa4diovznfRIogmaeg80wyLhRot66TQRIjmFvoAEcd+XnnBUVg2bz6LvMIFlaM1HJ3xLEGOaBee4c4qACZtBf8e6BNk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MIRUqbHU; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MIRUqbHU" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-40423dbe98bso539461fac.2 for ; Thu, 26 Mar 2026 11:54:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551280; x=1775156080; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vld9IFfyvePqt5M1J9/OwioGOqjnLV2rFk+KzTunpXM=; b=MIRUqbHUZQcrIRnusxrRMvE+dq+lif+zxGJvbEPA8nEd/Aiy7AQuBO+fXZktg0x/hd Gew2ekvhh4ohNDKqIjyUzuLxvzRMzcJxZ9ID0ef0X61r9Jd4oQlSbHTJEkRRt/erFAZQ coG/AXWeBS0hyO6K2iFUXfWCG8VqsT1fxVA544NYmfWUSEZCbNLAwPfNL2XDcvSrPT4K ZjaeehBQTfQjxXn/pzJcIhQXoE2FyAsPiLAqF5RaEg3S9l85DVEmf44KY6JKCPJBnMjf dL1mroFG98jfg06qGNA5yAaJpSl62yNZwxoG8N1SFY0gC6obQk3fAfAp/9V2lgU76BoG vsgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551280; x=1775156080; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vld9IFfyvePqt5M1J9/OwioGOqjnLV2rFk+KzTunpXM=; b=rCXjb7IDX8E4R3dEQ13d30lpzgG2fmn9ls64xqsmzadChwkPO4PxGt241cZUhFwQL1 HEg+hdxfYlyCwzqa62qCJ1wq+F6RMX0iy9O15zDKsK0SJAyr9PVLQBOzKFmYjlEQw2Nd Nw8MTYDLuIvdwa2czlYRfG+y+/JBPFph1TBe9ozKlqq0cOAX3d2hOp8jQb65PZBZhHrO Ay/ICpGIekYa98giNyI2sN+bpquc4BQw65164ff+3MtRTA759OmkTDXheZHfBw0X5HRa 5U6PhHvdc2Hq8exAQeeuEj+IVpG17WjyuH7SnQsVWFXP+ts/uIzlcv+LkhMeSyKx6Iae RGOw== X-Gm-Message-State: AOJu0YwQOya3MxjX1Sw3wNYTXorInVxV5CEegHfrnbsKwzTnQoD/ueCB EGXeCE/KTFfPCO3VXlyP1GMIi8QTFzu4HYGjvi2qtKTK/16TV/4PjsZvuyKu5g== X-Gm-Gg: ATEYQzzoo4Rm2mtClgT32muERPVMdrh264EGw87FLMV59TRlVPNQ1l4dKF6VV+GsJTk EMzNxFW+lV54D38oOYVA5nm7zbEYlCa9V9ZAwqzy0eQiKpZ6A4ZDydc7KMaBCrj4648U7RpLdwT idTblRznqF/V/OVuY3vVWIMv4czQPIpTMviSMx2qMQgdFqTJYVncLZkSiz1S5Yp3k6LA0vD7f5M XjAQ+DWdKD1Kr7vI85AbuqR1J+rfS9Z0tTU8CsFeCX/yUSMbYrmSJh+2U8r86KDCOkKYWL6zA5x LcxyFCygNO/N7ffxsmnFaJT0kWA+ya4HzGorBn/rpHpbcbGWefGudmCAg4yIBIog1mP4aH4fsKx OHW5KXFwZwVxNUw22dr5NOCC+shEaQHb94gcDa9ua9ANqZ8eu3x/hUka1yvDa6cYI1S1dIQ7Fj0 cq7cafbCvo49UHUaG/gFaF3sE1aezp6aL6pibCjR+CLN8qHLBy X-Received: by 2002:a05:6870:2e93:b0:41c:b780:93c with SMTP id 586e51a60fabf-41cb780158emr4151613fac.8.1774551280220; Thu, 26 Mar 2026 11:54:40 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:39 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 07/69] docs/dyndbg: update examples \012 to \n Date: Thu, 26 Mar 2026 12:53:11 -0600 Message-ID: <20260326185413.1205870-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit 47ea6f99d06e ("dyndbg: use ESCAPE_SPACE for cat control") changed the control-file to display format strings with "\n" rather than "\012". Update the docs to match the new reality. Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 095a63892257..4b14d9fd0300 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -38,12 +38,12 @@ You can view the currently configured behaviour in the = *prdbg* catalog:: =20 :#> head -n7 /proc/dynamic_debug/control # filename:lineno [module]function flags format - init/main.c:1179 [main]initcall_blacklist =3D_ "blacklisting initcall %s= \012 - init/main.c:1218 [main]initcall_blacklisted =3D_ "initcall %s blackliste= d\012" - init/main.c:1424 [main]run_init_process =3D_ " with arguments:\012" - init/main.c:1426 [main]run_init_process =3D_ " %s\012" - init/main.c:1427 [main]run_init_process =3D_ " with environment:\012" - init/main.c:1429 [main]run_init_process =3D_ " %s\012" + init/main.c:1179 [main]initcall_blacklist =3D_ "blacklisting initcall %s= \n" + init/main.c:1218 [main]initcall_blacklisted =3D_ "initcall %s blackliste= d\n" + init/main.c:1424 [main]run_init_process =3D_ " with arguments:\n" + init/main.c:1426 [main]run_init_process =3D_ " %s\n" + init/main.c:1427 [main]run_init_process =3D_ " with environment:\n" + init/main.c:1429 [main]run_init_process =3D_ " %s\n" =20 The 3rd space-delimited column shows the current flags, preceded by a ``=3D`` for easy use with grep/cut. ``=3Dp`` shows enabled callsites. @@ -59,10 +59,10 @@ query/commands to the control file. Example:: =20 :#> ddcmd '-p; module main func run* +p' :#> grep =3Dp /proc/dynamic_debug/control - init/main.c:1424 [main]run_init_process =3Dp " with arguments:\012" - init/main.c:1426 [main]run_init_process =3Dp " %s\012" - init/main.c:1427 [main]run_init_process =3Dp " with environment:\012" - init/main.c:1429 [main]run_init_process =3Dp " %s\012" + init/main.c:1424 [main]run_init_process =3Dp " with arguments:\n" + init/main.c:1426 [main]run_init_process =3Dp " %s\n" + init/main.c:1427 [main]run_init_process =3Dp " with environment:\n" + init/main.c:1429 [main]run_init_process =3Dp " %s\n" =20 Error messages go to console/syslog:: =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 149B53A7582 for ; Thu, 26 Mar 2026 18:54:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551284; cv=none; b=YCwin2biba0QtxHeKSUxSUOqe8pn/FWHeZ03v0S0AAHJUaG8CXqaII6OhjniN0jFWQtmknJdPxzUF6Y4NRUYpCeuGox9zb9M4/LGJAMywwFOjY76DFqLra7MNIPhPbLNZgyGgDaak1FVm4DdotKMTw5I3ylI0qQiSkGvSGfc/UM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551284; c=relaxed/simple; bh=E1VF4T7M7c35q9Qypwa46ANAajyN9sx88/WRdouByGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WE9uz/xXs4C6map0oc1h7GolmgKf4+Q1isjEtu+qQEJP1NEQ6vH1aAWdudVbHdXTpOwFtKqR/shGu6ZfVI7rJrHTU32pImsTTRAWJmxb5PCPXHgiNNoIpb9PUVG35deRTSmxBpiEfWMyF8hg9jstM4TXag7aiy9gWrMOo8dk86Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XD6MAfku; arc=none smtp.client-ip=209.85.161.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XD6MAfku" Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-66f3e7d9eccso778706eaf.1 for ; Thu, 26 Mar 2026 11:54:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551282; x=1775156082; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4wIIBK2xLHmy9ZZczWpP2RzFmOx4bELZz7aMw+RGO2w=; b=XD6MAfkuFGX+r6gi9KDzBjorR9+yatBNuBBp8//2Kl758ErMCwSme8Vw97j4m2J1TW VqSCbxkF5V7ejKQjEpmtmBsLsRc4elw1hoLYFI5G7b1WA9l0vtT5fiqqhCB600VifB+c 68cBwFzzVBg1dgSLJqq3gsutZR2ogLIMPM0NZURgerBrdZPyLODUbKJM6HR0kX/tFO8c Jmfo99I60AtfhoxZrSCxTNkiFPCnHrsY/98+AWyCv9cimUPuMryG1n1Pi1+qYzzrYVf9 N0hI7W67KBaaA2eg9iTSGZEH+334nJagp2Y2A4Gx4+BGMPi6d0xdVwuO3AZHTgq9g44g 24Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551282; x=1775156082; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4wIIBK2xLHmy9ZZczWpP2RzFmOx4bELZz7aMw+RGO2w=; b=Q97wl7MShFE79Kfutx17r1nQylN+traxL+3CXxq6XTWQNESQtreH0QOLxKYSqif2t/ 5KnLUVI/2NwUOLZ5v0h5WbavFI4oco1THODSr0hpBeR1gLnCi958eX4ppHY6Y7j2FkrY MF9Y4Cqifm1RZu5bylULwQizSQDDGyrsvnGaqD6lwuAmC2r5LHZRzUcfn0kSKiI+RxTQ V1ELMBVjr5q+lcoN/DumsHr2yHEiTOwUMk7tURN8o1vXuZDSbIufdzum9gbNfW6/KuUW aIa95Cobt3WkqIoRhYSE0Sh7LDotb3mOuPhPAoQ1hSMTewbXfj8iVZZ1wPh6MHoXdCKz N68w== X-Gm-Message-State: AOJu0Yy/c1CYRPX5UsfTN5SkWOsc4V3Iy1i8ecNu7Yp1+mqpun5KlAVk hxhAuuis+Ms/K8G2eQm8gIMR7OgaYVK4NZ54AKBaq03pNdLCrZ0jvaMcuRl4ig== X-Gm-Gg: ATEYQzx4xWtT6MVYrbt9RUKHp5UJihO51Z3c4olzgmqKLK3/odm6oa2QMo/rue0ahHR vzN+gzKsNpzPLjpKhrm9q+rvIMvj2qr6IYACDC/9F+ZnbFJBCzprRc3N6C3Rpc7kLmyUo4ghzHJ 5XsSmvmu4spiNtaAZ2xiucBuua9/nWuYsnSRVLyoIMWtj0KkPwU66bX+rorFYVINl+BPjAW+cr8 W3lMV2VsYmltvmgrDD8HYVHpTsLa9TCHxLzcdffOpzHAoO981EnvfHCtgPKuaCCSV27duYFRx3l Hta1zK3+3iN4A2sqZ+gVqGcPepTRiv2+EspnPOEKx+2P80xPqSyLknhmkCyaq7okQH9igU0J+bG X/Wf30ReqWdKUiDSgrVDzWlZ6z35jlgCyPbEbf4XduCxRgnL62BJR9QB+NVPsrc0FF6e5byJY6q ou/2rQrOYaWGXIuzWvSmx7UXKVpJmt0oQAbCVW9Z9OgpK/Q9m7 X-Received: by 2002:a05:6820:174b:b0:67c:2af2:a66a with SMTP id 006d021491bc7-67dff37caf7mr4976746eaf.11.1774551281759; Thu, 26 Mar 2026 11:54:41 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:41 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-doc@vger.kernel.org Subject: [PATCH v12 08/69] docs/dyndbg: explain flags parse 1st Date: Thu, 26 Mar 2026 12:53:12 -0600 Message-ID: <20260326185413.1205870-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When writing queries to >control, flags are parsed 1st, since they are the only required field, 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. cc: linux-doc@vger.kernel.org Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 4b14d9fd0300..9c2f096ed1d8 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -109,10 +109,19 @@ The match-spec's select *prdbgs* from the catalog, up= on which to apply the flags-spec, all constraints are ANDed together. An absent keyword is the same as keyword "*". =20 - -A match specification is a keyword, which selects the attribute of -the callsite to be compared, and a value to compare against. Possible -keywords are::: +Note that since the match-spec can be empty, the flags are checked 1st, +then the pairs of keyword and value. 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 + +So a match-spec is a keyword, which selects the attribute of the +callsite to be compared, and a value to compare against. Possible +keywords are:: =20 match-spec ::=3D 'func' string | 'file' string | --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C4703A759F for ; Thu, 26 Mar 2026 18:54:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551285; cv=none; b=eCRJ9vIWDhOT5jAuowBa2D45agHkA2o8cNqxblanl/rn4ahDyNukVyc2sdS07spluN8TsTq5H3p2F28vfIXf9LVYanEGB6P6ak748dCY8ItfthAjciFKvunuh32CM+N15z8GOzavpOW9qEm6t8Jyka5AkH9sqgsrmbah0VguUsI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551285; c=relaxed/simple; bh=6qEnUlc0QW37ApD+4VV5gg8sRlLcSuU7c6UrMPZMZns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KDFEhxStfM8sY2OfIiqSV5mkKrZzIwQtr419VtWjs6FooeVLDbTiVswG3D8O/2HYZqEkYEnaWbtKUOHPzMzG4goE1MHol3ffD1WN47HS5sXHypEWxGg4Fw/XLUQrh94uUIQrhUGCZKcfdUHCSMYl0DfFdtyqps7KEL7NIhTrBN4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=G4okRFer; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G4okRFer" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-41c0aae84e5so969916fac.3 for ; Thu, 26 Mar 2026 11:54:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551283; x=1775156083; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R/SjSwC+RMF8YRDI51sil3K6xHtCNjZlX0uljPPVd8o=; b=G4okRFerHQlKToG4DisDiM+MjCdMEvFtbaehJRmTfjomCAcjKMGXtKwpuXv6xlygIH X2rcoqpFJt/TycUBG0HAq9etVktPDwTo6K3Yqx0+9u7w9w+I7MCrxenHAcAnTJZ39M/c HX/AY48HHNgHrb+j8ZvNrJej7lzNDvD2MiyDiocbW1xoej3Ds/6JFJM9meSxJEsACYgQ 0nu4pgvf4i7orPsdHPrphxzBWyz2AFiJUt6seiZRYASAwddQBkw8OuCyfPMSTysEFeJ9 L8nV9Z3sJXXEmaM7wr4SzIhm5PKYam8hgOAJ4IOt5+BNuZnxTIfXnVt1iizhbEONzI6F UB/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551283; x=1775156083; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R/SjSwC+RMF8YRDI51sil3K6xHtCNjZlX0uljPPVd8o=; b=aPfio+4hlUh/hUsud5kxxEnVRgr+Mdl0H4c4KO4t1RBqLwyryms5jy/B1Xxd2coRiV WaN/GA58XEh7mkbjL211GRCvdHvdWaMi586rg9xqQoCPI/btevcTqP9zgKZNQHohxvyA Ce3VwHIJCVbH+xQ1cff3P4tehHptcZEry+AsXcWkygZwYixdiuLF4nSRtUuD32FowqwD fFH5Gs9ySUMBeA5Wq57VrY3LxtNpBtr3xZH5GAv5YEc0P2kQd8LogrPh7CDXgQn5bpgO 2ebiFa4V4ACqbp70W9LdecCTl+Aizaa/Xnm1pj2NrGdXpQDN8murP1otyIrnWiCsdi1O 5t7w== X-Gm-Message-State: AOJu0Yz3t+vV37Cw703112BhIGAAModCuREyekrHrtPszfoXcora4FlH DRfYy6jU2X5CRzWEdpbhXteU3cZ9P99aGcfGleMWcH8+mlBo1Hb0C6vEQNQKBg== X-Gm-Gg: ATEYQzxu3Jz/dQRgaxChF8kvFkkKPGoGQrLYuDTnlHRAXIfvzcCgww+F0YhjShA66/S m4haylUrGGKALhNHggbXuOiJPjL82auI5gN4BQ8mbRSmqPatyG7FlPeM3sVT1AzhUNV3csT1Y7t eL+lyFBAD+df4pOOmhbtLmoRzRloA7N6qh+8IVF6Ug55uEnLrlxsqqaiSZ+jaNNNSP7dy3TA8Oq QwvIpiy0pHvSWj/g7KCkM50cQkS0HUshnNxNsTDzrOCB/xbbvg0Wki1Je2SxGlUeOPNyvLsANuZ z2HEvCSunMag1e4JY83jZqRFLufXPzkOX/UfU3vg44QLc18suRiDCIEDqW+CDkuXlsrZl38acqd QW5k68aE3FBmJuQvKOJJgGBTwhwEn2cNxQ4CIPBgBiaMSwVUU7oeYA8j9N3tExSXS2vZrQrjMCf eCo9dvbKuuNKDi3qLLc4Z/z9V2NsUtRFfa7u2DYqB2yT3SRFSA X-Received: by 2002:a05:6870:f28d:b0:417:c2d1:fc2b with SMTP id 586e51a60fabf-41ca6e86dcdmr4692709fac.21.1774551283268; Thu, 26 Mar 2026 11:54:43 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:42 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 09/69] test-dyndbg: fixup CLASSMAP usage error Date: Thu, 26 Mar 2026 12:53:13 -0600 Message-ID: <20260326185413.1205870-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit 6ea3bf466ac6 ("dyndbg: test DECLARE_DYNDBG_CLASSMAP, sysfs nodes") A closer look at test_dynamic_debug.ko logging output reveals a macro usage error: lib/test_dynamic_debug.c:105 [test_dynamic_debug]do_cats =3Dp "LOW msg\n" c= lass:MID lib/test_dynamic_debug.c:106 [test_dynamic_debug]do_cats =3Dp "MID msg\n" c= lass:HI lib/test_dynamic_debug.c:107 [test_dynamic_debug]do_cats =3D_ "HI msg\n" cl= ass unknown, _id:13 107 says: HI is unknown, and 105,106 have a LOW/MID and MID/HI skew. DECLARE_DYNDBG_CLASSMAP() _base arg must equal the enum's 1st value, in this case it was _base + 1. This leaves HI class un-selectable. NB: the macro could better validate its arguments. Reviewed-by: Louis Chauvet Tested-by: Louis Chauvet 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); =20 /* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 11, MID, HI }; +enum cat_disjoint_names { LOW =3D 10, MID, HI }; DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, = 10, "LOW", "MID", "HI"); DD_SYS_WRAP(disjoint_names, p); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F5043A782C for ; Thu, 26 Mar 2026 18:54:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551287; cv=none; b=H5VqLJG1m+gKmCYG43+rlxb7XgF4oncJcYyH6Qpz3+2iLAYwneZPgmRWGTSMdOtFnWGfdi7y55MPxzwmDT0q62T4rNPV0ts3sqx3MlEEXEgDtMusbD9u2BSRCtCVsHyQSGd1wNW0IyGDQLhS9d3k4p/0nSdDS0s2+awdKDsGdYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551287; c=relaxed/simple; bh=jvrncrmm4HxGPm4Djs0mIKZWZzF44X90wc3C8KMjy10=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UvUIbEprSthey0PWgEOVxTFm5BVKwA8G/s+PwHT+f+myMtaGnpd9C3ZBXjnFNBBob4dF/SKxeQ0QTfqCJaOsWgCzxLZpUFvCEFNI6MQf2xLycNOYTdRDxS/yneheTVyfwGU5WKUH3sN3ZO3uwGwwZ0kC0hHX2YZUpEY5OCdKUvU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=S8vAIR4d; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S8vAIR4d" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-409de4132b5so816040fac.1 for ; Thu, 26 Mar 2026 11:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551285; x=1775156085; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Q0sBYQSvT/W3L1mc7F8xF1oVUSz9OX/m/AEikTG2UrU=; b=S8vAIR4d50iw6BK6xCslMZuaM3hqsfnLmrXDP/vAgiCmK7Vy/SEIRcFydF1kRPKxOR h7ixIawblygIU0vrXVCSq1U4OL50+//H0pMBalgjpURwJWH4w7fAtOD7O60pr5WdIOH6 noSNJ1eDnXKrf5UmFZUEP1EKwrw6OfqtEpbKfN9hKSSqpmddr+PYreWEONv8KHqVCqCk H/yaGzQKkxigImxKLcCsyouOswN/dQjD6lsfRirZxvXe4f3JXY4lVEv5rZVUX76267oU w9oRCiRTWbvYdegcPYmh3V7usf6sYk5+JjKVml2f7DAd3E8m7sjCuVbqQgrryHWwGxso IH9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551285; x=1775156085; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Q0sBYQSvT/W3L1mc7F8xF1oVUSz9OX/m/AEikTG2UrU=; b=in6pY8KHo+B5TB1flAcrjucV0mQCXGczr81JDRE/iR5Otdx1PydSrBt+TNpwMFT8Rf eO+v8PE+oIoXZtTlpfLZl0O1TqqRwXjeezx6EqoFkNoMyZmkHRp+u5ES8nuBoeVMFdZ5 GteOZpZkT30qNgkhpalycNdJkFs+t2jOp9U1EX7HoFsjr3rGZrzF34AgeG96+98BJJ0P OOGbBUnGnsH08m4x+plWNAuHuoRVOdcOZNnGjcu85BGSQML3HAuC2/JFaXGTM3AZHuNI tGAJ5fNgqr04vgEAPeajUc8h8nSZQXVr7j8/O8OiWnmHiF98ZAPP7/OlhTyIaXn9E1Gu Tjcg== X-Gm-Message-State: AOJu0YypLuGHeotlQdsZy/zoA67NhjKL1wbDN7BIGfOfo0FB9eKCdTVY 8CoApJ+2VKISo4Fgo8KtIv4oJdAeoboHDQ7Vzy6Tmkz3XtUaw2oXLJNUuQv+9g== X-Gm-Gg: ATEYQzxnbcGshKaoq5cyg9FWwUGTGPkCMbBJNYV79eInknyA6drpkpPOJl6b7ik9Ozc PwJiqE2r5UVhdvalqmlfe/JWibOhMcjFF5/KNpg0bDY83FpaIKAId2CMgBbuxRYoYaTIeEVwDdi +JqcQGCRYaOxntskarulhuxqq6C3+INPye7n5aitqaYTB7tnMzwO7zHkaKJAlQJHF6S74K38hEQ SIRIwsoZcNVnDKK72PZWJ2ouZN+PH8ge+X4YZaILBurgnX3+XHZip4oECpyYQXln9Kv4TMZweS5 K04mSYsl723LXq6gpFV/yfdumg1ZZs6rXT/QxjMBCHOW8RKbRTmud/HytLGpqPxuBZF8B+uDx3D mdyz2xEyZBmtrm4rA4v59IVc3lBx7y2mny7nn8SjJMtOP5fLDy6sg0JNcja/6BPvsPZ7e/Twkyi viamd0KSjLfdGznzKBKXEiliAgmZL+pTv65+lloeYBaDTixuje/Bhfwhi2KZ8= X-Received: by 2002:a05:6870:20c:b0:417:2156:ffea with SMTP id 586e51a60fabf-41ca6fcb4f3mr4549318fac.13.1774551284964; Thu, 26 Mar 2026 11:54:44 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:44 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 10/69] dyndbg: reword "class unknown," to "class:_UNKNOWN_" Date: Thu, 26 Mar 2026 12:53:14 -0600 Message-ID: <20260326185413.1205870-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When a dyndbg classname is unknown to a kernel module (as before previous patch), the callsite is un-addressable via >control queries. The control-file displays this condition as "class unknown," currently. That spelling is sub-optimal/too-generic, so change it to "class:_UNKNOWN_" to loudly announce the erroneous situation, and to make it uniquely greppable. Reviewed-by: Louis Chauvet 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 6b1e983cfedc..a9caf84ddb22 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1166,7 +1166,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'); =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2B8F3A7F6E for ; Thu, 26 Mar 2026 18:54:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551289; cv=none; b=YNsktPHr29wtL3X7HfkZoAd6fM6twOp/cV6hzn+cQlBL/II0LYeLYuTpdgpy1hieC7ntnM5D7y2XhL+E4+nMCzbsxQ+jYyUtJ6aX9xsYW3hjSPfvKVxHchXaxK419TF19fb7HNpeQuPDlW60Yq8BjICtzFjbhbToLGif3lvSus8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551289; c=relaxed/simple; bh=nT2X+0ltTDZpc2Ke/Nts5WB2aC9+0FZsv4JIXPNa2T0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DX8w4QwCsxACEMNbe7cwKSmj/ii2gT6/hVgnC4BJI0i6adX2zKCD9Mnq015SXHL/t9CsrFa1+RtoM/qPORNE45flqsbz+2o5mWv8UdElReMUdvYGYQouBbMVyR5eAKvUmNXGrfxnC8rx4qfJ5SfFUR2eTWvOUVV6Z7walP+tBsg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XKB1zx2k; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XKB1zx2k" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-41576c5c01cso890807fac.3 for ; Thu, 26 Mar 2026 11:54:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551286; x=1775156086; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6DJe7q9AzKIA5JE9j9dS7BkLMe6yLjsp/ulkOtgleYM=; b=XKB1zx2kMPW93WrVNtCmYH0d9eWAcywiqswqOIt1bluU8LLOdeX0FBGYEuhbW+V9CY 0TznFWvKaoNHxJBwBanzM77p53DCwzilH6t8IAQQde+NfGAp4yLy239cueRQJ8YxX8m+ Em683GqOI7d+sMGT7355tct6drmoFWKg3TpCRY6TpwxkbOOCzIWj9LenknW0lI8WAXSa A77fqaX2IHMVqGOzu1bR7r1SuSSlsnNvOEdzUZte0W9wVhkwlDAdw0K94ACNs53TkrRd Xy8SbgrS1HkYQ40vjfiEBVJz82HuTTgLxxGLTVeVtT5iWm+as2oWZiUXY9WYu+pw9EmA SHxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551286; x=1775156086; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6DJe7q9AzKIA5JE9j9dS7BkLMe6yLjsp/ulkOtgleYM=; b=LYWbEoY5w752SyfVTDRujs1T6rY1PyTtYmRCIGXksjeRtEPvyEE63PpHV7MQ10z6Or wIrlOu4CMTNx2uwRiQ8uytlzJEbsILQmb05koDa4CARr2uDspau4904B4NorRXjGbBDw tc6lAEaXHzMkrVezQLzbzUQFzsJALt/4f6yAHSwQ7ZtJjN6QyzgzWXhxAhoQUWeSK6y/ Asf8ne8tibqYOY13T3UNE5Tn7xC9B9WdbaMwSgoVaiKYvOgBg3YUqWHwFXTyguEIbbHl 4ad6sU/vVQXytHZ4vVX8fmoXzNM/OdM2GnUqE7LUceDYcyI/I2IBT9+6+cH9uUP6rWSC DeWA== X-Gm-Message-State: AOJu0YznnziYSMbkkLqM3k8deleYC69t8s6HLLHd6ooFkFJuCpkw63it +ml4JiSZEVZNOI+yob5RwLCmuPxl02sFanOJXpEgWYGDkSr+kGvMKoRA3lbotg== X-Gm-Gg: ATEYQzxiclkVY7/b5sTFy05EanLQEDyvTmk+rzrwIhDRSwBLpH5lpWbKgxCRPM0mUKR cpcqgSq04ND39w7+0j8Ug1B1giWps91K88o8eZ868vPyaVHipRLLyTrUhyTbN07mETwPsNVbeVb wZvfq9edhMNlmUWjtCYp+dNDhUTCccDZwGMyviA8ry4mjncDJu8/t8l3O2n9vB4Qati7zha05pG B+zbWTS7n+FMg4yj2gVzVdqUhT1sEIRwjF6L4iT99GKm25Bmiq4zZTEOMxYY2gikkh3lduoJHY9 zHdSE+UGdPYLlmxF4GwooRh4uztAKYxeZ9GImxZ5TQMFlkhMOyX1K2uUmHkbgmTInwOmC/iNVw4 bMfkAOWmeDM0TotEU5J9lWayDcA9RnzdBXZrze3EpynExPjdmbRniWiDWIJ7dwchBVnSl0R5DtV MV2OLzdzYj77WWyZfjleVI8Zm8LrRKJD8ZXoK/Lkq4OXXR5AFf X-Received: by 2002:a05:6870:458c:b0:417:4c0a:1ff4 with SMTP id 586e51a60fabf-41ca6d15f6amr4828699fac.10.1774551286631; Thu, 26 Mar 2026 11:54:46 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:45 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 11/69] dyndbg: make ddebug_class_param union members same size Date: Thu, 26 Mar 2026 12:53:15 -0600 Message-ID: <20260326185413.1205870-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" struct ddebug_class_param keeps a ref to the state-storage of the param; make both class-types use the same unsigned long storage type. ISTM this is simpler and safer; it avoids an irrelevant difference, and if 2 users somehow get class-type mixed up (or refer to the wrong union member), at least they will both see the same value. Reviewed-by: Louis Chauvet 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 a10adac8e8f0..441305277914 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -104,7 +104,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 a9caf84ddb22..ffa1cf7c2c72 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -811,7 +811,7 @@ int param_get_dyndbg_classes(char *buffer, const struct= kernel_param *kp) =20 case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: - return scnprintf(buffer, PAGE_SIZE, "%d\n", *dcp->lvl); + return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: return -1; } --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 568073A8741 for ; Thu, 26 Mar 2026 18:54:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551290; cv=none; b=J4RSkE+IdspJczVUq57PGP3bgj+RHAdaKxE+tHfFh8Wa31Ac+F27h1BvAXb4joXzflbz6u9AolsWy6VERbO+m02dUxTmBHk5Mcrwg4n7w3/DEopofkBXRb2ZHDQj5FaiPbXbu2nJerKmHTtLOx+fmORrHhTllOfN34Ghncp/G4g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551290; c=relaxed/simple; bh=SLkxALPzv5MuO/ZLVMcQnhi3lAgSVUDUGPYbYC6Snk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iuLTnHyro3ly/WXhnBb3r+n/MQ57pdU1Ca0CCn6mjIBfYrvB+58odXtPVpsENh7dyo0Okk6uKSS5T2JrLCB2LAVB1qAQsIUBZWRy03zcFeyGn+L5sgcHjC6cxqjqqftmz9PJV5tAEj7oUUG+kfa7zxN57/PhYZtAdLwJ9Y7msaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GUWOqVEO; arc=none smtp.client-ip=209.85.210.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GUWOqVEO" Received: by mail-ot1-f51.google.com with SMTP id 46e09a7af769-7d4be94eeacso1183160a34.2 for ; Thu, 26 Mar 2026 11:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551288; x=1775156088; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=q4prZoq+o67W5OQsgLrKexlAzQC80y9w+24uEfnXM5Y=; b=GUWOqVEOwnZyY2AF4JIUHIlX4Swhymo863qznyqxnq8SA867yl6wbAlAtFFzIoy4QV xg4BO8Ie+Al0LmjsgKmF4cOnbV9vqxLEpI6N7MCAsHDO+Spm17DjVRY2LUi1dmZQ1U6O lkdmXexqy+9S2p0nyRVwqwgNn8/gfwNQ8KTFNYmp0T0ctL2bQ1nmH2YWQK7rRJrP0jld 0NmyhKlfBiufIITwk/M/QzDb7LCcoAX0F3HWyb0bSXSGDPUawasRJUBLnKFQZCgzbKvP 9AOnPKD9eZRK5/YD/MkWfKd3OiVirn6H1gsfqN/BruSXiIu8ofQQV85LbkZfrvHBec+r KDSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551288; x=1775156088; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=q4prZoq+o67W5OQsgLrKexlAzQC80y9w+24uEfnXM5Y=; b=aAjJ2Ksf2dKh9MSNvNg+tDco7B35Ep+JGaX489GqTjoxx8qeluh0tQrmPXJmIVlzGE OlERyFiBe4ov4UeoJzZozGxkBd1XvEJP6VnwD4ddc/c+OEfLBlMcYCfxAREYDSFj/HX+ Ii038yLuVuRIs8lk8XzrHvehQhRCuzJQgTJTQFbFlz47/hXcIgV8EZma77P2KR/c7K8j faao3FYyaMEw7XJDPrur/0l2zzXNcaoJv0pY2c/FU5d+81tbAokBCX1ANJqpNMQ2AuP/ vPHvDD2s2ga7auPRLeLkO0Xa5HQMyJqv/lPHwbgCmkfI0Row5vsktTDDWNlLjZeSvz/4 agEg== X-Gm-Message-State: AOJu0YxxRsqvYfNy9ih51spfXpuIGti4iCa8JMr7xnxLlpPOBRgSicfb Qmz/BNBJPaAk3GHckPbTPeoAJAvryu1TqG1patJSZXjRgW6tgTrpjNtze28Cdg== X-Gm-Gg: ATEYQzzDIqSwXjxByCxj03lM6S8E7wiH4gaDW9tl5/8Wg4She9mAEYsBKCGQOajKKwf UM072s/FTonxEbyBkKUm7naY/+9eQom3XN8vHadj6Hw04+kR+GUTYYNnInyjEg13ptBpChJXber Cv/uS67dA/rdEjq5UdkxWupD9EGi1Fp9hVLVhXGkZ4+nmgIqe4BVVONdOD3hCdNYmwyGMURgEM7 UpIBYzAs1P/aduxGsgITy11vjxUATVutUSDRhZyybFkrrzz9Dxj7L1ben+etXoF1f4/2KlMDpV2 SUhA2joi0bnwk1a1hUk9iwI7CrrZgEpyWl1R0m3B1xFUgZoh2pubo8QINV+MykbFm+MU7rr+yhA C9B9npLTTFaEFbi2IXHSB5+p7Z5EUpCdfGEIXaIz9uom+5w8RGDPHuPpLwuyk8jMOMaHEg3Zh5J HytktNAfUHBSel0gJdwtBGBQd8I1LTouh9qXXZsd+ntuM7gRdS X-Received: by 2002:a05:6820:1893:b0:67d:b2f2:6e72 with SMTP id 006d021491bc7-67dff3ce6efmr4416641eaf.13.1774551288030; Thu, 26 Mar 2026 11:54:48 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:47 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 12/69] dyndbg: drop NUM_TYPE_ARRAY Date: Thu, 26 Mar 2026 12:53:16 -0600 Message-ID: <20260326185413.1205870-13-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ARRAY_SIZE works here, since array decl is complete. no functional change Reviewed-by: Louis Chauvet 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 441305277914..92627a03b4d1 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -132,11 +132,9 @@ struct ddebug_class_param { .mod_name =3D KBUILD_MODNAME, \ .base =3D _base, \ .map_type =3D _maptype, \ - .length =3D NUM_TYPE_ARGS(char*, __VA_ARGS__), \ + .length =3D ARRAY_SIZE(_var##_classnames), \ .class_names =3D _var##_classnames, \ } -#define NUM_TYPE_ARGS(eltype, ...) \ - (sizeof((eltype[]) {__VA_ARGS__}) / sizeof(eltype)) =20 extern __printf(2, 3) void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D33433A8735 for ; Thu, 26 Mar 2026 18:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551292; cv=none; b=SlOsfr//WrWGaDkGLAXcFZI0egNzEklkv4w0F/KBANosyuTgCKi6NTHFGjAYpJfFyas1bOQHMR9EbhhrsURdZox0DVEDSJoAhxOMsNGTuIUrwZtmj4m/K99ezhO83BwQj2m6FgPg0zI7Duf48n+fVu0sn5uM4nWBrz3qa0/g1ek= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551292; c=relaxed/simple; bh=A7NW1lcioeZvkxFMDB5jn7b/13wAFRirdZ/+LAy3Fqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aclxo8UEnu172g3bauTtn/AoMsHb/VTGCkas0CpodAuK13tv4xqaM8w5ltfn2RXpTMHKLszjZM3tGSQMJfCqURm7Hd44Y44q5yUWOgeg/IzODILuYQvLf/B7QhQY8/Be+sEjmWs4q34UuELOU4tmO65noKZJkQjQRb2B2poc9no= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qSHCVVvR; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qSHCVVvR" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-40946982a78so511382fac.2 for ; Thu, 26 Mar 2026 11:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551290; x=1775156090; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z18RPkW2IZoeg5aoWLW/CvDoUPtyLf/KFWO8hAB/+ds=; b=qSHCVVvRo2VjGfT53eK+ZbSV3FXp8zBHm8JQEi8/Q65yisOGZMxBC3iXnY6AHBqP6R gIrZUWlWC9nWKHkeTyjam5XdoqbCajy0Gk9e7XSJZcXa7XiSabaLORtKjV7gGSuNWdj3 Zfygb/EuPMqDOwaXncbLo1SY/rL8PHH6bDNNUTfc7H9gC3fm5PFl6UTXp+EN073+g5Yr rpvTVKcPCqGe9P/C3E/EWfN5ZfzNMbkGZOc7thXCs/qbHIA3ygd3+td6nAxTmv5+XGPe NHjmxiROKk904gEQphaBLzzDzkykSvXjZiZsLhy1NVQl7uOe3cDMHo8+6tqRKumADSPI sTvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551290; x=1775156090; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=z18RPkW2IZoeg5aoWLW/CvDoUPtyLf/KFWO8hAB/+ds=; b=b/0scbMEaPDgMUokG6NyBFtjDGKnHXAyWuAi8jtSXA2ofYoYGHDWnnI3BxhknmtCGQ Q2r/HcgekBcr86QvrQGT3oHUQMtCmE2zsRchYx7SkwVtuaXkzpo+hbw404khaz38wLJO uGGz6YZQ/8i8oFNSHQJZagJ0GmTUAjicBBiyEgHiGQRG2VLa34fhGb16UQIZq+kYXZAC c1Ct5pOqAtWvb5ZpOy6zc9Ks5UDastou0Xb2NU3RCl0hoNa7z2aYuWAQmeWBkTTG3gKW B3RvQ8pSYINKWfvA+UTbSq5YHYkjohpbbdIoADwGanEJwjf0rLFAQ3XJg8HVl6YLEvti /x2g== X-Gm-Message-State: AOJu0Yys4NJ0ygX1C49fVSs+hKQuVqP2453603y3ADr+jxwB32R8hbOs 0xhHnYB6V3QSmwN0CDHfkKjLw4eEqdCXJk8pPsF6aVHFUqzK1W1Jw9zKqcWR5Q== X-Gm-Gg: ATEYQzxln5GbyozyQJyMj1MzPfwHVVUQC2XsaQsJhmv0zvWixM+/T9UWQKhqDHilVpc gFAThijl7oi2EjQjPsEZZKTWdJT5w7O4BkT4cb1icgbNWTm7diZ83jtziErOaB4pkftK0BKO0DI btI+KMYxOKrMfExVfVxKyKzZ1SUZppy+m3EDRqxOxzr4QqLyHC84TG4kfiO+SbYVTSq+HiIKtCs zK2ouHOZHdY4z46y0l3Q2mhOUFLZvALGxP1aTg2TJezn2BX7cUoiO9Ra09W37A5fPJ+pW3HKJF2 pdrbOLyip+AVq7DIoQKb7/PGbuNztq24VGhH1iSIBRdN5jUhMKngDTkSchSkLN0Nu/T1ngApzZC 2vfi3bZN+6+AOlj94YrCQY1952TYphIzLCDoetm5/7kU11O5voKV6Gk0eNmVEBIsaOfqmLFdegz ZpRl58ZyRhYUcy30k52wFfQu10XXlOh0qD68knaKIs4ncPzetjhQgAcHThULA= X-Received: by 2002:a05:6870:e6c4:b0:417:5d13:2bdc with SMTP id 586e51a60fabf-41ca718019amr4930535fac.51.1774551289656; Thu, 26 Mar 2026 11:54:49 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:48 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 13/69] dyndbg: tweak pr_fmt to avoid expansion conflicts Date: Thu, 26 Mar 2026 12:53:17 -0600 Message-ID: <20260326185413.1205870-14-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Disambiguate pr_fmt(fmt) arg, by changing it to _FMT_, to avoid naming confusion with many later macros also using that argname. no functional change Reviewed-by: Louis Chauvet 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 ffa1cf7c2c72..9575b92a8deb 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -11,7 +11,7 @@ * Copyright (C) 2013 Du, Changbin */ =20 -#define pr_fmt(fmt) "dyndbg: " fmt +#define pr_fmt(_FMT_) "dyndbg: " _FMT_ =20 #include #include --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A57DD3AA50E for ; Thu, 26 Mar 2026 18:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551294; cv=none; b=lUeMcS68VYKsK3GG9l7g5U65/8AG66/LCbWJ0DdQyN9DVFAAZH0d42/lomNkJs/Nos6Y4G/l1O0u5c+M/82hiWn/fnxKcXz/5x0BlHnukrTA3agQs/1K4L/JILenhp4vlVCoh8prLk0cAvCGH+V5q/AN6kMRoCz6gKmuMMIUqyc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551294; c=relaxed/simple; bh=S6gUrn6AElwN551VfXZR8sAzEWfpnwUQMkcCkNtZGhE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VR3W6oOpKN7/juefeooElgHZNSOqpU3X12GeBwUlTAiNbP1SRluJ6iPCPHr3pbY91r3EVCoiaZvRqxHvcL6u/+Jn5uIZwvNtKciiMMiOmRO20sbiCooUpqLAm0Z6TEYPS3kOTuWWDMA0gOeeyvQUpr5nyPLSyrR8qofOwXwAuLQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eGA7D/nq; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eGA7D/nq" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-4043b909ed4so844140fac.3 for ; Thu, 26 Mar 2026 11:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551291; x=1775156091; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sNdSdlXltBKavjCpq8HaVo39jGQFAT2gyMj0g9RRu6w=; b=eGA7D/nqr0yFBSOYMlcL+Oq8QMo41opDt0KKp7XBPrqtYwYdB8M8/OBz4QehMJJcLs paQO3GnItCCSwWvJ/XiXzLNv/hZ+NeYb5hRXfmYQN5uTiKRvoYUiuwUZnv/HQBqaN5G2 ajmvQFBcpAbrzH2+juFveoLLRdZbVGyD5vvws/DW+kbXWwIJJAuxE9RdhjgiY/kh1ypM mIVTjkXYeLwtM95xy1srdELROAYHhgu5g1WDbIzA/Nk3aWJZWpnSN2iDEjloxDMqW7IU UTidjru2ru8xjft1IYZloYNXhgdTGNI/QgClBv+cXuhURu0gETEo0xlPTtixFAl1UMJo 1ibQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551291; x=1775156091; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=sNdSdlXltBKavjCpq8HaVo39jGQFAT2gyMj0g9RRu6w=; b=DqQCcpp55vWgtPZusStONb3PG/13nX1XqHVJxiWwWAdGM+HHuORWsdjJoBv5CjHAQL GZeDyCtJP8/Wl9WWB+Y6Hm8QZV1ecNnPCsNnAv82mkt8fQCpI+VWgsrYLfkGAb5fXNHb xLbb0TB1+Ci8SEQLgC70NNG4uv4Ffnuc0+5ycgu0TSigwRTS/MDH5mcZmADC5fTWRbz/ FGANm1g3zX6U5FyVZUebmaQUbGqEuoPiW+yHcBMj3SVgeSthVNNsIEQok3AyLwSvLu1K kb/XBsMw7G+O/TzC4LMkc4QFvQLfpBr7CFMg6O/gTknxnEUmLHZaNb29dshTC92wN8WW ofQA== X-Gm-Message-State: AOJu0YwE26qbtPuq6cfKTebVsAYNQac5hHSb5R9/SKa4U/nyLTGMKnxn 8sTXxJT9c2DvMwDhInRhkHUACBW+ZrcsO46X20yLoVkIS+Oo6mKBZp0SQBKx8A== X-Gm-Gg: ATEYQzwnIpkeV+mb7YvxvMm7BuS1bYNLCbHUQruMZwW6vA/do9nbskzV5PUG25R1fQi +RC+CDN5nypyynoPHi3Bdgk5A3t8Rtq6y9qLXAy0XsYo6bzOKMkDCrITXX6Acc5oQBC/U697AoZ L5KOiOfYanZGaWP69PfQFUY2ghtkcWRx5F7IbPDxy1EUJljrItyarOlzXtlYamp8wA8m31xaMXR VYY0ffetK28vObsRI4WD1/e6pJ82aEbErnIbYkcRWFDoOOeEa/DnRdz5ygVDgwFWlR/BdkffcnP PyjovuXVJXAiY9gRfzW08lp8ISQ3ksDomRcGfbhnPbMEcuZA1WtBkIMSmttuW9eUUPt1Cn5Vg15 R1/eDkhBUBOpNBbEYkJ7kmIu1WQ6QT6GKfmEFY1XnLj5u5gPrOS0AvfpsHiNTt/5wqz4e8iwDAK fl87WxZ5aY9/eNBOP0ODJSg9NxNU5FUhUwVz6zxUAVRFtKCxWnZo/TvrcHl44= X-Received: by 2002:a05:6871:520d:b0:41c:47b7:1f24 with SMTP id 586e51a60fabf-41ca6e37d7cmr4505067fac.21.1774551291322; Thu, 26 Mar 2026 11:54:51 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:50 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 14/69] dyndbg: reduce verbose/debug clutter Date: Thu, 26 Mar 2026 12:53:18 -0600 Message-ID: <20260326185413.1205870-15-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" currently, for verbose=3D3, these are logged (blank lines for clarity): dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op=3D'+' dyndbg: flags=3D0x1 dyndbg: *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: parsed: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0 c= lass=3D... dyndbg: no matches for query dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... dyndbg: processed 1 queries, with 0 matches, 0 errs That is excessive, so this patch: - shrinks 3 lines of 2nd stanza to single line - drops 1st 2 lines of 3rd stanza 3rd line is like 1st, with result, not procedure. 2nd line is just status, retold in 4th, with more info. New output: dyndbg: query 0: "class DRM_UT_CORE +p" mod:* dyndbg: split into words: "class" "DRM_UT_CORE" "+p" dyndbg: op=3D'+' flags=3D0x1 *flagsp=3D0x1 *maskp=3D0xffffffff dyndbg: no-match: func=3D"" file=3D"" module=3D"" format=3D"" lineno=3D0-0= class=3D... dyndbg: processed 1 queries, with 0 matches, 0 errs Also reduce verbose=3D3 messages in ddebug_add_module 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 Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 9575b92a8deb..3ae9ecabdad1 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -276,9 +276,6 @@ static int ddebug_change(const struct ddebug_query *que= ry, } mutex_unlock(&ddebug_lock); =20 - if (!nfound && verbose) - pr_info("no matches for query\n"); - return nfound; } =20 @@ -511,7 +508,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) pr_err("bad flag-op %c, at start of %s\n", *str, str); return -EINVAL; } - v3pr_info("op=3D'%c'\n", op); =20 for (; *str ; ++str) { for (i =3D ARRAY_SIZE(opt_array) - 1; i >=3D 0; i--) { @@ -525,7 +521,6 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) return -EINVAL; } } - v3pr_info("flags=3D0x%x\n", modifiers->flags); =20 /* calculate final flags, mask based upon op */ switch (op) { @@ -541,7 +536,7 @@ static int ddebug_parse_flags(const char *str, struct f= lag_settings *modifiers) modifiers->flags =3D 0; break; } - v3pr_info("*flagsp=3D0x%x *maskp=3D0x%x\n", modifiers->flags, modifiers->= mask); + v3pr_info("op=3D'%c' flags=3D0x%x maskp=3D0x%x\n", op, modifiers->flags, = modifiers->mask); =20 return 0; } @@ -551,7 +546,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) struct flag_settings modifiers =3D {}; struct ddebug_query query =3D {}; #define MAXWORDS 9 - int nwords, nfound; + int nwords; char *words[MAXWORDS]; =20 nwords =3D ddebug_tokenize(query_string, words, MAXWORDS); @@ -569,10 +564,7 @@ static int ddebug_exec_query(char *query_string, const= char *modname) return -EINVAL; } /* actually go and implement the change */ - nfound =3D ddebug_change(&query, &modifiers); - vpr_info_dq(&query, nfound ? "applied" : "no-match"); - - return nfound; + return ddebug_change(&query, &modifiers); } =20 /* handle multiple queries in query string, continue on error, return @@ -1246,11 +1238,10 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) { struct ddebug_table *dt; =20 - v3pr_info("add-module: %s.%d sites\n", modname, di->num_descs); - if (!di->num_descs) { - v3pr_info(" skip %s\n", modname); + if (!di->num_descs) return 0; - } + + v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); =20 dt =3D kzalloc_obj(*dt); if (dt =3D=3D NULL) { --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E9DAB3AB280 for ; Thu, 26 Mar 2026 18:54:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551295; cv=none; b=qG3da3K/9dcJts3/3VUBVL9LUh4QDnXzALJ/5HnRv7oiumQoYHn8fum8QnusQqXxNn3AIhnEy+yDSfihSshF2WHry6S8yIRLITtoHT82AtBuNQPc6oTlyRDfWwCKtJxTWPtc4SsWMZrUp4wES6Iqg6kG+bbpJrx3FaJjKqucimw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551295; c=relaxed/simple; bh=SoyzrIXTJl0zhkZLXioIJtb1P9eJp/0gNMCq5+HdwEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zftj0ZVGcSY4q8xnP5ufE+Rhx8koECss9U/J3JEsNhvoS5alzYE20vrZCCdCZ/Z+ToJiliz0Ov+4Y2izBcSEfc+9QLinzmnjbvNit+QyJ8QFNw5MSOqCGqbOuU3S7hr8ZgHkvv3Qo1F0GGSmOzJ1MnwOIpbNFBpHn/vY9jDfIoU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HnWz6zGr; arc=none smtp.client-ip=209.85.167.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HnWz6zGr" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-46808125c65so494403b6e.2 for ; Thu, 26 Mar 2026 11:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551293; x=1775156093; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pjtw7mSJYIyVbZmpiBkB/+QzGUfrkH1ZfSuml/KOt4o=; b=HnWz6zGrn5YRQvxCsDUTFp1VVOiFVPXKKMtYdyxYkaF990+3MohdithWfDom245Dn0 ib5c517zoISUSMlfrxbSNA1IRV5STlGdnCVjLVQ8gKYdpDTOoUjyMyVD/rrd3LSYNOMw 4q0WiHcFY+kez2RIYOGEDFCyk8mRPLnXVerqctEy6QUGlw1vSn7IFetIn9ljZo79yfo1 Ny3wUUoRglZQyoHjK8X3fo2AnJ8WYu4IECxG0xRP7JC6K2DmQHP68NP0yBsyW03f0hXe YKg/BH5+fNbrJWInABAPuM95ITPAXvqSPPzRDjSv1ahh0Epg/EtAIq1+3sSekzu1r5ZY KbmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551293; x=1775156093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pjtw7mSJYIyVbZmpiBkB/+QzGUfrkH1ZfSuml/KOt4o=; b=MR2PwpoYhzHgQSt86pm7PFFEXRcbYUoudgEAQh6b6KHvOGFGA2ZW/EDID1Q8ofxG+s o0wBsIsSCkrVIXMZ48qjXANDIZQBwRZZkoW9XLot1JJyyj0tGP+mZ2kSXlrP+HLYUWVU pen+ZXnduS/zRwuFHS7GZ2soGj7BNsGBe71gTvXE41aKe2jWzRSzw1kAZFxN2QtanpgZ Ang+2rAGFlYhWG4xI/BPDSyTcFDZsUeOYPqUsYAR3ylQJKdnXtaCq0KFAlIuGoPqNS4B FUqZkdLZLdazLjLgn51jAUHcqiIL0QKgVb14gXxHm6ovBELB/V3VAI6ybbV5gLBs9DyA VeaQ== X-Gm-Message-State: AOJu0YwEI6R3CMN5SzwfGiLupXxWQChGf2bevznt2oxcjVQoI54k3OC6 V+ExyvS8TmgVOZor7TxtCny3IF1CybHrKrbNoDYZkn5jIa7DXkL+td8iLGRUtA== X-Gm-Gg: ATEYQzx5v3jHj5y3ktYeUk3aesFcgluY4BltZU2jVvIcKDles2ZaaAbv6RkigrbBuWl rWtnjbfWt0dCoEVKxbtm96Bc2VGC7N0EWVvKFtErDEVYjGh/eUa50EOtG4Bg2zScNeBbJrvPn2k 6q39OV8eQdR/Q19+ns5FkYwriMe98OQMw2RvO+FoTfBHlwUNydXFQDKAKgwBc+bSbDO0Arob3/g vexbM7p9L9Tt42VgkYcgzF8izySwRapofukyJghtOv9wIWs50PyIHk2fy7gnAdyvL8sqrPuHdfm XhN0KVw0Uoab7+ZA7zwmClT8sWcqpd1gGB1ekv0u2sQlfVgTbnm7wwAMYptHHXVMoiAZETyhoHW /xs4jwumqrPHiRC0/PivDLbrnmj4Z0hsKLAvrTACs/U+gBn9yJpdPKUvY/KOelGCUNHS01/LFZt jRF4904Zk3KPc0UucmdYepoqXN1gjHCXI8BxIuHIcyBhh6/04j X-Received: by 2002:a05:6808:398e:b0:468:48d:8075 with SMTP id 5614622812f47-46a5c5783b1mr4231843b6e.8.1774551292717; Thu, 26 Mar 2026 11:54:52 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:52 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 15/69] dyndbg: refactor param_set_dyndbg_classes and below Date: Thu, 26 Mar 2026 12:53:19 -0600 Message-ID: <20260326185413.1205870-16-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Refactor callchain below param_set_dyndbg_classes(1) to allow mod-name specific settings. Split (1) into upper/lower fns, adding modname param to lower, and passing NULL in from upper. Below that, add the same param to ddebug_apply_class_bitmap(), and pass it thru to _ddebug_queries(), replacing NULL with the param. This allows the callchain to update the classmap in just one module, vs just all as currently done. While the sysfs param is unlikely to ever update just one module, the callchain will be used for modprobe handling, which should update only that just-probed module. In ddebug_apply_class_bitmap(), also check for actual changes to the bits before announcing them, to declutter logs. No functional change. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 65 ++++++++++++++++++++++++++++----------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 3ae9ecabdad1..4313c8803007 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -605,9 +605,10 @@ static int ddebug_exec_queries(char *query, const char= *modname) return nfound; } =20 -/* apply a new bitmap to the sys-knob's current bit-state */ +/* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits) + unsigned long *new_bits, unsigned long *old_bits, + const char *query_modname) { #define QUERY_SIZE 128 char query[QUERY_SIZE]; @@ -615,7 +616,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, int matches =3D 0; int bi, ct; =20 - v2pr_info("apply: 0x%lx to: 0x%lx\n", *new_bits, *old_bits); + if (*new_bits !=3D *old_bits) + v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) @@ -624,12 +627,16 @@ static int ddebug_apply_class_bitmap(const struct dde= bug_class_param *dcp, snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], test_bit(bi, new_bits) ? '+' : '-', dcp->flags); =20 - ct =3D ddebug_exec_queries(query, NULL); + ct =3D ddebug_exec_queries(query, query_modname); matches +=3D ct; =20 v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } + if (*new_bits !=3D *old_bits) + v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, + *old_bits, query_modname ?: "'*'"); + return matches; } =20 @@ -684,7 +691,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); *dcp->bits =3D curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -694,7 +701,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -708,18 +715,9 @@ static int param_set_dyndbg_classnames(const char *ins= tr, const struct kernel_pa return 0; } =20 -/** - * param_set_dyndbg_classes - class FOO >control - * @instr: string echo>d to sysfs, input depends on map_type - * @kp: kp->arg has state: bits/lvl, map, map_type - * - * Enable/disable prdbgs by their class, as given in the arguments to - * DECLARE_DYNDBG_CLASSMAP. For LEVEL map-types, enforce relative - * levels by bitpos. - * - * Returns: 0 or <0 if error. - */ -int param_set_dyndbg_classes(const char *instr, const struct kernel_param = *kp) +static int param_set_dyndbg_module_classes(const char *instr, + const struct kernel_param *kp, + const char *mod_name) { const struct ddebug_class_param *dcp =3D kp->arg; const struct ddebug_class_map *map =3D dcp->map; @@ -756,8 +754,8 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); inrep &=3D CLASSMAP_BITMASK(map->length); } - v2pr_info("bits:%lx > %s\n", inrep, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits); + v2pr_info("bits:0x%lx > %s.%s\n", inrep, mod_name ?: "*", KP_NAME(kp)); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, mod_name); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -770,7 +768,7 @@ int param_set_dyndbg_classes(const char *instr, const s= truct kernel_param *kp) old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, mod_name= ); *dcp->lvl =3D inrep; break; default: @@ -779,16 +777,33 @@ 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 - classmap kparam setter + * @instr: string echo>d to sysfs, input depends on map_type + * @kp: kp->arg has state: bits/lvl, map, map_type + * + * enable/disable all class'd pr_debugs in the classmap. For LEVEL + * map-types, enforce * relative levels by bitpos. + * + * Returns: 0 or <0 if error. + */ +int param_set_dyndbg_classes(const char *instr, const struct kernel_param = *kp) +{ + return param_set_dyndbg_module_classes(instr, kp, NULL); +} EXPORT_SYMBOL(param_set_dyndbg_classes); =20 /** - * param_get_dyndbg_classes - classes reader + * param_get_dyndbg_classes - classmap kparam getter * @buffer: string description of controlled bits -> classes * @kp: kp->arg has state: bits, map * - * Reads last written state, underlying prdbg state may have been - * altered by direct >control. Displays 0x for DISJOINT, 0-N for - * LEVEL Returns: #chars written or <0 on error + * Reads last written state, underlying pr_debug states may have been + * altered by direct >control. Displays 0x for DISJOINT classmap + * types, 0-N for LEVEL types. + * + * Returns: ct of chars written or <0 on error */ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp) { --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8257A3A6EE1 for ; Thu, 26 Mar 2026 18:54:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551296; cv=none; b=k/2CPBvM4D8O0Y7wavtzWgbYXt+XbbnKHn9IEJBltWSUSj3yPlAJcu+G0gCIUSIc4n1b4oToXkHCh3y44t42EL5tq9KMCFPhTNdSY7EfRV2P8LKseERtXh3B21AnPU0yYsCblgZCXMSwVXMORGDWIb/rFOhORzraQKbC2POVObg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551296; c=relaxed/simple; bh=PBAFi7y3YRuwq9TlfBtroorgB24BQAwGr2rvA4abp3A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OHen1COIXftWQGUOahmRJuBUr6lKIj9f1I9t6Fz4C3drXv2lMxQbbvpk5VJYaXyehMzSIjACImjE8yLt158MhlXSVpj59YAiaVIcepKZ1q+Zd0AueTbiWqh7ssOF2Y3MfyuZxyVaY1kBajmbtYCHvwoNmf0fCD5b6uZ4PK1fAL8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PcPUiRc2; arc=none smtp.client-ip=209.85.161.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PcPUiRc2" Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-66f3e7d9eccso778806eaf.1 for ; Thu, 26 Mar 2026 11:54:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551294; x=1775156094; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Lr3BXrtiuAvHSgc8/DPsjTxu/hA/+WXgrNkg64S657g=; b=PcPUiRc2aXV+PakgqCE14BtsaG/gVKVDzpYEXnVoPuWZNpbPz7tnVMixBJcaEK6sbD HyGKVCEpGaUSCKAKIm+ucvhncPFY0FqsGt/z13JpNQwCLH7MOTwWR+8RKwgf9U/5SQ+m i27rh+npiU4ps2t8w+yXpdmydX2atI8yChPhoscM6Zf0mJGEJqJod9bKXMjiwcnPeSRg +xUv2fBb2jbML7pVrBTwyAehOrRdYsSCjM9KrrGVgXn8vuIU9K6y+lXaXZSgIWJjxz54 SykzjjBhlWM5E2pJ3CBwPODdISTOiVcoxubcxiipabBveTkgjnG/Bj/anAyL8fYHeW0f lbBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551294; x=1775156094; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Lr3BXrtiuAvHSgc8/DPsjTxu/hA/+WXgrNkg64S657g=; b=cq2fRrL/kzqdeGVgvIKW7x8wawr3vXRT5yQL5OWUpOTHRB4MvzY2N4NaAaexNPTnrB H2HcS93Ub0qswBiJqc+x3Rv9+dn48YeLQtJuuUmjRfm6S2M6ga/ZXC1Q4FWIb6ECAWwJ 0vwmvQ0YgwwMKtTvHb6FMj0o+15c7Apz5rdX/0BwNyhoNTxy72jLA1JsrF0mYu15jjrN Qoe+bNZSy3fvFZNx9XT4eWlep1ZdcpOZNaq/lAcLTp6V1/9HQJnL+k7ZJA6W/g68uaGS QCxbJ8MoH+zvi6O7ss8TGCBdNR66QyOBQ4E1R34N4v0Sa2xL722jCH1UiPjTnRiC/yqZ 8tJg== X-Gm-Message-State: AOJu0Yzb4iimHLmuXmY7b3UyDJb9uS+SYTRZo+Vsy15tmngzWPO0wMmb 08FVeY93lb6Fw975aKdGuIPxzAcB07NJYNKecuWgXpsHEzCieSLKOx5GjHyEGg== X-Gm-Gg: ATEYQzyQoxwib4wgi0B8Foq2tvR4quuwK5s7tPUegfwatYJnkP7jSGIdsdjcylnbAi7 +olNslihT1QkRMTr6t+zothNIqqgYb9srDm1BQH6OJ230lGQLdpxMHpcgUF9NMgZGgdTmHcOnYX Pu2pBgd7m7hZv440NX0aVgW2yPkpN4rdyhxA0sb1v7D6/IJCoydJkAzpH+1dTdgHz+eO26Njxbs ftMtXSWTFZPJbqqqONYSqVvcS5TVOKETqGQhV0nrXOrvOYNLyUgv2NbJ2uH2IOImXproN+HnbQ8 uuPmSovnG+0w/7c6KfNkunem+czn8oVqXlHc4c/sXHm+UU9ofb3qP6ISCQwayecLXKM7lgmpr9Q SWkq9p2CjyXgGYAkXoHrnVKC4OHYZo9Wu5CJ4YVhH99nnGWvnO3pLMkKdlpPpZxXbeq3ArmfQdK OLGWVojiG3AytoFffUIPzTYi7RsEo90gDcJTARF2QON9009FSV+WJ6kmeylTI= X-Received: by 2002:a05:6820:210c:b0:67c:1d90:3949 with SMTP id 006d021491bc7-67dff4fc06dmr4216223eaf.48.1774551294126; Thu, 26 Mar 2026 11:54:54 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:53 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 16/69] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Date: Thu, 26 Mar 2026 12:53:20 -0600 Message-ID: <20260326185413.1205870-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" old_bits arg is currently a pointer to the input bits, but this could allow inadvertent changes to the input by the fn. Disallow this. And constify new_bits while here. Reviewed-by: Louis Chauvet 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 4313c8803007..a18f4bc63473 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -607,7 +607,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) =20 /* apply a new class-param setting */ static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, - unsigned long *new_bits, unsigned long *old_bits, + const unsigned long *new_bits, + const unsigned long old_bits, const char *query_modname) { #define QUERY_SIZE 128 @@ -616,12 +617,12 @@ static int ddebug_apply_class_bitmap(const struct dde= bug_class_param *dcp, int matches =3D 0; int bi, ct; =20 - if (*new_bits !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("apply bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 for (bi =3D 0; bi < map->length; bi++) { - if (test_bit(bi, new_bits) =3D=3D test_bit(bi, old_bits)) + if (test_bit(bi, new_bits) =3D=3D test_bit(bi, &old_bits)) continue; =20 snprintf(query, QUERY_SIZE, "class %s %c%s", map->class_names[bi], @@ -633,9 +634,9 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, v2pr_info("bit_%d: %d matches on class: %s -> 0x%lx\n", bi, ct, map->class_names[bi], *new_bits); } - if (*new_bits !=3D *old_bits) + if (*new_bits !=3D old_bits) v2pr_info("applied bitmap: 0x%lx to: 0x%lx for %s\n", *new_bits, - *old_bits, query_modname ?: "'*'"); + old_bits, query_modname ?: "'*'"); =20 return matches; } @@ -691,7 +692,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa continue; } curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, dcp->bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); *dcp->bits =3D curr_bits; v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, map->class_names[cls_id]); @@ -701,7 +702,7 @@ static int param_set_dyndbg_classnames(const char *inst= r, const struct kernel_pa old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); =20 - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, &old_bits, NULL); + totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, map->class_names[cls_id], old_bits, curr_bits); @@ -755,7 +756,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, inrep &=3D CLASSMAP_BITMASK(map->length); } v2pr_info("bits:0x%lx > %s.%s\n", inrep, mod_name ?: "*", KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, dcp->bits, mod_name); + totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, mod_name); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: @@ -768,7 +769,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); - totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, &old_bits, mod_name= ); + totct +=3D ddebug_apply_class_bitmap(dcp, &new_bits, old_bits, mod_name); *dcp->lvl =3D inrep; break; default: --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08F1C3AE717 for ; Thu, 26 Mar 2026 18:54:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551298; cv=none; b=ocs6l7+aN4LZm19KeCtqpM5fXZDbqrb7iqzJ4sO0QQTq2freME1G6fFJEqpYAI3FKVw08AkJ5RddvKBFYOCSxarozVOkyIJ0ULzQTGvlkiAceiyaiEIV3kS6qF7p4rFqp72QFGiGnUC9zmixBUSqPDbzo9vPkazaRAcK15UJ0qQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551298; c=relaxed/simple; bh=NxQl7h9bWLiIoq2p4gJ9qOg7QnNWnUPnOXXB1pgHnho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BnyrKIseYHdKIn9pkSdtMJHRcdzUlFdqfNAJv9ILuCixgb0st3GxVRv0TY1uKiJowcJyruraFiS36yH9xHZry68tGasOrZcGd1Cd3AwkjgBkWtBTlZUfwpJX4Ir+uI2MEELw10nWK9j4lNSfKuAkmWUM2bjLuKnCGp0vYFIdyTU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A8GK4MKN; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A8GK4MKN" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-7d7ebe11bffso1031852a34.0 for ; Thu, 26 Mar 2026 11:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551296; x=1775156096; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MC2lsh0Qhp0IwkFoRFt/G0LqEbae5jgNK4VV9aW2FC4=; b=A8GK4MKNSJuy5DoajckxO+t0eM0Lq87EeZnxXhUhhNOmwKeQPftiMLC5jndMt56oQ/ xJ9nf7oBMtg0zbxOMn2g2KQgyTG4RWifu2uxfUX1szbkbwFVzmC9Cg1EBcD/hN7nwkl1 Z4yJpVnkTFo5rnuttpSbmyGC6dnBiBlMpkTLEhjwBYg1FR0AH1ZQyfaa/ZbFXJ16frF9 Z+pnuIaRtPMNxekWLGWjcZxcncy4785wXqBAwl3h9SuDbLRUKV2SQA9keNa+TGKTTOsE vnncz/AvAstaV6T3cye4nFKVICzQ/xbofv5njakrFMQSdRb1neKhQwbnY/oux1hJeu4s J3Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551296; x=1775156096; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=MC2lsh0Qhp0IwkFoRFt/G0LqEbae5jgNK4VV9aW2FC4=; b=YBLaULwk8kpooJa8h/5Z3zB10xoewBrvMLKznYjfZV+gUpCNWruGbw/6lMnexS3yqI /KSLZNsTg1CpXh2gHWtNkLLZfnR6sjA18swLx0vFvl5i0QCVC5OgYolnN07gVqA/jOZf 6gxz25Mf+tiluLEzWcGdibvn9Nx92ZxTNwfmjW2bK4L82SkfPtjWbsZ6unXwZqcKE5dX 2uhEfD7vUGYUh8ALsO1+fo4dV7mb7yYElnjDCk/tbWr3f/8/kTPI2ya1KoSu9da01pi3 kWHGVaXpG7tk79jv7FfwS2Ec/it1yl5J+X4FdHhRsCPgGkEO4dDN1BS7N1f/YpdTU47G 3IxA== X-Gm-Message-State: AOJu0YwbdlJ7OE5zgCF8Y94OvZYTZNAMlkXB7F6A1LwBLSU4nzk/hD05 UfeXUmAe0MtGBO8YFFjQglisubOM654Gk2Lyg5uTj0joATn4pn3UrxIuyt76YQ== X-Gm-Gg: ATEYQzzXKGRzllp82gyDxOi5FQpXO8oIUl32oZmRRlqJkrxSLcn7w7nGp17ADyVu4HO Z7hBa2wx1nHVH9ymiJ1cUUS3N/q3xJBoefXS4htHa38ZM98afZw8fMP+XO+nHEqVwuwlJnBEW4u dn/1mq8GzzPmTilksYVHEHj0z30mBQyyV2izLR0n6joQNRQY3cHhMei95ws3luLkwni9wuhF/WN 6RGBtp/1th+/NY9RKO0h98aXQpWK1vXIf5OEcZdd6CnLl02zlLJACL6z1vzPMK7/lsuUP2UGloF VLjiiINJTmrZEDm3GB5FF2MLM0/frWs0hpiACZdw7E/QBWsaLDOGO9esty131zjVsMb9ZXpy5tE hZE04mOMfhe/NwKUdMfQcYEFjOWiM6H7b937FN0lhqfvWM9MrBacgsJXiiwXvqAgz7q6WDPENgf 2k5fARr6CS8i9w0GSpNTaM3gvZYkddy1vP8ISIsFfoed5J8eVm X-Received: by 2002:a05:6820:1686:b0:662:f2ea:8f9b with SMTP id 006d021491bc7-67dff41d463mr4535409eaf.20.1774551295761; Thu, 26 Mar 2026 11:54:55 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:55 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 17/69] dyndbg: replace classmap list with a vector Date: Thu, 26 Mar 2026 12:53:21 -0600 Message-ID: <20260326185413.1205870-18-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Classmaps are stored in an elf section/array, but currently are individually list-linked onto dyndbg's per-module ddebug_table for operation. This is unnecessary. Just like dyndbg's descriptors, classes are packed in compile order; so even with many builtin modules employing multiple classmaps, each modules' maps are packed contiguously, and can be treated as a array-start-address & array-length. So this drops the whole list building operation done in ddebug_attach_module_classes(), and removes the list-head members. The "select-by-modname" condition is reused to find the start,end of the subrange. NOTE: This "filter-by-modname" on classmaps should really be done in ddebug_add_module(1); ie at least one step closer to ddebug_init(2), which already splits up pr-debug descriptors into subranges by modname, then calls (1) on each. (2) knows nothing of classmaps currently, and doesn't need to. For now, just add comment. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 1 - lib/dynamic_debug.c | 62 ++++++++++++++++++----------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 92627a03b4d1..9fd36339db52 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -84,7 +84,6 @@ enum class_map_type { }; =20 struct ddebug_class_map { - struct list_head link; struct module *mod; const char *mod_name; /* needed for builtins */ const char **class_names; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a18f4bc63473..94a66c8537ab 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -45,10 +45,11 @@ extern struct ddebug_class_map __start___dyndbg_classes= []; extern struct ddebug_class_map __stop___dyndbg_classes[]; =20 struct ddebug_table { - struct list_head link, maps; + struct list_head link; const char *mod_name; - unsigned int num_ddebugs; struct _ddebug *ddebugs; + struct ddebug_class_map *classes; + unsigned int num_ddebugs, num_classes; }; =20 struct ddebug_query { @@ -149,12 +150,13 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) } =20 static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e const *dt, - const char *class_string, int *class_id) + const char *class_string, + int *class_id) { struct ddebug_class_map *map; - int idx; + int i, idx; =20 - list_for_each_entry(map, &dt->maps, link) { + for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -165,7 +167,6 @@ static struct ddebug_class_map *ddebug_find_valid_class= (struct ddebug_table cons return NULL; } =20 -#define __outvar /* filled by callee */ /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -227,7 +228,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; struct ddebug_class_map *map =3D NULL; - int __outvar valid_class; + int valid_class; =20 /* search for matching ddebugs */ mutex_lock(&ddebug_lock); @@ -1134,9 +1135,10 @@ static void *ddebug_proc_next(struct seq_file *m, vo= id *p, loff_t *pos) =20 static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) { - struct ddebug_class_map *map; + struct ddebug_class_map *map =3D iter->table->classes; + int i, nc =3D iter->table->num_classes; =20 - list_for_each_entry(map, &iter->table->maps, link) + for (i =3D 0; i < nc; i++, map++) if (class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1220,30 +1222,31 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 -static void ddebug_attach_module_classes(struct ddebug_table *dt, - struct ddebug_class_map *classes, - int num_classes) +static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { struct ddebug_class_map *cm; - int i, j, ct =3D 0; + int i, nc =3D 0; =20 - for (cm =3D classes, i =3D 0; i < num_classes; i++, cm++) { + /* + * Find this module's classmaps in a subrange/wholerange of + * the builtin/modular classmap vector/section. Save the start + * and length of the subrange at its edges. + */ + for (cm =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { =20 if (!strcmp(cm->mod_name, dt->mod_name)) { - - v2pr_info("class[%d]: module:%s base:%d len:%d ty:%d\n", i, - cm->mod_name, cm->base, cm->length, cm->map_type); - - for (j =3D 0; j < cm->length; j++) - v3pr_info(" %d: %d %s\n", j + cm->base, j, - cm->class_names[j]); - - list_add(&cm->link, &dt->maps); - ct++; + if (!nc) { + v2pr_info("start subrange, class[%d]: module:%s base:%d len:%d ty:%d\n= ", + i, cm->mod_name, cm->base, cm->length, cm->map_type); + dt->classes =3D cm; + } + nc++; } } - if (ct) - vpr_info("module:%s attached %d classes\n", dt->mod_name, ct); + if (nc) { + dt->num_classes =3D nc; + vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + } } =20 /* @@ -1275,10 +1278,9 @@ static int ddebug_add_module(struct _ddebug_info *di= , const char *modname) dt->num_ddebugs =3D di->num_descs; =20 INIT_LIST_HEAD(&dt->link); - INIT_LIST_HEAD(&dt->maps); =20 if (di->classes && di->num_classes) - ddebug_attach_module_classes(dt, di->classes, di->num_classes); + ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); @@ -1391,8 +1393,8 @@ static void ddebug_remove_all_tables(void) mutex_lock(&ddebug_lock); while (!list_empty(&ddebug_tables)) { struct ddebug_table *dt =3D list_entry(ddebug_tables.next, - struct ddebug_table, - link); + struct ddebug_table, + link); ddebug_table_free(dt); } mutex_unlock(&ddebug_lock); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52D0E3A5E82 for ; Thu, 26 Mar 2026 18:54:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551299; cv=none; b=Zvna8EuCL6KQz67WmLyck0+8v2sC0+2v68fShAsrMRE3wquua7FA0UTJggARud3zoy1SFaxhMdC16v5YEXCgHkbqvtSjGRE0KUU0trH7jZmxuCwgt5HwLPV3Of28n7pK37FsXGIddQImgE1dmBNcTiVqzTO4MJiRZaNKLnSJL/c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551299; c=relaxed/simple; bh=S44qNaJnprSPGtSX9jhfIgwHHExOvS0QRFBglJsEsKA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oEM6BjrrkDOeZYh8wp80k/iPhmenzhqchPIFqJAdF7g6Q0l2l9AhQIFR248LZ4oX+pVTq64w1C7738Bg0BD8ukdnGSBsJgZzcJ6uAId49P3O87cyDxrUIyQcgSUswIBRe5utTKLkW66UUVfA8Yhj51+8X1Zxl59JzQLjXyZy7QI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dVsUmWRj; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dVsUmWRj" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-467161c4b89so726110b6e.3 for ; Thu, 26 Mar 2026 11:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551297; x=1775156097; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R72DzlYh9MokOK1r/XXtR9MDuFmHujj2u63MvUuPRVY=; b=dVsUmWRjHJku0zMjKNiCYY0MXuGYKX0fd5o4nt8VuVYZWGZmbLK1BR5eAgesUwPaj8 aV+zO/oZTawGft9QQIyVOzWMuLp+zeQx32HL3vJ9N2iH54tIQU1alGc3Gh1sRmsaQv93 mUiF4uzntMmpsXkjYUoiDevUshUHO5L10s3qn/ANK+XgWRONjkRB4iuoDdZt8+DQKbSI MMpg7Qsa26gM2D8UyPErlEkEWWL25oIy+/R+jggLbZ/p0RBsajuHf5LXagX9tmygaidx LUxEfR39Kt4BeP/1a6iKwCie7sP5zPD4+AiLzUqH1ViI5gjvWpnDSaPytEMJqZsIkGZ9 vBZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551297; x=1775156097; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=R72DzlYh9MokOK1r/XXtR9MDuFmHujj2u63MvUuPRVY=; b=AU1CfYFWn3zU3/uiHOYbdwMKsyAfKgINX+7s+8NZBjxMUwVqNXNcoKx6WVMNsk4qBg aevjETCBbSeDN3F/kWhd03bg7o7jVcspAwV+zgz104DjOoT8N9E1bzS12dZiQyxKuas0 cIBSljeWRCEXn8d0VqZ9E3B5gIowJUQbfOb74W2oGBTODgy5FXt1PZ30lKGF0WDlBEXF cG8BVQz9eBtRm8HbXw/8jgoCVsl6IuO6hcFXf35uiRNW01RvTNPVousJJ3kHK8GkSiR/ CeTW0tjvA+JCCsYuMSqPo3GTsKGuoZJC3ZKHucsAlx8TkMvnxTU+5L9GlvO3wUQOGXSR Zvcg== X-Gm-Message-State: AOJu0YxNDgO3o4LaaxvKzA3GkeQSqsivOI80BhEQHvlh9TKpv7Tj3tpB Y9AnfmKTIsdD/S5n8i6MWwvOwYRYR9gQaBmCtcqoKsVxkOeFkbirG8PaBZ7y7g== X-Gm-Gg: ATEYQzzPeIpx2zA+LW4RQCkqqSnxvcTkUtkVk6+waqyLrLFR6ljDEzBRkcJmS0uKiPe 5uYMdN5L/sDjrnVFPM9KxtduysZqr0Qy6hRkzU4/vasO0JsjtV1clnRBwlUkHncU1yaN39qThMx OqeeTe8zohu80vS3jGinNcSoxogxF+ecX4TGyYlDnq3gC5DqcWBEKfp5L8DLZm+Ftct+aJVrA7Y BzPUjiUJNvCyBUGBCBRs9bZ2Y4rBJJjNCsehRR0iBHxamx/IoM9AQfQYSa807ZD9Xyp2pbRKurN 5ihIB13Ao4v09+OJf6d2NyTGrsJ6k7MLs1xsnKo3MXxQEfRfQ36tfcbmO34HfHJ1VfUSK7/RjZr oUuqJyFGtUjY5Z+lXK9kKllnTVvh02gBefhklBA9RgFst+/13igRyu1gYngjuQBg9T2OlXnZjJc gvpxPHthqm+CSmN7yPql4eGovnCgSvjQtCc/Edi/dJdLfc/o6D X-Received: by 2002:a05:6808:c299:b0:467:14c7:a8ae with SMTP id 5614622812f47-46a5c5f7c5cmr3888707b6e.21.1774551297062; Thu, 26 Mar 2026 11:54:57 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:56 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 18/69] dyndbg: macrofy a 2-index for-loop pattern Date: Thu, 26 Mar 2026 12:53:22 -0600 Message-ID: <20260326185413.1205870-19-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" dynamic-debug currently has 2 __sections (__dyndbg, __dyndb_classes), struct _ddebug_info keeps track of them both, with 2 members each: _vec and _vec#_len. We need to loop over these sections, with index and record pointer, making ref to both _vec and _vec_len. This is already fiddly and error-prone, and will get worse as we add a 3rd section. Lets instead embed/abstract the fiddly-ness in the `for_subvec()` macro, and avoid repeating it going forward. This is a for-loop macro expander, so it syntactically expects to precede either a single statement or a { block } of them, and the usual typeof or do-while-0 tricks are unavailable to fix the multiple-expansion warning. The macro needs a lot from its caller: it needs 2 local vars, 1 of which is a ref to a contained struct with named members. To support these requirements, add: 1. __ASSERT_IS_LVALUE(_X): ie: ((void)sizeof((void)0, &(x))) 2. __ASSERT_HAS_VEC_MEMBERS(_X, _Y): compile-time check that the _Y "vector" exists ie: _X->_Y and _X->num_##_Y are lvalues. The for_subvec() macro then invokes these in the initialization of the for-loop; they disappear at runtime. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 94a66c8537ab..8f614eba8ace 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -129,6 +129,28 @@ do { \ #define v3pr_info(fmt, ...) vnpr_info(3, fmt, ##__VA_ARGS__) #define v4pr_info(fmt, ...) vnpr_info(4, fmt, ##__VA_ARGS__) =20 +/* + * 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 member in @_box + */ +#define __ASSERT_IS_LVALUE(x) ((void)sizeof((void)0, &(x))) +#define __ASSERT_HAS_VEC_MEMBER(_box, _vec) \ + (void)sizeof((_box)->_vec + (_box)->num_##_vec) + +#define for_subvec(_i, _sp, _box, _vec) \ + for (__ASSERT_IS_LVALUE(_i), \ + __ASSERT_IS_LVALUE(_sp), \ + __ASSERT_HAS_VEC_MEMBER(_box, _vec), \ + (_i) =3D 0, \ + (_sp) =3D (_box)->_vec; \ + (_i) < (_box)->num_##_vec; \ + (_i)++, (_sp)++) /* { block } */ + static void vpr_info_dq(const struct ddebug_query *query, const char *msg) { /* trim any trailing newlines */ @@ -156,7 +178,7 @@ static struct ddebug_class_map *ddebug_find_valid_class= (struct ddebug_table cons struct ddebug_class_map *map; int i, idx; =20 - for (map =3D dt->classes, i =3D 0; i < dt->num_classes; i++, map++) { + for_subvec(i, map, dt, classes) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -1232,8 +1254,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug * the builtin/modular classmap vector/section. Save the start * and length of the subrange at its edges. */ - for (cm =3D di->classes, i =3D 0; i < di->num_classes; i++, cm++) { - + for_subvec(i, cm, di, classes) { 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= ", --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5A0A3BF688 for ; Thu, 26 Mar 2026 18:54:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551301; cv=none; b=P85OzRxVZ0Dp9C+0wy2ZwLBD3SpjebiT0oSwiDdgAg84ha/DPu8JpNaDmIVIA3ecO/zm2Ljq+Sg3sD/TLUvzstMmPzG9FcdBmp2Kv3AY/kZrf67Pxd19Q28zBjpwppqdMj4M/dqAzalOunY/W66LfhzgL+55M5EeLMA2SE5FAtQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551301; c=relaxed/simple; bh=3hfEX4bPIErfOAnk4GOb4hOzqvLmI/c9/6dXl4YdakM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J1k8oBV0Lgp7nptLSenTWJRmV41TD9xB5+ls9HVH7szJaMCo8zrqZz9XxtJInyNCtaixY39sRFNl2c1ALXwBZdJGg/MnlZI2b+nk7DSLjaHRSb1pOYPXUzSs0CfvYz+DQf8haGWshq27HULfnqPu8FcPmhOTWwUUMfDR0kAqMxw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DSRQVWaD; arc=none smtp.client-ip=209.85.160.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DSRQVWaD" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-40ee9b945d5so940162fac.0 for ; Thu, 26 Mar 2026 11:54:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551299; x=1775156099; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zxXMt35u3X3VtMu3QbosUQTDTh3RhUOIrPQ9QC83BFo=; b=DSRQVWaDbYpB1dBOxuAto9idn9DkFGSIIDat3yw9WEaD+jym24Y0kCVS7/dipmnQNz ulWrcqDQNrJ6dGff02e6Syl09iN5484EO3d8bU8mZs5Sxu2HKnIvw6UHWOwdj6Mz56fY NpgNrkatkXsS1no0Qr5WLvnPy3NWzmqYxkB9ulPXzyb7KbpayPuS6/AdsoE9dd/QQTbu lJmfH/lUBHKNofsELZwrHrtfuvFNOw+UT1T7bgjzpmx80u8CjswG7RNQh1OXstYgWdlp NASr8FEw/TuEjONS/vT8tWSOoRUMIBb3VgXRggw4VfnRPQ3B7xr5hR4HjL+gDlDJBSWG 9Pcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551299; x=1775156099; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=zxXMt35u3X3VtMu3QbosUQTDTh3RhUOIrPQ9QC83BFo=; b=oXft9yF/ukeoVG38t6I4G+2vvp/8v4ObxEzedrB97gsJ66N2L+9nvYRPvF0ysq4FN/ lyXUhZ095oFbtfWdgsNaoxKwNPd1glm6SeE6k6Jb32bQMSSSuGd+eaHtRt/UQ0AiPulQ 4UQVUmVnlR3gQ3JTgNsjmxOgUrJxzrbmBrFMmX4NFdbM4NvdoYVYGZOkDaGQxN8K+XN2 b5LnmeCeWb+QlDKnp6CaJjAHXdW22KGUpamXNNCX0pipsAWZ35llinhfa2SEmpB+ms9T qNRD16KZVDMqr3Czov3DI7c2xtawSAXyJwanRTcYQcUZ+XNhscsrzauzt27SqvfoHIOu vQ8A== X-Gm-Message-State: AOJu0YxKW/WnGzdCzfKax2wRgE3gVwqIE6cylGgyLiC9Dsr+P8cfHfly J+fjE2onQR4sC6JyNYz3oDoy16UTsCxrzegBiS4TjlGxjdQokuBFaXsKBrgvkA== X-Gm-Gg: ATEYQzzt6bR3WKInA35f3pkpwa6rOnKYny794ij1sDm877u+fXkdWwYF62k1JMI8R76 dUCdfA4/4f6EO7se8Ej2/jfFALCRzwj1TRt08/mTUQeeBr57KuKLOW7dnIEiK6nIYJA46Umfs0D A/1eTjsX2mIBQkZnZdnEP64LK50TFBBJbhes780LI4bnDV4+7p1ZQbl1hqYHXMVd0oqh0ZYMWuY 1uvMbuCffEGNsTpGCB3KgLMFh/NBBcwU2QjKXf9/1HprHiEP0Tjw+hnajLEpcguql+OhwewHXDh JV2oUQA5GQwBUadq1reVyTL0lmPBS7FYSv+UL8Cpg9ubZhtsYjsnH4bdv5fDTaPNGCs2LwU5T5c PU3BaVda7W78Ssvo0hTQhdQCvBLSNy0pSv59KOHJNT/kMJIcL6AAen1sGgZgVFT84J9w/0UtXLw sVtmmOpLiV7GHwc8zP7+0g+8bOqOhNYbIL41ZBMXFtScm8WUr5EDolsAiB/zo= X-Received: by 2002:a05:6871:453:b0:417:630d:1822 with SMTP id 586e51a60fabf-41ca71409edmr4768925fac.45.1774551298511; Thu, 26 Mar 2026 11:54:58 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:58 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 19/69] dyndbg,module: make proper substructs in _ddebug_info Date: Thu, 26 Mar 2026 12:53:23 -0600 Message-ID: <20260326185413.1205870-20-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" recompose struct _ddebug_info, inserting proper sub-structs. The struct _ddebug_info has 2 pairs of _vec, num_##_vec fields, for descs and classes respectively. for_subvec() makes walking these vectors less cumbersome, now lets move those field pairs into their own "vec" structs: _ddebug_descs & _ddebug_class_maps, and re-compose struct _ddebug_info to contain them cleanly. This also lets us get rid of for_subvec()'s num_##_vec paste-up. Also recompose struct ddebug_table to contain a _ddebug_info. This reinforces its use as a cursor into relevant data for a builtin module, and access to the full _ddebug state for modules. NOTES: Fixup names: Normalize all struct names to "struct _ddebug_*" eliminating the minor/stupid variations created in classmaps-v1. Modify __section names: __dyndbg to __dyndbg_descriptors, and __dyndbg_classes to __dyndbg_class_maps. This better matches the new struct names, and makes room for forthcoming _ddebug_class_user(s) structs and section. Invariant: These vectors ref a contiguous subrange of __section memory in builtin/DATA or in loadable modules via mod->dyndbg_info; with guaranteed life-time for us. struct module contains a _ddebug_info field and module/main.c sets it up, so that gets adjusted rather obviously. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- include/asm-generic/dyndbg.lds.h | 18 ++--- include/linux/dynamic_debug.h | 40 +++++++---- kernel/module/main.c | 12 ++-- lib/dynamic_debug.c | 120 +++++++++++++++---------------- lib/test_dynamic_debug.c | 2 +- 5 files changed, 103 insertions(+), 89 deletions(-) diff --git a/include/asm-generic/dyndbg.lds.h b/include/asm-generic/dyndbg.= lds.h index f95683aa16b6..8345ac6c52b7 100644 --- a/include/asm-generic/dyndbg.lds.h +++ b/include/asm-generic/dyndbg.lds.h @@ -3,17 +3,19 @@ #define __ASM_GENERIC_DYNDBG_LDS_H =20 #include -#define DYNDBG_SECTIONS() \ - . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) +#define DYNDBG_SECTIONS() \ + . =3D ALIGN(8); \ + BOUNDED_SECTION_BY(__dyndbg_descriptors, ___dyndbg_descs) \ + BOUNDED_SECTION_BY(__dyndbg_class_maps, ___dyndbg_class_maps) =20 #define MOD_DYNDBG_SECTIONS() \ - __dyndbg : { \ - BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + __dyndbg_descriptors : { \ + BOUNDED_SECTION_BY(__dyndbg_descriptors, \ + ___dyndbg_descs) \ } \ - __dyndbg_classes : { \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ + __dyndbg_class_maps : { \ + BOUNDED_SECTION_BY(__dyndbg_class_maps, \ + ___dyndbg_class_maps) \ } =20 #endif /* __ASM_GENERIC_DYNDBG_LDS_H */ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 9fd36339db52..5429315ada8e 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -83,8 +83,8 @@ enum class_map_type { */ }; =20 -struct ddebug_class_map { - struct module *mod; +struct _ddebug_class_map { + struct module *mod; /* NULL for builtins */ const char *mod_name; /* needed for builtins */ const char **class_names; const int length; @@ -92,21 +92,33 @@ struct ddebug_class_map { enum class_map_type map_type; }; =20 -/* 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; +}; + +struct _ddebug_class_maps { + struct _ddebug_class_map *start; + int len; +}; + struct _ddebug_info { - struct _ddebug *descs; - struct ddebug_class_map *classes; - unsigned int num_descs; - unsigned int num_classes; + struct _ddebug_descs descs; + struct _ddebug_class_maps maps; }; =20 -struct ddebug_class_param { +struct _ddebug_class_param { union { unsigned long *bits; unsigned long *lvl; }; char flags[8]; - const struct ddebug_class_map *map; + const struct _ddebug_class_map *map; }; =20 /* @@ -125,8 +137,8 @@ struct ddebug_class_param { */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ - static struct ddebug_class_map __aligned(8) __used \ - __section("__dyndbg_classes") _var =3D { \ + static struct _ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_class_maps") _var =3D { \ .mod =3D THIS_MODULE, \ .mod_name =3D KBUILD_MODNAME, \ .base =3D _base, \ @@ -166,7 +178,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, =20 #define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt) \ static struct _ddebug __aligned(8) \ - __section("__dyndbg") name =3D { \ + __section("__dyndbg_descriptors") name =3D { \ .modname =3D KBUILD_MODNAME, \ .function =3D __func__, \ .filename =3D __FILE__, \ @@ -253,7 +265,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * macro. */ #define _dynamic_func_call_cls(cls, fmt, func, ...) \ - __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS_= _) + __dynamic_func_call_cls(__UNIQUE_ID(_ddebug), cls, fmt, func, ##__VA_ARGS= __) #define _dynamic_func_call(fmt, func, ...) \ _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__) =20 @@ -263,7 +275,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * with precisely the macro's varargs. */ #define _dynamic_func_call_cls_no_desc(cls, fmt, func, ...) \ - __dynamic_func_call_cls_no_desc(__UNIQUE_ID(ddebug), cls, fmt, \ + __dynamic_func_call_cls_no_desc(__UNIQUE_ID(_ddebug), cls, fmt, \ func, ##__VA_ARGS__) #define _dynamic_func_call_no_desc(fmt, func, ...) \ _dynamic_func_call_cls_no_desc(_DPRINTK_CLASS_DFLT, fmt, \ diff --git a/kernel/module/main.c b/kernel/module/main.c index c3ce106c70af..a0fe6c7aab75 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2717,12 +2717,12 @@ static int find_module_sections(struct module *mod,= struct load_info *info) pr_warn("%s: Ignoring obsolete parameters\n", mod->name); =20 #ifdef CONFIG_DYNAMIC_DEBUG_CORE - mod->dyndbg_info.descs =3D section_objs(info, "__dyndbg", - sizeof(*mod->dyndbg_info.descs), - &mod->dyndbg_info.num_descs); - mod->dyndbg_info.classes =3D section_objs(info, "__dyndbg_classes", - sizeof(*mod->dyndbg_info.classes), - &mod->dyndbg_info.num_classes); + mod->dyndbg_info.descs.start =3D section_objs(info, "__dyndbg_descriptors= ", + sizeof(*mod->dyndbg_info.descs.start), + &mod->dyndbg_info.descs.len); + mod->dyndbg_info.maps.start =3D section_objs(info, "__dyndbg_class_maps", + sizeof(*mod->dyndbg_info.maps.start), + &mod->dyndbg_info.maps.len); #endif =20 return 0; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 8f614eba8ace..f47fdb769d7a 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -39,17 +39,15 @@ =20 #include =20 -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 __start___dyndbg_descs[]; +extern struct _ddebug __stop___dyndbg_descs[]; +extern struct _ddebug_class_map __start___dyndbg_class_maps[]; +extern struct _ddebug_class_map __stop___dyndbg_class_maps[]; =20 struct ddebug_table { struct list_head link; const char *mod_name; - struct _ddebug *ddebugs; - struct ddebug_class_map *classes; - unsigned int num_ddebugs, num_classes; + struct _ddebug_info info; }; =20 struct ddebug_query { @@ -136,19 +134,19 @@ do { \ * @_i: caller provided counter. * @_sp: cursor into _vec, to examine each item. * @_box: ptr to a struct containing @_vec member - * @_vec: name of a member in @_box + * @_vec: name of a vector member in @_box */ #define __ASSERT_IS_LVALUE(x) ((void)sizeof((void)0, &(x))) #define __ASSERT_HAS_VEC_MEMBER(_box, _vec) \ - (void)sizeof((_box)->_vec + (_box)->num_##_vec) + ((void)sizeof((_box)->_vec.start + (_box)->_vec.len)) =20 #define for_subvec(_i, _sp, _box, _vec) \ for (__ASSERT_IS_LVALUE(_i), \ __ASSERT_IS_LVALUE(_sp), \ __ASSERT_HAS_VEC_MEMBER(_box, _vec), \ (_i) =3D 0, \ - (_sp) =3D (_box)->_vec; \ - (_i) < (_box)->num_##_vec; \ + (_sp) =3D (_box)->_vec.start; \ + (_i) < (_box)->_vec.len; \ (_i)++, (_sp)++) /* { block } */ =20 static void vpr_info_dq(const struct ddebug_query *query, const char *msg) @@ -171,14 +169,14 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 -static struct ddebug_class_map *ddebug_find_valid_class(struct ddebug_tabl= e const *dt, +static struct _ddebug_class_map *ddebug_find_valid_class(struct ddebug_tab= le const *dt, const char *class_string, int *class_id) { - struct ddebug_class_map *map; + struct _ddebug_class_map *map; int i, idx; =20 - for_subvec(i, map, dt, classes) { + for_subvec(i, map, &dt->info, maps) { idx =3D match_string(map->class_names, map->length, class_string); if (idx >=3D 0) { *class_id =3D idx + map->base; @@ -249,7 +247,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, unsigned int newflags; unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; - struct ddebug_class_map *map =3D NULL; + struct _ddebug_class_map *map =3D NULL; int valid_class; =20 /* search for matching ddebugs */ @@ -270,8 +268,8 @@ static int ddebug_change(const struct ddebug_query *que= ry, valid_class =3D _DPRINTK_CLASS_DFLT; } =20 - for (i =3D 0; i < dt->num_ddebugs; i++) { - struct _ddebug *dp =3D &dt->ddebugs[i]; + for (i =3D 0; i < dt->info.descs.len; i++) { + struct _ddebug *dp =3D &dt->info.descs.start[i]; =20 if (!ddebug_match_desc(query, dp, valid_class)) continue; @@ -629,14 +627,14 @@ static int ddebug_exec_queries(char *query, const cha= r *modname) } =20 /* apply a new class-param setting */ -static int ddebug_apply_class_bitmap(const struct ddebug_class_param *dcp, +static int ddebug_apply_class_bitmap(const struct _ddebug_class_param *dcp, const unsigned long *new_bits, const unsigned long old_bits, const char *query_modname) { #define QUERY_SIZE 128 char query[QUERY_SIZE]; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_map *map =3D dcp->map; int matches =3D 0; int bi, ct; =20 @@ -672,8 +670,8 @@ static int ddebug_apply_class_bitmap(const struct ddebu= g_class_param *dcp, /* accept comma-separated-list of [+-] classnames */ static int param_set_dyndbg_classnames(const char *instr, const struct ker= nel_param *kp) { - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; unsigned long curr_bits, old_bits; char *cl_str, *p, *tmp; int cls_id, totct =3D 0; @@ -743,8 +741,8 @@ static int param_set_dyndbg_module_classes(const char *= instr, const struct kernel_param *kp, const char *mod_name) { - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct =3D 0; =20 @@ -831,8 +829,8 @@ EXPORT_SYMBOL(param_set_dyndbg_classes); */ int param_get_dyndbg_classes(char *buffer, const struct kernel_param *kp) { - const struct ddebug_class_param *dcp =3D kp->arg; - const struct ddebug_class_map *map =3D dcp->map; + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; =20 switch (map->map_type) { =20 @@ -1083,8 +1081,8 @@ static struct _ddebug *ddebug_iter_first(struct ddebu= g_iter *iter) } iter->table =3D list_entry(ddebug_tables.next, struct ddebug_table, link); - iter->idx =3D iter->table->num_ddebugs; - return &iter->table->ddebugs[--iter->idx]; + iter->idx =3D iter->table->info.descs.len; + return &iter->table->info.descs.start[--iter->idx]; } =20 /* @@ -1105,10 +1103,10 @@ static struct _ddebug *ddebug_iter_next(struct ddeb= ug_iter *iter) } iter->table =3D list_entry(iter->table->link.next, struct ddebug_table, link); - iter->idx =3D iter->table->num_ddebugs; + iter->idx =3D iter->table->info.descs.len; --iter->idx; } - return &iter->table->ddebugs[iter->idx]; + return &iter->table->info.descs.start[iter->idx]; } =20 /* @@ -1152,16 +1150,19 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) return dp; } =20 -#define class_in_range(class_id, map) \ - (class_id >=3D map->base && class_id < map->base + map->length) +static bool ddebug_class_in_range(const int class_id, const struct _ddebug= _class_map *map) +{ + return (class_id >=3D map->base && + class_id < map->base + map->length); +} =20 -static const char *ddebug_class_name(struct ddebug_iter *iter, struct _dde= bug *dp) +static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) { - struct ddebug_class_map *map =3D iter->table->classes; - int i, nc =3D iter->table->num_classes; + struct _ddebug_class_map *map; + int i; =20 - for (i =3D 0; i < nc; i++, map++) - if (class_in_range(dp->class_id, map)) + for_subvec(i, map, &dt->info, maps) + if (ddebug_class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 return NULL; @@ -1194,7 +1195,7 @@ static int ddebug_proc_show(struct seq_file *m, void = *p) seq_putc(m, '"'); =20 if (dp->class_id !=3D _DPRINTK_CLASS_DFLT) { - class =3D ddebug_class_name(iter, dp); + class =3D ddebug_class_name(iter->table, dp); if (class) seq_printf(m, " class:%s", class); else @@ -1246,7 +1247,7 @@ static const struct proc_ops proc_fops =3D { =20 static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) { - struct ddebug_class_map *cm; + struct _ddebug_class_map *cm; int i, nc =3D 0; =20 /* @@ -1254,18 +1255,18 @@ static void ddebug_attach_module_classes(struct dde= bug_table *dt, struct _ddebug * the builtin/modular classmap vector/section. Save the start * and length of the subrange at its edges. */ - for_subvec(i, cm, di, classes) { + for_subvec(i, cm, di, maps) { 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); - dt->classes =3D cm; + dt->info.maps.start =3D cm; } nc++; } } if (nc) { - dt->num_classes =3D nc; + dt->info.maps.len =3D nc; vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); } } @@ -1278,10 +1279,10 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) { struct ddebug_table *dt; =20 - if (!di->num_descs) + if (!di->descs.len) return 0; =20 - v3pr_info("add-module: %s %d sites\n", modname, di->num_descs); + v3pr_info("add-module: %s %d sites\n", modname, di->descs.len); =20 dt =3D kzalloc_obj(*dt); if (dt =3D=3D NULL) { @@ -1295,19 +1296,18 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) * this struct ddebug_table. */ dt->mod_name =3D modname; - dt->ddebugs =3D di->descs; - dt->num_ddebugs =3D di->num_descs; + dt->info =3D *di; =20 INIT_LIST_HEAD(&dt->link); =20 - if (di->classes && di->num_classes) + if (di->maps.len) ddebug_attach_module_classes(dt, di); =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - 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; } =20 @@ -1454,10 +1454,10 @@ static int __init dynamic_debug_init(void) char *cmdline; =20 struct _ddebug_info di =3D { - .descs =3D __start___dyndbg, - .classes =3D __start___dyndbg_classes, - .num_descs =3D __stop___dyndbg - __start___dyndbg, - .num_classes =3D __stop___dyndbg_classes - __start___dyndbg_classes, + .descs.start =3D __start___dyndbg_descs, + .maps.start =3D __start___dyndbg_class_maps, + .descs.len =3D __stop___dyndbg_descs - __start___dyndbg_descs, + .maps.len =3D __stop___dyndbg_class_maps - __start___dyndbg_class_maps, }; =20 #ifdef CONFIG_MODULES @@ -1468,7 +1468,7 @@ static int __init dynamic_debug_init(void) } #endif /* CONFIG_MODULES */ =20 - if (&__start___dyndbg =3D=3D &__stop___dyndbg) { + if (&__start___dyndbg_descs =3D=3D &__stop___dyndbg_descs) { if (IS_ENABLED(CONFIG_DYNAMIC_DEBUG)) { pr_warn("_ddebug table is empty in a CONFIG_DYNAMIC_DEBUG build\n"); return 1; @@ -1478,16 +1478,16 @@ static int __init dynamic_debug_init(void) return 0; } =20 - iter =3D iter_mod_start =3D __start___dyndbg; + iter =3D iter_mod_start =3D __start___dyndbg_descs; modname =3D iter->modname; i =3D mod_sites =3D mod_ct =3D 0; =20 - for (; iter < __stop___dyndbg; iter++, i++, mod_sites++) { + for (; iter < __stop___dyndbg_descs; iter++, i++, mod_sites++) { =20 if (strcmp(modname, iter->modname)) { mod_ct++; - di.num_descs =3D mod_sites; - di.descs =3D iter_mod_start; + di.descs.len =3D mod_sites; + di.descs.start =3D iter_mod_start; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1497,8 +1497,8 @@ static int __init dynamic_debug_init(void) iter_mod_start =3D iter; } } - di.num_descs =3D mod_sites; - di.descs =3D iter_mod_start; + di.descs.len =3D mod_sites; + di.descs.start =3D iter_mod_start; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; @@ -1508,8 +1508,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)); =20 - 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); =20 /* now that ddebug tables are loaded, process all boot args * again to find and activate queries given in dyndbg params. diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 396144cf351b..8434f70b51bb 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -41,7 +41,7 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 06= 00); */ #define DD_SYS_WRAP(_model, _flags) \ static unsigned long bits_##_model; \ - static struct ddebug_class_param _flags##_model =3D { \ + static struct _ddebug_class_param _flags##_model =3D { \ .bits =3D &bits_##_model, \ .flags =3D #_flags, \ .map =3D &map_##_model, \ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 329F53F077F for ; Thu, 26 Mar 2026 18:55:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551302; cv=none; b=nvmQ+qEGEBlKZbYwUssQUJ7+ea0dfaf4VN/XPYWsP+jyg8LMif1qpFqTa6yfQdzAV8YIMWk7bFtWfrboHy8QQL6pZHiH7wEsv8Mi0JT9Gi9QgFbBri278AOgNdnnecE1R4UX333vlKtAomk2cHgqo3F9wfgsYbTeWQ5PDw64vks= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551302; c=relaxed/simple; bh=uTEcJBYelrIyG2JjPn794qG9UfDtJUTMKVd8a0G5KCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JNOdD9lyMUnr/Hj+lqryhz0hIezMjb+eQQBjkRNbkS3RmZtBO1QEWlNUjsIduc4TALHfCFwXQa4b0n09OuaekVGZl+EQ4V++jZMxHTyW2hhTuj8lVxIBRFQLmE4qdTHGYNye+ghAb4GTsFeMsfV3srq67BcPaNcDto6McaEAK6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rFwi2FW+; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rFwi2FW+" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-40f0e14b9f9so935509fac.1 for ; Thu, 26 Mar 2026 11:55:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551300; x=1775156100; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=aZtEJyK8+Vy+6RrLQt/6TVbqc7gTE0xdy0M1pjWQpWg=; b=rFwi2FW+emMF7inj9GeFvruD3+VLWgexS8w8OK4AnZo5HsZir/8o+vn6Tb5kL7r86t Ik5RhF0EL7p+BXVHLznnoRUSRptwmrgAFBe5F7v5uJHXq5ZA/PZx2d81lweEmxHsLGX9 icLjjjQvq5x/31N9bp56E95uArIHevL7/WFajyr80BZ7rX9OT4GstfhOg7yajgrQWgBE EJPK4+oU+2V61PQa7wUmRlL1esIQWbvofy5kIsV3/HK6q8XTbEpx9SopMA51oWRD33Hf Ds+qnqM8dTH9buV2iRIJ4ZIcagnxMiZ6eUdC9njPPmpQU8YOiEA8Fxk8A6TorrZtjLrM 08lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551300; x=1775156100; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=aZtEJyK8+Vy+6RrLQt/6TVbqc7gTE0xdy0M1pjWQpWg=; b=jCHqRQJ9qO5VRHZXeF/GBRhtRhv6J9aBXUa53h/QvJ6usBZmLeymwlSLJsiwlOgqyM aPUFQg6CWjnhwAIG2MKYFWoRw8tFQSERKqSouTPxhtgFE33oJRdVytA54WEJd1NjsdRy nCYDgWgwFUIA66AgI/qim6NIT9oRyXRLLP9hoqpX7/5uQzdFZXoZS9muwMbAWKa2WsOu XZr69795hbbIbCt0nIvpryXuYZINAgy0es+cASHfa915CR2zdm6v+YK1WNmGys02KCOX qXPhSeb3fqgyVLCE9B9CdX1IHSIOegVZKCd8ReysKt0bqT+Sq0Y0et+gxmkD2jOqpK3C gW4w== X-Gm-Message-State: AOJu0Yz3S+MZdUoAO44AVCyEWlKTy2AwYFhk4niIJhaqaTUXGv8NhQG3 HIRAqJI7ztvQ8cSUYA+UNSq3M1B22N+xPwntb5B7OxOx6JTSXZgj8/uwvcgn5Q== X-Gm-Gg: ATEYQzxwKdZykF0heQhqS7vbeVHwBH4Os3O6kjNdO9J0St8kiRSTrG96+52xLFCdvYs O4K9BdA5HlISlJ7wzH4A3qcU+39LPafhdBzUphtUElyWFujXuwUuF/BGIOhXlNYtZZ/Bd89/7oi 2fmFoEgPbnSC49Dh87/MpqW4JuoAJNcQ5RsP75ajwEZ7nQ9js1tJmlT+0aIVd0i3CQdw53TwM2R H2Ocsp+CPYMCjg3clntcgVkiiK1fp0fFiiMXlC1v7nWbrTeejB0xX2sTldUXDbUxJ1v4PHPGBwA YvAncIElY2+wmQndKON1Q1davByW6kVC1PAxgBTF8zgnrkhQs2mNdvt0R85gAM1YJcXMf8qrr29 /bt+VWiT2aIxmATifMAhHSl3+hMvrO2W5awdN/vrvf6/QrEY39IAaWznFT9IExZXoQ7mRFInsGg WjrQqRpyX6sDOrCSbeqn5HyfzoDLxq3zQofJ4mmv+Gy3+m/Oxz X-Received: by 2002:a05:6870:9a22:b0:417:4888:327e with SMTP id 586e51a60fabf-41ca6de200bmr4549072fac.13.1774551299790; Thu, 26 Mar 2026 11:54:59 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:54:59 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 20/69] dyndbg: move mod_name down from struct ddebug_table to _ddebug_info Date: Thu, 26 Mar 2026 12:53:24 -0600 Message-ID: <20260326185413.1205870-21-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" struct _ddebug_info already has most of dyndbg's info for a module; push debug_table.mod_name down into it, finishing the encapsulation. This allows refactoring several callchains, passing &_ddebug_info instead of &ddebug_table, and hoisting the "&dt->info" deref up instead of repeating it thru the callchans ddebug_table contains a _ddebug_info member, so its users keep access to mod_name, just now with "->info." added in. In static ddebug_add_module(&di), reinforce the cursor-model by dropping the modname arg, and setting di->mod_name at each caller. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- v12 . moved up 1 position in series, ahead of hoist... --- include/linux/dynamic_debug.h | 1 + lib/dynamic_debug.c | 50 ++++++++++++++++++----------------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 5429315ada8e..a262a9862f2b 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -108,6 +108,7 @@ struct _ddebug_class_maps { }; =20 struct _ddebug_info { + const char *mod_name; struct _ddebug_descs descs; struct _ddebug_class_maps maps; }; diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index f47fdb769d7a..21ba5cb3b406 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -46,7 +46,6 @@ extern struct _ddebug_class_map __stop___dyndbg_class_map= s[]; =20 struct ddebug_table { struct list_head link; - const char *mod_name; struct _ddebug_info info; }; =20 @@ -253,10 +252,11 @@ static int ddebug_change(const struct ddebug_query *q= uery, /* search for matching ddebugs */ mutex_lock(&ddebug_lock); list_for_each_entry(dt, &ddebug_tables, link) { + struct _ddebug_info *di =3D &dt->info; =20 /* match against the module name */ if (query->module && - !match_wildcard(query->module, dt->mod_name)) + !match_wildcard(query->module, di->mod_name)) continue; =20 if (query->class_string) { @@ -268,8 +268,8 @@ static int ddebug_change(const struct ddebug_query *que= ry, valid_class =3D _DPRINTK_CLASS_DFLT; } =20 - for (i =3D 0; i < dt->info.descs.len; i++) { - struct _ddebug *dp =3D &dt->info.descs.start[i]; + for (i =3D 0; i < di->descs.len; i++) { + struct _ddebug *dp =3D &di->descs.start[i]; =20 if (!ddebug_match_desc(query, dp, valid_class)) continue; @@ -289,7 +289,7 @@ static int ddebug_change(const struct ddebug_query *que= ry, #endif v4pr_info("changed %s:%d [%s]%s %s =3D> %s\n", trim_prefix(dp->filename), dp->lineno, - dt->mod_name, dp->function, + di->mod_name, dp->function, ddebug_describe_flags(dp->flags, &fbuf), ddebug_describe_flags(newflags, &nbuf)); dp->flags =3D newflags; @@ -1156,12 +1156,12 @@ static bool ddebug_class_in_range(const int class_i= d, const struct _ddebug_class class_id < map->base + map->length); } =20 -static const char *ddebug_class_name(struct ddebug_table *dt, struct _ddeb= ug *dp) +static const char *ddebug_class_name(struct _ddebug_info *di, struct _ddeb= ug *dp) { struct _ddebug_class_map *map; int i; =20 - for_subvec(i, map, &dt->info, maps) + for_subvec(i, map, di, maps) if (ddebug_class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 @@ -1189,13 +1189,13 @@ static int ddebug_proc_show(struct seq_file *m, voi= d *p) =20 seq_printf(m, "%s:%u [%s]%s =3D%s \"", trim_prefix(dp->filename), dp->lineno, - iter->table->mod_name, dp->function, + iter->table->info.mod_name, dp->function, ddebug_describe_flags(dp->flags, &flags)); seq_escape_str(m, dp->format, ESCAPE_SPACE, "\t\r\n\""); seq_putc(m, '"'); =20 if (dp->class_id !=3D _DPRINTK_CLASS_DFLT) { - class =3D ddebug_class_name(iter->table, dp); + class =3D ddebug_class_name(&iter->table->info, dp); if (class) seq_printf(m, " class:%s", class); else @@ -1256,7 +1256,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug * and length of the subrange at its edges. */ for_subvec(i, cm, di, maps) { - if (!strcmp(cm->mod_name, dt->mod_name)) { + if (!strcmp(cm->mod_name, dt->info.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); @@ -1267,7 +1267,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug } if (nc) { dt->info.maps.len =3D nc; - vpr_info("module:%s attached %d classes\n", dt->mod_name, nc); + vpr_info("module:%s attached %d classes\n", dt->info.mod_name, nc); } } =20 @@ -1275,27 +1275,26 @@ static void ddebug_attach_module_classes(struct dde= bug_table *dt, struct _ddebug * Allocate a new ddebug_table for the given module * and add it to the global list. */ -static int ddebug_add_module(struct _ddebug_info *di, const char *modname) +static int ddebug_add_module(struct _ddebug_info *di) { struct ddebug_table *dt; =20 if (!di->descs.len) return 0; =20 - v3pr_info("add-module: %s %d sites\n", modname, di->descs.len); + v3pr_info("add-module: %s %d sites\n", di->mod_name, di->descs.len); =20 dt =3D kzalloc_obj(*dt); if (dt =3D=3D NULL) { - pr_err("error adding module: %s\n", modname); + pr_err("error adding module: %s\n", di->mod_name); return -ENOMEM; } /* - * For built-in modules, name lives in .rodata and is - * immortal. For loaded modules, name points at the name[] - * member of struct module, which lives at least as long as - * this struct ddebug_table. + * For built-in modules, name (as supplied in di by its + * callers) lives in .rodata and is immortal. For loaded + * modules, name points at the name[] member of struct module, + * which lives at least as long as this struct ddebug_table. */ - dt->mod_name =3D modname; dt->info =3D *di; =20 INIT_LIST_HEAD(&dt->link); @@ -1307,7 +1306,7 @@ static int ddebug_add_module(struct _ddebug_info *di,= const char *modname) list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - vpr_info("%3u debug prints in module %s\n", di->descs.len, modname); + vpr_info("%3u debug prints in module %s\n", di->descs.len, di->mod_name); return 0; } =20 @@ -1370,7 +1369,7 @@ static int ddebug_remove_module(const char *mod_name) =20 mutex_lock(&ddebug_lock); list_for_each_entry_safe(dt, nextdt, &ddebug_tables, link) { - if (dt->mod_name =3D=3D mod_name) { + if (dt->info.mod_name =3D=3D mod_name) { ddebug_table_free(dt); ret =3D 0; break; @@ -1390,7 +1389,8 @@ static int ddebug_module_notify(struct notifier_block= *self, unsigned long val, =20 switch (val) { case MODULE_STATE_COMING: - ret =3D ddebug_add_module(&mod->dyndbg_info, mod->name); + mod->dyndbg_info.mod_name =3D mod->name; + ret =3D ddebug_add_module(&mod->dyndbg_info); if (ret) WARN(1, "Failed to allocate memory: dyndbg may not work properly.\n"); break; @@ -1488,7 +1488,8 @@ static int __init dynamic_debug_init(void) mod_ct++; di.descs.len =3D mod_sites; di.descs.start =3D iter_mod_start; - ret =3D ddebug_add_module(&di, modname); + di.mod_name =3D modname; + ret =3D ddebug_add_module(&di); if (ret) goto out_err; =20 @@ -1499,7 +1500,8 @@ static int __init dynamic_debug_init(void) } di.descs.len =3D mod_sites; di.descs.start =3D iter_mod_start; - ret =3D ddebug_add_module(&di, modname); + di.mod_name =3D modname; + ret =3D ddebug_add_module(&di); if (ret) goto out_err; =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f180.google.com (mail-oi1-f180.google.com [209.85.167.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A76203FB7E6 for ; Thu, 26 Mar 2026 18:55:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551304; cv=none; b=ZDj8Ed6KsvBFkdZ+9DKngxAilkjz6wBty6TjRrLaxAkyOZ3WKrkGts0NMqLahdshkhNVK/wKmMyj5UqtmjlvD4muC7cK2n9AbjbOOmGXIwv8PxiFRV67otDJSimyRpY38cOZ2JBbkLYPTsyQcfFsRxGEU2bqftrnykaHzudiOQY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551304; c=relaxed/simple; bh=uocxdG/7/3dQ4Cvc1k0X43etAxjGMK8KCSQSXA4knnk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mZWNrOJAX9IGnUQjQrCQaDfeZ7qieYpF8jZMaikWwYe22G4Cr/DwqZgAdZdOiSeHnvwDRlcdIBieFcSYLW1BXzQSAax8oNrM3q/mumWVPRkRain2KFoRCAyM4jaKLs/kvs0kzag4rrEkVFWp4fqok3mTxu53WHDu677RL/tQoy8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EHy2ugvn; arc=none smtp.client-ip=209.85.167.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EHy2ugvn" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-467161c4ba7so760711b6e.0 for ; Thu, 26 Mar 2026 11:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551301; x=1775156101; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NLjFx8xvoYU6I9e8U5366NO9qUPUvtME5XDnhqfKA8c=; b=EHy2ugvnKJud7To/3hFfIQW2EYGuO1ATiQYbP4tvA7JDtHZ7pOFHIzekFcDqoAbOP9 GbT9OgR24/nEY4b3oPmgn1wbBhiZYXB2yAg139+XER3LHywfmbcsyZv2MLoVdTGNy0/B QVbWMEqTOUJ7FyX7Da+Y9+f7MjFag0rZKPnNWSsEWaokvds7fUSeTKV+idoMKOpDuQ76 SFJN6OTnlm41XK4HaUnJKPw/OsaG8pUdXXbi/ePUytttVFGn0kTe5O2qbDwKG7o0xp3q pDCu8RSyuA3uEUdcr2cUKHrrahg8qf0YsV0wJ8dbwEKUCZMpL6ITHmP73ytZqHwwBvku Dh4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551301; x=1775156101; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NLjFx8xvoYU6I9e8U5366NO9qUPUvtME5XDnhqfKA8c=; b=RQebrCwdX5WZAJjHu1BVSsw8oik36cSjkv8Kr/cqxIDmZWVKlGTDCFiIj0tDMeEF2e /O9jNdRglVBBIZb0MGoLgyaDv1rf9HwrwyP4I5gsAXZA13Bu3hrUkpOrhrQiobjbw9il 3ZpNywYAteC+/hbqpyjssRwyrrVNyQEyqcRszVP/lHLBZN7clbxPKLicALBznljm9kci JUkdZJOlizbFk896BDQ+z5LzqgGRPMYTq2pHWAZyOViQvJzEFZp2Gz4AN9oDRi//AV0V ts2P5Ft741dQhBeka8A1Md2r2LaBWzhWR1OTsBOzZBPJqdjDEUirgxzSu3W+2uZ2KpWj cv+A== X-Gm-Message-State: AOJu0YyOcyeUg5S8+N7Gb+dyfNoxfwHrhMn64yJd5lZwROdXS5Ie0tri daGKVI7aRe9K3YXIh+hDHpIwv4AVZ+MFNer3MvJI44xgSaBKhAzyaUnqMhCpWw== X-Gm-Gg: ATEYQzz5drlYa9R4eMaV/TIsJkvPSWJhLY2V3MmWvw9vvIstJnJ1m2NxjxWZgxGKTB7 rjB6KZF147GfNjkj9ZPAwFAc5UYuWQUZYnyemHW9oiDHV68SD4VbVYatWXByAQ++qLgVH6+Wac6 PTRZNUnhgXMosRPPlT3J8es1G6VymHb7XOUO8XPgQJ9xQxpZldpIMwxh43mM8gWxavHUtuyKcpZ jDQeJOEHWgecs6S2TewRGWkiZHZAZffW6SIgNNp0ViJtWUklC3OobUQUmPPvWusVN94UZscSKYm PKdU++cdCNi8dtwaMfZWpgrdUTlFflaEgIohOBYvqvPricdcSXdVvSVv6KQP2Hzd5QrBDpxcOqE gp/wHzacfvT6FQQTKguXaS7DK2ZGGVMlOiXNhn49wL9Z7QPFztLBEic8HRV7F9g88ZU2HD0tzTX 8TjIaOXJ6YlRnVvUxJeN4cyu/LCutLguI8oSjwxJ6UD3KFjFhK X-Received: by 2002:a05:6808:3509:b0:466:f451:a0c0 with SMTP id 5614622812f47-46a7a84537amr1185457b6e.1.1774551301362; Thu, 26 Mar 2026 11:55:01 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:00 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 21/69] dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module Date: Thu, 26 Mar 2026 12:53:25 -0600 Message-ID: <20260326185413.1205870-22-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The body of ddebug_attach_module_classes() is dominated by a code-block that finds the contiguous subrange of classmaps matching on modname, and saves it into the ddebug_table's info record. Implement this block in a macro to accommodate different component vectors in the "box" (as named in the for_subvec macro). We will reuse this macro shortly. And hoist its invocation out of ddebug_attach_module_classes() up into ddebug_add_module(). This moves the filtering step up closer to dynamic_debug_init(), which already segments the builtin pr_debug descriptors on their mod_name boundaries. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- v10?- reordered params to match kdoc v12- refactor/rename: s/dd_mark_vector_subrange/dd_set_module_subrange/ 1. Renamed the macro from dd_mark_vector_subrange to dd_set_module_subrange to better reflect its purpose of narrowing a vector to a module-specific subrange. 2. Simplified the arguments by removing the redundant _dst, as the _di pointer already provides access to the target _ddebug_info struct. 3. Refactored for Clarity: Instead of overwriting the struct's start pointer while the for_subvec loop is using it to iterate, I introduced a temporary __start variable. This avoids the "subtle" side effect and makes the logic easier to follow. 4. Updated Documentation: Improved the comment block to explicitly state that the macro scans for the first match and counts contiguous elements. --- lib/dynamic_debug.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 21ba5cb3b406..443f0fd6e8c4 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -169,8 +169,8 @@ static void vpr_info_dq(const struct ddebug_query *quer= y, const char *msg) } =20 static struct _ddebug_class_map *ddebug_find_valid_class(struct ddebug_tab= le const *dt, - const char *class_string, - int *class_id) + const char *class_string, + int *class_id) { struct _ddebug_class_map *map; int i, idx; @@ -1271,6 +1271,35 @@ static void ddebug_attach_module_classes(struct ddeb= ug_table *dt, struct _ddebug } } =20 +/* + * Narrow a _ddebug_info's vector (@_vec) to the contiguous subrange + * of elements where ->mod_name matches @__di->mod_name. + * + * This scans the @_di->_vec for the first element matching the module + * name, and counts contiguous matches to define the subrange. + * + * @_i: caller-provided index var + * @_sp: cursor into @_vec + * @_di: pointer to the struct _ddebug_info to be narrowed + * @_vec: name of the vector member (must have .start and .len) + */ +#define dd_set_module_subrange(_i, _sp, _di, _vec) ({ \ + struct _ddebug_info *__di =3D (_di); \ + typeof(__di->_vec.start) __start =3D NULL; \ + int __nc =3D 0; \ + for_subvec(_i, _sp, __di, _vec) { \ + if (!strcmp((_sp)->mod_name, __di->mod_name)) { \ + if (!__nc++) \ + __start =3D (_sp); \ + } else if (__nc) { \ + break; /* end of consecutive matches */ \ + } \ + } \ + if (__nc) \ + __di->_vec.start =3D __start; \ + __di->_vec.len =3D __nc; \ +}) + /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1278,6 +1307,8 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug static int ddebug_add_module(struct _ddebug_info *di) { struct ddebug_table *dt; + struct _ddebug_class_map *cm; + int i; =20 if (!di->descs.len) return 0; @@ -1299,6 +1330,8 @@ static int ddebug_add_module(struct _ddebug_info *di) =20 INIT_LIST_HEAD(&dt->link); =20 + dd_set_module_subrange(i, cm, &dt->info, maps); + if (di->maps.len) ddebug_attach_module_classes(dt, di); =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 534783FADE1 for ; Thu, 26 Mar 2026 18:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551306; cv=none; b=Uf6Q53L1QcJW2qbM/wM8Jp3QXtsPi+HHpFX3u/r31JDj7ZLbvj0iiw35pzzHIIlqwS1C1eGdkJc8n/0FchQ8AMQxOg3haohjPoS1Q01llqZHgJ+zG6ux84xUI3NosYKqy8+Y0asq217RNxDmTECphIvSBxctn9HUbdx7JALG1rY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551306; c=relaxed/simple; bh=we58PLtiVwTc6e4YAUWE6VtDxVS3XfGSJjWb473Cgrk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tHgmAixWSIwnH9LIGQ5fJizNHQXwT+Zrhbg7vYXbE3AnBeS/deQZ7IazJoS+YACR5WnPVbxv670jW89YQoDLG83TS/v9MXX2axsJ+6aoSJgRfAREp3VTALIw8euaRMnQGTXWVMKFL6f2rYVEWUGGszftaB2ypICDN3Grn6LdNlg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZejH296M; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZejH296M" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-4043b909ed4so844327fac.3 for ; Thu, 26 Mar 2026 11:55:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551303; x=1775156103; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OQemtEriWFNTwe8i/pi3edXLDDfArgFSunjHJVzmDyM=; b=ZejH296MXGRjNDz/JNe6HLNSfmX8XHP9SCf2r+OqPYBwh9XsrCZFL8YJPDfG/BBT9u PV3/dNXjydlp9gVGCRpFRH4Hl9sPa67WJyzWDTADb3kHArV4jbh89tyzhzbMmxVTyHsu Jy7WIMUH9CFnYUpr+z9IE3agXX26HqsBmGexk2ckmT3rrlduBACSKSHySI4wdHct+G5j 5Kv7nVRYWrJlCVWurQcqvDldOdQLd7Bz+kYTwMfnfWS8ZTQAHOZCZ/m5QbKM4nUzBGez v5Kc8MAMdPqXwwk030DjXIHNJrQexnGn027EGmxYihn0QwwE+FzwmPiyGOhuQadGRMeB qm4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551303; x=1775156103; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OQemtEriWFNTwe8i/pi3edXLDDfArgFSunjHJVzmDyM=; b=lmz3gKTF0uZV9I8ih2lrHLG4Z3bInhz7vhfBgdX/gWoWRYxNVclucVPAc0h3XKabzJ 45pP1Ybn7t4evahE2CFB3/GZ5rK/oZca744HMBZszM6MnDRgACMrJnHj9WOfSqx6JnYV AQ6O5GewZWujB6ZFj7nzEDWBdMoci1YtlNHX6ljZybmyDaV4M/CcnC7rNJ3iMs3QQ51+ WxFiKvziMvm5h0lSfUsSIjTesrX5w+HMVVgmJ6G9MQhTwcwopsHnJkvipdxDjW50Wq2B TsxZMq4v/S0yru7j3hPqwT0tljhp3qsu9xgEYo4MrtV9DNZCMdPpTlpAU7U6NwqEliHL KauA== X-Gm-Message-State: AOJu0Yyccu18pFgGacEy4EmL44JO1I37k4YhCNVhESB0xOyBOR3Af60U DyW+6aYxPJhl7eHq1n2OWvnULFu42msbx+lXDugu+2pQndU/IXdBt+uQLGmgkQ== X-Gm-Gg: ATEYQzwLg/9TVz0E+uE1nWS80T7pw0Ek90HdBBhOQcVHBdaJE60AaCeronNcbO5NIEB n7OAZZzSi1OMaHzYKxiTAhMSoE8DTVXTLb9I9QRLqty7cnWAHs8EvvTmggT3U4HjTDOIU6ZmuzP T+FbPwS7Dj4N+MBmXC+9Ij/qDl22VtE00rpN0RHM4HpN8g1T4Ug84vRMo6lQN8b2Ma1uTtfSkdV ckAYImBVMGmln5EcOVyvHabinA+FscJlPl18+fsU2ku3EWMC2kKVneGTNoYKNG/aKaT7qK3HpTS 0a0rT+o5sfYylycDyYTuKScMns/zPHfEFUTrGKj4VRbj+/L3TKwvWxdy+J/pTGhrP0amQ6DmC82 StsnVw9gTqpoLiDaRFzNXa2dkN9yufaz/oz1Idq7ST1Axn8aOTz+Jl4HzerJ8/BfAI6GWHjoLMr CT9uJ30H1i+p+hK1sLfrPrayikDBu/94UWx0ZsihnfN9SQUwZK X-Received: by 2002:a05:6870:9d9b:b0:40a:62b7:1627 with SMTP id 586e51a60fabf-41ca6fc3325mr5181037fac.30.1774551302968; Thu, 26 Mar 2026 11:55:02 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:02 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 22/69] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Date: Thu, 26 Mar 2026 12:53:26 -0600 Message-ID: <20260326185413.1205870-23-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Remove the DD_CLASS_TYPE_*_NAMES classmap types and code. 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 LOC & test-surface; simplify things. Also rename enum class_map_type to enum ddebug_class_map_type. Reviewed-by: Louis Chauvet 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 a262a9862f2b..3939b294c647 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -59,27 +59,16 @@ struct _ddebug { #endif } __attribute__((aligned(8))); =20 -enum class_map_type { +enum ddebug_class_map_type { DD_CLASS_TYPE_DISJOINT_BITS, /** - * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, one per bit. - * expecting hex input. Built for drm.debug, basis for other types. + * DD_CLASS_TYPE_DISJOINT_BITS: classes are independent, mapped to bits[0= ..N]. + * Expects hex input. Built for drm.debug, basis for other types. */ DD_CLASS_TYPE_LEVEL_NUM, /** - * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0-N. - * N turns on just bits N-1 .. 0, so N=3D0 turns all bits off. - */ - DD_CLASS_TYPE_DISJOINT_NAMES, - /** - * DD_CLASS_TYPE_DISJOINT_NAMES: input is a CSV of [+-]CLASS_NAMES, - * classes are independent, like _DISJOINT_BITS. - */ - DD_CLASS_TYPE_LEVEL_NAMES, - /** - * DD_CLASS_TYPE_LEVEL_NAMES: input is a CSV of [+-]CLASS_NAMES, - * intended for names like: INFO,DEBUG,TRACE, with a module prefix - * avoid EMERG,ALERT,CRIT,ERR,WARNING: they're not debug + * DD_CLASS_TYPE_LEVEL_NUM: input is numeric level, 0..N. + * Input N turns on bits 0..N-1 */ }; =20 @@ -89,7 +78,7 @@ struct _ddebug_class_map { const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ - enum class_map_type map_type; + enum ddebug_class_map_type map_type; }; =20 /* diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 443f0fd6e8c4..b8983e095e60 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -667,76 +667,6 @@ static int ddebug_apply_class_bitmap(const struct _dde= bug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 -/* accept comma-separated-list of [+-] classnames */ -static int param_set_dyndbg_classnames(const char *instr, const struct ker= nel_param *kp) -{ - const struct _ddebug_class_param *dcp =3D kp->arg; - const struct _ddebug_class_map *map =3D dcp->map; - unsigned long curr_bits, old_bits; - char *cl_str, *p, *tmp; - int cls_id, totct =3D 0; - bool wanted; - - cl_str =3D tmp =3D kstrdup_and_replace(instr, '\n', '\0', GFP_KERNEL); - if (!tmp) - return -ENOMEM; - - /* start with previously set state-bits, then modify */ - curr_bits =3D old_bits =3D *dcp->bits; - vpr_info("\"%s\" > %s:0x%lx\n", cl_str, KP_NAME(kp), curr_bits); - - for (; cl_str; cl_str =3D p) { - p =3D strchr(cl_str, ','); - if (p) - *p++ =3D '\0'; - - if (*cl_str =3D=3D '-') { - wanted =3D false; - cl_str++; - } else { - wanted =3D true; - if (*cl_str =3D=3D '+') - cl_str++; - } - cls_id =3D match_string(map->class_names, map->length, cl_str); - if (cls_id < 0) { - pr_err("%s unknown to %s\n", cl_str, KP_NAME(kp)); - continue; - } - - /* have one or more valid class_ids of one *_NAMES type */ - switch (map->map_type) { - case DD_CLASS_TYPE_DISJOINT_NAMES: - /* the +/- pertains to a single bit */ - if (test_bit(cls_id, &curr_bits) =3D=3D wanted) { - v3pr_info("no change on %s\n", cl_str); - continue; - } - curr_bits ^=3D BIT(cls_id); - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, *dcp->bits, NULL); - *dcp->bits =3D curr_bits; - v2pr_info("%s: changed bit %d:%s\n", KP_NAME(kp), cls_id, - map->class_names[cls_id]); - break; - case DD_CLASS_TYPE_LEVEL_NAMES: - /* cls_id =3D N in 0..max. wanted +/- determines N or N-1 */ - old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); - curr_bits =3D CLASSMAP_BITMASK(cls_id + (wanted ? 1 : 0 )); - - totct +=3D ddebug_apply_class_bitmap(dcp, &curr_bits, old_bits, NULL); - *dcp->lvl =3D (cls_id + (wanted ? 1 : 0)); - v2pr_info("%s: changed bit-%d: \"%s\" %lx->%lx\n", KP_NAME(kp), cls_id, - map->class_names[cls_id], old_bits, curr_bits); - break; - default: - pr_err("illegal map-type value %d\n", map->map_type); - } - } - kfree(tmp); - vpr_info("total matches: %d\n", totct); - return 0; -} - static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *mod_name) @@ -745,29 +675,17 @@ static int param_set_dyndbg_module_classes(const char= *instr, const struct _ddebug_class_map *map =3D dcp->map; unsigned long inrep, new_bits, old_bits; int rc, totct =3D 0; - - switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: - case DD_CLASS_TYPE_LEVEL_NAMES: - /* handle [+-]classnames list separately, we are done here */ - return param_set_dyndbg_classnames(instr, kp); - - case DD_CLASS_TYPE_DISJOINT_BITS: - case DD_CLASS_TYPE_LEVEL_NUM: - /* numeric input, accept and fall-thru */ - rc =3D kstrtoul(instr, 0, &inrep); - if (rc) { - pr_err("expecting numeric input: %s > %s\n", instr, KP_NAME(kp)); - return -EINVAL; - } - break; - default: - pr_err("%s: bad map type: %d\n", KP_NAME(kp), map->map_type); + char *nl; + + rc =3D kstrtoul(instr, 0, &inrep); + if (rc) { + nl =3D strchr(instr, '\n'); + if (nl) + *nl =3D '\0'; + pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } =20 - /* only _BITS,_NUM (numeric) map-types get here */ switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: /* expect bits. mask and warn if too many */ @@ -833,12 +751,8 @@ int param_get_dyndbg_classes(char *buffer, const struc= t kernel_param *kp) const struct _ddebug_class_map *map =3D dcp->map; =20 switch (map->map_type) { - - case DD_CLASS_TYPE_DISJOINT_NAMES: case DD_CLASS_TYPE_DISJOINT_BITS: return scnprintf(buffer, PAGE_SIZE, "0x%lx\n", *dcp->bits); - - case DD_CLASS_TYPE_LEVEL_NAMES: case DD_CLASS_TYPE_LEVEL_NUM: return scnprintf(buffer, PAGE_SIZE, "%ld\n", *dcp->lvl); default: diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 8434f70b51bb..9c3e53cd26bd 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -74,13 +74,6 @@ DECLARE_DYNDBG_CLASSMAP(map_disjoint_bits, DD_CLASS_TYPE= _DISJOINT_BITS, 0, DD_SYS_WRAP(disjoint_bits, p); DD_SYS_WRAP(disjoint_bits, T); =20 -/* symbolic input, independent bits */ -enum cat_disjoint_names { LOW =3D 10, MID, HI }; -DECLARE_DYNDBG_CLASSMAP(map_disjoint_names, DD_CLASS_TYPE_DISJOINT_NAMES, = 10, - "LOW", "MID", "HI"); -DD_SYS_WRAP(disjoint_names, p); -DD_SYS_WRAP(disjoint_names, T); - /* numeric verbosity, V2 > V1 related */ enum cat_level_num { V0 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, @@ -88,13 +81,6 @@ DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEV= EL_NUM, 14, DD_SYS_WRAP(level_num, p); DD_SYS_WRAP(level_num, T); =20 -/* symbolic verbosity */ -enum cat_level_names { L0 =3D 22, L1, L2, L3, L4, L5, L6, L7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_names, DD_CLASS_TYPE_LEVEL_NAMES, 22, - "L0", "L1", "L2", "L3", "L4", "L5", "L6", "L7"); -DD_SYS_WRAP(level_names, p); -DD_SYS_WRAP(level_names, T); - /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") =20 @@ -102,10 +88,6 @@ static void do_cats(void) { pr_debug("doing categories\n"); =20 - prdbg(LOW); - prdbg(MID); - prdbg(HI); - prdbg(D2_CORE); prdbg(D2_DRIVER); prdbg(D2_KMS); @@ -129,14 +111,6 @@ static void do_levels(void) prdbg(V5); prdbg(V6); prdbg(V7); - - prdbg(L1); - prdbg(L2); - prdbg(L3); - prdbg(L4); - prdbg(L5); - prdbg(L6); - prdbg(L7); } =20 static void do_prints(void) --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD0A93A6F15 for ; Thu, 26 Mar 2026 18:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551308; cv=none; b=AD/7ucqW+4hq3TxCcMV3ZRzsid8FQBhYY2aelgEUIBGqDQY8IaAytTNC+CrVn2QmxyzcZ6FL6Vuk0G5r1LChj/g23E925VHCIMgVyFJWs53UYl7Re9FmS5iXUzfgbS/mfLW/oMgPgT/7pf/GIcCI6LJD462lcF0MnGt0tkOh2Fo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551308; c=relaxed/simple; bh=KxVF9RCo+DN3HAvMx21WIEEd2P0A3mWLs3zR6rMwJ1I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n4jSPMqqs5StEP9cQ9i8PTgjHGaXyaiePPFMfpU8eV2QJvXVxaBCf0+0igV2BU/rXNcz6/S3y/OueRulxpzUHq13lSCyYk8e/ZSkn8JIoSTKe+Fx6QOcBx8f71GEB7Qwcunrrp2BOsQscnmBtmm8GKYt2EfNnsk47XZovCbjA/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Qb2N7WaS; arc=none smtp.client-ip=209.85.160.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qb2N7WaS" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-415b23dd6e5so537972fac.3 for ; Thu, 26 Mar 2026 11:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551305; x=1775156105; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BywPGIITms02mnic3SBKxshcp4ITWYCl/PnFGo9zSWo=; b=Qb2N7WaSe5R8dywTts9FHdYxoaw0lZZVYHhzE84P5a2oYR2Aoo7NfTddK/Zj3eqUY7 j61PMTTM78GRNHK8Cu4ieEjUeDjztH67VOO63eeiQQKl7GYB5k+0KdjWw9OKw8yQgfQl EQLkEAu1CELQIUppL4tMkpUCvclXl3XFiKvaxVAKMr/QrShY8twKAGq86VdzBUK5oGeO x3vuMCKvE2luGl5bb16cg7nC1XiN+qlSE8A+GH68fvWEDzTYA1/LdfCg0Ww0aX4x9ocP aYwdkwqNjG2Nph65kmfsqoiHa1y2QRql+cuc8gBCm6sn7tExqLw97biccbgRCjcgxv7w U8NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551305; x=1775156105; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BywPGIITms02mnic3SBKxshcp4ITWYCl/PnFGo9zSWo=; b=RkQ47gW6VQ6HEXKdsb4G/q+2IA2PwIjOwmXjKVqhg+6zLdc54hfQc5BXvf5HMmdqDK sV04Fx47USxcQMbNtv/oGANG0+LayAJiBKVbK4gVM/ppzrlZEhKAstRDajpZmjwHSVpa sMvgyD3G291gyRS3639KMtBEBop/q6hruvWg2Q8dTLOBhE56JWYfsUu8h2oNb429X4R6 yoQLU/eI/FCP04JZ4i2WqbI8Nm9kV8qPMfCNhPC8ou/O0hO8GJqto0O70i8wGbHWvwWz BRZHnI7HhyBPWArWz7KkzptPwRnU8xIY1S0VIsXmx8mTjyqhrlQxpg1kRMcQttLAWuE0 FfNQ== X-Gm-Message-State: AOJu0YzmGXNzWjSNERzDV6vZh0nKoO6oeZuGVVaoSSdg7yZzVKy8/jD0 h6eRy9EBo47KaBxSCnmjD9KUOsOIg6/Hr9JKvUJwkn+ixrHRUYKqoAkEEScrIA== X-Gm-Gg: ATEYQzwMnlprXJVpbIMXbWtRRheCQbbTe8+CyAzS2nfkelTTpzq8cIVTV7gNMFgHr1e BBA14F4GQM0z+XiE919p2XKzIlnJcj7qrMRD0ybdPZtmWaW4T10F2lXwwp4YTPaj9SAJ7ZKXYfJ ucGAN6ujvg8QkN99fklQ25lYXFr1vaMYxeyLYb3TbXKi2iyhtZI0gekPyKCEZ2bfOKIUWrBbojS jC/725zwKgn2ZPE22hNAFEvLichVDQpzI4g2HmEbNv1JgkbIT+BlndxJ3wQL3urwmSfN0lyWVyK Ieyi4LGDskPMwYndw/LhOtw9YM2/KyuxwdlPP/wd44AZYambiiiFE3c0J4gfZL/c41nQmMWkchz YV1ko7IQ99WDHW28sgM/C1vQ6Gaqn332N4BbDm9aebuV36jfkz4VFIn3X0NRVwkbFjteCczTZFa c1/9G2bgJEPPAB3SjS5toks3UIbjukphzFcU4GW56eAHA9Y/dF X-Received: by 2002:a05:6871:5d14:b0:41c:b0bc:d47e with SMTP id 586e51a60fabf-41cb0bcda7dmr4134040fac.11.1774551304565; Thu, 26 Mar 2026 11:55:04 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:03 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 23/69] selftests-dyndbg: add a dynamic_debug run_tests target Date: Thu, 26 Mar 2026 12:53:27 -0600 Message-ID: <20260326185413.1205870-24-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add a selftest script for dynamic-debug. The config requires CONFIG_TEST_DYNAMIC_DEBUG=3Dm and CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm, which tacitly requires either CONFIG_DYNAMIC_DEBUG=3Dy or CONFIG_DYNAMIC_DEBUG_CORE=3Dy ATM this has just basic_tests(), which modify pr_debug() flags in the builtin params module. This means they're available to manipulate and observe the effects in "cat control". 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: [jimc@gandalf b0-ftrace]$ vrun_t virtme-ng 1.32+115.g07b109d doing: vng --name v6.14-rc4-60-gd5f48427de0c \ --user root -v -p 4 -a dynamic_debug.verbose=3D3 V=3D1 \ -- ../tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh virtme: waiting for virtiofsd to start .. And add dynamic_debug to TARGETS, so `make run_tests` sees it properly For the impatient, set TARGETS explicitly: [root@v6 selftests]# make TARGETS=3Ddynamic_debug run_tests make[1]: Nothing to be done for 'all'. TAP version 13 1..1 # timeout set to 45 # selftests: dynamic_debug: dyndbg_selftest.sh # # BASIC_TESTS 95.422122] dyndbg: query 0: 0"=3D_" mod:* ... NOTES 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=3Dy: basic-tests() and comma-terminator-tests() test for the presence of the builtin pr_debugs in module/main.c, which I deemed stable and therefore safe to count. That said, the test fails if only CONFIG_DYNAMIC_DEBUG_CORE=3Dy is set. It could be rewritten to test against test-dynamic-debug.ko, but that just trades one config dependence for another. CONFIG_TEST_DYNAMIC_DEBUG=3Dm As written, test_percent_splitting() modprobes test_dynamic_debug, enables several classes, and counts 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. Reviewed-by: Louis Chauvet Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Signed-off-by: Jim Cromie --- MAINTAINERS | 1 + tools/testing/selftests/Makefile | 1 + .../testing/selftests/dynamic_debug/Makefile | 9 + tools/testing/selftests/dynamic_debug/config | 7 + .../dynamic_debug/dyndbg_selftest.sh | 257 ++++++++++++++++++ 5 files changed, 275 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 7d10988cbc62..b6104f33c3fc 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9029,6 +9029,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/* =20 DYNAMIC INTERRUPT MODERATION M: Tal Gilboa diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Mak= efile index 450f13ba4cca..e4fc4dd80cf9 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile @@ -27,6 +27,7 @@ TARGETS +=3D drivers/net/team TARGETS +=3D drivers/net/virtio_net TARGETS +=3D drivers/platform/x86/intel/ifs TARGETS +=3D dt +TARGETS +=3D dynamic_debug TARGETS +=3D efivarfs TARGETS +=3D exec TARGETS +=3D fchmodat2 diff --git a/tools/testing/selftests/dynamic_debug/Makefile b/tools/testing= /selftests/dynamic_debug/Makefile new file mode 100644 index 000000000000..6d06fa7f1040 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/Makefile @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-only +# borrowed from Makefile for user memory selftests + +# No binaries, but make sure arg-less "make" doesn't trigger "run_tests" +all: + +TEST_PROGS :=3D dyndbg_selftest.sh + +include ../lib.mk diff --git a/tools/testing/selftests/dynamic_debug/config b/tools/testing/s= elftests/dynamic_debug/config new file mode 100644 index 000000000000..0f906ff53908 --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/config @@ -0,0 +1,7 @@ + +# basic tests ref the builtin params module +CONFIG_DYNAMIC_DEBUG=3Dm + +# more testing is possible with these +# CONFIG_TEST_DYNAMIC_DEBUG=3Dm +# CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh new file mode 100755 index 000000000000..465fad3f392c --- /dev/null +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -0,0 +1,257 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-only + +V=3D${V:=3D0} # invoke as V=3D1 $0 for global verbose +RED=3D"\033[0;31m" +GREEN=3D"\033[0;32m" +YELLOW=3D"\033[0;33m" +BLUE=3D"\033[0;34m" +MAGENTA=3D"\033[0;35m" +CYAN=3D"\033[0;36m" +NC=3D"\033[0;0m" +error_msg=3D"" + +[ -e /proc/dynamic_debug/control ] || { + echo -e "${RED}: this test requires CONFIG_DYNAMIC_DEBUG=3Dy ${NC}" + exit 0 # nothing to test here, no good reason to fail. +} + +# need info to avoid failures due to untestable configs + +[ -f "$KCONFIG_CONFIG" ] || KCONFIG_CONFIG=3D".config" +if [ -f "$KCONFIG_CONFIG" ]; then + echo "# consulting KCONFIG_CONFIG: $KCONFIG_CONFIG" + grep -q "CONFIG_DYNAMIC_DEBUG=3Dy" $KCONFIG_CONFIG ; LACK_DD_BUILTIN= =3D$? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG=3Dm" $KCONFIG_CONFIG ; LACK_TMOD=3D= $? + grep -q "CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD=3Dm" $KCONFIG_CONFIG ; LACK_= TMOD_SUBMOD=3D$? + if [ $V -eq 1 ]; then + echo LACK_DD_BUILTIN: $LACK_DD_BUILTIN + echo LACK_TMOD: $LACK_TMOD + echo LACK_TMOD_SUBMOD: $LACK_TMOD_SUBMOD + fi +else + LACK_DD_BUILTIN=3D0 + LACK_TMOD=3D0 + LACK_TMOD_SUBMOD=3D0 +fi + +function vx () { + echo $1 > /sys/module/dynamic_debug/parameters/verbose +} + +function ddgrep () { + grep $1 /proc/dynamic_debug/control +} + +function doprints () { + cat /sys/module/test_dynamic_debug/parameters/do_prints +} + +function ddcmd () { + exp_exit_code=3D0 + num_args=3D$# + if [ "${@:$#}" =3D "pass" ]; then + num_args=3D$#-1 + elif [ "${@:$#}" =3D "fail" ]; then + num_args=3D$#-1 + exp_exit_code=3D1 + fi + args=3D${@:1:$num_args} + output=3D$((echo "$args" > /proc/dynamic_debug/control) 2>&1) + exit_code=3D$? + error_msg=3D$(echo $output | cut -d ":" -f 5 | sed -e 's/^[[:space:]]*= //') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function handle_exit_code() { + local exp_exit_code=3D0 + [ $# =3D=3D 4 ] && exp_exit_code=3D$4 + if [ $3 -ne $exp_exit_code ]; then + echo -e "${RED}: $BASH_SOURCE:$1 $2() expected to exit with code $= exp_exit_code" + [ $3 =3D=3D 1 ] && echo "Error: '$error_msg'" + exit + fi +} + +# $1 - pattern to match, pattern in $1 is enclosed by spaces for a match "= "\s$1\s" +# $2 - number of times the pattern passed in $1 is expected to match +# $3 - optional can be set either to "-r" or "-v" +# "-r" means relaxed matching in this case pattern provided in $1 is= passed +# as is without enclosing it with spaces +# "-v" prints matching lines +# $4 - optional when $3 is set to "-r" then $4 can be used to pass "-v" +function check_match_ct { + pattern=3D"\s$1\s" + exp_cnt=3D0 + + [ "$3" =3D=3D "-r" ] && pattern=3D"$1" + let cnt=3D$(ddgrep "$pattern" | wc -l) + if [ $V -eq 1 ] || [ "$3" =3D=3D "-v" ] || [ "$4" =3D=3D "-v" ]; then + echo -ne "${BLUE}" && ddgrep $pattern && echo -ne "${NC}" + fi + [ $# -gt 1 ] && exp_cnt=3D$2 + if [ $cnt -ne $exp_cnt ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO check failed expected $= exp_cnt on $1, got $cnt" + exit + else + echo ": $cnt matches on $1" + fi +} + +# $1 - trace instance name +# #2 - if > 0 then directory is expected to exist, if <=3D 0 then otherwise +# $3 - "-v" for verbose +function check_trace_instance_dir { + if [ -e /sys/kernel/tracing/instances/$1 ]; then + if [ "$3" =3D=3D "-v" ] ; then + echo "ls -l /sys/kernel/tracing/instances/$1: " + ls -l /sys/kernel/tracing/instances/$1 + fi + if [ $2 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instanc= e \ + '/sys/kernel/tracing/instances/$1' does exist" + exit + fi + else + if [ $2 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error trace instanc= e \ + '/sys/kernel/tracing/instances/$1' does not exist" + exit + fi + fi +} + +function tmark { + echo $* > /sys/kernel/tracing/trace_marker +} + +# $1 - trace instance name +# $2 - line number +# $3 - if > 0 then the instance is expected to be opened, otherwise +# the instance is expected to be closed +function check_trace_instance { + output=3D$(tail -n9 /proc/dynamic_debug/control | grep ": Opened trace= instances" \ + | xargs -n1 | grep $1) + if [ "$output" !=3D $1 ] && [ $3 -gt 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not opened" + exit + fi + if [ "$output" =3D=3D $1 ] && [ $3 -le 0 ]; then + echo -e "${RED}: $BASH_SOURCE:$2 trace instance $1 is not closed" + exit + fi +} + +function is_trace_instance_opened { + check_trace_instance $1 $BASH_LINENO 1 +} + +function is_trace_instance_closed { + check_trace_instance $1 $BASH_LINENO 0 +} + +# $1 - trace instance directory to delete +# $2 - if > 0 then directory is expected to be deleted successfully, if <= =3D 0 then otherwise +function del_trace_instance_dir() { + exp_exit_code=3D1 + [ $2 -gt 0 ] && exp_exit_code=3D0 + output=3D$((rmdir /sys/kernel/debug/tracing/instances/$1) 2>&1) + exit_code=3D$? + error_msg=3D$(echo $output | cut -d ":" -f 3 | sed -e 's/^[[:space:]]*= //') + handle_exit_code $BASH_LINENO $FUNCNAME $exit_code $exp_exit_code +} + +function error_log_ref { + # to show what I got + : echo "# error-log-ref: $1" + : echo cat \$2 +} + +function ifrmmod { + lsmod | grep $1 2>&1>/dev/null && rmmod $1 +} + +# $1 - text to search for +function search_trace() { + search_trace_name 0 1 $1 +} + +# $1 - trace instance name, 0 for global event trace +# $2 - line number counting from the bottom +# $3 - text to search for +function search_trace_name() { + if [ "$1" =3D "0" ]; then + buf=3D$(cat /sys/kernel/debug/tracing/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/trace | head -1 | sed -e = 's/^[[:space:]]*//') + else + buf=3D$(cat /sys/kernel/debug/tracing/instances/$1/trace) + line=3D$(tail -$2 /sys/kernel/debug/tracing/instances/$1/trace | head= -1 | \ + sed -e 's/^[[:space:]]*//') + fi + if [ $2 =3D 0 ]; then + # whole-buf check + output=3D$(echo $buf | grep "$3") + else + output=3D$(echo $line | grep "$3") + fi + if [ "$output" =3D "" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO search for '$3' fai= led \ + in line '$line' or '$buf'" + exit + fi + if [ $V =3D 1 ]; then + echo -e "${MAGENTA}: search_trace_name in $1 found: \n$output \nin:${= BLUE} $buf ${NC}" + fi +} + +# $1 - error message to check +function check_err_msg() { + if [ "$error_msg" !=3D "$1" ]; then + echo -e "${RED}: $BASH_SOURCE:$BASH_LINENO error message '$error_m= sg' \ + does not match with '$1'" + exit + fi +} + +function basic_tests { + echo -e "${GREEN}# BASIC_TESTS ${NC}" + if [ $LACK_DD_BUILTIN -eq 1 ]; then + echo "SKIP" + return + fi + ddcmd =3D_ # zero everything + check_match_ct =3Dp 0 + + # module params are builtin to handle boot args + check_match_ct '\[params\]' 4 -r + ddcmd module params +mpf + check_match_ct =3Dpmf 4 + + # multi-cmd input, newline separated, with embedded comments + cat <<"EOF" > /proc/dynamic_debug/control + module params =3D_ # clear params + module params +mf # set flags + module params func parse_args +sl # other flags +EOF + check_match_ct =3Dmf 3 + check_match_ct =3Dmfsl 1 + ddcmd =3D_ +} + +tests_list=3D( + basic_tests +) + +# Run tests + +ifrmmod test_dynamic_debug_submod +ifrmmod test_dynamic_debug + +for test in "${tests_list[@]}" +do + $test + echo "" +done +echo -en "${GREEN}# Done on: " +date +echo -en "${NC}" --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A6A440FDA8 for ; Thu, 26 Mar 2026 18:55:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551308; cv=none; b=re6d4LJnfb8i9w1Gwo8W0DET/JC6A9oefQJiXLsZ5Q+BHzMyrtkx5of6dw+rwxkYOXO0wLsFAwcvA3XvVvkx5GxDXQ4rPubAVCVzqqTcVlLVHUYKslKuKHXqI12smBAX9e2tGV1KN77dtwi3YlX89tFo7np4hPSquXwDA1FK2O0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551308; c=relaxed/simple; bh=hIKjF0ZA4fn0lNnk1oWbQpUQeAju5ZRz2ynTKZbuZAw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BJjxn7j3Q66HnDa7LVqrHHsPfnV3OKdg86ovHo2ozlEJ/szj0tlIsVQ6BedPRkiV8wPg7Q1dALj+aZ7kleDBZO2XkF66D88RAwDpXMqknoD4wn8kpot5uBHLHhizfWsASVKriP5iGBfqbxgjhO/jxTfEKIEmJEOuc5HTInC7Bko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KeJpMnvj; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KeJpMnvj" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-40ea611d1a4so611528fac.2 for ; Thu, 26 Mar 2026 11:55:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551306; x=1775156106; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BtzYjTItScPv3ZPv5u0hQB8QpwmveJQikTbqnzcN8xo=; b=KeJpMnvjG/U5oEAFOvgZXlfasVVeXvsp+nURhVQUwMmG8lEa8tTbfotPM8al5m1j7t HPXluCZ5NBgCSk3k5dc3Ocu2PlqTpG4BiZqPPJhV8R8IzirgLp0bAMCtGoWuZPOsiq7u NG1KUZd113/u42Z1w2+eGarn5mjIeJO/x6Edwd7eKknLuoZfnip8yACko3Y+nXhQ/2JB k7HGd3pg44pNRB3YKtl6Wwxn8tG+E8yOZ4Lzca4WMFv3ilOW8YwjEJ09VYtE/jobelVd qk8YfxXZApYlGMdz4G1dm4VnmciMbItRkvn4OrPRKc3KWs3K4pL+bYhAw+wRgtzIMhr5 N2Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551306; x=1775156106; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BtzYjTItScPv3ZPv5u0hQB8QpwmveJQikTbqnzcN8xo=; b=B5PBhHZnWl2bnNx758oWpV1xyybh5rYAufkRGcp1OlEc8e3zVhBToH9e0X3HR5/IK8 W+LC5E/DBYvdmgQqUcrCtG8LNqkqVmbCe49PoeO3EUzSHtRJLiBVUvcVIZQRzhZIC2ev VaZp+FA2EYRhSSm0zsorI0OkQXwgTkRJEfeN8jQOa+m+cS78WFWVQDkiBOQEaKdPqcDV 5tc3Ch2hKJIignn+etMOOEIBQK9FvkCpJz7fp9XVyVr/M8k6+wk9sdy6htVpBCOYT2Eq ZjbJoDY7d8dvdOYhOkePR66d/qc8BV92uxdmewOk7iVVGAOICNxpwNfkmaI3iCsvODRV xzfQ== X-Gm-Message-State: AOJu0YyiSEvS8K1rrH0RGcdDX1jlhcqtTL0pE5JFJ879pbmTOpskeTd9 4f8Llii/e7t7fXFCBCu2FeFtGiIqejLta90idPUetjxS2pDZsc01Y1F4KU4ffg== X-Gm-Gg: ATEYQzz0UNTvusVSvKCXeBUnFgtXkIRhSvXtfo8DvR30g5Qvt5pnmR9UKoHhgBL+OwQ ugIxN366Ds0Bq9M9bux2K+vChUIjSckc9VFsiXkN4TaX+2vcgpP/qGuePvvOUz01E0gfA5izV8B 0nafexR8n9tpmnNmcjLmlkW9Z2uTmSUToRnnBddlNNf1VBCtpaIvxzXY5XJRFVp1YzBmQK76aVF JHjTEf28f3B12fi9Ufr5sTgHgPl5V9FPj/Y6F9lrwCUAXTTwhPHeRmT/tsR3icngl0asO/p96eF yABv1U1uOjObEe1zjWV7Mdd6f5PaX1GmKl2H7LVDNBvnLy9/WZZRoqmZF2uBAGixF+8F3RWPZxT XrKJerWDtOa6TRvpQ1DalohC4J/Ah+sXIHCDQjRwwmEmt6+kjHQLkapeaWFdC7QRXtlFS6K/3Jh yEAEVo+StcB52nVXHcsr0LRSoPtaUEqZUCxSvLUi6blEbpPHyn X-Received: by 2002:a05:6870:d18d:b0:417:4679:d550 with SMTP id 586e51a60fabf-41ca6e15946mr4548356fac.22.1774551305958; Thu, 26 Mar 2026 11:55:05 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:05 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 24/69] dyndbg: change __dynamic_func_call_cls* macros into expressions Date: Thu, 26 Mar 2026 12:53:28 -0600 Message-ID: <20260326185413.1205870-25-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The Xe driver's XE_IOCTL_DBG macro calls drm_dbg() from inside an if (expression). This breaks when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy because the invoked macro has a do-while-0 wrapper, and is not an expression. 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"); Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 3939b294c647..33291abd8971 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -224,24 +224,24 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, * (|_cls): adds in _DPRINT_CLASS_DFLT as needed * (|_no_desc): former gets callsite descriptor as 1st arg (for prdbgs) */ -#define __dynamic_func_call_cls(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) { \ func(&id, ##__VA_ARGS__); \ __dynamic_dump_stack(id); \ } \ -} while (0) +}) #define __dynamic_func_call(id, fmt, func, ...) \ __dynamic_func_call_cls(id, _DPRINTK_CLASS_DFLT, fmt, \ func, ##__VA_ARGS__) =20 -#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) do { \ +#define __dynamic_func_call_cls_no_desc(id, cls, fmt, func, ...) ({ \ DEFINE_DYNAMIC_DEBUG_METADATA_CLS(id, cls, fmt); \ if (DYNAMIC_DEBUG_BRANCH(id)) { \ func(__VA_ARGS__); \ __dynamic_dump_stack(id); \ } \ -} while (0) +}) #define __dynamic_func_call_no_desc(id, fmt, func, ...) \ __dynamic_func_call_cls_no_desc(id, _DPRINTK_CLASS_DFLT, \ fmt, func, ##__VA_ARGS__) --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 942B1421893 for ; Thu, 26 Mar 2026 18:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551312; cv=none; b=HsNrvpzd0AKlviKw154Im27LZskdBxJVbt94HWk4ROS7c2ACdbUQHoEQt0bdyCNfDMIH9Xdqh057+QUyN98fZtfZHvVCIwYQ2NqdZhbMQNf/SvrXhjQ4mKchXS+/IzFVBEoCaTTMx/+8lGQlAbZLAc3gxlaEU5MeK30Qf1pFooY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551312; c=relaxed/simple; bh=kmDo6QOy+P+flbQJ0FkeWywVg6V4bS+rlM9ar2nOMnI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T/ZvQXbbeViuzQZmRjzRbxf4hD5O+E35D2wF9qlN/quskDrXSHoUUOTEnu/GMPDcLZsXMui4xFv72SXZUsdBvaJ5e+sqOf8y2YcBZ4+4r1hPb7O+QQ5LA2Uo4HmpRgGbZJfrIYzxORKohm8Nv7jyiVsWsc6ehEhlM/Z8EWFDTjE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=H3nO5h/s; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="H3nO5h/s" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-409de4132b5so816299fac.1 for ; Thu, 26 Mar 2026 11:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551308; x=1775156108; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tv11USxWVRVx0qnzDZ/hVjVtWSj5WY0mvwELd3NG4FM=; b=H3nO5h/sFobEvhecCh7zAmq5y6GJ80KtQMAYov3iiT+TW/zC7Bv58fOHPgcw8qCbUg cGCn4GjRGokzcNsnKQdELBu9UmIM7fuOpt47nywfE84FuWLy+1EY7chLdqaYqJEaGIqn 539akXndn2Q4DtesFQu4SVbErlzA/FQK5d499JGeN9dB97wiqzjh/AQNvXl//YtE1tSc MtYCAXjVNl1CVZp//0JqQSUbA4I52TMH0jHjhH8lWl2qscM8mYfXfWP4VlJSql/idMyD vPlvPMrDeel13eWGwN+NDOX8Tac3/NKCeUdsGqu+nASyLRx5GDOkaQBviQS0r/4Dnlag gkVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551308; x=1775156108; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Tv11USxWVRVx0qnzDZ/hVjVtWSj5WY0mvwELd3NG4FM=; b=Gm24nPdEdONKFq0bK1Uta715xwMgacHZKaftmKSHj4F2XIomDNQ+huxZxTlE20cJGe PlCFCs/Gqp2FoIOzeL/9k1hRTKsBLR26WKvqlxnnbnFhgvD5DKXgoWZiYa7Dh+IqnCkh JXDJQ1MzVJmuGgPMNhJgf95YQ2CtHsgv4ZqstJKZx5YyYlGPhI2V+esx1jkW1vw6TBMm o3y2ZOFUYbcOK5aRdSz2idHPfH2P9jvpVjsDEtA+ERI52dhP7y7O0KFduQuwKmeTmB4e Jv/16Te86AkniuzYW48eWPWGxVAxq2uB29VyEtrX0QDS0gsNcPtTE4ofrn6/SnG+u3Rf RqSQ== X-Gm-Message-State: AOJu0YxiBrtEbwro7WzkbH7o2dlLCskitkVl1+3wo6c6JCYAdtZoRfW7 XwGev+/ik122CRNpE9a3RrcyEkGVlH/LjTh2xjKcv9BVh6Z/LbSfN0ooNlIhSA== X-Gm-Gg: ATEYQzxy0DlPSj+ukRY9sFyyG1/Nq39GhInTOY5giO8rLuydOQHL7MBuFFnqIPFmusT nAOeYnQtANCtBp6GQzoDikXPqwz5Q1xXspdIDnhijmlF8WndPKZlNVztgGJeSV27nU5glYuuWNZ zUYpVM4wdv/JYP3wWkSMjJ1SsV7rYWqcHAPiUZIwpFVWQwxpYSuFYp7aIwb8EV2kfmbrUBiZDU1 MHHHH2xnaQCDBDtL+7P4/3uBXtZV3xL9GSGnvipsapaCGOG5bEH6YJYzjPP+PpkBYwp18LL1gwt xhrjOEExzjwnHURootXlwPiPaDLU29NuI3Rr68gD6ExufiVS2QUa96vhlezBTmtFoRemTwigUPq 8SZdlFQbVDKazZSZi866xe1dr6KgZEsPL4qUuh0S0cy51hg7lt6ACwuhIFYd2g1LgUjsuDx+7b1 5bYOQeIQPB/ozQAOGhpk00wtsW41NzhiCE8vloaJoSvuHu0tq+ X-Received: by 2002:a05:6871:61c4:b0:417:435c:b9ef with SMTP id 586e51a60fabf-41ca6fd525emr4653009fac.11.1774551307704; Thu, 26 Mar 2026 11:55:07 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:06 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-doc@vger.kernel.org Subject: [PATCH v12 25/69] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP Date: Thu, 26 Mar 2026 12:53:29 -0600 Message-ID: <20260326185413.1205870-26-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" commit aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") DECLARE_DYNDBG_CLASSMAP() has a design error; its usage fails a basic K&R rule: "define once, refer many times". When CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, it is used across DRM core & drivers; each invocation allocates/inits the classmap understood by that module. They *all* must match for the DRM modules to respond consistently when drm.debug categories are enabled. This is at least a maintenance hassle. Worse, its the root-cause of the CONFIG_DRM_USE_DYNAMIC_DEBUG=3DY regression; its use in both core & drivers obfuscates the 2 roles, muddling the design, yielding an incomplete initialization when modprobing drivers: 1st drm.ko loads, and dyndbg initializes its drm.debug callsites, then a drm-driver loads, but too late for the drm.debug enablement. And that led to: commit bb2ff6c27bc9 ("drm: Disable dynamic debug as broken") So retire it, replace with 2 macros: DYNAMIC_DEBUG_CLASSMAP_DEFINE - invoked once from core - drm.ko DYNAMIC_DEBUG_CLASSMAP_USE* - from all drm drivers and helpers. NB: name-space de-noise DYNAMIC_DEBUG_CLASSMAP_DEFINE: this reworks DECLARE_DYNDBG_CLASSMAP, basically by dropping the static qualifier on the classmap, and exporting it instead. DYNAMIC_DEBUG_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 new section is scanned "differently" DECLARE_DYNDBG_CLASSMAP is preserved temporarily, to decouple DRM adaptation work and avoid compile-errs before its done. 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 initial scan is repeated for classmap-users. dyndbg's existing __dyndbg_classes[] section does: . catalogs the module's classmaps . tells dyndbg about them, allowing >control . DYNAMIC_DEBUG_CLASSMAP_DEFINE creates section records. . we rename it to: __dyndbg_class_maps[] this patch adds __dyndbg_class_users[] section: . catalogs users of classmap definitions from elsewhere . authorizes dyndbg to >control user's class'd prdbgs . DYNAMIC_DEBUG_CLASSMAP_USE() creates section records. 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: Add a new BOUNDED_SECTION for __dyndbg_class_users. this creates start,stop C symbol-names for the section. TLDR ? dynamic_debug.c: 2 changes from ddebug_add_module() & ddebug_change(): ddebug_add_module(): ddebug_attach_module_classes() is reworked/renamed/split into debug_apply_class_maps(), ddebug_apply_class_users(), which both call ddebug_apply_params(). 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've been 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 OR 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: 0. define an enum for the classmap's class_ids drm.debug gives us DRM_UT_<*> (aka ) multiple classmaps in a module(s) must share 0-62 classid space. 1. DYNAMIC_DEBUG_CLASSMAP_DEFINE(classmap_name, .. "") names the classes, maps them to consecutive class-ids. convention here is stringified ENUM_SYMBOLS these become API/ABI if 2 is done. 2. DYNAMIC_DEBUG_CLASSMAP_PARAM* (classmap_name) adds a controlling kparam to the class 3. DYNAMIC_DEBUG_CLASSMAP_USE(classmap_name) for subsystem/group/drivers to use extern created by 1. Move all the enum declarations together, to better explain how they share the 0..62 class-id space available to a module (non-overlapping subranges). reorg macros 2,3 by name. This gives a tabular format, making it easy to see the pattern of repetition, and the points of change. And extend the test to replicate the 2-module (parent & dependent) scenario which caused the CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy regression seen in drm & drivers. The _submod.c is a 2-line file: #define _SUBMOD, #include parent. This gives identical complements of prdbgs in parent & _submod, and thus identical print behavior when all of: >control, >params, and parent->_submod propagation are working correctly. It also puts all the parent/_submod declarations together in the same source; the new ifdef _SUBMOD block invokes DYNAMIC_DEBUG_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/Y, since this is disallowed by dependence). Y/Y, Y/M testing once exposed a missing __align(8) in the _METADATA macro, which M/M didn't see, probably because the module-loader memory placement constrained it from misalignment. Fixes: aad0214f3026 ("dyndbg: add DECLARE_DYNDBG_CLASSMAP macro") cc: linux-doc@vger.kernel.org Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- -v? replace di with &dt->info, since di becomes stale fix dd_mark_vector_subrange macro param ordering to match kdoc s/base/offset/ in _ddebug_class_user, to reduce later churn -v12 - squash in _USE_ and refinements. A: dyndbg: add DYNAMIC_DEBUG_CLASSMAP_USE_(dd_class_name, offset) Allow a module to use 2 classmaps together that would otherwise have a class_id range conflict. Suppose a drm-driver does: DYNAMIC_DEBUG_CLASSMAP_USE(drm_debug_classes); DYNAMIC_DEBUG_CLASSMAP_USE(drm_accel_xfer_debug); If (for some reason) drm-accel cannot define their constants to avoid DRM's drm_debug_category 0..10 reservations, we would have a conflict with reserved-ids. In this case a driver needing to use both would _USE_ one of them with an offset to avoid the conflict. This will handle most forseeable cases; perhaps a 3-X-3 of classmap-defns X classmap-users would get too awkward and fiddly. B: dyndbg: refine DYNAMIC_DEBUG_CLASSMAP_USE_ macro The struct _ddebug_class_user _varname construct is needlessly permissive; it has a static qualifier, and a unique name. Together, these allow a module to have 2 or more _USE(foo)s, which is contrary to its purpose, and therefore potentially confusing. So drop the unique name, and the static qualifier, and replace it with an extern pre-declaration. Construct the name by pasting together the _var (which is the name of the exported ddebug_class_map), and __KBUILD_MODNAME (which is the user module name). This allows only a single USE() reference to the exported record, which is all that is required. Signed-off-by: Jim Cromie --- MAINTAINERS | 2 +- include/asm-generic/dyndbg.lds.h | 7 +- include/linux/dynamic_debug.h | 159 +++++++++++++++++++++++--- kernel/module/main.c | 3 + lib/Kconfig.debug | 24 +++- lib/Makefile | 5 + lib/dynamic_debug.c | 185 ++++++++++++++++++++++++------- lib/test_dynamic_debug.c | 132 ++++++++++++++++------ lib/test_dynamic_debug_submod.c | 14 +++ 9 files changed, 433 insertions(+), 98 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c diff --git a/MAINTAINERS b/MAINTAINERS index b6104f33c3fc..fed071308998 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9028,7 +9028,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 F: tools/testing/selftests/dynamic_debug/* =20 DYNAMIC INTERRUPT MODERATION diff --git a/include/asm-generic/dyndbg.lds.h b/include/asm-generic/dyndbg.= lds.h index 8345ac6c52b7..6e38d0f1d00b 100644 --- a/include/asm-generic/dyndbg.lds.h +++ b/include/asm-generic/dyndbg.lds.h @@ -6,7 +6,8 @@ #define DYNDBG_SECTIONS() \ . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__dyndbg_descriptors, ___dyndbg_descs) \ - BOUNDED_SECTION_BY(__dyndbg_class_maps, ___dyndbg_class_maps) + BOUNDED_SECTION_BY(__dyndbg_class_maps, ___dyndbg_class_maps) \ + BOUNDED_SECTION_BY(__dyndbg_class_users, ___dyndbg_class_users) =20 #define MOD_DYNDBG_SECTIONS() \ __dyndbg_descriptors : { \ @@ -16,6 +17,10 @@ __dyndbg_class_maps : { \ BOUNDED_SECTION_BY(__dyndbg_class_maps, \ ___dyndbg_class_maps) \ + } \ + __dyndbg_class_users : { \ + BOUNDED_SECTION_BY(__dyndbg_class_users, \ + ___dyndbg_class_users) \ } =20 #endif /* __ASM_GENERIC_DYNDBG_LDS_H */ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 33291abd8971..71c91bc8d3a6 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -72,19 +72,30 @@ enum ddebug_class_map_type { */ }; =20 +/* + * map @class_names 0..N to consecutive constants starting at @base. + */ struct _ddebug_class_map { - struct module *mod; /* NULL for builtins */ - const char *mod_name; /* needed for builtins */ + const struct module *mod; /* NULL for builtins */ + const char *mod_name; /* needed for builtins */ const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ enum ddebug_class_map_type map_type; }; =20 +struct _ddebug_class_user { + char *mod_name; + struct _ddebug_class_map *map; + const int offset; /* offset from map->base */ +}; + /* - * @_ddebug_info: gathers module/builtin dyndbg_* __sections together. + * @_ddebug_info: gathers module/builtin __dyndbg_ __sections + * together, each is a vec_: a struct { struct T start[], int len }. + * * For builtins, it is used as a cursor, with the inner structs - * marking sub-vectors of the builtin __sections in DATA. + * marking sub-vectors of the builtin __sections in DATA_DATA */ struct _ddebug_descs { struct _ddebug *start; @@ -96,10 +107,16 @@ struct _ddebug_class_maps { int len; }; =20 +struct _ddebug_class_users { + struct _ddebug_class_user *start; + int len; +}; + struct _ddebug_info { const char *mod_name; struct _ddebug_descs descs; struct _ddebug_class_maps maps; + struct _ddebug_class_users users; }; =20 struct _ddebug_class_param { @@ -118,12 +135,81 @@ struct _ddebug_class_param { #if defined(CONFIG_DYNAMIC_DEBUG) || \ (defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE)) =20 +/* + * dyndbg classmaps is modelled closely upon drm.debug: + * + * 1. run-time control via sysfs node (api/abi) + * 2. each bit 0..N controls a single "category" + * 3. a pr_debug can have only 1 category, not several. + * 4. "kind" is a compile-time constant: 0..N or BIT() thereof + * 5. macro impls - give compile-time resolution or fail. + * + * dyndbg classmaps design axioms/constraints: + * + * . optimizing compilers use 1-5 above, so preserve them. + * . classmaps.class_id *is* the category. + * . classmap definers/users are modules. + * . every user wants 0..N + * . 0..N exposes as ABI + * . no 1 use-case wants N > 32, 16 is more usable + * . N <=3D 64 in *all* cases + * . modules/subsystems make category/classmap decisions + * . ie an enum: DRM has DRM_UT_CORE..DRM_UT_DRMRES + * . some categories are exposed to user: ABI + * . making modules change their numbering is bogus, avoid if possible + * + * We can solve for all these at once: + * A: map class-names to a .class_id range at compile-time + * B: allow only "class NAME" changes to class'd callsites at run-time + * C: users/modules must manage 0..62 hardcoded .class_id range limit. + * D: existing pr_debugs get CLASS_DFLT=3D63 + * + * By mapping class-names at >control to class-ids underneath, and + * responding only to class-names DEFINEd or USEd by the module, we + * can private-ize the class-id, and adjust class'd pr_debugs only by + * their names. + * + * This give us: + * E: class_ids without classnames are unreachable + * F: user modules opt-in by DEFINEing a classmap and/or USEing another + * + * Multi-classmap modules/groups are supported, if the classmaps share + * the class_id space [0..62] without overlap/conflict. + * + * NOTE: Due to the integer class_id, this api cannot disallow these: + * __pr_debug_cls(0, "fake CORE msg"); works only if a classmap maps 0. + * __pr_debug_cls(22, "no such class"); compiles but is not reachable + */ + /** - * 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 + * DYNAMIC_DEBUG_CLASSMAP_DEFINE - define debug classes used by a module. + * @_var: name of the classmap, exported for other modules coordinated u= se. + * @_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 s= pace + * @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 DYNAMIC_DEBUG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ + static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + extern struct _ddebug_class_map _var; \ + struct _ddebug_class_map __aligned(8) __used \ + __section("__dyndbg_class_maps") _var =3D { \ + .mod =3D THIS_MODULE, \ + .mod_name =3D KBUILD_MODNAME, \ + .base =3D (_base), \ + .map_type =3D (_mapty), \ + .length =3D ARRAY_SIZE(_var##_classnames), \ + .class_names =3D _var##_classnames, \ + }; \ + EXPORT_SYMBOL(_var) + +/* + * XXX: keep this until DRM adapts to use the DEFINE/USE api, it + * differs from DYNAMIC_DEBUG_CLASSMAP_DEFINE by the lack of the + * extern/EXPORT on the struct init, and cascading thinkos. */ #define DECLARE_DYNDBG_CLASSMAP(_var, _maptype, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ @@ -137,6 +223,44 @@ struct _ddebug_class_param { .class_names =3D _var##_classnames, \ } =20 +/** + * DYNAMIC_DEBUG_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, and ignores unknown names. This is a wrapper for + * DYNAMIC_DEBUG_CLASSMAP_USE_() with a base offset of 0. + */ +#define DYNAMIC_DEBUG_CLASSMAP_USE(_var) \ + DYNAMIC_DEBUG_CLASSMAP_USE_(_var, 0) + +/** + * DYNAMIC_DEBUG_CLASSMAP_USE_ - refer to a classmap with a manual offset. + * @_var: name of the exported classmap var to use. + * @_offset: an integer offset to add to the class IDs of the used map. + * + * This is an extended version of DYNAMIC_DEBUG_CLASSMAP_USE(). It should + * only be used to resolve class ID conflicts when a module uses multiple + * classmaps that have overlapping ID ranges. + * + * The final class IDs for the used map will be calculated as: + * original_map_base + class_index + @_offset. + */ +#define DYNAMIC_DEBUG_CLASSMAP_USE_(_var, _offset) \ + extern struct _ddebug_class_map _var; \ + static_assert((_offset) >=3D 0 && (_offset) < _DPRINTK_CLASS_DFLT, \ + "classmap use offset must be in 0..62"); \ + extern struct _ddebug_class_user __aligned(8) \ + __PASTE(_var ## _, __KBUILD_MODNAME); \ + struct _ddebug_class_user __aligned(8) __used \ + __section("__dyndbg_class_users") \ + __PASTE(_var ## _, __KBUILD_MODNAME) =3D { \ + .mod_name =3D KBUILD_MODNAME, \ + .map =3D &(_var), \ + .offset =3D _offset \ + } + extern __printf(2, 3) void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); =20 @@ -298,12 +422,18 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, KERN_DEBUG, prefix_str, prefix_type, \ rowsize, groupsize, buf, len, ascii) =20 -/* for test only, generally expect drm.debug style macro wrappers */ -#define __pr_debug_cls(cls, fmt, ...) do { \ +/* + * This is the "model" class variant of pr_debug. It is not really + * intended for direct use; I'd encourage DRM-style drm_dbg_ + * macros for the interface, along with an enum for the + * + * __printf(2, 3) would apply. + */ +#define __pr_debug_cls(cls, fmt, ...) ({ \ BUILD_BUG_ON_MSG(!__builtin_constant_p(cls), \ "expecting constant class int/enum"); \ dynamic_pr_debug_cls(cls, fmt, ##__VA_ARGS__); \ - } while (0) +}) =20 #else /* !(CONFIG_DYNAMIC_DEBUG || (CONFIG_DYNAMIC_DEBUG_CORE && DYNAMIC_D= EBUG_MODULE)) */ =20 @@ -311,6 +441,8 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, #include #include =20 +#define DYNAMIC_DEBUG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) +#define DYNAMIC_DEBUG_CLASSMAP_USE(_var) #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) #define DYNAMIC_DEBUG_BRANCH(descriptor) false #define DECLARE_DYNDBG_CLASSMAP(...) @@ -357,8 +489,7 @@ static inline int param_set_dyndbg_classes(const char *= instr, const struct kerne static inline int param_get_dyndbg_classes(char *buffer, const struct kern= el_param *kp) { return 0; } =20 -#endif - +#endif /* !CONFIG_DYNAMIC_DEBUG_CORE */ =20 extern const struct kernel_param_ops param_ops_dyndbg_classes; =20 diff --git a/kernel/module/main.c b/kernel/module/main.c index a0fe6c7aab75..8a3fc98d8a4c 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2723,6 +2723,9 @@ static int find_module_sections(struct module *mod, s= truct load_info *info) mod->dyndbg_info.maps.start =3D section_objs(info, "__dyndbg_class_maps", sizeof(*mod->dyndbg_info.maps.start), &mod->dyndbg_info.maps.len); + mod->dyndbg_info.users.start =3D section_objs(info, "__dyndbg_class_users= ", + sizeof(*mod->dyndbg_info.users.start), + &mod->dyndbg_info.users.len); #endif =20 return 0; diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 93f356d2b3d9..302bb2656682 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -3106,12 +3106,26 @@ config TEST_STATIC_KEYS If unsure, say N. =20 config TEST_DYNAMIC_DEBUG - tristate "Test DYNAMIC_DEBUG" - depends on DYNAMIC_DEBUG + tristate "Build test-dynamic-debug module" + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE help - This module registers a tracer callback to count enabled - pr_debugs in a 'do_debugging' function, then alters their - enablements, calls the function, and compares counts. + This module exercises/demonstrates dyndbg's classmap API, by + creating 2 classes: a DISJOINT classmap (supporting DRM.debug) + and a LEVELS/VERBOSE classmap (like verbose2 > verbose1). + + If unsure, say N. + +config TEST_DYNAMIC_DEBUG_SUBMOD + tristate "Build test-dynamic-debug submodule" + default m + depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE + depends on TEST_DYNAMIC_DEBUG + help + This sub-module uses a classmap defined and exported by the + parent module, recapitulating drm & driver's shared use of + drm.debug to control enabled debug-categories. + It is tristate, independent of parent, to allow testing all + proper combinations of parent=3Dy/m submod=3Dy/m. =20 If unsure, say N. =20 diff --git a/lib/Makefile b/lib/Makefile index 1b9ee167517f..19ab40903436 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -83,6 +83,9 @@ obj-$(CONFIG_TEST_RHASHTABLE) +=3D test_rhashtable.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_keys.o obj-$(CONFIG_TEST_STATIC_KEYS) +=3D test_static_key_base.o obj-$(CONFIG_TEST_DYNAMIC_DEBUG) +=3D test_dynamic_debug.o +obj-$(CONFIG_TEST_DYNAMIC_DEBUG_SUBMOD) +=3D test_dynamic_debug_submod.o +obj-$(CONFIG_TEST_PRINTF) +=3D test_printf.o +obj-$(CONFIG_TEST_SCANF) +=3D test_scanf.o =20 obj-$(CONFIG_TEST_BITMAP) +=3D test_bitmap.o ifeq ($(CONFIG_CC_IS_CLANG)$(CONFIG_KASAN),yy) @@ -206,6 +209,8 @@ obj-$(CONFIG_ARCH_NEED_CMPXCHG_1_EMU) +=3D cmpxchg-emu.o obj-$(CONFIG_DYNAMIC_DEBUG_CORE) +=3D dynamic_debug.o #ensure exported functions have prototypes CFLAGS_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug.o :=3D -DDYNAMIC_DEBUG_MODULE +CFLAGS_test_dynamic_debug_submod.o :=3D -DDYNAMIC_DEBUG_MODULE =20 obj-$(CONFIG_SYMBOLIC_ERRNAME) +=3D errname.o =20 diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index b8983e095e60..ce512efaeffd 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -29,6 +29,7 @@ #include #include #include + #include #include #include @@ -43,6 +44,8 @@ extern struct _ddebug __start___dyndbg_descs[]; extern struct _ddebug __stop___dyndbg_descs[]; extern struct _ddebug_class_map __start___dyndbg_class_maps[]; extern struct _ddebug_class_map __stop___dyndbg_class_maps[]; +extern struct _ddebug_class_user __start___dyndbg_class_users[]; +extern struct _ddebug_class_user __stop___dyndbg_class_users[]; =20 struct ddebug_table { struct list_head link; @@ -168,20 +171,37 @@ static void vpr_info_dq(const struct ddebug_query *qu= ery, const char *msg) query->first_lineno, query->last_lineno, query->class_string); } =20 -static struct _ddebug_class_map *ddebug_find_valid_class(struct ddebug_tab= le const *dt, - const char *class_string, - int *class_id) +#define vpr_di_info(di_p, msg_p, ...) ({ \ + struct _ddebug_info const *_di =3D di_p; \ + v2pr_info(msg_p "module:%s nd:%d nc:%d nu:%d\n", ##__VA_ARGS__, \ + _di->mod_name, _di->descs.len, _di->maps.len, \ + _di->users.len); \ + }) + +static struct _ddebug_class_map * +ddebug_find_valid_class(struct _ddebug_info const *di, const char *query_c= lass, int *class_id) { struct _ddebug_class_map *map; + struct _ddebug_class_user *cli; int i, idx; =20 - for_subvec(i, map, &dt->info, maps) { - idx =3D match_string(map->class_names, map->length, class_string); + for_subvec(i, map, di, maps) { + idx =3D match_string(map->class_names, map->length, query_class); if (idx >=3D 0) { + vpr_di_info(di, "good-class: %s.%s ", map->mod_name, query_class); *class_id =3D idx + map->base; return map; } } + for_subvec(i, cli, di, users) { + idx =3D match_string(cli->map->class_names, cli->map->length, query_clas= s); + if (idx >=3D 0) { + vpr_di_info(di, "class-ref: %s -> %s.%s ", + cli->mod_name, cli->map->mod_name, query_class); + *class_id =3D idx + cli->map->base - cli->offset; + return cli->map; + } + } *class_id =3D -ENOENT; return NULL; } @@ -238,8 +258,7 @@ static bool ddebug_match_desc(const struct ddebug_query= *query, return true; } =20 -static int ddebug_change(const struct ddebug_query *query, - struct flag_settings *modifiers) +static int ddebug_change(const struct ddebug_query *query, struct flag_set= tings *modifiers) { int i; struct ddebug_table *dt; @@ -260,7 +279,8 @@ static int ddebug_change(const struct ddebug_query *que= ry, continue; =20 if (query->class_string) { - map =3D ddebug_find_valid_class(dt, query->class_string, &valid_class); + map =3D ddebug_find_valid_class(&dt->info, query->class_string, + &valid_class); if (!map) continue; } else { @@ -590,7 +610,7 @@ static int ddebug_exec_query(char *query_string, const = char *modname) =20 /* handle multiple queries in query string, continue on error, return last error or number of matching callsites. Module name is either - in param (for boot arg) or perhaps in query string. + in the modname arg (for boot args) or perhaps in query string. */ static int ddebug_exec_queries(char *query, const char *modname) { @@ -721,7 +741,7 @@ static int param_set_dyndbg_module_classes(const char *= instr, /** * param_set_dyndbg_classes - classmap kparam setter * @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 all class'd pr_debugs in the classmap. For LEVEL * map-types, enforce * relative levels by bitpos. @@ -758,6 +778,7 @@ int param_get_dyndbg_classes(char *buffer, const struct= kernel_param *kp) default: return -1; } + return 0; } EXPORT_SYMBOL(param_get_dyndbg_classes); =20 @@ -1073,12 +1094,17 @@ static bool ddebug_class_in_range(const int class_i= d, const struct _ddebug_class static const char *ddebug_class_name(struct _ddebug_info *di, struct _ddeb= ug *dp) { struct _ddebug_class_map *map; + struct _ddebug_class_user *cli; int i; =20 for_subvec(i, map, di, maps) if (ddebug_class_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 + for_subvec(i, cli, di, users) + if (ddebug_class_in_range(dp->class_id, cli->map)) + return cli->map->class_names[dp->class_id - cli->map->base - cli->offse= t]; + return NULL; } =20 @@ -1159,32 +1185,87 @@ static const struct proc_ops proc_fops =3D { .proc_write =3D ddebug_proc_write }; =20 -static void ddebug_attach_module_classes(struct ddebug_table *dt, struct _= ddebug_info *di) +#define vpr_cm_info(cm_p, msg_fmt, ...) ({ \ + struct _ddebug_class_map const *_cm =3D 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 cha= r *modname) { - struct _ddebug_class_map *cm; - int i, nc =3D 0; + const struct _ddebug_class_param *dcp =3D kp->arg; =20 - /* - * Find this module's classmaps in a subrange/wholerange of - * the builtin/modular classmap vector/section. Save the start - * and length of the subrange at its edges. - */ - for_subvec(i, cm, di, maps) { - if (!strcmp(cm->mod_name, dt->info.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); - dt->info.maps.start =3D cm; - } - nc++; - } + /* clamp initial bitvec, mask off hi-bits */ + if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { + *dcp->bits &=3D CLASSMAP_BITMASK(dcp->map->length); + v2pr_info("preset classbits: %lx\n", *dcp->bits); + } + /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-= param */ + ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); +} + +static void ddebug_match_apply_kparam(const struct kernel_param *kp, + const struct _ddebug_class_map *map, + const char *mod_name) +{ + struct _ddebug_class_param *dcp; + + if (kp->ops !=3D ¶m_ops_dyndbg_classes) + return; + + dcp =3D (struct _ddebug_class_param *)kp->arg; + + if (map =3D=3D dcp->map) { + v2pr_info(" kp:%s.%s =3D0x%lx", mod_name, kp->name, *dcp->bits); + vpr_cm_info(map, " %s maps ", mod_name); + ddebug_sync_classbits(kp, mod_name); + } +} + +static void ddebug_apply_params(const struct _ddebug_class_map *cm, const = char *mod_name) +{ + const struct kernel_param *kp; +#if IS_ENABLED(CONFIG_MODULES) + int i; + + if (cm->mod) { + vpr_cm_info(cm, "loaded classmap: %s ", mod_name); + /* ifdef protects the cm->mod->kp deref */ + for (i =3D 0, kp =3D cm->mod->kp; i < cm->mod->num_kp; i++, kp++) + ddebug_match_apply_kparam(kp, cm, mod_name); } - if (nc) { - dt->info.maps.len =3D nc; - vpr_info("module:%s attached %d classes\n", dt->info.mod_name, nc); +#endif + if (!cm->mod) { + vpr_cm_info(cm, "builtin classmap: %s ", mod_name); + for (kp =3D __start___param; kp < __stop___param; kp++) + ddebug_match_apply_kparam(kp, cm, mod_name); } } =20 +static void ddebug_apply_class_maps(const struct _ddebug_info *di) +{ + struct _ddebug_class_map *cm; + int i; + + for_subvec(i, cm, di, maps) + ddebug_apply_params(cm, cm->mod_name); + + vpr_di_info(di, "attached %d class-maps to ", i); +} + +static void ddebug_apply_class_users(const struct _ddebug_info *di) +{ + struct _ddebug_class_user *cli; + int i; + + for_subvec(i, cli, di, users) + ddebug_apply_params(cli->map, cli->mod_name); + + vpr_di_info(di, "attached %d class-users to ", i); +} + /* * Narrow a _ddebug_info's vector (@_vec) to the contiguous subrange * of elements where ->mod_name matches @__di->mod_name. @@ -1214,6 +1295,22 @@ static void ddebug_attach_module_classes(struct ddeb= ug_table *dt, struct _ddebug __di->_vec.len =3D __nc; \ }) =20 +static int __maybe_unused +ddebug_class_range_overlap(struct _ddebug_class_map *cm, + u64 *reserved_ids) +{ + u64 range =3D (((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 |=3D range; + return 0; +} + /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1222,6 +1319,7 @@ static int ddebug_add_module(struct _ddebug_info *di) { struct ddebug_table *dt; struct _ddebug_class_map *cm; + struct _ddebug_class_user *cli; int i; =20 if (!di->descs.len) @@ -1234,26 +1332,29 @@ static int ddebug_add_module(struct _ddebug_info *d= i) pr_err("error adding module: %s\n", di->mod_name); return -ENOMEM; } + INIT_LIST_HEAD(&dt->link); /* - * For built-in modules, name (as supplied in di by its - * callers) lives in .rodata and is immortal. For loaded - * modules, name points at the name[] member of struct module, - * which lives at least as long as this struct ddebug_table. + * For built-in modules, di-> referents live in .*data and are + * immortal. For loaded modules, di points at the dyndbg_info + * member of its struct module, which lives at least as + * long as this struct ddebug_table. */ dt->info =3D *di; - - INIT_LIST_HEAD(&dt->link); - dd_set_module_subrange(i, cm, &dt->info, maps); - - if (di->maps.len) - ddebug_attach_module_classes(dt, di); + dd_set_module_subrange(i, cli, &dt->info, users); + /* now di is stale */ =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); =20 - vpr_info("%3u debug prints in module %s\n", di->descs.len, di->mod_name); + if (dt->info.maps.len) + ddebug_apply_class_maps(&dt->info); + if (dt->info.users.len) + ddebug_apply_class_users(&dt->info); + + vpr_info("%3u debug prints in module %s\n", + dt->info.descs.len, dt->info.mod_name); return 0; } =20 @@ -1403,8 +1504,10 @@ static int __init dynamic_debug_init(void) struct _ddebug_info di =3D { .descs.start =3D __start___dyndbg_descs, .maps.start =3D __start___dyndbg_class_maps, + .users.start =3D __start___dyndbg_class_users, .descs.len =3D __stop___dyndbg_descs - __start___dyndbg_descs, .maps.len =3D __stop___dyndbg_class_maps - __start___dyndbg_class_maps, + .users.len =3D __stop___dyndbg_class_users - __start___dyndbg_class_user= s, }; =20 #ifdef CONFIG_MODULES diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 9c3e53cd26bd..6c4548f63512 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -6,11 +6,30 @@ * Jim Cromie */ =20 -#define pr_fmt(fmt) "test_dd: " fmt +/* + * This file is built 2x, also making test_dynamic_debug_submod.ko, + * whose 2-line src file #includes this file. This gives us a _submod + * clone with identical pr_debugs, without further maintenance. + * + * If things are working properly, they should operate identically + * when printed or adjusted by >control. This eases visual perusal of + * the logs, and simplifies testing, by easing the proper accounting + * of expectations. + * + * It also puts both halves of the subsystem _DEFINE & _USE use case + * together, and integrates the common ENUM providing both class_ids + * and class-names to both _DEFINErs and _USERs. I think this makes + * the usage clearer. + */ +#if defined(TEST_DYNAMIC_DEBUG_SUBMOD) + #define pr_fmt(fmt) "test_dd_submod: " fmt +#else + #define pr_fmt(fmt) "test_dd: " fmt +#endif =20 #include =20 -/* run tests by reading or writing sysfs node: do_prints */ +/* re-gen output by reading or writing sysfs node: do_prints */ =20 static void do_prints(void); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_para= m *kp) @@ -29,24 +48,39 @@ static const struct kernel_param_ops param_ops_do_print= s =3D { }; module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0600); =20 -/* - * Using the CLASSMAP api: - * - classmaps must have corresponding enum - * - enum symbols must match/correlate with class-name strings in the map. - * - base must equal enum's 1st value - * - multiple maps must set their base to share the 0-30 class_id space !! - * (build-bug-on tips welcome) - * Additionally, here: - * - tie together sysname, mapname, bitsname, flagsname - */ -#define DD_SYS_WRAP(_model, _flags) \ - static unsigned long bits_##_model; \ - static struct _ddebug_class_param _flags##_model =3D { \ +#define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << (base)) + +/* sysfs param wrapper, proto-API */ +#define DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, _init) \ + static unsigned long bits_##_model =3D _init; \ + static struct _ddebug_class_param _flags##_##_model =3D { \ .bits =3D &bits_##_model, \ .flags =3D #_flags, \ .map =3D &map_##_model, \ }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, &_flags##_m= odel, 0600) + module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ + &_flags##_##_model, 0600) +#ifdef DEBUG +#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ + DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, ~0) +#else +#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ + DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, 0) +#endif + +/* + * Demonstrate/test DISJOINT & LEVEL typed classmaps with a sys-param. + * + * To comport with DRM debug-category (an int), classmaps map names to + * ids (also an int). So a classmap starts with an enum; DRM has enum + * debug_category: with DRM_UT_. We use the enum + * values as class-ids, and stringified enum-symbols as classnames. + * + * Modules with multiple CLASSMAPS must have enums with distinct + * value-ranges, as arranged below with explicit enum_sym =3D X inits. + * To clarify this sharing, declare the 2 enums now, for the 2 + * different classmap types + */ =20 /* numeric input, independent bits */ enum cat_disjoint_bits { @@ -60,26 +94,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 =3D 14, V1, V2, V3, V4, V5, V6, V7 }; -DECLARE_DYNDBG_CLASSMAP(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, 14, - "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); -DD_SYS_WRAP(level_num, p); -DD_SYS_WRAP(level_num, T); + +/* numeric verbosity, V2 > V1 related. V0 is > D2_DRMRES */ +enum cat_level_num { V0 =3D 16, V1, V2, V3, V4, V5, V6, V7 }; + +/* recapitulate DRM's multi-classmap setup */ +#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. + */ +DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BI= TS, + D2_CORE, + "D2_CORE", + "D2_DRIVER", + "D2_KMS", + "D2_PRIME", + "D2_ATOMIC", + "D2_VBL", + "D2_STATE", + "D2_LEASE", + "D2_DP", + "D2_DRMRES"); + +DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_TYPE_LEVEL_NUM, + V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); + +/* + * now add the sysfs-params + */ + +DYNAMIC_DEBUG_CLASSMAP_PARAM(disjoint_bits, p); +DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); + +#else /* TEST_DYNAMIC_DEBUG_SUBMOD */ + +/* + * in submod/drm-drivers, use the classmaps defined in top/parent + * module above. + */ + +DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); +DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); + +#endif =20 /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") @@ -115,6 +174,7 @@ static void do_levels(void) =20 static void do_prints(void) { + pr_debug("do_prints:\n"); do_cats(); do_levels(); } diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submo= d.c new file mode 100644 index 000000000000..672aabf40160 --- /dev/null +++ b/lib/test_dynamic_debug_submod.c @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Kernel module for testing dynamic_debug + * + * Authors: + * Jim Cromie + */ + +/* + * clone the parent, inherit all the properties, for consistency and + * simpler accounting in test expectations. + */ +#define TEST_DYNAMIC_DEBUG_SUBMOD +#include "test_dynamic_debug.c" --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9BE703A75A5 for ; Thu, 26 Mar 2026 18:55:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551312; cv=none; b=dvmn/+qyx4fxqLumUWoZSq1XYTNbefB/EACAMT6zbA+A/RbIMCUFQVvrjOpwcLsCy90XZStS9miiL3gyqbPjxA+KS06ud54ydKsIqLoju9si/rrEA8Os2OZdOVnnLEGknEBOFbMjiP0I6xz8stYW0XTsf3Ssz1zi5e6upBK65+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551312; c=relaxed/simple; bh=Zzx4Sn733ZM1tO7JuXAJ/z8qin9BcfpX6BljoYIv/Xw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XNvi4ZXZk8B/H6FB1ZeamkJQPXbmOyt6PIzafqr/JQqNgoBbBXy1s5p0KS/7qNC0r9wRd3ZflwO15qI3bQo+rp7TJO2b9IAcUiLsYhwPp0OdvilWyuzNxLQ8UWyIdWAr6JJjRPi9eKqB5wxC1IO9PCxeNxzWe8z4gJz5dSaJ5ZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lnkFy6XV; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lnkFy6XV" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-4043b27ddeaso852458fac.1 for ; Thu, 26 Mar 2026 11:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551309; x=1775156109; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fhkUA1UVesD8yNrP4RsQIbF+Lt6WpQrbgggJ/VjIv9U=; b=lnkFy6XVQ2rHyvNlUuYWxY7R91dsb7KGw4blA3bvwhyXtvpmvqVfk25gATjjTsefx9 vB/TX7/OJFMzseMwqm13q2/iN51WRpsXoP47juSbr9ixaMu2mzXUwWgloUInn2lcIz/x bpZlYzPOcme2705NLyLT6K03u7rgBD6SpPt9droJWzaWWFXuT0E5uSNmIF+4sbH2A9qj LiWdql+CQwmP4u8dxTGNgAiSh7UqU2NTbn7qqhOT1NAfjpo9g5bDH1QsAO886MSh1rqG Ce6FuPHD/IRMw6BI/S8o5ZL7j2K31UhpLLfvT6+MuFF7TnlIPYeepgzJqA2DkfDf/DLH yJPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551309; x=1775156109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=fhkUA1UVesD8yNrP4RsQIbF+Lt6WpQrbgggJ/VjIv9U=; b=kwIwdgKumArMgmBQqMpKcCR39PX7UxCgiwVhO3PeEXg4iMMpFWPAe8405NyqCw6s3N TzXIoM/VUrAbQCDM9oD7EH9bU7XSasqV6JX2j7UGK5AshoGkn4UU6CJu9NyNHNYFBfUG fqFbm3vPsvvrKw0UfvE6PSVzlG7v72PCEPYeJl8W7mrXp7a7eYrxa3fOkKlfF7DjEECN zRfNhXiUj22jFveBP5ujatBKEzyDOVqUAAG15xLyIXDtsus2sANrAlnfLCcInQhbqVGl 1g0+G2uPbneXmUzHwZ8fr39m+PLOVws4DRRlsCrrmIgHShQ+e/S1y6npqLLjageFYT4Y PyGg== X-Gm-Message-State: AOJu0YwuXMeJ6w9umbPIuNp/PCiVyX2FTgLM+Z+iTURZ16AZe08wgTAe 4IDLm4WnWBBClI4u2PB1t4IvkaMllOzPfS97IRJIK/Gqwiw1NtwN5VK3jPKLLg== X-Gm-Gg: ATEYQzyhV5GKrKWuLiZr6ZVpLIenqwsNtx6Xyoeqtjs+FY/tSGdE1eihK2luoBs6LuW heA6h9m1XLx4Z75K55A2K+yG2AC76fxTxzxDvcBHpi/sChgNN8JMfY9Kj6ggCNCweVJOE2dAPYt ArGaPHwSEZD7jNi8UqQ2m2YbPpEU4d3el6S/QSwaJrm8Iwe2BTsLgy6idKl0ggtT2N60kkuynQp MR/Pg1U2nLvj+CrvaM0ApvVE6KNwHyAiZIQg+IpE1UDbXTfuGbm4H+x15pTT4VXOdeIPWKkYajB 4wo8BPwVGdddKmjHA4t1YMpJ1AV4iQi5at9WRJCfiYm5+LJkE3NLnMuZzZcOhqbLPJPwelIG4CT hARm2Qz31dBVbHEn5qjP/F4ZlC4aRBYr7ztlzrzHKCHZB9CrycTuKDQmTsQCsWPtIt+N4v/q0xB wc0rlZTKBtC4GJfTXAAdV9cFBKoWq20vbXtvGe6pC1vhimdCED X-Received: by 2002:a05:6871:820d:b0:404:1250:1c1f with SMTP id 586e51a60fabf-41ca6d160c2mr4341523fac.5.1774551309361; Thu, 26 Mar 2026 11:55:09 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:08 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 26/69] dyndbg: detect class_id reservation conflicts Date: Thu, 26 Mar 2026 12:53:30 -0600 Message-ID: <20260326185413.1205870-27-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If a module _DEFINEs 2 or more classmaps, it must devise them to share the per-module 0..62 class-id space; ie their respective base,+length reservations cannot overlap. To detect conflicts at modprobe, add ddebug_class_range_overlap(), call it from ddebug_add_module(), and WARN and return -EINVAL when they're detected. This insures that class_id -> classname lookup has just 1 answer, so the 1st-found search in find-class-name works properly. test_dynamic_debug.c: If built with -DFORCE_CLASSID_CONFLICT, the test-modules invoke 2 conflicting DYNAMIC_DEBUG_CLASSMAP_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 WARN and fail. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- v9 - fix WARN() by adding new 1st arg 1. v12 - drop maybe_unused on range-overlap fn --- lib/dynamic_debug.c | 25 +++++++++++++++++++------ lib/test_dynamic_debug.c | 8 ++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index ce512efaeffd..a7f67ecbc4d7 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1085,12 +1085,17 @@ static void *ddebug_proc_next(struct seq_file *m, v= oid *p, loff_t *pos) return dp; } =20 -static bool ddebug_class_in_range(const int class_id, const struct _ddebug= _class_map *map) +static bool ddebug_class_map_in_range(const int class_id, const struct _dd= ebug_class_map *map) { return (class_id >=3D map->base && class_id < map->base + map->length); } =20 +static bool ddebug_class_user_in_range(const int class_id, const struct _d= debug_class_user *user) +{ + return ddebug_class_map_in_range(class_id - user->offset, user->map); +} + static const char *ddebug_class_name(struct _ddebug_info *di, struct _ddeb= ug *dp) { struct _ddebug_class_map *map; @@ -1098,11 +1103,11 @@ static const char *ddebug_class_name(struct _ddebug= _info *di, struct _ddebug *dp int i; =20 for_subvec(i, map, di, maps) - if (ddebug_class_in_range(dp->class_id, map)) + if (ddebug_class_map_in_range(dp->class_id, map)) return map->class_names[dp->class_id - map->base]; =20 for_subvec(i, cli, di, users) - if (ddebug_class_in_range(dp->class_id, cli->map)) + if (ddebug_class_user_in_range(dp->class_id, cli)) return cli->map->class_names[dp->class_id - cli->map->base - cli->offse= t]; =20 return NULL; @@ -1295,9 +1300,7 @@ static void ddebug_apply_class_users(const struct _dd= ebug_info *di) __di->_vec.len =3D __nc; \ }) =20 -static int __maybe_unused -ddebug_class_range_overlap(struct _ddebug_class_map *cm, - u64 *reserved_ids) +static int ddebug_class_range_overlap(struct _ddebug_class_map *cm, u64 *r= eserved_ids) { u64 range =3D (((1ULL << cm->length) - 1) << cm->base); =20 @@ -1320,6 +1323,7 @@ static int ddebug_add_module(struct _ddebug_info *di) struct ddebug_table *dt; struct _ddebug_class_map *cm; struct _ddebug_class_user *cli; + u64 reserved_ids =3D 0; int i; =20 if (!di->descs.len) @@ -1344,6 +1348,11 @@ static int ddebug_add_module(struct _ddebug_info *di) dd_set_module_subrange(i, cli, &dt->info, users); /* now di is stale */ =20 + /* insure 2+ classmaps share the per-module 0..62 class_id space */ + for_subvec(i, cm, &dt->info, maps) + if (ddebug_class_range_overlap(cm, &reserved_ids)) + goto cleanup; + mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); mutex_unlock(&ddebug_lock); @@ -1356,6 +1365,10 @@ static int ddebug_add_module(struct _ddebug_info *di) vpr_info("%3u debug prints in module %s\n", dt->info.descs.len, dt->info.mod_name); return 0; +cleanup: + WARN_ONCE(1, "dyndbg multi-classmap conflict in %s\n", di->mod_name); + kfree(dt); + return -EINVAL; } =20 /* helper for ddebug_dyndbg_(boot|module)_param_cb */ diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 6c4548f63512..fc599bbe605e 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -128,6 +128,14 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_level_num, DD_CLASS_= TYPE_LEVEL_NUM, DYNAMIC_DEBUG_CLASSMAP_PARAM(disjoint_bits, p); DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); =20 +#ifdef FORCE_CLASSID_CONFLICT +/* + * Enable with -Dflag on compile to test overlapping class-id range + * detection. This should warn on modprobes. + */ +DYNAMIC_DEBUG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_= CORE"); +#endif + #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ =20 /* --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78F4841C2F5 for ; Thu, 26 Mar 2026 18:55:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551314; cv=none; b=quCn2yUKmr88fgTGEGlxbu6ZEiq8FZJEYkK6+ky8cSjp77F5LB7UTP7YIWaY54QSvalHyDzmtwin6BkvzVKXSZSpUz5qCjyV669p2X3bG5HdH8DnEFhv7m1PMDgpXzt5IWOiRW5DPyUkjSP8RzxNKP8QDN4Y7AHMirWo/NqJ+Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551314; c=relaxed/simple; bh=H+0xsGZIBwrkk/b4jBgR9GkrHr0yKiHAF3ASxvB/fw4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s4+ay52+ZmoZzga7GXMKJRXUjfSZHi0tk1uydXpUA2ZxmeZ0cfI9voq1qkNRFTRZA0JXF3VOGwxnLsULM+KshSloP9Pg69p3HubM3kYd77jl7exdQO9EpOUffiVI7rfOqOcb6xgMT2abm/GIB9uYLXEHziBe0Jb1fmQ+0c1LyDs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gG2uVxa0; arc=none smtp.client-ip=209.85.160.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gG2uVxa0" Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-40429b1d8baso540358fac.0 for ; Thu, 26 Mar 2026 11:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551311; x=1775156111; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5920cM3w/QFHxSwN5yK5lUkglylj8O6aZoTa/l3EtaQ=; b=gG2uVxa0gRFhY49nne58BdbSZrmNkFxg6YBzuQcHGwJqUH0z2Mjwp4R2Kd8yj6r/8a hb7ESMysdtyaSLjMzjMfjMoghR4B+uoeLLrkCEFL2LDEsZoiO2qqA77jrpW8634FbcQD enFWhch6/+mJwqT9u8R8gEwNLUi1qNp6JB2jep1gqdjH+FQsuVVtYqXxuf4hlr5rKlUN L349gTQYyElMQ5XpCP4T9PpEc2wtdP+IONCv0eloWIjtjPDfHZXSMWEB9OoWUVfeNbuH JP4VEC08wz9vNhouT/FHMo2icJxXvrpPr6G6p9qi4BxMKivjsEV28VhITbDnoP/e1YBV g4SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551311; x=1775156111; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=5920cM3w/QFHxSwN5yK5lUkglylj8O6aZoTa/l3EtaQ=; b=Nj+qTZWKpeFnsX1k1mCM57zHydAceV96Lhi/W5vEWhIqCtMpmjn7FLgc6b64BFPcMV 6KxN4fHLgqJUT8IyE1r3fzFNHKkfANZJEMYfpX0/LCAoAWrqqSHjub8aePVxRxLTVWzf /kWeYiVtc1DKCPV0ElAzxRaoCfilq1Byk0C7fV9c/t3hj/IaBSTti03kNVR2tOiYY6OV jXX1aV5HHwEGIF6dBk9YYdkVcEixgEnCZ0YPrrO3Zybrm0tUInhq7g7wC2MNJxOo76sq vgCVQ31cY5cU/Gdcz7h3mxOzSn+tsYIzPszIcHPT6hi/unzG3YkTc9XD3PHHdIDhDztI 9lWQ== X-Gm-Message-State: AOJu0YyBUDyZ3hG/5IDjSO/aROZ7uf5HsFkB1B7FPDMray7pDgbktYAj iq63+w5SVR3crbLlhq6tPCk+POAxq5U4kc5VFtLcW/mlcYhD5INO/ArCk2t7Xw== X-Gm-Gg: ATEYQzzRXl4IjGzB9gJJQr/YkmSlLB/34FPORihadSeGGWyA7PagJSIaWPHeCZRmsbJ YyVPQ+BCOnZ055jTe+4HexEbZReYRb1UT8WlxGMCFGA+30u3e+gH38SXxT6qeKEngOL9VDOCegv PCPbtC7f5owOaz0QxYdzop4oraS+R10aKeIsykNIuiBP1EcGHJPCPkUIHssos88vru3RfUlakRC azm/vhrDfWFB9nUsvM+Tmht/U+2uzfoxcRtEOvIwfhqNmllaT9uXg/0/6zhKcLfHtS8UXriAQAh O0/jlPxTo/h5n3LosL1QPp5JHlufdyErHEbDRR6zpecczDvwPK1qxeUfZSL7vg44ryzqdw3LnsL 1KueVvkpo1c8T3Eew4gaqvYVtZa/sBat6EA4Xky/1H4cet891LekfloXizAhPwskbv98iOky1au vyrE7ISxl2Yt7g2f2nL1Na6PcRurSE/rr0qWi9UL1lzyizy3jOBIRnkuE+LCs= X-Received: by 2002:a05:6870:8a21:b0:41c:976:374e with SMTP id 586e51a60fabf-41ca6fdc8e9mr4813996fac.30.1774551311110; Thu, 26 Mar 2026 11:55:11 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:10 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 27/69] dyndbg: check DYNAMIC_DEBUG_CLASSMAP_DEFINE args at compile-time Date: Thu, 26 Mar 2026 12:53:31 -0600 Message-ID: <20260326185413.1205870-28-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add __DYNAMIC_DEBUG_CLASSMAP_CHECK to implement the following arg-checks at compile-time: 0 <=3D _base < 63 class_names is not empty class_names[0] is a string (class_names.length + _base) < 63 dd-map-type is known value These compile-time checks will prevent several simple misuses, and will issue obvious errors if violated. 4 such examples are added to test_dynamic_debug_submod.ko, and will fail compilation if -DDD_MACRO_ARGCHECK is added to cflags. This wouldn't be a useful CONFIG_ item, since it breaks the build. Signed-off-by: Jim Cromie --- -v12 check map-type at compile-time make base+len(classnames) check more explicit dyndbg-test: add more tests of compile-time CHECKs add 3 tests of static-asserts added to 2 macros: DYNAMIC_DEBUG_CLASSMAP_{DEFINE,USE_} _DEFINE(): 1- validates maptype, 2- validate classmap.length + base-offset < 63 _USE_(): 3- validate user-offset < 63 As before, these tests fail when activated: make KCPPFLAGS=3D"-DDD_MACRO_ARGCHECK" lib/test_dynamic_debug_submod.o NOTE: _USE_() cannot test classmap.length, since its a property of the referent, not the macro itself. --- include/linux/dynamic_debug.h | 12 ++++++++++++ lib/test_dynamic_debug.c | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 71c91bc8d3a6..a1c75237abaa 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -181,6 +181,17 @@ struct _ddebug_class_param { * __pr_debug_cls(22, "no such class"); compiles but is not reachable */ =20 +#define __DYNAMIC_DEBUG_CLASSMAP_CHECK(_clnames, _base, _mapty) \ + static_assert(((_base) >=3D 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 must be <=3D 62"); \ + static_assert(((_mapty) >=3D DD_CLASS_TYPE_DISJOINT_BITS) && \ + ((_mapty) <=3D DD_CLASS_TYPE_LEVEL_NUM), \ + "unknown class_map_type") + /** * DYNAMIC_DEBUG_CLASSMAP_DEFINE - define debug classes used by a module. * @_var: name of the classmap, exported for other modules coordinated u= se. @@ -194,6 +205,7 @@ struct _ddebug_class_param { */ #define DYNAMIC_DEBUG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) \ static const char *_var##_classnames[] =3D { __VA_ARGS__ }; \ + __DYNAMIC_DEBUG_CLASSMAP_CHECK(_var##_classnames, (_base), (_mapty)); \ extern struct _ddebug_class_map _var; \ struct _ddebug_class_map __aligned(8) __used \ __section("__dyndbg_class_maps") _var =3D { \ diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index fc599bbe605e..5036fd58d7c6 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -146,8 +146,22 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(classid_range_conflict, = 0, D2_CORE + 1, "D3_CORE") DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); =20 +#if defined(DD_MACRO_ARGCHECK) +/* + * Exersize compile-time arg-checks in DYNAMIC_DEBUG_CLASSMAP_DEFINE. + * These will break compilation. + */ +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_neg, 0, -1, "NEGATIVE_BASE_ARG"); +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_big, 0, 100, "TOOBIG_BASE_ARG"); +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_str_type, 0, 0, 1 /* not a string */); +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_emptyclass, 0, 0 /* ,empty */); +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_maptype, 3, 10, "no such type"); +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_len, 0, 60, "one", "two", "three"); +DYNAMIC_DEBUG_CLASSMAP_USE_(map_level_num, 100); #endif =20 +#endif /* TEST_DYNAMIC_DEBUG_SUBMOD */ + /* stand-in for all pr_debug etc */ #define prdbg(SYM) __pr_debug_cls(SYM, #SYM " msg\n") =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-ot1-f49.google.com (mail-ot1-f49.google.com [209.85.210.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81190421F1D for ; Thu, 26 Mar 2026 18:55:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551315; cv=none; b=DN36dO0I03vuGgsckpgrYL9AqrVEGFjd7soV6wHND530kP5ApSYs1lhToGsrbmGeYEcLQfF16UwBdmpwCoLPGYDnZ0v6mfezBvO9mvw1uIm2exhpRLvKbYJglTv4PzGewZBmzJ5fVQ10AmwWtxO7LmV0OiD5ACIrJ0oYASUXHy8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551315; c=relaxed/simple; bh=YpD4dMT1HKzN0yePr1Vk/Dwbjcl1dJwb05D7+MNcOHE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AjDVERc2wyLJi5td6hKbMCmodStJYVd6MFSz6tCTM/CdmA6V5gJqbfpMZjekp+NEW+7+mC+Aaf8/7uRWPl8FAugrHlNm0nNVAL9EPdSuOSHzncoQhnDBwHGjnzwYw/pODv7RiqxemrC9lHpq/qjK2T3j9GagH62WMsvFrufyUUA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ld5altW6; arc=none smtp.client-ip=209.85.210.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ld5altW6" Received: by mail-ot1-f49.google.com with SMTP id 46e09a7af769-7d74dbfe84cso856760a34.1 for ; Thu, 26 Mar 2026 11:55:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551312; x=1775156112; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=COes0JAbo1d/mRlXxq1tSmCpD+ZApr8iQ8/8rv37VLw=; b=ld5altW6bps1URfySSL8bys8G/sJL1GckKMtG3OwvhjIYV5RlfwG2G7VqWCh3A/Cwh wz3/MEt5UZs8BWRJJZWEMlJd9wuylTsEv2O3oDgnL/mMbesDieymF53KL+wLmZ1G+n4s kw8NAOusy7nqhlIrrctGVKtXHA9tihjLhdnt0fsrL/q9gaI3+wnXiIGr9b2cBbGY8FPB Z1nDXQXihlVr6hrcBbppSygDic688z68s/+r3kGHEscPsgFh1dG7d0Aa4+UG6L5tDP5u EmkUsEH6NRokHHI2N8rmGVFHkKVfZ6eoSsXHS7XDnk+Jy7gDL59vueOaIKW8adJSS21b Frbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551312; x=1775156112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=COes0JAbo1d/mRlXxq1tSmCpD+ZApr8iQ8/8rv37VLw=; b=hCw0C9TRVsu5ZiEYwoMsPs+1Ax9RmIG2WB2aZCD7xpgxs4+d6DZgzBG7LEjkZygNup BYk0t/yg/NNk8Bc6FbfdQeGu3dnLgxIc6HK5pKfEaOKManvRjK5fjUyebbNqRyWCwhLe OfEfG3AyzFrvORX/l1nMdn5PvfT1cEu4zIG2f815oKtQtmgwAIjdHecPcTWgC6+txAve ZM6vOeQUmr2uGqbtxzSJx2vh2dp0HipDwr0bVixt8k/RveLAZja4pDMac55PFOfx9Vim 3984U80b2h0AkjcmWQfwFNAV5xEa+2Y/dqh9CnBtDr/am+vDzPn0v6VeCmkcknlFattS Zeug== X-Gm-Message-State: AOJu0Yz0VZ38crgCfW5iOaA4K+IkeLlL0od2RS1J/wdCSXymEbPjdH3h c/stda4VNa/mCM4lAIJ62Ult0wf+F7GR1+EYuakJndXuuafRPgzAqqQ3IfXaUQ== X-Gm-Gg: ATEYQzzwKyf0VJOXuSgFw9ie4X8XPXN88MAcRiekoNM2lfHkUat3xXCTi0WI7T1zBJr ZUJGLZKL8fSzdx3KlvRHpJ1j3MJhnzO/X2qRDeG/yTGUagJvo38jC7t0Sj2/J5LDj1Efh3Kp1PJ lEEFUu76s7jewD/43ZNfgVr+MmillrKze3K8+7STQpC7u0YE8EbwhvBbzXHoe+a8mcxbnGagVBo 5jw4dmldw3G+QvzNtZ273xfUucT7PZ1R53X90ygd++xY3qICs6pP7g2JRC9qHts6BcUXrM+wi/C 03th14HjGVH3s33wPJZWrDBM/uU6AOiOYqnMFeQ207+IltY0LD2y7mbXCUQydA7gbFJUd247sUU ZL/1mpp/466QiIaotXmg3/DR+Lur4E8Kad3wx/ACujRKOMawd0weW2ylSGc87hLPezOsNRCjf5h uYjokwQzchdHqrWQfO2aDm0LbuBEpSES7AzRCUI/RUdzmAbaQI X-Received: by 2002:a05:6830:4392:b0:7d7:e792:b98e with SMTP id 46e09a7af769-7d9d6617e9bmr4694632a34.8.1774551312358; Thu, 26 Mar 2026 11:55:12 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:12 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 28/69] dyndbg-test: change do_prints testpoint to accept a loopct Date: Thu, 26 Mar 2026 12:53:32 -0600 Message-ID: <20260326185413.1205870-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 messages. This will make it easy to assess the cost of the prefixing. Reading the ./do_prints node also prints messages (once). Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 5036fd58d7c6..756bbb7506ea 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -29,18 +29,25 @@ =20 #include =20 -/* re-gen output by reading or writing sysfs node: do_prints */ - -static void do_prints(void); /* device under test */ +/* re-trigger debug output by reading or writing sysfs node: do_prints */ +static void do_prints(unsigned int); /* device under test */ static int param_set_do_prints(const char *instr, const struct kernel_para= m *kp) { - do_prints(); + int rc; + unsigned int ct; + + rc =3D kstrtouint(instr, 0, &ct); + if (rc) { + pr_err("expecting numeric input, using 1 instead\n"); + ct =3D 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 =3D { .set =3D param_set_do_prints, @@ -194,17 +201,20 @@ static void do_levels(void) prdbg(V7); } =20 -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(); + } } =20 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; } --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A6AD42315C for ; Thu, 26 Mar 2026 18:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551319; cv=none; b=Etq1KwfD9bt6Qlx/2Kb2uT00T3E6Gi2121cg70gPIS6EqBjkw6rL3uXtvPYy4/Xu9MPHlCKUHSHvo3UOQlghcyfPnjIfPeRphIy+m9feKSgvqLUa7ttIgZRw4AYu8Ht1v50gUuB6z0BnHe1fTjRjR5mGEZ4DhyOCu79FZlyWq4c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551319; c=relaxed/simple; bh=X0+yUzLjMtIAUqisLxJZnvTkjkMvrFZAQFf9Z2nBo5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WlgGIoC4aztHVrHXP5exa1YZ1XPEad3+sDzDB49NB3CuigACtaX0IlTC39k1I2u1Za2JKFIifqT8LlxOhfdXCpWfOp6fF8RJ9g6E6BfC82OjsGnTkG+AF3xUmtmTHO9cFXse1/Pwu7jdiG/SPyFtEftM3h8bRj+XWGCB9fPp3m0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FIIPzsmG; arc=none smtp.client-ip=209.85.167.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FIIPzsmG" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-466f00535cfso785929b6e.1 for ; Thu, 26 Mar 2026 11:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551314; x=1775156114; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=emP3nQcuNL/ne18G73lPz2QFpBWIEZlStjMlA9+Jcn0=; b=FIIPzsmGDMVMrZfcoNFYYbCIOZNSB0FO06aLa1HBlQeWa8X8aGv/Bg5IDnK18BqOSz uzS7GHAvA7cJ/as0loIUNYm1aQ/Z3v5WcuK315hhtIcDAx+KNPvzBgAPyKhj6q/OtMjJ X4t2u3w03jgLBcbYOWXOm8F8VDoD5mdQX5DcSN8fecbtyJrZJHtwOFwAt5sG2k9tyxGs s7mFild8sfkwJ6Tj8DIsEEMsanMLrBhYJt1qPug+rHXxeD1uxatmUv/UnqgGgAfkSlat HpcWh3JQsGQm2z3MGabRtg//wfauQYNQMI7ksGTQ0sBcqD47e2ZC0gBP565ZdD0m4BvQ uHNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551314; x=1775156114; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=emP3nQcuNL/ne18G73lPz2QFpBWIEZlStjMlA9+Jcn0=; b=e8WfvAWs8ktUrZXdMRvLbSRxmqNAGzvduk0itZocOqFRbVTDq+GtBgElQwVij5wjUc 1I5AYS26zC30RjRpU/W7mS1arw5tUT8MQcU/bTDgbLtZU73wvUyZZmRJUaTcdoZVUMRg dP8gUBdQIwY6BZcYlN357kxk5kQI7+xgcrLsJyp4GbSa4oONvXROS0mjmpLSeB39eWl6 WnvicxzaW3jag+mhObBNJ0isi4YI5ge+p7G1Yu9dKth1UgKEfTrf1uZQoSn+BiNommgu 0MD6Fb3naRD9s87GqXwNDAsa1q3dYWyPvzQmykeVIySOat4gKoRXQiuVXtnhrdqW2NH/ lNIA== X-Gm-Message-State: AOJu0YwFTOSoTQR8YzqeIMc2xSp/UJwAg4YGG1EJhnsAf1Hot+SZOUXX pXkbafZI5HjmUESbhQUZXT65X1hGUqxt5N1RfMv+0LEwdF5GSNAd6m/jq/QqbQ== X-Gm-Gg: ATEYQzwKwrXPidScUcxP0pugBRa6Dhrs+z+oGCn8DJHI8u/MQF6mGXtCJMIlpa39uBC y77AA3aDX4MJrQ0EehPQETJ3Zxmk92osQjHie8ksbBPn3QVnL5uFEbBeIbuVEmiOwHwXpLsP5KU 70FjTiW6bUdgggQJidh0ouAtFLb40T2/rQG5Ljd5S+TptE7iJQyH4yZQzqS7dvJXhZi2Z9KUIzK I+RZGNS8Mb0vnxm9G3g3gz1ccvqcpqGRlIGfZR87TnC5RgVteWAAAgWIC+SGvQKdf3Ku9coTuzk 1KC72J6RCjQ1QX3Gk4OTDYWKvDlXflNAFNbD5Awn3Ji1t4RDvEMhKYiIzl37F4L+WA6fhYs6foL lMyLDPcTHiBdZGzIJgohEiD6Cr/e5r2pmD7YkiJLZ7xUK2S0qyx/jzgd3ihvVO4geAyZYSrhQ18 lQHHxovKYObk3muOL5EEF4sxbX0/hjcCZwbiAWAlS4HZD7BGEg X-Received: by 2002:a05:6808:4f4c:b0:467:f3d4:fc4e with SMTP id 5614622812f47-46a5c719aa6mr4130081b6e.33.1774551313851; Thu, 26 Mar 2026 11:55:13 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:13 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-doc@vger.kernel.org Subject: [PATCH v12 29/69] dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to API Date: Thu, 26 Mar 2026 12:53:33 -0600 Message-ID: <20260326185413.1205870-30-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" move the DYNAMIC_DEBUG_CLASSMAP_PARAM macro from test-dynamic-debug.c into the header, and refine it, by distinguishing the 2 use cases: 1.DYNAMIC_DEBUG_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.DYNAMIC_DEBUG_CLASSMAP_PARAM new user (test_dynamic_debug) doesn't need to share state, decls a static long unsigned int to store the bitvec. __DYNAMIC_DEBUG_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 add stub macros, clean up and improve comments in test-code, and add MODULE_DESCRIPTIONs. cc: linux-doc@vger.kernel.org Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 40 ++++++++++++++++++++++ lib/dynamic_debug.c | 60 ++++++++++++++++++++++----------- lib/test_dynamic_debug.c | 47 ++++++++++---------------- lib/test_dynamic_debug_submod.c | 9 ++++- 4 files changed, 106 insertions(+), 50 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index a1c75237abaa..1cae9a2f32d7 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -273,6 +273,44 @@ struct _ddebug_class_param { .offset =3D _offset \ } =20 +/** + * DYNAMIC_DEBUG_CLASSMAP_PARAM - control a ddebug-classmap from a sys-par= am + * @_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 DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _var, _flags) \ + static unsigned long _name##_bvec; \ + __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _name##_bvec, _var, _flags) + +/** + * DYNAMIC_DEBUG_CLASSMAP_PARAM_REF - wrap a classmap with a controlling s= ys-param + * @_name: sysfs node name + * @_bits: name of the module's unsigned long bit-vector, ex: __drm_debug + * @_var: name of the (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 DYNAMIC_DEBUG_CLASSMAP_PARAM_REF(_name, _bits, _var, _flags) \ + __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _bits, _var, _flags) + +#define __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _bits, _var, _flags) \ + static struct _ddebug_class_param _name##_##_flags =3D { \ + .bits =3D &(_bits), \ + .flags =3D #_flags, \ + .map =3D &(_var), \ + }; \ + module_param_cb(_name, ¶m_ops_dyndbg_classes, \ + &_name##_##_flags, 0600) + extern __printf(2, 3) void __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...); =20 @@ -455,6 +493,8 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, =20 #define DYNAMIC_DEBUG_CLASSMAP_DEFINE(_var, _mapty, _base, ...) #define DYNAMIC_DEBUG_CLASSMAP_USE(_var) +#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _var, _flags) +#define DYNAMIC_DEBUG_CLASSMAP_PARAM_REF(_name, _var, _flags) #define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) #define DYNAMIC_DEBUG_BRANCH(descriptor) false #define DECLARE_DYNDBG_CLASSMAP(...) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index a7f67ecbc4d7..c6f3b0452dfa 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -687,6 +687,30 @@ static int ddebug_apply_class_bitmap(const struct _dde= bug_class_param *dcp, =20 #define CLASSMAP_BITMASK(width) ((1UL << (width)) - 1) =20 +static void ddebug_class_param_clamp_input(unsigned long *inrep, const str= uct kernel_param *kp) +{ + const struct _ddebug_class_param *dcp =3D kp->arg; + const struct _ddebug_class_map *map =3D dcp->map; + + switch (map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + /* expect bits. mask and warn if too many */ + if (*inrep & ~CLASSMAP_BITMASK(map->length)) { + pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", + KP_NAME(kp), *inrep, CLASSMAP_BITMASK(map->length)); + *inrep &=3D CLASSMAP_BITMASK(map->length); + } + break; + case DD_CLASS_TYPE_LEVEL_NUM: + /* input is bitpos, of highest verbosity to be enabled */ + if (*inrep > map->length) { + pr_warn("%s: level:%ld exceeds max:%d, clamping\n", + KP_NAME(kp), *inrep, map->length); + *inrep =3D map->length; + } + break; + } +} static int param_set_dyndbg_module_classes(const char *instr, const struct kernel_param *kp, const char *mod_name) @@ -705,26 +729,15 @@ static int param_set_dyndbg_module_classes(const char= *instr, pr_err("expecting numeric input, not: %s > %s\n", instr, KP_NAME(kp)); return -EINVAL; } + ddebug_class_param_clamp_input(&inrep, kp); =20 switch (map->map_type) { case DD_CLASS_TYPE_DISJOINT_BITS: - /* expect bits. mask and warn if too many */ - if (inrep & ~CLASSMAP_BITMASK(map->length)) { - pr_warn("%s: input: 0x%lx exceeds mask: 0x%lx, masking\n", - KP_NAME(kp), inrep, CLASSMAP_BITMASK(map->length)); - inrep &=3D CLASSMAP_BITMASK(map->length); - } v2pr_info("bits:0x%lx > %s.%s\n", inrep, mod_name ?: "*", KP_NAME(kp)); totct +=3D ddebug_apply_class_bitmap(dcp, &inrep, *dcp->bits, mod_name); *dcp->bits =3D inrep; break; case DD_CLASS_TYPE_LEVEL_NUM: - /* input is bitpos, of highest verbosity to be enabled */ - if (inrep > map->length) { - pr_warn("%s: level:%ld exceeds max:%d, clamping\n", - KP_NAME(kp), inrep, map->length); - inrep =3D map->length; - } old_bits =3D CLASSMAP_BITMASK(*dcp->lvl); new_bits =3D CLASSMAP_BITMASK(inrep); v2pr_info("lvl:%ld bits:0x%lx > %s\n", inrep, new_bits, KP_NAME(kp)); @@ -1200,15 +1213,24 @@ static const struct proc_ops proc_fops =3D { static void ddebug_sync_classbits(const struct kernel_param *kp, const cha= r *modname) { const struct _ddebug_class_param *dcp =3D kp->arg; + unsigned long new_bits; =20 - /* clamp initial bitvec, mask off hi-bits */ - if (*dcp->bits & ~CLASSMAP_BITMASK(dcp->map->length)) { - *dcp->bits &=3D CLASSMAP_BITMASK(dcp->map->length); - v2pr_info("preset classbits: %lx\n", *dcp->bits); + ddebug_class_param_clamp_input(dcp->bits, kp); + + switch (dcp->map->map_type) { + case DD_CLASS_TYPE_DISJOINT_BITS: + v2pr_info(" %s: classbits: 0x%lx\n", KP_NAME(kp), *dcp->bits); + ddebug_apply_class_bitmap(dcp, dcp->bits, 0UL, modname); + break; + case DD_CLASS_TYPE_LEVEL_NUM: + new_bits =3D CLASSMAP_BITMASK(*dcp->lvl); + v2pr_info(" %s: lvl:%ld bits:0x%lx\n", KP_NAME(kp), *dcp->lvl, new_bits= ); + ddebug_apply_class_bitmap(dcp, &new_bits, 0UL, modname); + break; + default: + pr_err("bad map type %d\n", dcp->map->map_type); + return; } - /* force class'd prdbgs (in USEr module) to match (DEFINEr module) class-= param */ - ddebug_apply_class_bitmap(dcp, dcp->bits, ~0, modname); - ddebug_apply_class_bitmap(dcp, dcp->bits, 0, modname); } =20 static void ddebug_match_apply_kparam(const struct kernel_param *kp, diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 756bbb7506ea..08d4e3962026 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 @@ -57,24 +58,6 @@ module_param_cb(do_prints, ¶m_ops_do_prints, NULL, 0= 600); =20 #define CLASSMAP_BITMASK(width, base) (((1UL << (width)) - 1) << (base)) =20 -/* sysfs param wrapper, proto-API */ -#define DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, _init) \ - static unsigned long bits_##_model =3D _init; \ - static struct _ddebug_class_param _flags##_##_model =3D { \ - .bits =3D &bits_##_model, \ - .flags =3D #_flags, \ - .map =3D &map_##_model, \ - }; \ - module_param_cb(_flags##_##_model, ¶m_ops_dyndbg_classes, \ - &_flags##_##_model, 0600) -#ifdef DEBUG -#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ - DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, ~0) -#else -#define DYNAMIC_DEBUG_CLASSMAP_PARAM(_model, _flags) \ - DYNAMIC_DEBUG_CLASSMAP_PARAM_(_model, _flags, 0) -#endif - /* * Demonstrate/test DISJOINT & LEVEL typed classmaps with a sys-param. * @@ -105,12 +88,15 @@ enum cat_disjoint_bits { /* numeric verbosity, V2 > V1 related. V0 is > D2_DRMRES */ enum cat_level_num { V0 =3D 16, V1, V2, V3, V4, V5, V6, V7 }; =20 -/* recapitulate DRM's multi-classmap setup */ +/* + * 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. */ DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_disjoint_bits, DD_CLASS_TYPE_DISJOINT_BI= TS, D2_CORE, @@ -129,11 +115,13 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(map_level_num, DD_CLASS= _TYPE_LEVEL_NUM, V0, "V0", "V1", "V2", "V3", "V4", "V5", "V6", "V7"); =20 /* - * now add the sysfs-params + * for use-cases that want it, provide a sysfs-param to set the + * classes in the classmap. It is at this interface where the + * "v3>v2" property is applied to DD_CLASS_TYPE_LEVEL_NUM inputs. */ =20 -DYNAMIC_DEBUG_CLASSMAP_PARAM(disjoint_bits, p); -DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); +DYNAMIC_DEBUG_CLASSMAP_PARAM(p_disjoint_bits, map_disjoint_bits, p); +DYNAMIC_DEBUG_CLASSMAP_PARAM(p_level_num, map_level_num, p); =20 #ifdef FORCE_CLASSID_CONFLICT /* @@ -144,12 +132,10 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(classid_range_conflict,= 0, D2_CORE + 1, "D3_CORE") #endif =20 #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ - /* - * in submod/drm-drivers, use the classmaps defined in top/parent - * module above. + * the +1 members of a multi-module group refer to the classmap + * DEFINEd (and exported) above. */ - DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); =20 @@ -227,6 +213,7 @@ static void __exit test_dynamic_debug_exit(void) module_init(test_dynamic_debug_init); module_exit(test_dynamic_debug_exit); =20 +MODULE_DESCRIPTION("test/demonstrate dynamic-debug features"); MODULE_AUTHOR("Jim Cromie "); MODULE_DESCRIPTION("Kernel module for testing dynamic_debug"); MODULE_LICENSE("GPL"); diff --git a/lib/test_dynamic_debug_submod.c b/lib/test_dynamic_debug_submo= d.c index 672aabf40160..3adf3925fb86 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 @@ -12,3 +15,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"); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FE8F3A75A5 for ; Thu, 26 Mar 2026 18:55:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551318; cv=none; b=ocKTX/+QO/28VJebWdac+ZnyoGzKHuF05ywkfhlSQ9rqdDk5uXRB5j7T8yHInXkOfi9LXwA0t8weSGyGhJzk+e84nZwqa8AAwF+qXmCPhV1MlUZw27E/ebhNKhO29SaTwPN2Er7ANl7ZWbqjm2alPwqH0K3ex3yQ86Y9yPLpmgk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551318; c=relaxed/simple; bh=9ethbFA+3sG+Yt9H6ZFtM83MzmnmFw3XXUtYcrjFgG4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=hl/8gGvsPbPqeQf2GynQbBqaaJv2VbCGVdf2+ghw9FQAMR1vCEvRbiydox0LnIF0satb0YVpta9D9NHgM/AOQ4knSqfTxbwtm1lLZKlt7Pp5n4xzoEQCZSvidc0jyVkMGZSPMwlkeyuyuGpPrlwlfMKhKdOyIF3hEtWkduLYXKo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=p9uiqp7f; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p9uiqp7f" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-67bad873c3eso872534eaf.3 for ; Thu, 26 Mar 2026 11:55:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551315; x=1775156115; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Op8z6BF2VC082oV6Way2DdykcbiTU1bYqkraAfxcvx0=; b=p9uiqp7fFDgZ4LzHUuEL++z3IOR42FKZwwJdMdTOeBMAGuUIIrAlORLrxX6zhwkjBx GpOQ9La5NGH3AXrZqN3dAeGHAtf1BWQ75K9eiiqxOYKsB5GBDZXt4M1MB2nYx5QIQd/v IYDIgminI5FKYomYLzJ5sUEgu+DXvg7qxSS6yq41O+jQQIipGG3X9cTHVVt6Y1QRMeU1 1Wqk59ln5eF9fG76gbVn7iIs4b8KMoDfS2GT8ynvIVffItn+lF6cq63MKU8COxE4259m rCLYv+bAhiNrUesAXPAeoYEhzcHPIGTKI68YuSjhiFsmER/R1fLFTaaNstJUeVznQXor JFcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551315; x=1775156115; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Op8z6BF2VC082oV6Way2DdykcbiTU1bYqkraAfxcvx0=; b=jCh4S+U80M39WDSxU1IwXbzeSqQdx810EkjOxyN0ozJ7QAFTvc6VzlWAuHgUXFe8gd R/LufDZx51jikgUEF5ozURgRsKyvWYaL0pN4DtBnu+Xv0/3mhJOHE5PudBW8jePA4n4Z mTpMwUMBKMJuymcMqzhFVbJvsYoPZEhlrMNYkNiJS4IDKwhNwGonbZp499ikldu1Mj79 KkM2a9QbBLPd8FLChMXj8szln4GHPfER7rJR7V3AP1NdcNf2OfA6wFo9GTvkBz+sHuFs ZFbLa7LBD9kvOLU+pPOm5LZzrEHqYptHqzA6rtqUYvD9BHDqBnBNYui3tDDqYhudp2Kx qkOg== X-Gm-Message-State: AOJu0YzN3BdU3GkRpJ8+zkfHpYb+hhxnX/54YY3Pf8B7TlCtxiLKVhPh 3rH+iioHhOqF8Y1mbQLCkFDDyvxCCLILwdaTS4MM8K45n084utzO6WO9YVDGMg== X-Gm-Gg: ATEYQzxR8Ot70Wcwc3V2xG1VIc8p4aGSRdxbH81PTRc4FVMryPdqI2qWR8ND4JiJXdw ckGOxhHu9DY4bx53iqdqqkq4XM1TI4gdaxdglI96PRAGNtgBOm4Ta0bdGpfgm/emTNTz/T4yotF jIG903o1QHb6GCcsxhG7lvk1jxaKOQSaK/nWDGpbv8ZKEFNBUAUXex0QHDbdsCA6jmZoByhZcpz T9D3PE/oODMhB6BCPJ+qZ+Ftz5tsmHGO+jpo2N23njAa9hdTDOWURRpDAFCCUJw1q2cFRRfuoMf 0ERBMrjFoMRz9FFPjP0mAG1R7SOqG5xU5FoawCevMoACtzIAKZxu5CjzMt/1UVztHUbGWJWXxyt MElQvQ2xXn5ZCUJQF9tTAZQ02B5GXJqjMBEN4XUhDxNft5/S3crOpYF9d3k6KdNRGKBSG0T1Oxm RhrPnDiWAAOWn1cVe3tokG8dJkQzNRljPE6qcb2nK0ydO9b9OY X-Received: by 2002:a05:6820:8c1:b0:67c:305f:ac67 with SMTP id 006d021491bc7-67dff3cfa80mr4059105eaf.11.1774551315200; Thu, 26 Mar 2026 11:55:15 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:14 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 30/69] dyndbg: treat comma as a token separator Date: Thu, 26 Mar 2026 12:53:34 -0600 Message-ID: <20260326185413.1205870-31-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Treat comma as a token terminator, just like a space. This allows a user to avoid quoting hassles when spaces are otherwise needed: :#> modprobe drm dyndbg=3Dclass,DRM_UT_CORE,+p\;class,DRM_UT_KMS,+p or as a boot arg: drm.dyndbg=3Dclass,DRM_UT_CORE,+p # todo: support multi-query here Given the many ways a boot-line +args can be assembled and then passed in/down/around shell based tools, this may allow side-stepping all sorts of quoting hassles thru those layers. existing query format: modprobe test_dynamic_debug dyndbg=3D"class D2_CORE +p" new format: modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+p ALSO selftests-dyndbg: add comma_terminator_tests 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. Reviewed-by: Louis Chauvet Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 9 +++++--- lib/dynamic_debug.c | 17 +++++++++++---- .../dynamic_debug/dyndbg_selftest.sh | 21 ++++++++++++++++++- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 9c2f096ed1d8..dbf901150587 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -78,11 +78,12 @@ Command Language Reference =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D =20 At the basic lexical level, a command is a sequence of words separated -by spaces or tabs. So these are all equivalent:: +by spaces, tabs, or commas. So these are all equivalent:: =20 :#> ddcmd file svcsock.c line 1603 +p :#> ddcmd "file svcsock.c line 1603 +p" :#> ddcmd ' file svcsock.c line 1603 +p ' + :#> ddcmd file,svcsock.c,line,1603,+p =20 Command submissions are bounded by a write() system call. Multiple commands can be written together, separated by ``;`` or ``\n``:: @@ -167,9 +168,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 ``_``. =20 - module sunrpc + Examples:: + + module,sunrpc # with ',' as token separator module nfsd module drm* # both drm, drm_kms_helper =20 diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index c6f3b0452dfa..16cff6c3b81a 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -320,6 +320,14 @@ static int ddebug_change(const struct ddebug_query *qu= ery, struct flag_settings return nfound; } =20 +static char *skip_spaces_and_commas(const char *str) +{ + str =3D skip_spaces(str); + while (*str =3D=3D ',') + str =3D skip_spaces(++str); + return (char *)str; +} + /* * Split the buffer `buf' into space-separated words. * Handles simple " and ' quoting, i.e. without nested, @@ -333,8 +341,8 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) while (*buf) { char *end; =20 - /* Skip leading whitespace */ - buf =3D skip_spaces(buf); + /* Skip leading whitespace and comma */ + buf =3D skip_spaces_and_commas(buf); if (!*buf) break; /* oh, it was trailing whitespace */ if (*buf =3D=3D '#') @@ -350,7 +358,7 @@ static int ddebug_tokenize(char *buf, char *words[], in= t maxwords) return -EINVAL; /* unclosed quote */ } } else { - for (end =3D buf; *end && !isspace(*end); end++) + for (end =3D buf; *end && !isspace(*end) && *end !=3D ','; end++) ; if (end =3D=3D buf) { pr_err("parse err after word:%d=3D%s\n", nwords, @@ -622,7 +630,8 @@ static int ddebug_exec_queries(char *query, const char = *modname) if (split) *split++ =3D '\0'; =20 - query =3D skip_spaces(query); + query =3D skip_spaces_and_commas(query); + if (!query || !*query || *query =3D=3D '#') continue; =20 diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 465fad3f392c..c7bf521f36ee 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 =3D_ # zero everything @@ -238,8 +238,27 @@ EOF ddcmd =3D_ } =20 +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,=3D_ # commas as spaces + ddcmd module,params,+mpf # turn on module's pr-debugs + check_match_ct =3Dpmf 4 + ddcmd ,module ,, , params, -p + check_match_ct =3Dmf 4 + ddcmd " , module ,,, , params, -m" # + check_match_ct =3Df 4 + ddcmd =3D_ +} + tests_list=3D( basic_tests + comma_terminator_tests ) =20 # Run tests --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC23C423A71 for ; Thu, 26 Mar 2026 18:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551319; cv=none; b=CB6elxpbkkTTurPp5i0CGLRFbH2gWSSrth3Kej2rdF7n5tVRVLMsPh58p/RwOpD3RbJqVLuKBYWrl5cDMRiEpvaq7z2NR70zy5BNpFaiYGXssiiS/rcUl2a7it7AXduuOjwEFJPCpHvL16w5qbwvysSTa9OunegK7oEruff047k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551319; c=relaxed/simple; bh=gSLOnEPV+jvjPNA5x/nZIZ9K0KOd+BB7WmwBOrzaITU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UPY/GBgqRvvwWGlsCFNZnIgZQ5dxe4053808J4uT0YqMNb5vwkrRL8J+O34XSkNUHI0SLHsrkW5xY6DdyGMa6APsZIm4mIXAbEMpvG/DwGBbo4Itxr+YQwtMcq+2OeteUw8e9UVQBiTAWs3EwO04LEOVvVr65lmuRLPh0wvA/IQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WVTb43Ej; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WVTb43Ej" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-409de4132b5so816385fac.1 for ; Thu, 26 Mar 2026 11:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551316; x=1775156116; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wYQBxHr3Fa2/s6UIiugIdxA7TpYQIjo73GyHI23/HiM=; b=WVTb43EjXpYOeySnfM4GmZq1go9009N9pLjOBp4pe5gUOreu6nGuHN73pSfnEga9kk Cy8XtsQxiQe1W5iPBoIx98DLV1xO+BpGOerojVnkzjiZc3zcVZuOPy1cTznom3Lfyqqw cGn27c2HkReE5wdULUxPXNOj/MLXde3kZDAvbV048Sy1llYovG88eNy4iCW4Sj7g1/gv /HtFfxNfoRtFFyD4VJmfSWMNHrVD3rUokiEXL0qhfVmJfgtIMT0S/iVTNeUouPoXJSX5 k2jTYoJVkr6iL5eYUWs2esRlnPVpf0GaP7aVC8q5FxYLxRYxdx+0iZ+MZTgEKjjqtpfz lOUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551316; x=1775156116; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wYQBxHr3Fa2/s6UIiugIdxA7TpYQIjo73GyHI23/HiM=; b=oseHXSmiGMEknVd52ij1xmdcpggCpdRfcRkPG3DatWtI8qw+2/SNfLbzob+skiwld7 Hm3xShNlq7zZVB5d5Zf4Ka+8TjMOeTv15ahgm8jyUYDCF6w2Y3hWDUaIQC2Wn3GSFrP6 FaQLhKWrVvAWZSSSkTggwTZXsp/6g6s5/WbcPGcvMegpLTBLzWVCLBHVTxYxg8U7PTML dj7sJzbOpTEJOdkPPZ7hu/aXWIE/6R9qPFKyvhJm9L+any+M4Y2Lpfh4ff38xokTLbYB ms8GEBZTZGVMUV3Ay+tzOwUIo5ccr3z6bYQxUS/pjmuP0U/yEDJA7AYBX8ql+j4PVVSK PCwQ== X-Gm-Message-State: AOJu0YwFq4RduO4Eb6HBUVR/Bscr4QjnKbH6d8Fs7eAcsBNcyQnnVQa2 o12bYc55PkKXv5FzgDy4a+T47loVrNBNxDvHLOfny5T27xRS6FF03SCyMFzRnA== X-Gm-Gg: ATEYQzz5OvXdlQUS/SA9CJO7y+WxLAu+qbDimj0fJtNXT5XqSitLlZOBIVNFQkZvh2h vPKKmsRO2CaMXyaXjM/A7dwCG2xVNguatg2m3HjMbpAFRpa0r7wSRvVRHJZ5otl+FUQKTP8fP5/ rsEoKsSeweZZ8I8p17pshWgUBOcBrzEIVCcWVlWAJbdoDW8n8w29kl/rP8ZohxcIWfopxfs8sNB +iN5UHALzA8UiHUfxqhgPfnuvLX2bJFTF//26Zf6mLZezmZu15Oa78PQKBt+d4xDQVuboIYru7M EcgDdZKzD5Hd5LEHpYLoKdmIsZse1nmKYDF2Qr4eaqz2Dxh8noXlvODJLtQLvhcspPIBWF+qV2t a30MDRMJZLn2i1oVkD8gSdjAaeQmGgZql2np3Zfiq9eF/gwljPrQHf0r2uXJappvKoXMPhcRlYQ ClG9YWblucQkPp0gri4buFd4u5rhlKXgw9lKZkfbD+8NM5X8qV X-Received: by 2002:a05:6870:16cb:b0:41c:4e6b:3673 with SMTP id 586e51a60fabf-41ca6f4c6c3mr4241281fac.10.1774551316520; Thu, 26 Mar 2026 11:55:16 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:16 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 31/69] dyndbg: split multi-query strings with % Date: Thu, 26 Mar 2026 12:53:35 -0600 Message-ID: <20260326185413.1205870-32-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Since commit 85f7f6c0edb8 ("dynamic_debug: process multiple debug-queries on a line") Multi-query commands have been allowed: modprobe drm dyndbg=3D"class DRM_UT_CORE +p; class DRM_UT_KMS +p" modprobe drm dyndbg=3D< [ 203.902703] dyndbg: query parse failed [ 203.902871] dyndbg: processed 2 queries, with 0 matches, 2 errs bash: echo: write error: Invalid argument The '%' splits the input into 2 queries, and both fail. Given the limited utility of matching against the working parts of a format string "foo: %d bar %s", nothing is actually lost here. selftests-dyndbg: test_percent_splitting 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. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 8 ++++--- lib/dynamic_debug.c | 2 +- .../dynamic_debug/dyndbg_selftest.sh | 24 +++++++++++++++++++ 3 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index dbf901150587..0a42b9de55ac 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -85,10 +85,12 @@ by spaces, tabs, or commas. So these are all equivalen= t:: :#> ddcmd ' file svcsock.c line 1603 +p ' :#> ddcmd file,svcsock.c,line,1603,+p =20 -Command submissions are bounded by a write() system call. -Multiple commands can be written together, separated by ``;`` or ``\n``:: +Command submissions are bounded by a write() system call. Multiple +commands can be written together, separated by ``%``, ``;`` or ``\n``:: =20 - :#> ddcmd "func pnpacpi_get_resources +p; func pnp_assign_mem +p" + :#> ddcmd func foo +p % func bar +p + :#> ddcmd func foo +p \; func bar +p + :#> ddcmd "func foo +p ; func bar +p" :#> ddcmd <<"EOC" func pnpacpi_get_resources +p func pnp_assign_mem +p diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 16cff6c3b81a..6430f77c7b9c 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -626,7 +626,7 @@ static int ddebug_exec_queries(char *query, const char = *modname) int i, errs =3D 0, exitcode =3D 0, rc, nfound =3D 0; =20 for (i =3D 0; query; query =3D split) { - split =3D strpbrk(query, ";\n"); + split =3D strpbrk(query, "%;\n"); if (split) *split++ =3D '\0'; =20 diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index c7bf521f36ee..513f6cb1db1d 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -256,9 +256,33 @@ function comma_terminator_tests { ddcmd =3D_ } =20 +function test_percent_splitting { + echo -e "${GREEN}# TEST_PERCENT_SPLITTING - multi-command splitting on= % ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP - test requires test-dynamic-debug.ko" + return + fi + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =3D_ + modprobe test_dynamic_debug dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+p= t%class,D2_ATOMIC,+pm + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + check_match_ct test_dynamic_debug 23 -r + # add flags to those callsites + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + check_match_ct test_dynamic_debug 23 -r + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests comma_terminator_tests + test_percent_splitting ) =20 # Run tests --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FD16423A7A for ; Thu, 26 Mar 2026 18:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551320; cv=none; b=oCkDUseOn4+VHK19TeoTnqv3+RJns+ExC9BcQXwzEpemCyjBxqRz+YOUo0X4PfVmLshBB4L2DdTk20SwmLIKjC32REOhsU8yaXhWSI1JgbfT2p7ZrXIiv/bEPhAXDb0dNo4GFVBus/8hi4tERMcc2MRIwtrSVmmypA4kJEjMTdo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551320; c=relaxed/simple; bh=o9XAvjSs/yDZQc7WmR2T+j5cz0yKThRjVBgsLtPQWN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ICcUJPwaysumEAxyKHzEc/bsfuNPtfowgYIHBpDH6Q7Bz1LmK1FsanuALN9U6Ln4g143gShPQn7bR3ToB2BlvGZkOV24Sa5JiTCvT//pvjZ8ZMgdr9sBJ3x+UcDLgSYjJuG8A09YCReWDdgkS6s9o19Nc+6kic3D0XC3I+Hui+U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=b1/uBh0m; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b1/uBh0m" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-415c8a4d2e6so561651fac.0 for ; Thu, 26 Mar 2026 11:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551318; x=1775156118; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZxTkOltoVAiRQNIiLPEo11+229bHMC78x0TMXlU2wIM=; b=b1/uBh0mUaBoFkERYSJbe/00zPtSU9WD1USpCD43yxOZp6G/qoJHH2N0Vw+Aczae8B LOK4mc9InTitvjad9leNFkN7BaWR5UzXW6oFbZHURExchVItcDeeCo2TWq6+w1UiJD4P MLu1kB/tX3fu+HxQGIhsSP7W6Xuv8s2rtT5RhjU/kcisDuVSoKV7iS/XRe6Ien6jC3w+ VJgC1tuZ90I4N0yD7TmbkjIKN0ZH0o7lw0+s+u1rzHtc8EYmM7NmE+aaeNKYQ3Y55Gyp RDJO8vtcHDGHerxhvd9awjCfKZzeMJBVYxZBiO6qoz9o4wrrGqlLvyKoget3r7cs/KkX RLUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551318; x=1775156118; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZxTkOltoVAiRQNIiLPEo11+229bHMC78x0TMXlU2wIM=; b=Xf32U0bkRYDb97J+cyb+KAVFctsvqaF3TVf9CuyJTg8SdxozBEv6MOk8lN26asSxZ6 1dIgFbP8kawvH856mD3+Hp27Yyxsejncyuo9PMI2EODIDi1LYaqcpj/OxfD7o1QRXvYD /laIOPiwSgOCQDxxXVTuM72wV234ZjOe8e9Z7oUfdzI8zcb4bMq1GDYI9ChLfv37Hnnn co3R6WLqG0RIsJYEnO+s5vsOlXm47vHOKUbVeGKFwPhoXKoGhkNFi16Xks4VAMGbwYAs ZCjvWUVBn2g6wTa//dwrfCi/xn44D5CKf5UA3dB7OCgR5dPfkDI8a2tHO4Erw0aQxO7d 1d4w== X-Gm-Message-State: AOJu0YwYRfsiFmguL0A2AACapp/9AL0KIU2Ww054WfyU55wTpUzjbXp0 8mmBEJA1I/8jcKFepYMVCKnoPrL6qoh7YOHfekZfCjI3GRegTHuembjhBR9XPg== X-Gm-Gg: ATEYQzz0yPZq15poHJl0c7kGPHWiyu7SMsQv5lYDP9nC3k1M3V1NIyO4IHzkubtBsoD M0X2rOWQAuvrcYMvGLqML3LBqYZujx9o5TvvfQbK+jD32IObchdVU0QTIQ+UxaJJp8kTXVFhN3n d+mp56A/cTdryHI1gPjoF9XT4Av+jCdttU/qiOSGQY9ujnGEeqh2P2u/T9OwxKkOohsjwklhSHz Bb6OpHHBvxrHwei8dH3OqYdTT3CBIA5BITCECIueXX4SvbQ9yhEn1HxUoQI9pwKxH29rlBg5dNj Sm7CGCYNw9wuf+tUtGteU4ZL/xT3KtMKh5EtqzhJ+yYfVg9qiPhrHqm3TwEElejC8K/18M6K4Pj j+jEWhHusCqFLWc7vktXRWo0EvHlznmCpWqWNZDjz1bvPVXpnGvcOPoP1sVnOkDt7OXRvvq7JoE Hv/OF0aPPGNO/BnkH1KLm30GMaSCh0FJhR5eCNobH0DJSqXQbZ X-Received: by 2002:a05:6870:b0eb:b0:3eb:7a2e:34a4 with SMTP id 586e51a60fabf-41ca6ff26a6mr4833606fac.28.1774551317851; Thu, 26 Mar 2026 11:55:17 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:17 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 32/69] selftests-dyndbg: add test_mod_submod Date: Thu, 26 Mar 2026 12:53:36 -0600 Message-ID: <20260326185413.1205870-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This new test-fn runs 3 module/submodule modprobe scenarios, variously using both the generic dyndbg=3D modprobe arg, and the test-module's classmap-params to manipulate the test-mod*'s pr_debugs. In all cases, the current flag-settings are counted and tested vs expectations. The 3rd scenario recapitulates the DRM_USE_DYNAMIC_DEBUG=3Dy failure. 1. 2 modprobes (super then sub), with separate dyndbg=3Dclass-settings check module specific flag settings 2. modprobe submod, supermod is auto-loaded set supermod class-params check expected enablements in super & submod 3. modprobe super, with param=3Dsetting (like drm.debug=3D0x1ef) modprobe submod validate submod's class'd pr_debugs get properly enabled The test uses multi-queries, with both commas and percents (to avoid spaces and quoting). This is the main reason the test wasn't earlier in the patchset, closer to the classmap patches its validating. With some tedium, the tests could be refactored to split out early tests which avoid multi-cmds, and test only the class-params. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- .../dynamic_debug/dyndbg_selftest.sh | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh b/too= ls/testing/selftests/dynamic_debug/dyndbg_selftest.sh index 513f6cb1db1d..09937dca3056 100755 --- a/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh +++ b/tools/testing/selftests/dynamic_debug/dyndbg_selftest.sh @@ -279,10 +279,83 @@ function test_percent_splitting { ifrmmod test_dynamic_debug } =20 +function test_mod_submod { + echo -e "${GREEN}# TEST_MOD_SUBMOD ${NC}" + if [ $LACK_TMOD -eq 1 ]; then + echo "SKIP - test requires test-dynamic-debug.ko" + return + fi + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + ddcmd =3D_ + + # modprobe with class enablements + modprobe test_dynamic_debug \ + dyndbg=3Dclass,D2_CORE,+pf%class,D2_KMS,+pt%class,D2_ATOMIC,+pm + + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + + modprobe test_dynamic_debug_submod + check_match_ct test_dynamic_debug_submod 23 -r + check_match_ct '\[test_dynamic_debug\]' 23 -r + check_match_ct test_dynamic_debug 46 -r + + # no enablements propagate here + check_match_ct =3Dpf 1 + check_match_ct =3Dpt 1 + check_match_ct =3Dpm 1 + + # change classes again, this time submod too + ddcmd class,D2_CORE,+mf%class,D2_KMS,+lt%class,D2_ATOMIC,+ml "# add so= me prefixes" + check_match_ct =3Dpmf 1 + check_match_ct =3Dplt 1 + check_match_ct =3Dpml 1 + # submod changed too + check_match_ct =3Dmf 1 + check_match_ct =3Dlt 1 + check_match_ct =3Dml 1 + + # now work the classmap-params + # fresh start, to clear all above flags (test-fn limits) + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + modprobe test_dynamic_debug_submod # get supermod too + + echo 1 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 4 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( V1-3 + D2_CORE ) + check_match_ct =3Dp 8 + echo 3 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_CORE, D2_DRIVER ) + check_match_ct =3Dp 4 + echo 0x16 > /sys/module/test_dynamic_debug/parameters/p_disjoint_bits + echo 0 > /sys/module/test_dynamic_debug/parameters/p_level_num + # 2 mods * ( D2_DRIVER, D2_KMS, D2_ATOMIC ) + check_match_ct =3Dp 6 + + # recap DRM_USE_DYNAMIC_DEBUG regression + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug + # set super-mod params + modprobe test_dynamic_debug p_disjoint_bits=3D0x16 p_level_num=3D5 + check_match_ct =3Dp 7 + modprobe test_dynamic_debug_submod + # see them picked up by submod + check_match_ct =3Dp 14 + ifrmmod test_dynamic_debug_submod + ifrmmod test_dynamic_debug +} + tests_list=3D( basic_tests + # these require test_dynamic_debug*.ko comma_terminator_tests test_percent_splitting + test_mod_submod ) =20 # Run tests --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C0E425CC9 for ; Thu, 26 Mar 2026 18:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551322; cv=none; b=EfBHrorxNN0X0VUHusIqRk6mqdKjIoVVimSEnTgZoStL+P835qWwzqZ83JuzJdlgCIryn51Eb3+Qbv8QkHJsWQqkYbzWHjUiFK+es8E38hb03IfASC07wUYNjr7/PJw7a/Ql2JxtxlyjpUDBsPBTYC4HO5LH1rTi8cI0AbepbB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551322; c=relaxed/simple; bh=ffYea5QwG/vcMRALURtxHTtwAd5CEp54EzMGG1f4Al8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RP61e8n5ZMgPKlJH7tMo00duui7d+k3CM3F3bWHftOp8mcUFbT44fqy9DagNJcEnVwnno5K1LXeZlcK4yOg91JsXjZLqFnAw+de7jVpePogA5J5G/N0lp8Jy9VX6SQgtUpNA8PQz3FnUqvIwczWKxj18i90frroACHR7jFcCEEY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mIiBLeQx; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mIiBLeQx" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-417571c6083so746791fac.2 for ; Thu, 26 Mar 2026 11:55:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551319; x=1775156119; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J42RjL3XW7iYvn8zHG5csoL/H2RaSYA/baR8+V+mULo=; b=mIiBLeQxGXxky+y+0rcsaoZI84iyumUZjjqR6XhcIyQuqdYoV/vrdyRCL4YYNFHfxL p0mAo/as21/IFkZ+oNBzlfrcBU+/yieMVuABwtMcjbNnsNiStaSr/A+OnqSHCJCMn68H +ufUVPRVvXBlN2/g5K+6KvUB9Z7RwUVWSk+4zbfXBSQsPOQMT9vbZgj9idKXJvPM8lRb p6Y+LJGMvTbsuFHPyem9JSH4qiZm4QPW+4zOa9ZckjaQqACRQS934JQnAGCH7ikBn8ol W3HmIx2pkbGoo7PScT97eo/jszDAN3BhBPKr2aSTJ7oRizD+aFDNPpTL5UD6q2pLH5Aw GzwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551319; x=1775156119; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=J42RjL3XW7iYvn8zHG5csoL/H2RaSYA/baR8+V+mULo=; b=RRcSJFsngZnOHa8VFlUzHSgSD5E/p+djV4BQUiBJVpycwi55Z9nnsorydZJoHHgqR8 41Y+Ti43qiAKTczxONP9hApJ2RY/++8v5iN2ApR3sYj8hF1uQRCaSsyyL+XYXviD/JoQ aVo7gxEjU1rbGUvHDL0Etof5K0IPg6QeH1/hUFNa9SxeD+WTeakzhHR0d0Be8FlCzESj RCPJaREgp/v8JdzUxsbRaiGsg3GVhsjkfAF2iHA9EtkdrgXLquPgjwI8TIqNN41IKzK8 HXhJGP3DqiFSNXy1PX+9kS3jHrF6QLwWWVv/D8Mc4VoNa11WgpGOZ53mQC9LS9tm1Kqo xvBw== X-Gm-Message-State: AOJu0YyHFH9Dfdf05pTgrO8Ut9BL8KkkT5IgmsDlWkXw8WBTcaOH+rs7 kfUjGDh4ddrpIpr2YTh9CU6rS2GGUmO/D+entIwVSyCktR0/rAkfaNyhQr9D9Q== X-Gm-Gg: ATEYQzz/fbaqVZnYauxFGKSR7RZp+bp5lOJXsgQW6iht+GSheP1uWv1GSgn+Qoy/1Yz y+8/GqVBDn9ucIIK1FvuEmpHjbjmw+oxCEef64ZPqy368ulAeGbltzpOiqxvxBvDGpidTCAtT6w iXqgNhtzoWc1yRL94jVUpSlQLkvYzF0qKGPuDKK714g1NE25xExysqwY9K3WOUZ12XtCqc6E6ml 5Pw4Qn6TfvWtgqpg9E9qkCaApVkvU4D0NCsdgzI2v9gHtZX17puaeWeJULtX9T0Le3g+GMYN+Jo emhNCQPTONVw97YfqhzzU6UaM6AwqPVM2aDp+o8XzF29oE3Mr9qofvh0pLCh4Ba0pmGJ68U+QPj tjqRbRcK94fZpgp0yEUkIfaJ+MT46YjpmlzzIKNqGljBkFwWwgXfnMj3oFwmPkDFrjo72HBXxRu QwfD3pL1yPD6vJddFoqS2pGkpndGIA79rApWxWiJlcWLGVuxZt X-Received: by 2002:a05:6870:d8cc:b0:417:c2d1:fc36 with SMTP id 586e51a60fabf-41ca7051971mr4708391fac.33.1774551319350; Thu, 26 Mar 2026 11:55:19 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:18 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 33/69] dyndbg: resolve "protection" of class'd pr_debug Date: Thu, 26 Mar 2026 12:53:37 -0600 Message-ID: <20260326185413.1205870-34-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" classmap-v1 code protected class'd pr_debugs from unintended changes by unclassed/_DFLT queries: # - to declutter examples: alias ddcmd=3D'echo $* > /proc/dynamic_debug/control' # IOW, this should NOT alter drm.debug settings ddcmd -p # Instead, you must name the class to change it. # Protective but tedious ddcmd class DRM_UT_CORE +p # Or do it the (old school) subsystem way # This is ABI !! echo 1 > /sys/module/drm/parameters/debug Since the debug sysfs-node is ABI, if dyndbg is going to implement it, it must also honor its settings; it must at least protect against accidental changes to its classes from legacy queries. The protection allows all previously conceived queries to work the way they always have; ie select the same set of pr_debugs, despite the inclusion of whole new classes of pr_debugs. But that choice has 2 downsides: 1. "name the class to change it" makes a tedious long-winded interface, needing many commands to set DRM_UT_* one at a time. 2. It makes the class keyword special in some sense; the other keywords skip only on query mismatch, otherwise the code falls thru to adjust the pr-debug site. Jason Baron didn't like v1 on point 2. Louis Chauvet didn't like recent rev on point 1 tedium. But that said: /sys/ is ABI, so this must be reliable: #> echo 0x1f > /sys/module/drm/parameters/debug It 'just works' without dyndbg underneath; we must deliver that same stability. Convenience is secondary. The new resolution: If ABI is the blocking issue, then no ABI means no blocking issue. IOW, if the classmap has no presence under /sys/*, ie no PARAM, there is no ABI to guard, and no reason to enforce a tedious interface. In the future, if DRM wants to alter this protection, that is practical, but I think default-on is the correct mode. So atm classes without a PARAM are unprotected at >control, allowing admins their shortcuts. I think this could satisfy all viewpoints. That said, theres also a possibility of wildcard classes: #> ddcmd class '*' +p Currently, the query-class is exact-matched against each module's classmaps.names. This gives precise behavior, a good basis. But class wildcards are possible, they just did'nt appear useful for DRM, whose classmap names are a flat DRM_UT_* namespace. IOW, theres no useful selectivity there: #> ddcmd class "DRM_*" +p # these enable every DRM_* class #> ddcmd class "DRM_UT_*" +p #> ddcmd class "DRM_UT_V*" +p # finally select just 1: DRM_UT_VBL #> ddcmd class "DRM_UT_D*" +p # but this gets 3 #> ddcmd class "D*V*" +p # here be dragons But there is debatable utility in the feature. #> ddcmd class __DEFAULT__ -p # what about this ? #> ddcmd -p # thats what this does. automatically Anyway, this patch does: 1. adds link field from _ddebug_class_map to the .controlling_param 2. sets it in ddebug_match_apply_kparam(), during modprobe/init, when options like drm.debug=3DVAL are handled. 3. ddebug_class_has_param() now checks .controlling_param 4. ddebug_class_wants_protection() macro renames 3. this frames it as a separable policy decision 5. ddebug_match_desc() gets the most attention: a. move classmap consideration to the bottom this insures all other constraints act 1st. allows simpler 'final' decisions. b. split class choices cleanly on query: class FOO vs none, and class'd vs _DPRINTK_CLASS_DFLT site. c. calls 4 when applying a class-less query to a class'd pr_debug here we need a new fn to find the classmap with this .class_id d. calls new ddebug_find_classmap_by_class_id(). when class-less query looks at a class'd pr_debug. finds classmap, which can then decide, currently by PARAM existence. NOTES: protection is only against class-less queries, explicit "class FOO" adjustments are allowed (that is the mechanism). The drm.debug sysfs-node heavily under-specifies the class'd pr_debugs it controls; none of the +mfls prefixing flags have any effect, and each callsite remains individually controllable. drm.debug just toggles the +p flag for all the modules' class'd pr_debugs. Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- -v12 minor fixup after squashing subsequent commits to previous ones --- include/linux/dynamic_debug.h | 14 ++-- lib/dynamic_debug.c | 137 ++++++++++++++++++++++++++-------- 2 files changed, 115 insertions(+), 36 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 1cae9a2f32d7..1b401f398a3c 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -76,6 +76,7 @@ enum ddebug_class_map_type { * map @class_names 0..N to consecutive constants starting at @base. */ struct _ddebug_class_map { + struct _ddebug_class_param *controlling_param; const struct module *mod; /* NULL for builtins */ const char *mod_name; /* needed for builtins */ const char **class_names; @@ -281,7 +282,12 @@ struct _ddebug_class_param { * * 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. + * + * Since sysfs-params are ABI, this also protects the classmap'd + * pr_debugs from un-class'd `echo -p > /proc/dynamic_debug/control` + * changes. + * + * This keeps class-state in a private long int. */ #define DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _var, _flags) \ static unsigned long _name##_bvec; \ @@ -294,10 +300,8 @@ struct _ddebug_class_param { * @_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. + * Like DYNAMIC_DEBUG_CLASSMAP_PARAM, but maintains param-state in + * extern @_bits. This lets DRM check __drm_debug elsewhere too. */ #define DYNAMIC_DEBUG_CLASSMAP_PARAM_REF(_name, _bits, _var, _flags) \ __DYNAMIC_DEBUG_CLASSMAP_PARAM(_name, _bits, _var, _flags) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 6430f77c7b9c..66879a40b822 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -206,6 +206,55 @@ ddebug_find_valid_class(struct _ddebug_info const *di,= const char *query_class, return NULL; } =20 +static bool ddebug_class_map_in_range(const int class_id, const struct _dd= ebug_class_map *map) +{ + return (class_id >=3D map->base && + class_id < map->base + map->length); +} + +static bool ddebug_class_user_in_range(const int class_id, const struct _d= debug_class_user *user) +{ + return ddebug_class_map_in_range(class_id - user->offset, user->map); +} + +static struct _ddebug_class_map * +ddebug_find_map_by_class_id(struct _ddebug_info *di, int class_id) +{ + struct _ddebug_class_map *map; + struct _ddebug_class_user *cli; + int i; + + for_subvec(i, map, di, maps) + if (ddebug_class_map_in_range(class_id, map)) + return map; + + for_subvec(i, cli, di, users) + if (ddebug_class_user_in_range(class_id, cli)) + return cli->map; + + return NULL; +} + +/* + * classmaps-V1 protected classes from changes by legacy commands + * (those selecting _DPRINTK_CLASS_DFLT by omission). This had the + * downside that saying "class FOO" for every change can get tedious. + * + * V2 is smarter, it protects class-maps if the defining module also + * calls DYNAMIC_DEBUG_CLASSMAP_PARAM to create a sysfs parameter. + * Since the author wants the knob, we should assume they intend to + * use it (in preference to "class FOO +p" >control), and want to + * trust its settings. This gives protection when its useful, and not + * when its just tedious. + */ +static inline bool ddebug_class_has_param(const struct _ddebug_class_map *= map) +{ + return !!(map->controlling_param); +} + +/* re-framed as a policy choice */ +#define ddebug_class_wants_protection(map) (ddebug_class_has_param(map)) + /* * Search the tables for _ddebug's which match the given `query' and * apply the `flags' and `mask' to them. Returns number of matching @@ -214,11 +263,10 @@ ddebug_find_valid_class(struct _ddebug_info const *di= , const char *query_class, */ static bool ddebug_match_desc(const struct ddebug_query *query, struct _ddebug *dp, - int valid_class) + struct _ddebug_info *di, + int selected_class) { - /* match site against query-class */ - if (dp->class_id !=3D valid_class) - return false; + struct _ddebug_class_map *site_map; =20 /* match against the source filename */ if (query->filename && @@ -255,7 +303,28 @@ static bool ddebug_match_desc(const struct ddebug_quer= y *query, dp->lineno > query->last_lineno) return false; =20 - return true; + /* + * above are all satisfied, so we can make final decisions: + * 1- class FOO or implied class __DEFAULT__ + * 2- site.is_classed or not + */ + if (query->class_string) { + /* class FOO given, exact match required */ + return (dp->class_id =3D=3D selected_class); + } + /* query class __DEFAULT__ by omission. */ + if (dp->class_id =3D=3D _DPRINTK_CLASS_DFLT) { + /* un-classed site */ + return true; + } + /* site is class'd */ + site_map =3D ddebug_find_map_by_class_id(di, dp->class_id); + if (!site_map) { + WARN_ONCE(1, "unknown class_id %d, check %s's CLASSMAP definitions", dp-= >class_id, di->mod_name); + return false; + } + /* module(-param) decides protection */ + return !ddebug_class_wants_protection(site_map); } =20 static int ddebug_change(const struct ddebug_query *query, struct flag_set= tings *modifiers) @@ -265,33 +334,31 @@ static int ddebug_change(const struct ddebug_query *q= uery, struct flag_settings unsigned int newflags; unsigned int nfound =3D 0; struct flagsbuf fbuf, nbuf; - struct _ddebug_class_map *map =3D NULL; - int valid_class; + int selected_class; =20 /* search for matching ddebugs */ mutex_lock(&ddebug_lock); list_for_each_entry(dt, &ddebug_tables, link) { struct _ddebug_info *di =3D &dt->info; + struct _ddebug_class_map *mods_map; =20 /* match against the module name */ if (query->module && !match_wildcard(query->module, di->mod_name)) continue; =20 + selected_class =3D _DPRINTK_CLASS_DFLT; if (query->class_string) { - map =3D ddebug_find_valid_class(&dt->info, query->class_string, - &valid_class); - if (!map) + mods_map =3D ddebug_find_valid_class(di, query->class_string, + &selected_class); + if (!mods_map) continue; - } else { - /* constrain query, do not touch class'd callsites */ - valid_class =3D _DPRINTK_CLASS_DFLT; } =20 for (i =3D 0; i < di->descs.len; i++) { struct _ddebug *dp =3D &di->descs.start[i]; =20 - if (!ddebug_match_desc(query, dp, valid_class)) + if (!ddebug_match_desc(query, dp, di, selected_class)) continue; =20 nfound++; @@ -656,6 +723,7 @@ static int ddebug_exec_queries(char *query, const char = *modname) } =20 /* apply a new class-param setting */ + static int ddebug_apply_class_bitmap(const struct _ddebug_class_param *dcp, const unsigned long *new_bits, const unsigned long old_bits, @@ -1107,17 +1175,6 @@ static void *ddebug_proc_next(struct seq_file *m, vo= id *p, loff_t *pos) return dp; } =20 -static bool ddebug_class_map_in_range(const int class_id, const struct _dd= ebug_class_map *map) -{ - return (class_id >=3D map->base && - class_id < map->base + map->length); -} - -static bool ddebug_class_user_in_range(const int class_id, const struct _d= debug_class_user *user) -{ - return ddebug_class_map_in_range(class_id - user->offset, user->map); -} - static const char *ddebug_class_name(struct _ddebug_info *di, struct _ddeb= ug *dp) { struct _ddebug_class_map *map; @@ -1242,25 +1299,36 @@ static void ddebug_sync_classbits(const struct kern= el_param *kp, const char *mod } } =20 -static void ddebug_match_apply_kparam(const struct kernel_param *kp, - const struct _ddebug_class_map *map, - const char *mod_name) +static struct _ddebug_class_param * +ddebug_get_classmap_kparam(const struct kernel_param *kp, + const struct _ddebug_class_map *map) { struct _ddebug_class_param *dcp; =20 if (kp->ops !=3D ¶m_ops_dyndbg_classes) - return; + return NULL; =20 dcp =3D (struct _ddebug_class_param *)kp->arg; =20 - if (map =3D=3D dcp->map) { + return (map =3D=3D dcp->map) + ? dcp : (struct _ddebug_class_param *)NULL; +} + +static void ddebug_match_apply_kparam(const struct kernel_param *kp, + struct _ddebug_class_map *map, + const char *mod_name) +{ + struct _ddebug_class_param *dcp =3D ddebug_get_classmap_kparam(kp, map); + + if (dcp) { + map->controlling_param =3D dcp; v2pr_info(" kp:%s.%s =3D0x%lx", mod_name, kp->name, *dcp->bits); vpr_cm_info(map, " %s maps ", mod_name); ddebug_sync_classbits(kp, mod_name); } } =20 -static void ddebug_apply_params(const struct _ddebug_class_map *cm, const = char *mod_name) +static void ddebug_apply_params(struct _ddebug_class_map *cm, const char *= mod_name) { const struct kernel_param *kp; #if IS_ENABLED(CONFIG_MODULES) @@ -1280,6 +1348,13 @@ static void ddebug_apply_params(const struct _ddebug= _class_map *cm, const char * } } =20 +/* + * called from add_module, ie early. it can find controlling kparams, + * which can/does? enable protection of this classmap from class-less + * queries, on the grounds that the user created the kparam, means to + * use it, and expects it to reflect reality. We should oblige him, + * and protect those classmaps from classless "-p" changes. + */ static void ddebug_apply_class_maps(const struct _ddebug_info *di) { struct _ddebug_class_map *cm; --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f41.google.com (mail-oo1-f41.google.com [209.85.161.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1847B425CF7 for ; Thu, 26 Mar 2026 18:55:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551323; cv=none; b=D/ef+tBWTelvF0c/X328IDmkfaGfwfcdBChirODx/OKuewMmYbvUH7IqMVu0/waSloAxfR+VSkG+LkFN/DsD7db7NnTYfaW5yxm3G51tEHRIHtFpj2eStrQm9jO0Z4X1Ff622/tkD0u6N5X1bEh9X3nDN24yr1QIsx13hNQQtM8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551323; c=relaxed/simple; bh=oq1YShVuokabewzhhC4F4u//3loNomj7t/HzAoIQxeY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DAl2Rk+XF2sg38vtbVqvA49sgcWgRMjbj+Yt0PqS/m1olf9DyC/zbFPCMDWHv5NQqkLXy0k17BHlea1ByCW7SlTt9M9iGF4HMjI0kulQ7Deo0livZU7QREC5jUJYMM0Oq/QDkuYCRVOkNcq4/m+47upY6Gq8y69vm1q+NvGtJQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TzZPWtLI; arc=none smtp.client-ip=209.85.161.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TzZPWtLI" Received: by mail-oo1-f41.google.com with SMTP id 006d021491bc7-673ee2a98b1so763563eaf.0 for ; Thu, 26 Mar 2026 11:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551321; x=1775156121; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kmGyHMtly7Qz0CqR2wXNKvZRnLsbvPnYKpSxXzkbtSQ=; b=TzZPWtLILbCI1fx2pbsRhjqEChqvopFZnfUo7m479bv9sNaATF3/YFHjGzKNl4qJXV v/avyz6pFKXCDzXaSfQAcTLjeEQGNzEL5r+5r4EMbG1SrUs4dHL7YkhBlo9sZOTixozT PDpxXXZneXE93GPsvw4Deu11XxVfL7KBDh6dMWVVw267izBv3Fi58wVbsjpJghUSnd34 7L3qCghWH6p7bEyN1elmd3T66r4/T+06jVQBQOLOLgPNscY3peU47kH+JvVH2HOkufcL sxB7UC/z/eDnTkVPbyuRjF3fLggjHPk6dIry2BovQejqkZ6OQoyFRYw65YF/Q+ZvbKtg qYIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551321; x=1775156121; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=kmGyHMtly7Qz0CqR2wXNKvZRnLsbvPnYKpSxXzkbtSQ=; b=UOKVZ/hMAD5+a93nxwW9z+uDp2G8XTEB5UCjBfzr139bQF/C2g76jpSj3P4mk/7rDA MwjCP276fdIkLtPL59g2OrJxE/ZewhzKCpWtb12IfpboV9k5fNpN8oCfymsl+Dqi6NKL YHHaEsJNKDE9nlKLL4oxkPDyHZQw1JKgGwoPLwpb1/ySJrY5Ls3TCnP9928WC0LW3ygz uDXc8HM/huoajC1HHPkiKTse3hJ4OWmX4aEgABHgxduhhN/9AgHNHmFeAOxrxL1NTAfC NREHxMlR5QMSPy3WVXNb37ht0QanT9/QUafvQ0/cUGeI8JWvf7uSVVNzzuDPTFFt/A76 fEhA== X-Gm-Message-State: AOJu0YwyExNnS9FgExrGzBaKTq2ORWcfBVcKfZPHhpoMC+Pfp6udzzQF JhZoa+PiCS1hZn+jZ6gpZ+7YVxF833Ls2qfdhXtC1jHQeJd+TpFAQTLPMxtDvQ== X-Gm-Gg: ATEYQzzAiRyifV/EoZsi6q6hE8kJ578xYA6GuzGxUdvJluZ9uNrNG5uzo8QRTeJMhZY /OcgLPWZbBTbwcb/akjgZPR2+xmYl2F9D5QeylsqwpYzwclr6egaSNh39jZYVZyJSqc+Q9e0Cg6 omeKzI+InGidv/IyxpHPiaKbiS3tkQG04OjlI+TIVDhEipwmzqZtJkXC9hRZ6Wgbln2wNI/Eybg J5nXg0qY16XboxwtjIgIuBiWbG+vvE8M8iCLnAhLQ6HMTy+UNHbz135M+eitNUkc9K8OG73gMGO 1eosWGttnkZt8Lsw7xkpgS8k3uX4tzCma8P/OM2Xgq0Ms1exuFAdF+AWjozN5Qm7cur87dIJo+L HgIwKHKkMcdYZREtZfkBZFmDdo04hZjoR2BPDIcG5O4Gh4omx1AQEcj75xzVW+xrxMfu22UqVbf DADnoayaEZFhS0BbA/g0hT8E0bWxzhsf2dN6kfFcOboDGW43uaWnng8GNW2hA= X-Received: by 2002:a05:6820:4715:b0:67e:d8c:9f87 with SMTP id 006d021491bc7-67e0d8caa1amr1460403eaf.5.1774551320853; Thu, 26 Mar 2026 11:55:20 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:20 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 34/69] dyndbg: harden classmap and descriptor validation Date: Thu, 26 Mar 2026 12:53:38 -0600 Message-ID: <20260326185413.1205870-35-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Dynamic debug classmaps allow modules to _DEFINE and/or _USE multiple classmaps, but this requires coordination amongst the classmaps. Previously, class validation done by DYNAMIC_DEBUG_CLASSMAP_DEFINE at compile-time, and ddebug_class_range_overlap() at modprobe-time, was incomplete, and DYNAMIC_DEBUG_CLASSMAP_USE_ had no validation. This could allow broken classmaps, making them harder to use well. This commit improves classmap and descriptor validation: - Mirror the compile-time limits of _DEFINE by adding a static_assert to validate the _offset value passed to DYNAMIC_DEBUG_CLASSMAP_USE_. - Add run-time overlap checks for _USEd classmaps in ddebug_add_module() to prevent collisions between private maps and imported APIs. - Scan module descriptors at load time to print a single warning per missing class_id, rather than waiting for a user query to trip over it. - Downgrade the global WARN_ONCE in ddebug_match_desc() to a pr_warn_ratelimited, since orphaned class IDs are now tracked and warned about early at module load. Signed-off-by: Jim Cromie --- -v12 - squash several enhancments together drop run-time USE check, now done at compile-time s/WARN_ONCE/pr_err/, dont need stack trace for this, and do want multiple error reports, so dont quit on 1st err. Now that DYNAMIC_DEBUG_CLASSMAP_USE_() has an offset parameter, it is possible for a user to specify an illegal value - one that shifts the bit-range past the 64 bit max. The macro detects an offset > 63, but this isn't enough; the legal max is: map.length - 1 + map.base + user.offset < 64 Testing class-map vs class-user overlap is nonsense if the class-user range extends past the implemented limit. So check that 1st, before looking for map/user overlap. To validate this, add ifdef DD_RUNTIME_CLASS_CHECK code to test_dynamic_debug_submod.ko. When its enabled, it creates a bad class-user record via: DYNAMIC_DEBUG_CLASSMAP_USE_(map_level_num, 55); bash-5.3# modprobe test_dynamic_debug_submod [ 19.359818] dyndbg: 23 debug prints in module test_dynamic_debug [ 19.366239] dyndbg: module test_dynamic_debug_submod: base:16 + classes.= len:8 + cli.offset:55 must be < 63 [ 19.366612] dyndbg: dyndbg multi-classmap conflict in test_dynamic_debug= _submod [ 19.366945] dyndbg: dyndbg: failed to add module test_dynamic_debug_subm= od: -22 Finally, replace the misleading "Failed to allocate memory" WARN in the module notifier with a pr_err that reports the specific failure code without the stack-trace. Signed-off-by: Jim Cromie --- lib/dynamic_debug.c | 67 ++++++++++++++++++++++++++++++++++++---- lib/test_dynamic_debug.c | 9 +++++- 2 files changed, 69 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 66879a40b822..3cd9b67bd995 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -320,7 +320,8 @@ static bool ddebug_match_desc(const struct ddebug_query= *query, /* site is class'd */ site_map =3D ddebug_find_map_by_class_id(di, dp->class_id); if (!site_map) { - WARN_ONCE(1, "unknown class_id %d, check %s's CLASSMAP definitions", dp-= >class_id, di->mod_name); + pr_warn_ratelimited("unknown class_id %d, check %s's CLASSMAP definition= s\n", + dp->class_id, di->mod_name); return false; } /* module(-param) decides protection */ @@ -1420,6 +1421,23 @@ static int ddebug_class_range_overlap(struct _ddebug= _class_map *cm, u64 *reserve return 0; } =20 +static int ddebug_class_user_overlap(struct _ddebug_class_user *cli, + u64 *reserved_ids) +{ + struct _ddebug_class_map *cm =3D cli->map; + int base =3D cm->base + cli->offset; + u64 range =3D (((1ULL << cm->length) - 1) << base); + + if (range & *reserved_ids) { + pr_err("module %s: [%d..%d] (from %s) conflicts with %llx\n", + cli->mod_name, base, base + cm->length - 1, + cm->class_names[0], *reserved_ids); + return -EINVAL; + } + *reserved_ids |=3D range; + return 0; +} + /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1430,7 +1448,8 @@ static int ddebug_add_module(struct _ddebug_info *di) struct _ddebug_class_map *cm; struct _ddebug_class_user *cli; u64 reserved_ids =3D 0; - int i; + u64 bad_ids =3D 0; + int i, err =3D 0; =20 if (!di->descs.len) return 0; @@ -1454,10 +1473,46 @@ static int ddebug_add_module(struct _ddebug_info *d= i) dd_set_module_subrange(i, cli, &dt->info, users); /* now di is stale */ =20 - /* insure 2+ classmaps share the per-module 0..62 class_id space */ + /* validate the per-module shared 0..62 class_id space */ for_subvec(i, cm, &dt->info, maps) if (ddebug_class_range_overlap(cm, &reserved_ids)) - goto cleanup; + err =3D -EINVAL; + + for_subvec(i, cli, &dt->info, users) { + cm =3D cli->map; + if (!cm) { + pr_err("module %s: classmap not found for user\n", di->mod_name); + err =3D -EINVAL; + continue; + } + + if (cm->base + cm->length + cli->offset >=3D _DPRINTK_CLASS_DFLT) { + pr_err("module %s: base:%d + classes.len:%d + cli.offset:%d must be < %= d\n", + di->mod_name, cm->base, cm->length, cli->offset, _DPRINTK_CLASS_= DFLT); + err =3D -EINVAL; + continue; + } + + if (ddebug_class_user_overlap(cli, &reserved_ids)) + err =3D -EINVAL; + } + if (err) + goto cleanup; + + /* validate all class_ids against module's classmaps/users */ + for (i =3D 0; i < dt->info.descs.len; i++) { + struct _ddebug *dp =3D &dt->info.descs.start[i]; + + if (dp->class_id =3D=3D _DPRINTK_CLASS_DFLT) + continue; + if (bad_ids & (1ULL << dp->class_id)) + continue; + if (!ddebug_find_map_by_class_id(&dt->info, dp->class_id)) { + pr_warn("module %s uses unknown class_id %d\n", + dt->info.mod_name, dp->class_id); + bad_ids |=3D (1ULL << dp->class_id); + } + } =20 mutex_lock(&ddebug_lock); list_add_tail(&dt->link, &ddebug_tables); @@ -1472,7 +1527,7 @@ static int ddebug_add_module(struct _ddebug_info *di) dt->info.descs.len, dt->info.mod_name); return 0; cleanup: - WARN_ONCE(1, "dyndbg multi-classmap conflict in %s\n", di->mod_name); + pr_err("dyndbg multi-classmap conflict in %s\n", di->mod_name); kfree(dt); return -EINVAL; } @@ -1559,7 +1614,7 @@ static int ddebug_module_notify(struct notifier_block= *self, unsigned long val, mod->dyndbg_info.mod_name =3D mod->name; ret =3D ddebug_add_module(&mod->dyndbg_info); if (ret) - WARN(1, "Failed to allocate memory: dyndbg may not work properly.\n"); + pr_err("dyndbg: failed to add module %s: %d\n", mod->name, ret); break; case MODULE_STATE_GOING: ddebug_remove_module(mod->name); diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 08d4e3962026..db555f5f8ea4 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -137,7 +137,14 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(classid_range_conflict, = 0, D2_CORE + 1, "D3_CORE") * DEFINEd (and exported) above. */ DYNAMIC_DEBUG_CLASSMAP_USE(map_disjoint_bits); -DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); +#if !defined(DD_RUNTIME_CLASS_CHECK) + DYNAMIC_DEBUG_CLASSMAP_USE(map_level_num); +#else +/* + * force failure of runtime sanity test of classmap.length + offset < 63 + */ +DYNAMIC_DEBUG_CLASSMAP_USE_(map_level_num, 55); +#endif =20 #if defined(DD_MACRO_ARGCHECK) /* --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f50.google.com (mail-oa1-f50.google.com [209.85.160.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92908426693 for ; Thu, 26 Mar 2026 18:55:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551325; cv=none; b=Y5TSxjyjUJv/3srQAnS7cLWj/S8bWII62qZCQIAvz9iZ/CFmdz1Ws8t2QSHq8Bh4zBzkNk/2KgGnhI024Moj/C4ImCMcuocTEBW8fN+AUG7wkMumhwWVaGLKa/3yLSNWhrjNY0uGJqpIetVQO8N4iGJj0/5nkDISgWx+jM8kKBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551325; c=relaxed/simple; bh=ftTpVckDB1Ntqu89+1elJ8nn6xn5PfMnDJrkqsIjPtg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M9/oWSCq+QoS0Siou6H74oIPXIWOOA/N2MGKGD+g87x5Oqcm/E19ViQKAaStz3pNsrbtdFyiXSBysBIH/8O/YaE2Ova1CRWSRJvH39GddvfkJG6TLWToNRX4QOeYBOb3tMOWeaeUyJd7Espkska7xQlIuuV8Q0XvZrKnjkH7Y2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=tNrrickZ; arc=none smtp.client-ip=209.85.160.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="tNrrickZ" Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-415c8a4d2e6so561680fac.0 for ; Thu, 26 Mar 2026 11:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551322; x=1775156122; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8Fn+1VGRF0lzR7vhJfSVcQCaTLdIbHbYdKyEKI0VCCs=; b=tNrrickZnDQHlB+6XBWrAuuHxEVlUasxGPz03ryAjzpJd7N8YhClVp2RhO//YDpKPH JHW2ykcfUVhaY8zA8uS0xU5QPe2SoPHtHa0Uc/GVq72dNnDH17WI5ofbPV/uKp0e7s5P 5UcWBUfy4MFd0fWy25sMA2wX966ne7TXGJf5aBEBStr5sAJxK6PCl14uNd4FATLNRfHH M/KJ8RqsVhCRIYxwkyDJiE6873RrdVEablBrmhjpFI/XcdsHCfRP0InAldY77DEE7hut ViRP7n1kjBN/n1s6jtEJ/oUXy72hjhP1JSyrC/Rn5gVcHlsrJqRlMSfy1Tl3ruK7RmNo Y/JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551322; x=1775156122; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8Fn+1VGRF0lzR7vhJfSVcQCaTLdIbHbYdKyEKI0VCCs=; b=ghslrKSRH6ROMmfaUsUmfj/q1gX7nWEPno8H4tID25iZVY/qtYqBTwO+bXXrgwVEli N8RucgRgRLKQBKVQh2PHtcmzAh2y1kF5sCLK1oXHd1J71KvZQ3DgjHKulpujyXS90B3U ORPBaA3T55PD+aQtvTOCD2AzGts1iSB2G/GQX4CJtp/0ng7OcsO//wMEdBSYKgA0PF0o tfZJboPzE35Vvfv7R9FI3WU9+cf19ieDFsJFD1mUAv1JAYuGXTA7+m1Z/zp0dAWPswef dh+++rntsEfVeZo1LfJp7ibANB6zwLqUcnBtQW1Rh2xz5BGwNeqac0fx9SYaBs23DBPD u/mA== X-Gm-Message-State: AOJu0YwquE4e3FHXhSQPDKQAFJde1N0QLAOGJF1geZl821hCxECWqNx8 J17D+kCYSkiyviQOPyUpgKyknS25rIEwJsLB2hO52kIvGWzen1DCp2awQG5VBg== X-Gm-Gg: ATEYQzxaXz6mbT7Zrxl45hZjDowAMwuN/txf+nqsSq1CN49GI+NEGtjNoqhbaHPL2d4 tiaU7NX1R2hQD4819vGtu93GgnFikqJIFQsgixEAddsul53qPqOmMD7bLauUBkj5S4G2EVYwerY VCmJGyHYXPCW5IR9Ncon6SU3Q7uKxbbEEehPpS15BzyEF5e/JpqGv22W2fx/Bnd2ldbHS7KZnfm eTZfRwCOlHlzQZoHniguGmujyUTOPlkvUkw319pUQPB81LXD4DNKAgKtIw4kViBbttNb5KNT6On K2vS+azOSOIdIqI+HGtrw1qHM0AB5AdN+2pbQwfFGF5GrYiqkhBxConJ+XhNyTZUALWULq1NMjW /gLuRN/b5IVgjJDRScOxyk9COU03ePtwtjhVG7KL9Aph4sFAc10Ef0u6wJfB4FVa7o7CAIzSVRS 5FKegLjbR/cbTTcdPLydrO7iB27Sr/llwPj1J4UvCeT74myI5fTwi9KVm3e4w= X-Received: by 2002:a05:6870:26c:b0:404:1c81:596e with SMTP id 586e51a60fabf-41ca6dc8e73mr4730077fac.12.1774551322184; Thu, 26 Mar 2026 11:55:22 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:21 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, linux-doc@vger.kernel.org Subject: [PATCH v12 35/69] docs/dyndbg: add classmap info to howto Date: Thu, 26 Mar 2026 12:53:39 -0600 Message-ID: <20260326185413.1205870-36-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Describe the 3 API macros providing dynamic_debug's classmaps DYNAMIC_DEBUG_CLASSMAP_DEFINE - create & export a classmap DYNAMIC_DEBUG_CLASSMAP_USE - refer to exported map DYNAMIC_DEBUG_CLASSMAP_PARAM - bind control param to the classmap DYNAMIC_DEBUG_CLASSMAP_PARAM_REF + use module's storage - __drm_debug NB: The _DEFINE & _USE model makes the user dependent on the definer, just like EXPORT_SYMBOL(__drm_debug) already does. cc: linux-doc@vger.kernel.org Reviewed-by: Louis Chauvet Signed-off-by: Jim Cromie --- .../admin-guide/dynamic-debug-howto.rst | 132 ++++++++++++++++-- 1 file changed, 122 insertions(+), 10 deletions(-) diff --git a/Documentation/admin-guide/dynamic-debug-howto.rst b/Documentat= ion/admin-guide/dynamic-debug-howto.rst index 0a42b9de55ac..734be0b5fe9a 100644 --- a/Documentation/admin-guide/dynamic-debug-howto.rst +++ b/Documentation/admin-guide/dynamic-debug-howto.rst @@ -146,6 +146,9 @@ keywords are:: "1-30" is valid range but "1 - 30" is not. =20 =20 +Keywords +-------- + The meanings of each keyword are: =20 func @@ -194,16 +197,6 @@ format format "nfsd: SETATTR" // a neater way to match a format with whitespace format 'nfsd: SETATTR' // yet another way to match a format with whitesp= ace =20 -class - The given class_name is validated against each module, which may - have declared a list of known class_names. If the class_name is - found for a module, callsite & class matching and adjustment - proceeds. Examples:: - - class DRM_UT_KMS # a DRM.debug category - class JUNK # silent non-match - // class TLD_* # NOTICE: no wildcard in class names - line The given line number or range of line numbers is compared against the line number of each ``pr_debug()`` callsite. A single @@ -218,6 +211,25 @@ line line -1605 // the 1605 lines from line 1 to line 1605 line 1600- // all lines from line 1600 to the end of the file =20 +class + + The given class_name is validated against each module, which may + have declared a list of class_names it accepts. If the class_name + accepted by a module, callsite & class matching and adjustment + proceeds. Examples:: + + class DRM_UT_KMS # a drm.debug category + class JUNK # silent non-match + // class TLD_* # NOTICE: no wildcard in class names + +.. note:: + + Unlike other keywords, classes are "name-to-change", not + "omitting-constraint-allows-change". See Dynamic Debug Classmaps + +Flags +----- + The flags specification comprises a change operation followed by one or more flag characters. The change operation is one of the characters:: @@ -239,6 +251,11 @@ The flags are:: l Include line number d Include call trace =20 +.. note:: + + * To query without changing ``+_`` or ``-_``. + * To clear all flags ``=3D_`` or ``-fslmpt``. + For ``print_hex_dump_debug()`` and ``print_hex_dump_bytes()``, only the ``p`` flag has meaning, other flags are ignored. =20 @@ -395,3 +412,98 @@ 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. + +.. _dyndbg-classmaps: + +Dynamic Debug Classmaps +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +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: classes must be named to be +changed. This protects them from unintended overwrite:: + + # IOW this cannot undo any drm.debug settings + :#> ddcmd -p + +This protection is needed; /sys/module/drm/parameters/debug is ABI. +drm.debug is authoritative when dyndbg is not used, dyndbg-under-DRM +is an implementation detail, and must not behave erratically, just +because another admin fed >control something unrelated. + +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 + +That makes direct >control wordy and annoying, but it is a secondary +interface; it is not intended to replace the ABI, just slide in +underneath and reimplement the guaranteed behavior. So DRM would keep +using the convenient way, and be able to trust it:: + + :#> echo 0x1ff > /sys/module/drm/parameters/debug + +That said, since the sysfs/kparam is the ABI, if the author omits the +CLASSMAP_PARAM, theres no ABI to guard, and he probably wants a less +pedantic >control interface. In this case, protection is dropped. + +Dynamic Debug Classmap API +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D + +DYNAMIC_DEBUG_CLASSMAP_DEFINE(clname,type,_base,classnames) - this maps +classnames (a list of strings) onto class-ids consecutively, starting +at _base. + +DYNAMIC_DEBUG_CLASSMAP_USE(clname) & _USE_(clname,_base) - modules +call this to refer to the var _DEFINEd elsewhere (and exported). + +DYNAMIC_DEBUG_CLASSMAP_PARAM(clname) - creates the sysfs/kparam, +maps/exposes bits 0..N as class-names. + +Classmaps are opt-in: modules invoke _DEFINE or _USE to authorize +dyndbg to update those named classes. "class FOO" queries are +validated against the classes defined or used by the module, this +finds the classid to alter; classes are not directly selectable by +their classid. + +Classnames are global in scope, so subsystems (module-groups) should +prepend a subsystem name; unqualified names like "CORE" are discouraged. + +NB: It is an inherent API limitation (due to class_id's int type) that +the following are possible: + + // these errors should be caught in review + __pr_debug_cls(0, "fake DRM_UT_CORE msg"); // this works + __pr_debug_cls(62, "un-known classid msg"); // this compiles, does nothi= ng + +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) + +DYNAMIC_DEBUG_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" +or "PL_ERROR" vs "PL_WARNING". + +Modules or subsystems (drm & drivers) can define multiple classmaps, +as long as they (all the classmaps) share the limited 0..62 +per-module-group _class_id range, without overlap. + +If a module encounters a conflict between 2 classmaps it is _USEing or +_DEFINEing, it can invoke the extended _USE_(name,_base) macro to +de-conflict the respective ranges. + +``#define DEBUG`` will enable all pr_debugs in scope, including any +class'd ones. This won't be reflected in the PARAM readback value, +but the class'd pr_debug callsites can be forced off by toggling the +classmap-kparam all-on then all-off. --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f49.google.com (mail-oa1-f49.google.com [209.85.160.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8B5C3A7F72 for ; Thu, 26 Mar 2026 18:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551326; cv=none; b=mwxV3GXnVujkGsTYf1tyMizPyjO/Sb7xT491O3YekmhJn7Z9x4Xuk4FQGDNudQruKszt6VlQ8zicFGRjArvxx2OrbLtubkc4kgRJlsUwsndQOG7OMNnQYC2/Kvf4xi6U9O6gOvlZunvpKQWIVXWsLAtOTcJUF1VSyXBBZp+IwU4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551326; c=relaxed/simple; bh=g/R4mNpoNQFynh3xzppOxNaEKQ8esIfVn/96Jwzn8vA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=aCOEc/MttiFmAyv/DJOJLpbJpqk8trz07cKpLgZkCobmw0krh5XibSC/9x/n19/zWFYwPUktsLn2ndULsItqxZeBW+6cZh0yK47mYxmc9IMpJT8Lc1q42y9UDIoNbxUDRcJTzVv30xPVavroUTpnrTurlrhpEUGHdVnwXTmQwS8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=EDipy9Np; arc=none smtp.client-ip=209.85.160.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EDipy9Np" Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-40f1ffba6a0so828773fac.0 for ; Thu, 26 Mar 2026 11:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551323; x=1775156123; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=PHBDIqz9/qVForB86mGxoTdQjucG23eTecUbThbELwQ=; b=EDipy9NpyGleghqv+pdHtOsMEl3wjBPR5DlwReJU7GBDszL2bRjZCqbyk3JlfWV7jW Gt53zwsKpeRB2LHK3se0H6B511HGo4QK5aFyR0Dedf3Ihm8p1VsFlHcHMWWbgiD2Ztl2 UhDdUeaWL07RuhDIZszh7QzL6+TCVc1Fe+eVnlUcZSks65IgSbV2Wbt8JWsZkpsJoHRX xTuXMoIqAS1RlK9Gn//i0giLOkt/is3rTlemvAGzrsZMGJA7ofqe85Pfsb4JBzxa/AEh cJlNikwwJjbNSCU28JGULGWSxehTEVZdDL4cvwk/h/DEplladR+GKCWU67b0ZNoga09b d4IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551323; x=1775156123; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PHBDIqz9/qVForB86mGxoTdQjucG23eTecUbThbELwQ=; b=he5iw2DjBmXgjsBjEsOjdm8+CQfcgzLuxcJqE575ZcU6A1GXmOimd0fji3z00xPv7T ZVw4aAl4ilgG+7NLFXNVhv4f4WghyJt4HSQndeGlrhlH4vNISi765j/UxhF9pOoT5BRn /gVg3u87fEhf4Cio/zCCNg/Zgc2WljabBlIWVWSa4rLs4bXPNSqdGrbMMJlO4w/Bat0s gybS4RbxkNycMXqN6WghbfkVZkVD+jcSwQ5cf8fVEJ7umJQBk+oY2A3op/XOub8/8APQ PRORrmapQo4tj8uIlmWkuvbNA+kaaRf0nB8U1H38B/SqaPy+uf2prnE1kyHekZk3EHBK bt2Q== X-Gm-Message-State: AOJu0Yz4kCIoos8w+ZeMJ5Bx6QdoXNmamBPVsKcHY2Ut+U2Dnd8gJ9bY 1pB57II1oybMfWqqUQGJ48tQJtI8qI/uh+vHh1yGTpKmuA44m7YLrmQ0crjOwA== X-Gm-Gg: ATEYQzzaTe0kVtS4nuJa+xLCg4+3BUSIOWaRaflSqjP/qo8VWjX5hpMES/FJz0qPbij VDxmYxsX0mzjDbCPkpPXgUm6pQMMIBota+gMVj+rj+p7NpqamqcLuO7pmWHrMKten4fwMAk8YmO Cm72KlykcNehyp0ufaMjfbSJFxVsYWS0L2oN1qq4NPKu41m+wuktSszVVc65dexygvcsuiNElCm 360f28PRKVdAYKTB9uxi0xOC1nckSGsAnAjlRpJG9YBmjnWxqAACcjiLfxqnVE5nu6WCRMMuUn9 esEY3JUBTUi9h3j3fhoTtGwjv+66trIYAuFGx3+R7iGVZOYf9q9LpoVfWxYHGJNrndSh1C8D0Kx 53Jf9C3fvfOJb7ipt9viC3W4o10OPImh5AvkdlejZym6FZy4h+EeqBxVhlJq4hlt0hiiJeo3d2Z uy0DVIa8Yze/rKqFgw8o278gDr07nF5EP1X/EZm+HlgSm0P8Ey X-Received: by 2002:a05:6871:520d:b0:417:5970:28ea with SMTP id 586e51a60fabf-41ca715a2acmr4330662fac.51.1774551323554; Thu, 26 Mar 2026 11:55:23 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:23 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Philipp Hahn Subject: [PATCH v12 36/69] dyndbg: Ignore additional arguments from pr_fmt Date: Thu, 26 Mar 2026 12:53:40 -0600 Message-ID: <20260326185413.1205870-37-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Philipp Hahn pr_fmt can be used to add a common prefix to any output from a module: #define pr_fmt(fmt) KBUILD_MODNAME ".%s " fmt, __func__ But adding additional arguments breaks dynamic debug: > error: macro "DEFINE_DYNAMIC_DEBUG_METADATA_CLS" passed 4 arguments, but = takes just 3 > | pr_debug_ratelimited("%s", "Hello world!"); > | ^ > note: macro "DEFINE_DYNAMIC_DEBUG_METADATA_CLS" defined here > | #define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt) \ > | > error: =E2=80=98DEFINE_DYNAMIC_DEBUG_METADATA_CLS=E2=80=99 undeclared (fi= rst use in this function) > | DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, _DPRINTK_CLASS_DFLT, fm= t) > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > note: in expansion of macro =E2=80=98DEFINE_DYNAMIC_DEBUG_METADATA=E2=80= =99 > | DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, pr_fmt(fmt)); = \ > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > note: in expansion of macro =E2=80=98pr_debug_ratelimited=E2=80=99 > | pr_debug_ratelimited("%s", "Hello world!"); > | ^~~~~~~~~~~~~~~~~~~~ Add an additional ', ...' to DEFINE_DYNAMIC_DEBUG_METADATA_CLS to slurp any additional argument, which `pr_fmt` might add. Signed-off-by: Philipp Hahn [pr_fmt change on _submod] Reviewed-by: Jim Cromie --- include/linux/dynamic_debug.h | 2 +- lib/test_dynamic_debug.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 1b401f398a3c..49f37d6a4eab 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -344,7 +344,7 @@ void __dynamic_ibdev_dbg(struct _ddebug *descriptor, dump_stack(); \ } =20 -#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt) \ +#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt, ...) \ static struct _ddebug __aligned(8) \ __section("__dyndbg_descriptors") name =3D { \ .modname =3D KBUILD_MODNAME, \ diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index db555f5f8ea4..779309898422 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -23,7 +23,7 @@ * the usage clearer. */ #if defined(TEST_DYNAMIC_DEBUG_SUBMOD) - #define pr_fmt(fmt) "test_dd_submod: " fmt + #define pr_fmt(fmt) "test_dd_submod: %s " fmt, __func__ #else #define pr_fmt(fmt) "test_dd: " fmt #endif @@ -214,7 +214,7 @@ static int __init test_dynamic_debug_init(void) =20 static void __exit test_dynamic_debug_exit(void) { - pr_debug("exited\n"); + pr_debug_ratelimited("exited\n"); } =20 module_init(test_dynamic_debug_init); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 354983A7F50 for ; Thu, 26 Mar 2026 18:55:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551328; cv=none; b=pX0rS58woP8ybgTLNSYVMQ2aoNSvG8S3JrqrN/8d2bMCh3ARotpPMBajTvfIy7Zc4r3Nsa2OeXmNNPNdVrZD+J0ylU8I4LHkIBZWmqWYkacmf/Oly8CcV6a+r8zfNe21OWmnuPfu116XB+VDC5yLanA8EZ2zodmGDEDHLV8c1cY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551328; c=relaxed/simple; bh=g03EOnJ/xpGxXACBIHfZnTiSkG+7394ncCZ1uvw27W4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B9AVvjozaXf6GSZRS/aBxOKExrUYZwtdqNSniGo0oUMiSqY53W3fpDNFQQluenBi37pprxl9373vpORIqLfEHctrNug2QINHsXvwdl+LHctlb03SOACPy2JadQ3NPR5/3EH0i5DGN/cA5Bu1Uemoo1B03j4JEop63CGVKZpxX1w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=SKlmumsy; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="SKlmumsy" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-41708f6c3feso861350fac.3 for ; Thu, 26 Mar 2026 11:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551326; x=1775156126; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U461BxJhRY45gNpAWL37hzV1gL48r7XKATdpr+1ais0=; b=SKlmumsyYBhqFNsgSOsbaE1hYO2mZ7Kf/F/lLj4qsIZAkXeuQREiAy5XThxTzjJJu4 9s4Tb7W7+LFTdZ6008BbjPTmrYbLTPZsj27Au0MzbaDQLaIFyjBMLbLSWPUt+HCPnbRx svieIsA0q+3fhmzVoNjewNvDznsJNSFk8lnnnLoJZ9h4yhFQD/JB8GAQgK0L6e9ZCjy7 Zb5Ochqz6cIqeNGDCFQl+/Jx+PDp9fkY8wCEcMN/Kq7Mbp01oh2PQ36lwflTsuHWCNoy woFHEZboO4kcvbGwhGi+2zboDBs42t9cZ9bfm386roO5xg2OWb7U89bWdZt99GCVh8Zp hv1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551326; x=1775156126; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=U461BxJhRY45gNpAWL37hzV1gL48r7XKATdpr+1ais0=; b=Ds8Rsc7PQBx10GKGWIMK3jcP9NMOR/4nzNMpJhcN34phS2oz5m47/l2rmT4EEc9vRB vggVgDKVeTRpB2cnqWtK5vY6re/QtUfjZ62aqugR3D9i/TRNzEQ0qYMmf32ZTPtqptnl XipgXVL3vuarMlDbEWfQb/y7zHC9yNCEjtkPy3NbWsvvNRjUkP0tMws2C3+2TxU9JRue lySe4M+XZZ+ccSlH56+JfMqi07KmRVHKT9WDi+wiYpIKmWdrhbXkAb2W4pcHpd/McWT6 yTn+eW5FZDs+m9idNDx9BdQptjMjJbDuop/mF1SK7GkEXPTmrfmnF0egYb9Th+UueI8b nPpw== X-Gm-Message-State: AOJu0YzbGaAWmTO+ck6fysxXLPa3qVO6x6faWlJscwBSlWJyZRhzvK+M QAJ/F3yNUBLG3xwHXh2TFCK/uL1cGDwqR1dwjC+9YYGnLrS8B1FyYXAIq2wBCA== X-Gm-Gg: ATEYQzxJ6wf13+OUlr34r2gmOps1yUUPaT10xoxOxs0DdSp8xOJnRedh3CcON7CyFxV GIrMVhexJc36rExRP4qNIpDL3EmCc6Tq8W8ThiNrvdxHCtUlUnsDHkT2gxH9aZ7OWcL0BDmotD8 7D3+/rNuIYzq0kDA0KJWxkXLyi3wi7Ky2CHrq1EEdBQ2vMkBuGQRnWwzjUtFJKeBWwiPVNqTiVA hVPzyeOGXTmvbAyPN/3Xzt7cMiSNcBlG/zg2B/ZbZmawLKBfo1lpZv8hcsseJVyw4nfvfjv4vqL YMISaDqPxGZVcaQR/Bj0TOr082oKNZeacMVFhh4SaRXqeP1iSDGQPG1dk0f5P5hwrKS5COMOAk8 FiZEwzIZaLbIuZODLaGza+YddoHg0irGqQ3xkpPwWnsaFM9vJ2HdD4rHG/prd6dSoMZUNl+mqv6 dcU7NRzB/eqDFrHpwnnrcp3hrqiUmWSy+fZ+Opqv/YYmKaUhYX X-Received: by 2002:a05:6870:5494:b0:3e7:fa5f:7269 with SMTP id 586e51a60fabf-41ca6d6a46dmr4909366fac.2.1774551325975; Thu, 26 Mar 2026 11:55:25 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:25 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 37/69] dyndbg-test: verify DYNAMIC_DEBUG_CLASSMAP_USE_() compile-time CHECK Date: Thu, 26 Mar 2026 12:53:41 -0600 Message-ID: <20260326185413.1205870-38-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add another failing use-case, this time to verify that _USE properly rejects an offset > 62. This is an incomplete test; the proper test is: classes.length + base + offset < 63, but the macro cannot test classes.length at compile-time. Signed-off-by: Jim Cromie --- lib/test_dynamic_debug.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/test_dynamic_debug.c b/lib/test_dynamic_debug.c index 779309898422..72a1a1c89cb2 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -156,8 +156,9 @@ DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_big, 0, 100, "T= OOBIG_BASE_ARG"); DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_str_type, 0, 0, 1 /* not a string */); DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_emptyclass, 0, 0 /* ,empty */); DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_maptype, 3, 10, "no such type"); -DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_len, 0, 60, "one", "two", "three"); -DYNAMIC_DEBUG_CLASSMAP_USE_(map_level_num, 100); +DYNAMIC_DEBUG_CLASSMAP_DEFINE(fail_base_len, 0, 60, + "base", "plus", "classes", "length", "too-big"); +DYNAMIC_DEBUG_CLASSMAP_USE_(fail_offset_big, 100); #endif =20 #endif /* TEST_DYNAMIC_DEBUG_SUBMOD */ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f45.google.com (mail-oa1-f45.google.com [209.85.160.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57B893A875D for ; Thu, 26 Mar 2026 18:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551331; cv=none; b=HWGVOhSoI2NA+sYuNy68OFL1HhunGl2vxzP7qfYSy5gLOMXfG2NQjVqM3YEZcibkNx68SKlCamJWl53aqNXO2Rt40r25aBVhKctQrZPYjzzc9B7dt2dkin5reNDuM+ReDmGoa6NKeuPoVkOgaDZb+LFOYgpK45uraC+KIPn24qI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551331; c=relaxed/simple; bh=UNIgTGhdJ59/dqHCgYPN0A/QSStPlf036BmUrRYMo3U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A+yFYVtBacLIWed/irxYxDW7b79mYTBq889GdMR4mBorO2MsoJaG8PZQvgLRNYRX9XVXOfwBtsA9ZMOrD5Z7mDTqQjecBpHmCpsIYdqE8Xjrc02QIOJUxoJCN3sUGehyZZdjNzw9LmH2tuCiRB3db15pv+TQ+8ahTQn1SoiA9q4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eozsVX0N; arc=none smtp.client-ip=209.85.160.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eozsVX0N" Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-41cd9267bbfso533792fac.1 for ; Thu, 26 Mar 2026 11:55:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551329; x=1775156129; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BSisvrIuxABye56v+k4UdRTAwS5HV0U80AJ6AJkDqLc=; b=eozsVX0NF+vxRWBlO7SY9s09zN1LvGcx5VLtKI/FBOfbdyOECYgmUfi81WOjhAWqZB BYnXL7AnHRB2bcX4G5LPMpvXaTeDa+FYxcdCbCG9yna8PFLaiGu83A1j+mFQYuOerOG2 Yn9slyxZfJ39GSf+XqAAApM2FrlpGhGdAWsDicb7MP8iFWDPwV9mMxqVwqvZ4g001vt0 Uia3btK/YGPISFk2KaAApB4jZAfB5NCbP+sn3ry1psomh/DUQfpggO/hoTlpR4Ywvhl/ wSAYEa+sby8rg5lvyjifXYVKGI2EvydUyL3v95aNfOR+YIGF7L/r72Ncu+pzN72eYEJ5 2Ldw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551329; x=1775156129; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BSisvrIuxABye56v+k4UdRTAwS5HV0U80AJ6AJkDqLc=; b=BWfxj60fosKvQ53ttSUFDYuzNHQp2OQIr9/MILeGJZi5KesZk0aqHsFNTV5yBuUd0w 9VXqrh+Q3ATureGsugvi0Pv5QfeH+vg2b7cAC5BOqCe8mEY0Do8ZiCcvswPj+Sx7OuhC Vc4p3OVVS17FtOJlPUFVm02MZwjEbEZyzghMY62GYlvEMNGgdqyj2/0SUmqwXLncigjT WsGNsU3762gKW9dP43IMN76yaYsFfYgn9Gzp0c87Lckl3sC6KVyRioX3tqYPooPtZ8/j sixkLmvEB+bMYJWZLADlS/wu6+5QYrpFihJGvku8W05gbeBZG+y5dRgEIv8CBaM9jVOu Cjvg== X-Gm-Message-State: AOJu0Yz1xrR57yXS3F+qOGopq/pfn2Guf7BZ9ftMGAi0LvvZL80oxIxt 54B0Ua56s3jY5GbkWQkigoMP5pkDznxxp4FJrHSwShTMxyQ+Lh2bP55QG1qK0A== X-Gm-Gg: ATEYQzwI4HOQDUivo2CI9rqCm/XWZ+xYyp5PdBiz2sOUP+KpFZjGBmrP8YpoLLBQoyz ZVd3yHXcnBnStqLWTwdKQk+uxDPgy6afq27BW2xF/HLyVkt2XI5rRJQGFSr42ujbsyJY46T20V4 pAGEVw0fLZpRP8DwjWOBbI+UFOIVpdCWK5Iml5V3c9CCjcxq2xnc4pRzAaP8fHJWJyMyZU6uYDs ewdfuhzBKO3+rz4mprtWcdyN6KkWFCq1qqDW306CpSjKNrTFXa47ts2CUe4bapZVUKaQrx8FkPR sra0ekWgVSO/HEq9X1brqM6lV6NkT4HPe98MvQXpKjzWEXiqjVThrRjxYVXQlvme7w7werZYntE 4dNyYOK5rQB5n/aYRwiqAkfzSzdtcZfh9b/SpJ0eqgjfK/dMTcILIwFaEP6WqL0VW3mrdCZGhdf xlL/C4mc5M0C7upDPLdP52cqiMHLPDBYGvv1MqG7z6tQtdV1F1ZKRhW2le5Tg= X-Received: by 2002:a05:6870:b0e4:b0:40e:a9c5:5c32 with SMTP id 586e51a60fabf-41cd7b187d0mr1250153fac.8.1774551329111; Thu, 26 Mar 2026 11:55:29 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:28 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 38/69] drm: use correct ccflags-y spelling Date: Thu, 26 Mar 2026 12:53:42 -0600 Message-ID: <20260326185413.1205870-39-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Incorrectly spelled CFLAGS- failed to add -DDYNAMIC_DEBUG_MODULE, which disabled dynamic-debug in modules built with: CONFIG_DYNAMIC_DEBUG=3Dn # 1 CONFIG_DYNAMIC_DEBUG_CORE=3Dy # 2 CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy # 3 NB: this adds the flag (when 3) more often than strictly needed; modules built with CONFIG_DYNAMIC_DEBUG=3Dy (!1) don't need the flag. Fixes: 84ec67288c10 ("drm_print: wrap drm_*_dbg in dyndbg descriptor factor= y 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 ec2c5ff82382..da36a9dbf170 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -3,7 +3,8 @@ # Makefile for the drm device driver. This driver provides support for the # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. =20 -CFLAGS-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE =20 # Unconditionally enable W=3D1 warnings locally # --- begin copy-paste W=3D1 warnings from scripts/Makefile.warn --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F7E242847F for ; Thu, 26 Mar 2026 18:55:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551334; cv=none; b=DWUn+ku9svdJJGJEhBnt7fqZbvI26atQoZ+kBcwNBV5vS7v7yBZhG1zbfZCn+6ihmIk6fkjsrK0iW5gFeRoUaL1SJW83piE7GtmtslLKIy4Us5mcLGtANXAIUruRsFIE1tsYddQ7j1gGaghbwC0ECF2eBCi6KLLZb0Gw+zK07Rs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551334; c=relaxed/simple; bh=H71niF05ZOADzPSzlZP1dJBCWxzy2fREPqYgW69VFBY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RWjiepUrxRp1O+HivxBV5t/b7z77Io47l+mlfo8Kv5GfTwg89RmoQv0MmHuEM9HqOveu9wGUW4e45rOjP/pdGkglAmrqq5wW1d96XvlKE8CGMw1myLdU3PhZr5h67XvALRNy+EGG0mwsExImX2c8AhuCB2wEad8nY6P5dwa51aY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Azeyqb4M; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Azeyqb4M" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-40ee9b945d5so940474fac.0 for ; Thu, 26 Mar 2026 11:55:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551332; x=1775156132; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b4jWe/O/TQKg+phAG4swgxb5r2uUue/0h3/17ze4tn4=; b=Azeyqb4M/Lqy4DYaeLyK6KH6f2z+gaAdvU0bcxXU0TDj5Ystzaccw4Iu4V3a6I5Llf cK3oehQ5Wu/mzw3kUcNc4nPHYaxDj4779jocjM+Bc9UUN+GQBRjCIzhrh73/3JzLkpfM 41ppmxSGVBmiFJJr7RLU54M2exs8yR3jSsabj7YkIIjtAxIYKiDKZfiP3BRKr3h/5PaQ wuiJ/3BOIyfYCipFJnp3JSFfBmKL3kz/Ik7IYu5LI80ft9dKiKEWIXmg6LPEjTKXH6dl oy+Di99uPbxmjn2uUHNUX2ocgg/GjH330qooa6xjivqQIA9Yl1N3/wTgZIEWJ6w6ASJW RKLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551332; x=1775156132; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=b4jWe/O/TQKg+phAG4swgxb5r2uUue/0h3/17ze4tn4=; b=knJBUy5b7aDfxg3wBF1cpQm+S9UK/CnPQyEiqn2ZkCGcBNIU7f2Uu7ZIGuR5oCQdM2 /NhmzTwdEBoC7azpYUl8zS47SLo86uSpb4aug3ep4FKAIDW7MXqf5iyuB2mD7beEyZhC /xjyEOXBFsuNJBOEZjW4QYRK/8jarKWJMj9qaDOi+KPuUXzHEZMs5L9D1MubFNu1vf9M I49UkP1oAw/Or168ZSVQLqhEZRhvR7ffi5Sc6pYs+UDPZtwWufnEXtmXcIh3hpiTCZs7 sARutk/byV9678Bj2LgwNGHJrurx6tge/6bNISfsZkn5zcFVgRJ1Y9GgrIDGB2ozzio/ cvqg== X-Gm-Message-State: AOJu0YwWwKxeQWITrr3sJO51FeKo2JkHZ9XV+6+4szFWd2WZ33c2TdGw +23zsDQ8plg7hrFDCnx5zmJF4jXFMeA1wccN0LydnJD4aDIDC1riVYOZl4nozQ== X-Gm-Gg: ATEYQzxespx8W62RQrnRiPU5n6SVMMm2/XXyxw2HgO7CJl7t+l8wgC1l/refka9lSRL GyJ/ZXSjCcK1uQXm3jLGCIPEQ2y1frPSEZ/BmGAt0QbIbAAATh7jndJbTTW2GkBtywk0ojsNj40 Z4xJkmRiLee/RUdEvx309TP/AgksEBV5M47LWhqqsOOkJNHSjU2c6lPx34dXT9YNdyLGgbA/lwR EfxWB3MLwwyxlLnuXTsT8sO3Aa1JzNqCvj8bc3BvEOvHhzifYB8g2u6muHknc04GpgabHvhcEJi K4LQgXVWQPSwBzqddRAEiuEUdQ1grG6Hb4cKiCiVECzdRas/SevqT39gcQqw0d7NhVhrgzWfMZ8 rf0KDuKRgNBXFtz/mZwzXySkyOvO3khFKDCUe8LPGwPRlPkHQODz2ETltCPQapn/yD1zKdXiCqI R21wQpyWzrp//CFcpmg6YX71cw39aLi0bq9mvnveGG+FfiVJyN X-Received: by 2002:a05:6870:194b:b0:409:9a0b:b733 with SMTP id 586e51a60fabf-41ca6d6a50emr4662736fac.10.1774551332051; Thu, 26 Mar 2026 11:55:32 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:31 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 39/69] drm_buddy: fix power-of-2 rounding errs Date: Thu, 26 Mar 2026 12:53:43 -0600 Message-ID: <20260326185413.1205870-40-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The standard roundup_pow_of_two() and rounddown_pow_of_two() macros use unsigned long internally, which on 32-bit architectures (like arm32) is a 32-bit type. drm_test_buddy_alloc_exceeds_max_order() uses these on a u64 value, where they silently truncate the 10GB allocation, giving unexpected success in DRM-CI. (see below the snip). Fix this by replacing the those macros with safe 64-bit power-of-two calculations using ilog2(). Signed-off-by: Jim Cromie --- On DRM-CI, I encountered this kunit:arm32 failure. [23:19:40] [PASSED] drm_test_buddy_alloc_clear [23:19:40] [PASSED] drm_test_buddy_alloc_range_bias [23:19:41] [PASSED] drm_test_buddy_fragmentation_performance [23:19:41] # drm_test_buddy_alloc_exceeds_max_order: EXPECTATION FAILED= at drivers/gpu/drm/tests/drm_buddy_test.c:889 [23:19:41] Expected err =3D=3D -22, but [23:19:41] err =3D=3D 0 (0x0) [23:19:41] ------------[ cut here ]------------ [23:19:41] WARNING: drivers/gpu/drm/drm_buddy.c:405 at drm_buddy_fini+0x114= /0x1b8, CPU#0: kunit_try_catch/74 [23:19:41] CPU: 0 UID: 0 PID: 74 Comm: kunit_try_catch Tainted: G = N 7.0.0-rc1-gdfb0bcedd08a #1 VOLUNTARY [23:19:41] Tainted: [N]=3DTEST [23:19:41] Hardware name: Generic DT based system [23:19:41] Call trace: [23:19:41] unwind_backtrace from show_stack+0x10/0x14 [23:19:41] show_stack from dump_stack_lvl+0x3c/0x4c [23:19:41] dump_stack_lvl from __warn+0xe8/0x1c4 [23:19:41] __warn from warn_slowpath_fmt+0xa4/0xc0 [23:19:41] warn_slowpath_fmt from drm_buddy_fini+0x114/0x1b8 [23:19:41] drm_buddy_fini from drm_test_buddy_alloc_exceeds_max_order+0x1c= 8/0x36c [23:19:41] drm_test_buddy_alloc_exceeds_max_order from kunit_try_run_case+= 0x78/0x1c8 [23:19:41] kunit_try_run_case from kunit_generic_run_threadfn_adapter+0x1c= /0x34 [23:19:41] kunit_generic_run_threadfn_adapter from kthread+0x108/0x134 [23:19:41] kthread from ret_from_fork+0x14/0x28 [23:19:41] Exception stack(0xf0bd5fb0 to 0xf0bd5ff8) [23:19:41] 5fa0: 00000000 00000000 0000= 0000 00000000 [23:19:41] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 0000= 0000 00000000 [23:19:41] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [23:19:41] ---[ end trace 0000000000000000 ]--- [23:19:41] # drm_test_buddy_alloc_exceeds_max_order: drivers/gpu/drm/dr= m_buddy.c:406: buddy_fini() root [23:19:41] ------------[ cut here ]------------ [23:19:41] WARNING: drivers/gpu/drm/drm_buddy.c:414 at drm_buddy_fini+0x1b4= /0x1b8, CPU#0: kunit_try_catch/74 [23:19:41] CPU: 0 UID: 0 PID: 74 Comm: kunit_try_catch Tainted: G W = N 7.0.0-rc1-gdfb0bcedd08a #1 VOLUNTARY [23:19:41] Tainted: [W]=3DWARN, [N]=3DTEST [23:19:41] Hardware name: Generic DT based system [23:19:41] Call trace: [23:19:41] unwind_backtrace from show_stack+0x10/0x14 [23:19:41] show_stack from dump_stack_lvl+0x3c/0x4c [23:19:41] dump_stack_lvl from __warn+0xe8/0x1c4 [23:19:41] __warn from warn_slowpath_fmt+0xa4/0xc0 [23:19:41] warn_slowpath_fmt from drm_buddy_fini+0x1b4/0x1b8 [23:19:41] drm_buddy_fini from drm_test_buddy_alloc_exceeds_max_order+0x1c= 8/0x36c [23:19:41] drm_test_buddy_alloc_exceeds_max_order from kunit_try_run_case+= 0x78/0x1c8 [23:19:41] kunit_try_run_case from kunit_generic_run_threadfn_adapter+0x1c= /0x34 [23:19:41] kunit_generic_run_threadfn_adapter from kthread+0x108/0x134 [23:19:41] kthread from ret_from_fork+0x14/0x28 [23:19:41] Exception stack(0xf0bd5fb0 to 0xf0bd5ff8) [23:19:41] 5fa0: 00000000 00000000 0000= 0000 00000000 [23:19:41] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 0000= 0000 00000000 [23:19:41] 5fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [23:19:41] ---[ end trace 0000000000000000 ]--- [23:19:41] [FAILED] drm_test_buddy_alloc_exceeds_max_order [23:19:41] # drm_buddy: Testing DRM buddy manager, with random_seed=3D0= xacce106c [23:19:41] # module: drm_buddy_test [23:19:41] # drm_buddy: pass:8 fail:1 skip:0 total:9 --- drivers/gpu/drm/drm_buddy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c index dbf984f8e301..8f23fb615d47 100644 --- a/drivers/gpu/drm/drm_buddy.c +++ b/drivers/gpu/drm/drm_buddy.c @@ -919,7 +919,7 @@ static int __alloc_contig_try_harder(struct drm_buddy *= mm, u64 modify_size; int err; =20 - modify_size =3D rounddown_pow_of_two(size); + modify_size =3D 1ULL << ilog2(size); pages =3D modify_size >> ilog2(mm->chunk_size); order =3D fls(pages) - 1; if (order =3D=3D 0) @@ -1140,7 +1140,7 @@ int drm_buddy_alloc_blocks(struct drm_buddy *mm, =20 /* Roundup the size to power of 2 */ if (flags & DRM_BUDDY_CONTIGUOUS_ALLOCATION) { - size =3D roundup_pow_of_two(size); + size =3D 1ULL << (ilog2(size - 1) + 1); min_block_size =3D size; /* Align size value to min_block_size */ } else if (!IS_ALIGNED(size, min_block_size)) { --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93D073A7F47 for ; Thu, 26 Mar 2026 18:55:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551336; cv=none; b=sFDcX4x04ZU8tc/dEBhW5/lUp/Ky9PaNwOWZCxmui5UXuFCGGZOkc2IoRybd4aLCLWvorNnxKYH0M5p3+8NCsKmiSAtQ+FCn+oIREYeaL8BEWX2YRMkRzIPayUaNlJ0spGvxjt8fatLIic0JNKGbcL4H7R+ODnnjtzwnJZvRNf8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551336; c=relaxed/simple; bh=R2Y7naG7/G7m4Sj5amN9w2j8cpntcn6acGk+uQXvJBI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GJradbyVKGkm+DnazxISGfisqPZDZYpkva2rU5V2uVwV7P//yigl83fWXQvzwCRkd7B188XZ+SLoL0acY/2Pvvq7sY1SUNkqKoXud4vtJzNC4/qxqW9r5O3Hn6gTbzG+k5K+8C2GqgiGqFiGiednm/pzLHmDjxbgb2rT31LgwAE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=N0CbO/Je; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="N0CbO/Je" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-41708f6c3feso861443fac.3 for ; Thu, 26 Mar 2026 11:55:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551334; x=1775156134; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bX4ilSonYi7XSfI6S+RBBXv+cAYgjTID5jxcrBPOaxA=; b=N0CbO/Jed1yUDbF3FeVWt/IrYx4DIVXzT44fnAD7Lj8CZpNYRnj4R3Eezg/kc2+EW7 /aVL6Q6FqtsXPXYm/zN1eYmx/SM365+OM/SRSz2RMbAHdRED4euZogNJajQdy4zzbumq kI7GNG3slIAqbND3nJiVlpIggyYgcSh6Athg8f6FMKQeEA4pBy88IFIXE+Iu0mFEDGwy sNg4YblC38Vx4kQLmJBcsJMU2aE0lfcfnco288uO8DAQ4W1DcfUGnk4MZEuzYQYknSjH REYN3ey6qg+gbJnPJYLloIpu4Lo9uqdZ52ptkBPJIJn4mN4tFMSRC28CNXCSsDJiUymT 5LHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551334; x=1775156134; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=bX4ilSonYi7XSfI6S+RBBXv+cAYgjTID5jxcrBPOaxA=; b=AYeH82KYKWdZ/ty8JwwvIrX8ra/L8auFoX4ymmKj1kWq0B5Xr1J6IUoRQ89GE1e1um 8OQlScpBPehbfgs9f1eJKFS4C7znmCpfVJdnjr8G9lKqhJX83/k+aDWBgdnvFN8dRPI0 Q8dSakAo1J6I+Jgvs1czAoJ/J6mjYuhNBTLXOkuhoZVp0ezXMFL+t0lHcR9Nt9BKw3dV HCOObOOtX/3PK8Piy7leNBxKuL3QXAlC6DcL9RrmM3Kb7+7aZniCURyMw16PUBmFMq+a T7GiRDgL2rAl015UxVm7hdphzTdXcwM04xf0qkx6ZaYzoyegaItWYATLXzTVMTr8fS+n Y5Ow== X-Gm-Message-State: AOJu0YxTqDto/86lh5n2aHyLz5PVhh8qYyA3jmdPjRtEF7WVV6jzM7id DTK9pAGLJjBBEsGJitFz7/SZHiN3utpsWFzH5AD8kq+xFIVqhFNFOLqEv0NvlQ== X-Gm-Gg: ATEYQzzOUaC0s7q0JpohysqA6sfCFCE4ySINx64szLEPpzGBrQn0icj1/fXcGKwRH89 cWmTXyCkx3/y4mO2dKZqFcJOJIL1vEgOyEY4UDw2+5k8uWBEMUQMA3ezx7gV1qltiVKEkg7GYsV Q58DHYuNatpuu92yfNJEuPpykd817M1Ycv1JNQb4BvrM3xAo6gtmR9t9G3d0Sn9LKK4PyO66a2L VsvF8QBV0nXaLEx/oZAA8rgaHatB14zCbV843u7TGneYjLP2mm2GLNX2VL9pWCWidMthiOsSWd9 qt6BusEvgChAKYAylhxIlvQDkP2iouVuJ4R1LcDl28PKkRftZ9EHGFBg3e741KD8CutgtllHd2c xi1g9wAdAutC85L3uLX0sGC9fDskk192Qq/Jw2dgtTkzFv79FJrWR8AWtw1pVV4CI/WKTClGAg/ Wu/xUQh2vq1tFd7T9jiNlFM36RQn2qFXeFAYIG1mYoho2EMerI X-Received: by 2002:a05:6870:9502:b0:409:5ef5:be0c with SMTP id 586e51a60fabf-41ca6de6bcbmr4583508fac.12.1774551334408; Thu, 26 Mar 2026 11:55:34 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:34 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 40/69] drm_print: fix drm_printer dynamic debug bypass Date: Thu, 26 Mar 2026 12:53:44 -0600 Message-ID: <20260326185413.1205870-41-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" drm_debug_enabled() is the canonical bit-test for drm.debug. Commit 6ce6fae84536 ("drm_print: optimize drm_debug_enabled for jump-label") renamed the original bit-test to drm_debug_enabled_raw() and introduced an internal bypass for dyndbg. When [1]=3Dy, it defined __drm_debug_enabled() to evaluate to 'true', allowing dyndbg's static-key to handle the filtering at the callsite. It also provided drm_debug_enabled() for cases where an explicit bit-mask check is still required. Later, commit 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device specific printer") added __drm_printfn_dbg(), but mistakenly used the internal bypass __drm_debug_enabled() instead of the canonical drm_debug_enabled(). This went unnoticed because at the time, [1]=3Dy was marked BROKEN. Because __drm_printfn_dbg() is a shared helper where the callsite is not directly guarded by dyndbg's static-key, this caused it to hit the 'true' bypass and always print, ignoring the drm.debug bit-mask. This results in a flood of messages in environments with slow serial consoles, as seen in DRM-CI on i915 CML devices. When IGT causes a mismatch in intel_pipe_config_compare(), the resulting UART storm causes a hard timeout after 20 minutes. To fix this, change __drm_printfn_dbg() to use drm_debug_enabled_instrumented() instead. This ensures the bit-test is performed at runtime even when dyndbg is enabled. It also adds a pr_debug(), allowing us to enable it and count the frequency of this bit-test. Note that using drm_debug_enabled() here would also instrument the callsite but only when [1]=3Dn. Since _instrumented() is basically free when its off, theres no reason to not have it available where it might provide some insight into the performance benefits of [1]=3Dy. Additionally, update __drm_dev_dbg() to use the canonical drm_debug_enabled() instead of the internal __drm_debug_enabled(). - when [1]=3Dy the call to __drm_dev_dbg() is guarded by a static-key, so the bit-test is redundant. - when [1]=3Dn, we need the bit-test, since drm_dev_dbg() calls __drm_dev_dbg() directly. Here the pr_debug() can tell us the possible value of further optimization. [1] CONFIG_DRM_USE_DYNAMIC_DEBUG Fixes: 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device speci= fic printer") Signed-off-by: Jim Cromie --- -v12- improve commit-msg explanation of choices re (__)?drm_debug_enabled --- drivers/gpu/drm/drm_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index ded9461df5f2..9b622345e2eb 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -218,7 +218,7 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va= _format *vaf) const struct device *dev =3D drm ? drm->dev : NULL; enum drm_debug_category category =3D p->category; =20 - if (!__drm_debug_enabled(category)) + if (!drm_debug_enabled_instrumented(category)) return; =20 __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); @@ -335,7 +335,7 @@ void __drm_dev_dbg(struct _ddebug *desc, const struct d= evice *dev, struct va_format vaf; va_list args; =20 - if (!__drm_debug_enabled(category)) + if (!drm_debug_enabled(category)) return; =20 /* we know we are printing for either syslog, tracefs, or both */ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4686428498 for ; Thu, 26 Mar 2026 18:55:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551338; cv=none; b=aKnUJY0gZRwM8eDodXcYzX1Rb3u4tzIVSafnty6j2ZGZr/xaZoPPw9f+JHoBsCln4xa9U5NzrBFqyX52uHG2lA9GXLOxz2FBUmEe9diqC2jsJsDRH25+GHX8UMj72BZoRXYKTHy3go/jVU+VMjMSKFf0/n0N9jDYedurWWtIBuY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551338; c=relaxed/simple; bh=bMhsW/LDsj9gJH69RL2hioPjNS4PBn+qQV3wty5reno=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hcpWuHkHE2tE6iS0hHASk1p/riwcGgHROrRChSAfAevS1y6DNIEziLKxNckrnasFJlhlyEGgwiT4lxE1ceKpr8XffUzwX6ltGBopYyGV6G1E+nyGo3nAw+npaJvn8P+k6QzPGmz/ZqYNOefSAesiofjzpim6mZarmy4+rO/LagU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l6TlHzuH; arc=none smtp.client-ip=209.85.167.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l6TlHzuH" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-466ec4c6852so809522b6e.3 for ; Thu, 26 Mar 2026 11:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551336; x=1775156136; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=odzxhFrE/OaIR8r3wWCi5vPBwW9g54UQJlDBz7itpic=; b=l6TlHzuHOVuwcxrb3lmzaDtXv848rvykIhcXTI3wllUWH0YiaHfwirW9jSLZ9IamXz RQKyfXWsI+NCIPFh2aFkOJBteIXc4hrRHzJWyLtd/Qf0/jZwyJUfcdfQsfcZ2XMixMbj 4/nZ6FTRyn3Ybvw4FUJ0pJmeLu2LQYEub2v2LhLvOTGfq50m0JXUadn+rtknjntl9dte HftMzYf1ncBWYzdpvSbdMBfM4kxVIcr1YmxpgWTjCOm6BwUVoFqjggxNNqB4AqyIegyF Htvrf/uHwQ5zbTh4iVeEnlLeC2EwAUegbvSMg6dkx16gKL5rCSCDPpEXtlHbpP68BAd9 nyAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551336; x=1775156136; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=odzxhFrE/OaIR8r3wWCi5vPBwW9g54UQJlDBz7itpic=; b=RJr7iielD90wYoHRBh0goY2ooOq0fJbDcABhaK6+zpIrpAEMME0QZg4QJy8f5iyJBa qEQO//HytAe7lC680cRjM3DKMmIyIez6C2h8r/dWkPauooiwuBjEyjZOzLzilqw26670 DXqcp5tPoFsGv7KoAbqBGwai/cTUaD0HSW+q6kkJS5nH8i7oK01L/X1647sVL/7zZHcB tpC72f1zSdG5G8BF5PULvnyTiwBZ5y6AgNaOI/fGqIvcgnqMLwCg1rg+wukfWv5UaD8j 4Pa2pWmMCFYOv1sNpdoj27p0EwQWvGaS4mPOHIeqv/zg8gxq1IZiuZX5FuHMo/8VpyC5 O59A== X-Gm-Message-State: AOJu0Yz6E2831xTdkZykQTx2u96+niG77r1JlbYNsj/fbsYGYic8kc8B OdpV9CEDbLI5gis1/aJUwbHkwlW1M1M3IeSfek+Bt1e2CKM3RiOoy7PDmqvqVw== X-Gm-Gg: ATEYQzwUBx4ihtfbsRTfQDL0k7iHcZ0L7Ms5qX4zNFOq8dejUwHsfR6c0oRHUeGWS+C 4G+7KaWp6Oo2V21yBg7nhv6YsmWn0fiwnM/X3ultgg0L1C5Ltbls54ARy4x+PYf2jSUTGVCSnG9 +ZDs660yW+QGiIBnhc/02n+gj6OjFPzt0RW4Lb5Zr9/byujjDjBrfcDsmmibYUXyvgxM76zNnPX 2az1omd10vIQEWmLVuSqBZaB5fvAEkkjzYVhRL9LlvhBgbO6uVP5CJKr2FJVXumlY/m5FLXEzMV 0XmGxcsPyxiK/8cGWA6NrYLJ7QlFiAfAmqQvz47vZ9HhR/25Paiyx0v71F+xxi4Ft+6c2BrnOSl xcIaQ8pufOvBs1ZlnpK9EEFcyF9s5X+ewkOEwi3oDiWNjwEyNV8MImjuHbZZRdgxOBAZkgi+vXY XHmazbttktnY1IkToVFQ8wYJLZWzcVN0bkW5Ivd9u14ehJYvXX X-Received: by 2002:a05:6808:5246:b0:467:1f90:412d with SMTP id 5614622812f47-46a5c5a5802mr3709128b6e.11.1774551335668; Thu, 26 Mar 2026 11:55:35 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:35 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 41/69] drm_vblank: avoid bit-test when DRM_USE_DYNAMIC_DEBUG=y Date: Thu, 26 Mar 2026 12:53:45 -0600 Message-ID: <20260326185413.1205870-42-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" drm_crtc_vblank_helper_get_vblank_timestamp_internal() is called about ~100 times per sec, on a single display. It currently calls drm_debug_enabled(DRM_UT_VBL) to avoid doing ktime_to_timespec64() conversions when drm_dbg_vbl() is disabled. When CONFIG_DRM_USE_DYNAMIC_DEBUG=3DY, that bit-test is redundant, because its also done by the static-key inside drm_dbg_vbl(). In this case, we can move the ktime conversions into the drm_dbg_vbl() argument list (using a comma operator to evaluate the assignment, then pass the address of its LHS). Then the __dynamic_func_call() wrapping the func guards the arg-list too, avoiding its evaluation when its not being printed. When CONFIG_DRM_USE_DYNAMIC_DEBUG=3DN, the bit-test is needed, because the conversion in the arg-list is not guarded, and we'd do the conversions even when the callsite is disabled. We can optimize for both Y/N cases by changing drm_debug_enabled(DRM_UT_VBL) to __drm_debug_enabled(DRM_UT_VBL). This gives us the short-circuit when the static-key guard is there, and the bit-test by drm_debug_enabled_raw() otherwise. TLDR: we could change __drm_debug_enabled() to call _instrumented() instead of _raw() for the =3DN case, but that should be accompanied by some experiments and results. Signed-off-by: Jim Cromie --- -v12- restore (previously dropped) drm_debug_enabled, with __ alterations. --- drivers/gpu/drm/drm_vblank.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index f78bf37f1e0a..8ec025e12c67 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -803,15 +803,14 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal( */ *vblank_time =3D ktime_sub_ns(etime, delta_ns); =20 - if (!drm_debug_enabled(DRM_UT_VBL)) + if (!__drm_debug_enabled(DRM_UT_VBL)) return true; =20 - ts_etime =3D ktime_to_timespec64(etime); - ts_vblank_time =3D ktime_to_timespec64(*vblank_time); - drm_dbg_vbl(dev, "crtc %u : v p(%d,%d)@ %ptSp -> %ptSp [e %d us, %d rep]\n", - pipe, hpos, vpos, &ts_etime, &ts_vblank_time, + pipe, hpos, vpos, + (ts_etime =3D ktime_to_timespec64(etime), &ts_etime), + (ts_vblank_time =3D ktime_to_timespec64(*vblank_time), &ts_vblank_ti= me), duration_ns / 1000, i); =20 return true; --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3339342882D for ; Thu, 26 Mar 2026 18:55:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551339; cv=none; b=muqxnw162KhSrQAJMj9rnLhObVB476tX16wduzIq2kAkR3SX3qUeS/tu8SYyAg4kDyFTyBrgagrCNVcrBYaD5mDymfSdDk/F/mfZhzEKhKeh9yLq6WbTMUykjcwFu+9iUNr7aHNZL888sVUoJoDSB+9fAqltX0p0/imWhtfcLaI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551339; c=relaxed/simple; bh=doahK3euwSwH3hEueyi8Mitvhv84R/5qSjOPxkfWLnA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c9vi75rH5dvZtQJ7Ev5XPISnxFQvNZNvoHbME14Db6k2K0mapvc/Jq5rYDJPMWcNuqymkXxSLXjdjr+m+Tl0IafkoE5598xdtS+aJMtboSmYo0xuyT3jyCbyk4ZjtxWWEeqVc7krBblz5A/2vwYrhp9xBGDTQaOy0ZkLzwCFu8I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Gw9kEWJz; arc=none smtp.client-ip=209.85.161.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Gw9kEWJz" Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-67e0ac36d87so562493eaf.1 for ; Thu, 26 Mar 2026 11:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551337; x=1775156137; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jaS+vAPe+o14cf01tnHTOxQ9DFEqgjCQ99ScUUNb7AU=; b=Gw9kEWJzx2WlvUf2Ici3H1f30K0jp4l3kVrDlNAPMijnYHHOPG1yqPVwVoXPhMM0Rf G+2iIah5kQye12HGDqiBs+wlEYf1F53LjWkExd+XZy3XjTJvhh+D8+CP99eyVtZlgT2N 5XWUappQ5ReTuvvBpDGzOSuN4YZhWKMDd82Apfe7/qiCeINHTIAVHXf7hw/8q9EJ0fXl WRHZrq4eyTHKJt1f2+ZNWHTrdChqJdspcrdN7+IiUO1dyj5BZ00DP8/epFbkbfOs+s7u oMZ+uNp/PrOJdte7qt9cx+P3Y2fFI2s35zstBt1vavcydTo4zeteaxqZDvsiI+L6mmr2 s3Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551337; x=1775156137; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jaS+vAPe+o14cf01tnHTOxQ9DFEqgjCQ99ScUUNb7AU=; b=Xrorpq7KfZNY3WkfEL85wu8UE5cU0tgku8DjHOCDt2VFYfniszLwWnjPgo0A1a3nho i1kiKDyz8H3XiNggxHMX9L9QWtcA/3hWdvibsNwJV4n+oY2JhGkfKPpkJOS4req5UhwJ ae36ntHO6uZYavY00qU85HLr3CRL7hlfwy/n2+MET8nHrUXsO1lwV884fx5WeQEqNKuk RNTmN6uyP8jUhoD2234Op8r8EZWhc8q8hG53bzS1KqK/+xwmuNCcUKCBAYCl/ZPcxLBj 3PzD7FSydO02bdKp2cZzXgx2gkvDusTSy227/BBR6dgkBClWaaUtCWXAQGl5ybk/843f X5fg== X-Gm-Message-State: AOJu0YzNw9k/NCCRApy5LkC+BRq4Hk4wJee2XRiQNoRXZQjtxjOluqel 1XHFlGxed8lYg6eYB5TVSUJtwSyhkBcQ0KM3YjArbqIsWmYR/D62UY7SNxTB5w== X-Gm-Gg: ATEYQzy5MyLK5AleRhqROQifJIm+8BoFl0nocqNkUFp9U0iwqJu+T6Ahny85Rk4jSep 7BHtJdN6TQyOuFizNt04x+GuRukbooUuacQRjZmC8MnY5GstLsC9f3NZn0CNg+FXdi5/HYsFCO8 c7X6MBPMcpwgCIRBtb9Ta6O5AfLjNizuJgb4fH0xqt5wtxolyH9Y34vk9D8gJ34dNED8vWcMdon I0fp8W4blz5Fcav6IpekqC5G5FsKp/u31VKUwy5xAYcuIZrMcg+YxH0+FcJP0/qt4LybyVivFcx prYrOk0o6w/0v3fjVBmYgJpHw2ajZPUZ/BmNtues87JHHz5qJwB+VOOJec/f8VdXrymsUci9Kit vC+jBqiaaOocXYNdStnt9Jv2lS1IEZcfZiHrTluiUEHXRlqE9CFrGgm8HFQYdGwNhz9oomQRQg7 jDA9fx0IP2YeIFrvnnyVzNu07ojT/T8t9ytzqSzlFptUkdQQlT X-Received: by 2002:a05:6820:338a:20b0:67e:f8c:6bcf with SMTP id 006d021491bc7-67e0f8c6db0mr1039841eaf.21.1774551337025; Thu, 26 Mar 2026 11:55:37 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:36 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 42/69] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Thu, 26 Mar 2026 12:53:46 -0600 Message-ID: <20260326185413.1205870-43-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to do too much. Its replaced by DYNAMIC_DEBUG_CLASSMAP_DEFINE which creates & EXPORTs a classmap, and DYNAMIC_DEBUG_CLASSMAP_USE which refers to that exported classmap, creating a module dependency. DRM gets DRM_CLASSMAP_* wrappers to hide the DRM_USE_DYNAMIC_DEBUG ifdef. 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, at which point they'll respond to the echo class FOO >control commands. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- this ignored 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. v++: fix old CLASSBITS/CLASSMAP comment --- drivers/gpu/drm/drm_print.c | 25 +++++++++++++------------ include/drm/drm_print.h | 13 ++++++++++++- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 9b622345e2eb..c0ec866f31dd 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -56,18 +56,19 @@ MODULE_PARM_DESC(debug, "Enable debug output, where eac= h bit enables a debug cat #if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) module_param_named(debug, __drm_debug, ulong, 0600); #else -/* classnames must match vals of enum drm_debug_category */ -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +/* classnames must match value-symbols of enum drm_debug_category */ +DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, + DRM_UT_CORE, + "DRM_UT_CORE", + "DRM_UT_DRIVER", + "DRM_UT_KMS", + "DRM_UT_PRIME", + "DRM_UT_ATOMIC", + "DRM_UT_VBL", + "DRM_UT_STATE", + "DRM_UT_LEASE", + "DRM_UT_DP", + "DRM_UT_DRMRES"); =20 static struct ddebug_class_param drm_debug_bitmap =3D { .bits =3D &__drm_debug, diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index ab017b05e175..b743ee3f8f5e 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -96,7 +96,10 @@ extern unsigned long __drm_debug; * */ enum drm_debug_category { - /* These names must match those in DYNAMIC_DEBUG_CLASSBITS */ + /* + * These enum-names are reused in DRM_CLASSMAP_DEFINE to + * expose them as classes in /proc/dynamic_debug/control + */ /** * @DRM_UT_CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, * drm_memory.c, ... @@ -141,6 +144,14 @@ enum drm_debug_category { DRM_UT_DRMRES }; =20 +#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG +#define DRM_CLASSMAP_DEFINE(...) DYNAMIC_DEBUG_CLASSMAP_DEFINE(__VA_ARG= S__) +#define DRM_CLASSMAP_USE(name) DYNAMIC_DEBUG_CLASSMAP_USE(name) +#else +#define DRM_CLASSMAP_DEFINE(...) +#define DRM_CLASSMAP_USE(name) +#endif + static inline bool drm_debug_enabled_raw(enum drm_debug_category category) { return unlikely(__drm_debug & BIT(category)); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A014D42883E for ; Thu, 26 Mar 2026 18:55:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551340; cv=none; b=a1mNsAmrWNA3aAkhmIiN9sBPLj4uRJ6rDulThkYocrIeRSM5zkilvw6I5/LRhhwQjASQVSaTMbVgG5yQjSoUtnnGBBTuQi99JXPqlAfv2o70XIXJbY1B4Ry2sh4L+G2d/kpczvyKcqmTvqX/VGWP4oDu5j7VThjwL80sGBx/5iI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551340; c=relaxed/simple; bh=pQH56LwJ2DBr85i9EEmMic4BOG6R0M1uawn2jdMxias=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Vu+MCuriuzjSCW/PqkOVPb4dHzFMYfLdh0vAbnvk8P8mtqvAsMaXNK4tTZe1K8r5tiKQpBRAB5LHZjdHrDD0f4s+tsjvJR+o09/6uF6B8DpREAlNCcWv7RwTNsGG+vWIUSptsjF46MtwoMobEDE+mpe8hFmTEMCvWkhMj+c9PZM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=XVsabzVm; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XVsabzVm" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-40f1a1f77a6so940024fac.2 for ; Thu, 26 Mar 2026 11:55:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551338; x=1775156138; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b4VPaN2JxzLfP79BRo4ZYIGptPdGN0vKlLM6mj5G4BY=; b=XVsabzVmUzw1JgSXopKCsAVpe3EB11X9lmWhUkJlaHRLPFLYd74pg6rYo4/g/sXfE6 k0sXdTILzIncjMnWV2q/y5Bq8XNRYUK3gnWDzU0uxpqKbeGP4r81W8JkTuCL9bUZrpe0 p8lKrS15a+eBA0udIWu3DpDoZThAiqjaXR6ZVKqZVzeStIYaFiJPUBmfVOLkU/YL/Trw EtQhmZISUYyvejp5poUbvUdAUG4QFagVFLf4nIkCb/pPc0mPTfAYgQius78vjiAnZLqh jB4vxdFjTRllSbD8+SbdNyGedlVojjd/FPIJxBDT0EQccuwQmoIrfBT/RpCvv67bgk5b UhFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551338; x=1775156138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=b4VPaN2JxzLfP79BRo4ZYIGptPdGN0vKlLM6mj5G4BY=; b=V8UypOywns/ViJ/FDsyWW2XaVmpHFIHdNKCnIAiaFMLqXR00+GIbViGxpoXter72Ok p4KKi7rFI6aoG83Ws+AjfkqcfHM/KNbZv0oT8lICTyikrDZF+YJj5xrssF5zWoz6nNcC TNDQbsV05flxoQjL3ZV8X5PDfawDHMCoM0NrSTp7PcvZm1Xf+0fSqfwE3PSfh5XIe/tn pEOwolVt8rFDvVu7gDMYuccHwT+VUSzeURjBPI9yBjO7+DD9P6U6vE0LZ2JExi2gxC1c eFdvsSPs+tjhe540qY5RosV4Qjvg6EN2/Eg0/XNT3VrlfUsQodqmFnQBlc016M71NcdE iusw== X-Gm-Message-State: AOJu0YzOojNKRCuGPMm3ri2huI9/AlUSxdQCd3v5AeWIAgb0FBI9f3Rl /lK7uMXrpFK/wBYjA8rdA1Iqu4/e8/ySlBCnYDxuOlzB93CpGcT3s5ieeshO4w== X-Gm-Gg: ATEYQzwzLjwA7ocCNA1DcZ5IqsFEqDlZHTpc6yaqxqo0FEj13KwytG36w9Bkj4wL1pP zy855UnuXge8AFvYMCwzC920QkBL+e/otIi7cGcgpgKHiph335SYDHx5AutOs9rjsR9vWe5wR0S RQeW5QZodJiRNerPONFQSJ+KZBKyooV3YyjlbbK7K4Z2VLHdITv/BAykbeFdwek93i+xm0Dw4ry GO1FDK2dooR3gBXetnJMqHzbhSWWra9iB/l8AoKGglASub2p6FStWpDL6y0M+9fkp7EvKwUm1xt tP/rdLok6biu2N8ESBi2Wp5O1I/k6S+Teh4R5GTYzmT827P8shE3aXzrh4VHKhzgwtooCZ3mhZ2 ozRWpJ3uNXAjM+3XlZRGaSrURSljLpNZWTBnLXyBPuVuU9Q6zaN/nVR5VN47NSdYc/zq2PbzXgu b1HYrUnlrhI4rcJn1QLKTm2zLwIIZJmWTFgkJVgJ8NOD6wVnKB X-Received: by 2002:a05:6871:4604:b0:409:95c6:f2dd with SMTP id 586e51a60fabf-41ca6e9ff1emr4767565fac.22.1774551338399; Thu, 26 Mar 2026 11:55:38 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:38 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 43/69] drm-dyndbg: adapt DRM to invoke DYNAMIC_DEBUG_CLASSMAP_PARAM Date: Thu, 26 Mar 2026 12:53:47 -0600 Message-ID: <20260326185413.1205870-44-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Invoke DYNAMIC_DEBUG_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 DYNAMIC_DEBUG_CLASSMAP_* when DRM_USE_DYNAMIC_DEBUG=3Dy is configured. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_print.c | 8 ++------ include/drm/drm_print.h | 4 ++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index c0ec866f31dd..9cdc547e3f85 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -70,12 +70,8 @@ DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DIS= JOINT_BITS, "DRM_UT_DP", "DRM_UT_DRMRES"); =20 -static struct ddebug_class_param drm_debug_bitmap =3D { - .bits =3D &__drm_debug, - .flags =3D "p", - .map =3D &drm_debug_classes, -}; -module_param_cb(debug, ¶m_ops_dyndbg_classes, &drm_debug_bitmap, 0600); +DRM_CLASSMAP_PARAM_REF(debug, __drm_debug, drm_debug_classes, p); + #endif =20 void __drm_puts_coredump(struct drm_printer *p, const char *str) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index b743ee3f8f5e..94064ec6c229 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -147,9 +147,13 @@ enum drm_debug_category { #ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG #define DRM_CLASSMAP_DEFINE(...) DYNAMIC_DEBUG_CLASSMAP_DEFINE(__VA_ARG= S__) #define DRM_CLASSMAP_USE(name) DYNAMIC_DEBUG_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) DYNAMIC_DEBUG_CLASSMAP_PARAM_REF(__VA_= ARGS__) +#define DRM_CLASSMAP_PARAM(...) DYNAMIC_DEBUG_CLASSMAP_PARAM(__VA_ARGS= __) #else #define DRM_CLASSMAP_DEFINE(...) #define DRM_CLASSMAP_USE(name) +#define DRM_CLASSMAP_PARAM_REF(...) +#define DRM_CLASSMAP_PARAM(...) #endif =20 static inline bool drm_debug_enabled_raw(enum drm_debug_category category) --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-ot1-f41.google.com (mail-ot1-f41.google.com [209.85.210.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 24D4B3AA51A for ; Thu, 26 Mar 2026 18:55:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551342; cv=none; b=ftAHDokOePQydy+aelhaM8JqjIDH4W0SvI1XLsVQqBl15fcR3y7dT+q9fr7qAoLv8WnYHxwzKWx8rs59x9XGKriNCjixmQ7xbHxN5BhX9W9iDFKtJhvxkLSE8t5YTrds5ww6IqfL2oC7Co7Y0vocwbD55GoVtj6KBYzc0kfdemo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551342; c=relaxed/simple; bh=KZkwS/gASrRe40Fg/Uo592wLx6Gm5HyNR7dkCn3OSGY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Iz9Yvq9vspxn3e/ZFGPHOT05Ej0Urkfm/u6AuiAJ8fsavx85zanqkQdLvM9YkicNpaQ8WPipqlRaSATpTqDAfvJopc98iELanijJ60WidnK2pBwNjcJddICVUDZvkQsI4yQihn1XSqN/KlfIHrwD5UmcgcFoPPFm8nazsn8xbUM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Yu+re/P/; arc=none smtp.client-ip=209.85.210.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yu+re/P/" Received: by mail-ot1-f41.google.com with SMTP id 46e09a7af769-7d9c98e437cso1084998a34.0 for ; Thu, 26 Mar 2026 11:55:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551340; x=1775156140; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=26vMP3nfkpOdAIVisqGbQnZnw5iiyCO+aaCVYuAOEzg=; b=Yu+re/P/E1ADKCsfhIZO1YaL/opytnZ09S8SQLdMz9X3eFkojWAKwGhumUUqiFoXwx ZTnw0ePJIiERqp0wWEE/MrEYTqtm55euEh3zp9Z7zHnBi1tIvY0kBLxfpXX8Zz+CwtLl WXMYSBZz3+TUJ2FIbJ2sBD2+LhflA5tVZkXDOOFA2yfKCs2nNdCgoIAHUAEZDNZJghsw EUCxhtKQUYsUA74VOF+ZkpFosY5mI4yEcYbLAb1dwYI4g1S/j2cx1ntZ+o8kGOuBqs4Y xrtJHNzJuJdfXWLtC64lDLks7wrgiVCDYxVLtWfyqP1NKLeBP+0iSrHayFIdJnBzwCzi rK4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551340; x=1775156140; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=26vMP3nfkpOdAIVisqGbQnZnw5iiyCO+aaCVYuAOEzg=; b=aMCZLZ2lJg8xETxhT2g5L1yD3A/tJq6idCObyKNkL6jDiBrHFZzhAg8eyLd2zLCR+M R8Kw8FbCfSR/YRU33Ke62AeYyZZN64yP3sgRC2d3qhhpPbCfl9dN+++lXSG1q1qtfTcl fjbpvF6dhonlj6imhk0SYBKv0QdaWZgaLIKwBWZ5knlZwUNMmXZX0u2qhAvNvYoV5aK0 JJlrYt1b4KZX7M8aP0SWsgHe/EyH0dX47NrI3Y//aJvXaMh5OZ0PpMEgmIVC5FobgoPw gZeW+dblPHQI82r4+efQLXOeQVBRFAimlodKlBy790kz8o7F6XnpXe5CR+4ZKH+0LQux 2Dgw== X-Gm-Message-State: AOJu0Yz9fbLrprImFh6PzmQw8E3/680SV/krA8V7RaJaaSfZNzMCW2sE /2cl3ZuUc2KGtKGy1QK7yGgHiuetlf6TNMI5NRGTQUjDiK/KZaWLPvb0+paUBw== X-Gm-Gg: ATEYQzzZUk3uow4NOxXtAMtRGzWQtv4efuLtP1HNVFd/EmTwodDAPbPNPXz6seRKO82 8f8pf7eHTTglT3Vu3hp4GLIc7hyHaR+fWvPfPcX4dfcuoeuhsOz9SBzbdWpB9yR89Xzpq8hSd+E YzmrcK8IclDCC1mIFLld4/W9HOilWbCiB8GZI789n+s0O7Jwj/FoaAsriv0CYQp7EMYZb0VRNVz uH5mtbcKhc1eEPUJy40oMPmN3KuTHe9la+2ZHZdSkdHjUyJNCuEi9QVaa+8lr8A0nYY+/yd2ojl YU+86N4aSPp+j3SNCP5JVnj9VXAVYdD6AgPDR5Xv32x0Su6jSovIDIsktNgvPnUCz6PsaDXsx6v Z5ZA7T8wxmZiYnSYYUjFRqZC9x/fP0877nG/ASlyif9TdQb3etVpqOvy+cBBg/l7Ckz8z0gUFeC mzv0kTcgZ6UqX+OmjYu8eVUg5rZLqgngmEyW7ZkEcoYjDzI78T X-Received: by 2002:a05:6820:2289:b0:67e:14bd:5ef3 with SMTP id 006d021491bc7-67e14bd605dmr669706eaf.30.1774551339843; Thu, 26 Mar 2026 11:55:39 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:39 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 44/69] drm_print: modernize an archaic comment Date: Thu, 26 Mar 2026 12:53:48 -0600 Message-ID: <20260326185413.1205870-45-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In the year 2025 it is no longer noteworthy that drm.debug logging is adjustable at runtime, via sysfs node. Simplify the statement. Signed-off-by: Jim Cromie --- include/drm/drm_print.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 94064ec6c229..c3df2f3f47d8 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -89,10 +89,9 @@ extern unsigned long __drm_debug; * - ... * - drm.debug=3D0x1ff will enable all messages * - * An interesting feature is that it's possible to enable verbose logging = at - * run-time by echoing the debug value in its sysfs node:: + * You can also alter the logged categories at run-time: * - * # echo 0xf > /sys/module/drm/parameters/debug + * #> echo 0xf > /sys/module/drm/parameters/debug * */ enum drm_debug_category { --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5F74429810 for ; Thu, 26 Mar 2026 18:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551343; cv=none; b=BeAtAoh1elbL93OReIhhuR7+umI/R+OpUP2Src67k4Wwlm+bfnd3SUNRwJgz2uPQ41UM8c+JiDRv+JS1w+WSPudCiHxAqvxLK1KJ0vNgqdJYAZ2EMU4ZBnvG4XTNnqPw62aHMCVm5ySF/dhViD8NgqArB2VA9JWz8c2n6nTCdRI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551343; c=relaxed/simple; bh=zrYSZbyFliQNBLQwKCgZgJElXJxGEf/eOfLdEojCS2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fqJ801HnbBILbPJEX+j0g7Xlxw3+YSyOu6jmBv77XplC/f5Q7+ci4B45XdC42INMVcSox+DFgN7duCW3+m1Ah+PhirbRVNhw+y4uUE1tPkuA6Ntfjt6DQw4pVqmtJ4tOsQ2JE2Fel/bGkvHCX7j+nqEDMSkFLePZgcHFxmPcCeg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k5Zkq+Us; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k5Zkq+Us" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-40f1a1f77a6so940063fac.2 for ; Thu, 26 Mar 2026 11:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551341; x=1775156141; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=93dR2Z7/f38EiX2nhH8I335LY48jx/pTe8LM2CbujQc=; b=k5Zkq+UsaShnrhYAVXVMiUnxCCgdw9tn1Iok73vu/opIggVnS5Vbkm3Fs3jPd4Y8JR ASx8xYQNQrStWya8i5flWnQJLEytgbWH8rmbwYzYYl2EJ0YAV6PDX5VPbuftKza/z63T bCI2n7svK28cvRhcZfnnMTPsTLbbQ0z+l9J/+k5cXXFtUzJxZLXB5O8v01QjdqOTAhVN ljLMlljtD2MPWwOARqV8nQPkwVi6NA5cHKBWo/sPDFFhOPVmah2620KrKad3l6l3Ahht riuD50+D0btmVs6VT6fdiQdOvDCZdnioKCIm0yJNwGzOa2fJB223gwDXISQjgacaoSZl 7U5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551341; x=1775156141; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=93dR2Z7/f38EiX2nhH8I335LY48jx/pTe8LM2CbujQc=; b=BOfrgZmMz1iagLE1PT+Wv7w/MRI4KDV/khLMrfgu+aUnlKh0DAlqpvpVnEU6DMJj1v Kt0dSLk34s/t+aJtzE343XAyLnSGEL1eQvi4JZ1U9W9rYiZFgEXwQU1MwsRA7afm8I9D XvKi9U5TNfo3QJJVJRIbWloT1ssNIraXHqMKbcQ4dVOmgU4tIGL1AlGDVnRKbneekMcf JfkJdAo9FgHwMewqHA0EeVLSTveEjHnfjT+iSVowVsC1+wSdb8HYiFmERmk6RDxIkYhT hMBELZ6/+ZsBhLXm/McWsJcgEvjZq5/d25rTZAZfxbR6zVXoce4ILWDkrbCzkD/sYgsH 1Dbw== X-Gm-Message-State: AOJu0YzpCpgFPnP3BBa2iX8mHqL9KKlYQCf2UKnxqycyoTtScxvRm0dB sM4VuVMw+u5q0Kqw8elfm1J7tYzFxSVdBtnNjkeWhha1XJWAEGAV3M1IdWKKhg== X-Gm-Gg: ATEYQzzFCBQsnAt2Hh1aJdByfSpeni4P4a2j3MeIVfTK2enUE2qU3BNpgBsoJepILpv nGacnoZxAhPCcG1IwhJXuHpXrr+m/iqY29kvOc59q2+miYk+y2enLTYj+cjQoJB7sQMoFvp5Jad JDWH7vz4sQS7dY6OBTpzvB/VZ2niBKAhmQPi9ZM1zhJZ442UHii56o5z4nfA+MuZQbiqHeH8NkQ +iY5qDtiVnJk2CN9Nl3j5viaZ1XdDH/SMtncRE/ReKWI0nvzSqjDLE0DOU1RK4wOcPzyI31D/mf sn36x1wEsC1s6WahSk8BGfZu2KLmWWaoIbx/CCZXbx5jxvoiQWzd4YCOjXmyQNWBnXKf9981KEH mgcz6BNIjs71qSxb2fDz22wqMD9JdzIOUGynH5nVDGWRl9nfEksCZ7V7LhdCjs6mXAyYMpNlfVm UjSgVfE56dhlDonxi4ekJrrnbvSbadq68Fn1LS4GlCqsEnqvm9 X-Received: by 2002:a05:6870:209:b0:417:2b13:f2cd with SMTP id 586e51a60fabf-41ca6d734dcmr4697103fac.10.1774551341455; Thu, 26 Mar 2026 11:55:41 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:40 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 45/69] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver Date: Thu, 26 Mar 2026 12:53:49 -0600 Message-ID: <20260326185413.1205870-46-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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 95d26f086d54..e5dd051eeba9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c @@ -249,17 +249,7 @@ int amdgpu_rebar =3D -1; /* auto */ int amdgpu_user_queue =3D -1; uint amdgpu_hdmi_hpd_debounce_delay_ms; =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 struct amdgpu_mgpu_info mgpu_info =3D { .mutex =3D __MUTEX_INITIALIZER(mgpu_info.mutex), --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f53.google.com (mail-oa1-f53.google.com [209.85.160.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D2BF3AB277 for ; Thu, 26 Mar 2026 18:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551345; cv=none; b=DNMmlLE0gq++IzCSC7OlW9UMs134CKIVzlfyqLr2QPp5aOuwWIoGXtVIcz/NAg1V67t/YpYIny8yB0xHFOZz0154TXCUi1N/gxdwKHbNQuzaym9JyqCRbR4vRFYjci5F2nieyBxsMKAxsTLTCfemOtaaxY01fGktNullgrlyDng= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551345; c=relaxed/simple; bh=kIneIdJmA/K/guUX/16vxiReuFcXvRmSJJYLDlOxvwI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nbqo15iLSfdGqDwWY8iMuN8TMA36dZpOSoIV06DzROfkDdFtmSmaJ6IbqTUeeNjW9DZkRY02xVyICyD68K+B9d/hjgBD3pymnZdYpdgQNFSDsTdoQGv46ph2mfbfzoxPOT/ws8zXqflw6DAqZkewdsbsnVq+waxpsP2KvSVAUGE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hTraALMx; arc=none smtp.client-ip=209.85.160.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hTraALMx" Received: by mail-oa1-f53.google.com with SMTP id 586e51a60fabf-40974bf7781so1893678fac.0 for ; Thu, 26 Mar 2026 11:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551343; x=1775156143; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=irTrrnawNz+DXC6VSfC9mZGBC+I85t9C/e5XGxZ5eAQ=; b=hTraALMxvLMdawW0LKezd4wMbeODjc7IFEhJzqfhSeaut/OwF6H1iUTndDjJJ6IzGI w5NEmWcDsn2LsMUWtWwfvVaakdj+jW6pgO5cYvFBToVJYPert0fyZara8Fx7l02f32U8 yP71t6Oe30sV6InEbJt3AxINY66otjqRDobXFMwyhqmKlDVfgX8Mcuz2PT4HXameZGZ9 1XXaLMHpgeVvi4Y2QkRqZcRJdaCpRBDnhTH8G7UuHe8oHUO4jA9eYh+aBUrqmofuP8+A dtRJiHndGa4/yKkFL7tymydsWhnEpDRBKTg9s/OoFba9gpgsdqJYQjYFuhaJLnV30SB1 gV1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551343; x=1775156143; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=irTrrnawNz+DXC6VSfC9mZGBC+I85t9C/e5XGxZ5eAQ=; b=nYDdrG1Z4dJFt5OMmYOVkxKqqd49OSNLkZTUKDxuafr/RnBEDXCCQBVwtk2LFNXKs9 EWaRxbPC/yVcb24Re2RMdg2LeLmlagJJfixY7OUur9yzBYz0jfQPQgJ45KyK82DyX1TO 324GHdHVgdnNf8rH59vvyzFbp81rfMVpUUlYHylY9TxqFA+Fuj6eW+7Hj0RC9lXg/ZEw 5kxny3oB2Og408gWpH9XX7xImrrUECsmKp3vSW5IuosDwAWhlEyp37cfIe0FpFtxRyGV qvUdK7UKfQx2O+6kISlLUm29XH/GSEvQSEBh1Ncewo8KlUl74ZaMlPGKfjWKLi+MyxFB 8N0Q== X-Gm-Message-State: AOJu0Yzf4rEKiKKleIfRnnMx7vV+9l90GGoDMOUSfXIsHrTwD7ADzTk4 cFLXl+OgzVSDpSsMHdelruyCZ4pBRYnYxC8lRxNhwQQ74MuqUEmIXvHSwQW5Ww== X-Gm-Gg: ATEYQzwNGxPRJDeyRrgevKq/8YhqE3cv0b3kKVwi8S554jbdQ9rAJ1MbEStYveeoWFR idypNBLiCZgsniyW05yYTr5n/cFLZ/8Ub42va2Yki4F60YZMlnaKB0E83/PTfwjr3n96qLBCw9q Dgr3HVwZCoedbIClSces6p5FwB39+r69uqg3nzTOruyjQ0o1EBOF8sbyVQK8tIfx/A1TuWmpVxk hxeh/lvVKIUA574RJTQ9L6I/z3SyiqQpWqJaVGZAHGvZuCMr+O03wIZtjX6F2Gs64BwP5H9A5Xn D35tJDZJwWPGmK2bA7IRGqoe/Ae5VAVfESp4RGmfce2JsoxGMIe6SGpZv0jQTq30rKGfo6BX4rt h6UGZY0xqAIaXwVJCOUYsI5kkx0W1zcejab0l6FeRs1j+Nmk1NfBZR5vSFkhKA740LMZef0tO99 wMqO6qPiEZZTUrxxmR9Vr1bfR5ZEh5y/iIrhc1UoxXEGEvY4de X-Received: by 2002:a05:6871:e488:b0:41c:6bae:2307 with SMTP id 586e51a60fabf-41cd7b9c264mr1725197fac.12.1774551342859; Thu, 26 Mar 2026 11:55:42 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:42 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 46/69] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver Date: Thu, 26 Mar 2026 12:53:50 -0600 Message-ID: <20260326185413.1205870-47-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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 34ed82bb1b1a..40c5e0014686 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -29,17 +29,7 @@ #include "i915_params.h" #include "i915_drv.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 #define i915_param_named(name, T, perm, desc) \ module_param_named(name, i915_modparams.name, T, perm); \ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 73A3E42983F for ; Thu, 26 Mar 2026 18:55:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551346; cv=none; b=HxeVMil3VkmX2pKw97KWwaT2COnhClQHoH49T8zNH0xDiYwrjQeTp2OPnjvD3lhPW+gnF05iFoFi70lrVUgmVfJcYqjLN562mb8ns2TEQPnJ1Qks8sW6xahMLzEYIegkjKmpn0Lp6uXXM/RmfwkTQ9c5QmcZnksSsZZl0NEd7Rk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551346; c=relaxed/simple; bh=Wk6QLcJ2xP6K2Pz0o2P28Q3gwORgkQHcBwvF0pNJ3tw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s5VEqzxnbyLsCVETnCH1JJlI2rVnR4HoPPCVGfscf3CRFHTNYBMJgwxWeu1I34NG6FultZoZDV0Gchu64Xzae6DIr3SLhiDAw7Q4kCKwqxzJkL0QW8YFJJVqZu/wF5s3PsR1BPZ2h/HYyafPglTwrcsY9XyWqP9FJA6fBflp78o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=i+BhMFgW; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="i+BhMFgW" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-67baf20e8c2so651238eaf.3 for ; Thu, 26 Mar 2026 11:55:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551344; x=1775156144; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nWuUyl3pJMGaRe5YpqoxGiWQwsY1kd47fne8B+3aeoU=; b=i+BhMFgWzGQqd/MLv7Ve1e7n9DG3KczLk6oqqeR4U1bbPCYTHa0Zot3R4zZhSw/JCe 1MTs8+ivcDVbDYeASgu/lEoVf9bzZhqzqCa8qe5jakvl5i5lluNjAuRi/GINqfl2VO49 7ez8M7evSWZYo3JhY0ak98gD4L2QgvQkwAcidRhApQLsXdlIstNz7EMHn0TkIG6Yhtlc NkcVZE7M2Stosvyc/rq/ZakI1ROQrIht/iynB1hRjr6vGvW0DpCUrBGyTbI1nbsd/L2b nvYy0VIYKXM5v2e3oTVyW/i5SaCwWWC95dx1aFGXIU2go3QwS/den7P4A1HMjuZ9KtqH LwCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551344; x=1775156144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nWuUyl3pJMGaRe5YpqoxGiWQwsY1kd47fne8B+3aeoU=; b=dRXWeMBI0LXNngRo3rdNumgOzEZDPfzbIvKN37q+FxYLkWP3jEosgRORBwjpw5dc29 wfXe7eQznuhPKspPvLyCrMKO96z62eNJLqtRqVDhy1Rt33pdWR+6SqqqlTvfOCfVdP0K vsars2mS6iJJcbdip73wPYovpuJrxyDKOe8nR00anj0+pI/9xutu6iwrycAIwPYkqK3r nkktzyF6uraXM8+X//bE3XW8ucUJuECiiKdRAN42n39u6LFm3yGmdaow3HW0qtJdQzLU ji/+y5lJNcN1q4IVyDaft5zCT0Sfn8/UGA/2qfPMC2eHwm3mEHYm8jr0tML8Yrct+swI gnmg== X-Gm-Message-State: AOJu0Yy7cJThzZLl5KmIytK3Xh8YhHlu1fj/EFYo7mkkDe9W8AiLSsXm 3J6mwiwS0xQAUTp1sZ3LkXukw5588tyEW5kP/zhvol5tVmceDhIfMngGBiOA1g== X-Gm-Gg: ATEYQzwb513HE9I5BO6s3mU6YmG7bIiDDEWYRMTmAZyXSWSupMxEHihmhUP9F9MAiKt 6Z7strDpurpRkjXisQekYe4TBdqWKkXpdPd8QbaDjdY1+Q2intLB3wYqGXYP0JC5EM9O4vVz2CQ xBWm0rsgTht6qGmbxTAqI7pX6FdSXiDhmYo65FiSUkqDf6B6Wv7XPrvzDFxzjjLVe+QBZfgZRch Y7SJlJu4vx9PTlYgry1/ALXGUwBR+rzig6pyl7N9MZHsWlMdc+ae5RFxnMopNkL9pzoLWUTWavs IMVA6AlsRw9jL1OWKdfNQL2fiGW6HUMCWrJWAAZkmMoP/zN+TgNV6KZgz/cgdKm+Z1iultnd/iK Vly35oRUiFDtgYDe7Vr2fiU9Wwzs03ZNibV0kAZZ0iVH4f3wwiMynywiodRoLkFdVM9JxmtXc/s IA40qve3iwArc8B+SGvubeOuvHk0gTHrRBrfJajMsCWjl+yjrB X-Received: by 2002:a05:6820:2223:b0:67d:e140:3451 with SMTP id 006d021491bc7-67dff3d219emr4887862eaf.11.1774551344312; Thu, 26 Mar 2026 11:55:44 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:43 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 47/69] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper Date: Thu, 26 Mar 2026 12:53:51 -0600 Message-ID: <20260326185413.1205870-48-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_crtc_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_h= elper.c index 5de9aaa5ba04..31c5294b252c 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -50,17 +50,7 @@ =20 #include "drm_crtc_helper_internal.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 /** * DOC: overview --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1176342B739 for ; Thu, 26 Mar 2026 18:55:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551348; cv=none; b=HiqPxvHbhzRyUppKyhoE98c0UUsyLf+5st+7fmzmI3lmwWFgP8kC4nYNpGldqG64ORIwa6/tuPvWq/I8rtCsCtfBgnyFeCc9dowiN97NVPoT6xfEKQKZbOS67KGpJKPq2TsgbozFUNM+L07ATlCEMQKIZIxn2VtpdbF1ZKIuANE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551348; c=relaxed/simple; bh=K203VObBwbIrCIpDYuU2I5mJB0BwEDffYJvxM0ZzZBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UQkqcSUg4S5B0Qgr3hloH7zWd7m+/19tx9vlaW7See8mKkVZQNMi2ik9iQ7/iaft0JW6OXz+0GCkIu6YKpRcI+AG9zBldhrSy7UF1L4zxKg+O6tSWNjSqmLX6kQPDSecPJxJIAfUUbu/4pWtZn7FqnnWAHFboJrL/ZF2pWNAxJE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=d/Iu0bp5; arc=none smtp.client-ip=209.85.160.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="d/Iu0bp5" Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-415c8a4d2e6so561807fac.0 for ; Thu, 26 Mar 2026 11:55:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551346; x=1775156146; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QuXW2pVB+6BOeyoEL7PCyteLSTsnkRNE1etSyCy+RQQ=; b=d/Iu0bp54kta/peE3oo98aHAq/3rInq+diTYm4h7ELk0OXMHxAsucjp9O3kwpLfk07 0uB6HXISP1C2OLxU9yUBzCnnAKgL/Qq9q/3ZcshbJL/L/CaeGnccjC3BE/oojQ0nFp2l IqwSJaRY8GlyAYOR8bqCfBqYtb881e7u5ZsP94RLOVR1fYotjVRKrNtSReLlwIRIkah4 iDcEoZ/I2KoGgg39tLOzTxBFMmsu7CHY0UrGsH51+g5oNM6HcRQnLIRYT1q6cnDkKRds 8ztMaUB3762rq67s2GFlhDoLzrR2zQZ7s8Dy8mcPAMxqak69HphoDellSgd6LalOUtTI tQSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551346; x=1775156146; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QuXW2pVB+6BOeyoEL7PCyteLSTsnkRNE1etSyCy+RQQ=; b=PeSaTbJAvKKtKYlmbi7OSOYBPovJpGH2XVXJVXrznuVA/ukb3syibk9E+8vwNijDYx GIuAx25Wkfuj6zliNkAvMn52iHyiZpPAY6bDOkN/Rc3Tqt+L86jzo1ddffGEksU4xCit 03GjHPC8Fc766VgOynoO/Or33upxuG1uHXiSFjM+POKATqoTjVbzB/9+jA7+y+OkhkUO b9UCN0as/LkaXTzzVqp9CzYRG6w2mU9Tt01JKh6e9zuTlWBq5r5e5rVL+e28+uppb6mg 2HWdBVShnZ/vu2f4nUG+au4pZRJFUcFF2sLjfv7Nz/+pjdWch8gR06n4pY3ucfHwxcmp QFiA== X-Gm-Message-State: AOJu0Yw7xUHfeO5V/5PG28qUQ8fg5WIyzJ/gAOHCx8M9M8lMpdVbTzgO g8UCTzZRe6RXTwLAPb7/WdcMB3KGsOyGJIuC/cUFFpNvQxKBMrn8QCQfeTsXKA== X-Gm-Gg: ATEYQzwTDF9hkqIPYt6lBOA1HovqW4PP7M34BMLzz3wlKEMu+HVaLMvk3HZKX79CRXy lDuBt/0Q+IK2PRw58lZ5AwlRavROBobjT0AN1IGk93NOr7vlqmpwHqy3A6Bk6bs/g3qs90GNemv 27a2AR/gqdX8alhi3kV+8vARPRX/bo6JorY99mGcMMUHGEcvjFUQmqe2lgZUQYA9Uwtj3o+1R4K g63bUGdezc1JR1snj08ZTGdtaq/m0cO4Ee7uXYKx+wAKnb6IfiTvKDNPSdb1WbaBaWNNG+5o64K IzJg+Kntaxv0kYRzjQRwDKrnp1hVFk5qFCxsV3FZ7Id/sOYEoFV+3A+OqAjNdiM6MV/79Dv7LDD vJLFmuj/mgdT5NhuVrz0QRL6rC+v5sGgCrPiw8uxp9AZj8ZENlASdvAaG0PM1l136BY91pKxWqo EWJEZZZgvrGNjcvLXEs8YIPC1j/odhQKHFh1yy9+Ju6+v8qZdH X-Received: by 2002:a05:6870:2e93:b0:41c:b780:93c with SMTP id 586e51a60fabf-41cb780158emr4153585fac.8.1774551345778; Thu, 26 Mar 2026 11:55:45 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:45 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 48/69] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper Date: Thu, 26 Mar 2026 12:53:52 -0600 Message-ID: <20260326185413.1205870-49-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/display/drm_dp_helper.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/disp= lay/drm_dp_helper.c index a697cc227e28..308083e244d4 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -45,17 +45,7 @@ =20 #include "drm_dp_helper_internal.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 struct dp_aux_backlight { struct backlight_device *base; --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f176.google.com (mail-oi1-f176.google.com [209.85.167.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94F843ACA52 for ; Thu, 26 Mar 2026 18:55:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551349; cv=none; b=uqpMy4t2oR7D/ClL7XYMgQQpoyk9MrmMu84t317Svkhx8TtEFIzM8MKuexMVMd3Qokhu8n4O131RFsbukSTgTdTu7twygmjWrQSInUwmBZ1/SQInKeleW+RkG3KXpo6k6DOLquXSZyjkMV+xgWIW2F89Qitj3nh4OSdUHpT/8I0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551349; c=relaxed/simple; bh=D72swpOVqiiaN3H7yZNAQW3FyuuxGlAVbPzHfFWDigA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uijTWh+NTMUldXZb+IKM/yXsqX8hUaDADf/n1eYhi7zcxpASphLrkeWwEmGQnbgQs2Ntzp6vyBED+TGMkYo+HnuUVLEOlJ2xwmXjA1z0Aq/JW8XDZGjwcPzEhx0dymzi4cveZBRW0vUJNwgYQncyf4OTcBpTwU6E6ntVIwR4L44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pSfNOF4u; arc=none smtp.client-ip=209.85.167.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pSfNOF4u" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-464bba3a9easo828633b6e.0 for ; Thu, 26 Mar 2026 11:55:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551347; x=1775156147; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=biXThcx+6w3P/qlWl1X8ZrrgjPyfHSHs7iDi6/iglY8=; b=pSfNOF4u9e8HFpttjOhG8YVtgvmD+Js1nTkLnXbheIHXunVg3gGZ2RVvvtudYJ4RIo U51+Xqa59ZQDd9VHHIIMYEnrRlTC0n58Kvuz+iEMCuGR5ahb4L8i54jJTV67g2N7+8fs K7jS+qTZ5XB4gyPjo1euA7l7RMjTbGwzYz21+8MFay4raKaeZIJG6Vy4fF7m0DG2A2MK XM+S5EeQIqidCMuWeGR+ZuQt8A67m+n1eb481mUD3oFDBql+Q3m+mhDwSwkOa/jmyMYy KPnbKHlwKfbnnZm609RD0tZK6xynDMwHB6lWoGqY6sEpDYQhkRiH+95HAyyjVyRxJ3Bi kV3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551347; x=1775156147; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=biXThcx+6w3P/qlWl1X8ZrrgjPyfHSHs7iDi6/iglY8=; b=NUMBvf9v8wXFDKGm1JOk2o/a/qsxaBxI6ZLZ/gw+YRFJB+w0ccZUwdEvqXfiwdrVT8 yY4YGctEFNGUHjGxqKsuW8p/bYuQq+wsxJkCaCkZHiU/NTcbNWgVLh4N4Coq2Re0/0ez +D83uQjTxTuVMeZaQbTvHcJDsS5a/GygiRCUrOLizT85EXwmEfpUSTgbOHnYFupKxIRk yxsjtvWLm4wKyRW85cnIM8uL0m+cZD63m2MRZH+9BxffyyqZmw0WyI1KWIBbMxPECOy4 COVOlGTpiu+Lj5MVMijQE9clWKRvPBLecizKM4f85PK4P6BBSkM/iVACdfwoojLTvwNZ 5kpw== X-Gm-Message-State: AOJu0Yw8CafrqPIlMd3q9x26Hnnkfh5wY6g94ruaYOlAaDQsbEmR4Ih/ PGRIbjjCbvDGcIdvJs0wZoUNr5ES7TQyBclnKzIA3jwSzJ1ao6HRUFTekuZ58Q== X-Gm-Gg: ATEYQzweaVJ438psu3M/Cl/KJOviEIiag15K4VJB1M2UxMMSazgY8ftBVxVSVYmp7I6 OglOlRcNY7oFM0lOIHb5U9eHu2qw2kQ37NFySuZAs0cP68cYsPybbGpyxIZiy4DXpHwj+TkUtZj ZktbpfUMexMoG/8Zkf/cAtcIEZHAI2C+AE7oVakCw+D8jQG0BUk3eIfmOv2g7RRZivNX7tWEup8 gsFOQu2AKmBWLHtdPwOup43OehxIXW1XsarNmAFCt0BML47kB8kr811igmf4jsD60pBPo//AFAP DDetTH914jNacWsNd/sJnAQxou23el7VocGN9Zjkel0zxS0GLRWpJGkN+Vk8P4u8hwuNbUeBQwF Q64ttyjOAKblMX4rA8fTFZ64+PN1xAr03dpjgrvOCnMC7Rla0/a/RbL9Q/+Zvet61L/HqU0QstR NcjTjcpjqkitVBFrf0SagPfHUq0ngmc1wZ969rfkTfnMSFlmwhbGvuvszGDj4= X-Received: by 2002:a05:6808:6714:b0:467:58e:5d6e with SMTP id 5614622812f47-46a5c71bc54mr3926380b6e.30.1774551347410; Thu, 26 Mar 2026 11:55:47 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:46 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Lyude Paul Subject: [PATCH v12 49/69] drm-dyndbg: DRM_CLASSMAP_USE in nouveau Date: Thu, 26 Mar 2026 12:53:53 -0600 Message-ID: <20260326185413.1205870-50-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Following the dyndbg-api-fix, replace DECLARE_DYNDBG_CLASSMAP with DRM_CLASSMAP_USE. This refs the defined & exported classmap, rather than re-declaring it redundantly, and error-prone-ly. This resolves the appearance of "class:_UNKNOWN_" in the control file for the driver's drm_dbg()s. Fixes: f158936b60a7 ("drm: POC drm on dyndbg - use in core, 2 helpers, 3 dr= ivers.") Reviewed-by: Lyude Paul 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/nouvea= u/nouveau_drm.c index 915f73279302..7f7c0cc1da64 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drm.c +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c @@ -74,17 +74,7 @@ #include "nouveau_uvmm.h" #include "nouveau_sched.h" =20 -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 MODULE_PARM_DESC(config, "option string to pass to driver core"); static char *nouveau_config; --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C93DD3AB28C for ; Thu, 26 Mar 2026 18:55:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551350; cv=none; b=JHy+jeiawJpbmkKzENv63t8P/KZ07D0iAX5IAE3rBfW9RXAe/P6Koz0Fmk/hVuosR3/SvKj3KcsQgy4NTo3bTzVlENvb9ae5GS124Fga103eimBEyf/9gaokm4t/uC6/5gNFhBYLkF8L977DyiybsuY2Z/ucYdIbs/qQ5QXrO1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551350; c=relaxed/simple; bh=uCisBkzGldfZMS8BCfNXt14noun+4sHUlmOOszf1SZ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bq9r+Ez0QGRQay2yhhA5aQOdhy3RiU3gMLkh1ifCJ2lTy9Ujf7kte0/TCyiCkb2Ucmc3jMuBfG26ReeUoW8aOoCjb+DhJ1v9UCrWFp5DfXjX7K0tXRVTWo4jY9bWVeL25vkXzKvD4+yzR/sHmQVzke8O0zY1vnl0ifWbGkONMvE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=pBnnAVPG; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pBnnAVPG" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-417571c6083so747086fac.2 for ; Thu, 26 Mar 2026 11:55:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551349; x=1775156149; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6v3HiIDRukL8wqePVR5l3Bo2Gj7Iv9DgR3CyiTeT7DE=; b=pBnnAVPGrJEVQW86JtANdnciu8PWyHLiMlxizZ6zu0s9QN00vZ6V9VoLYzDdXSLlI8 RkgPCpC/ld91mMZU4TdpfInIpILOozIGK1+tcpUmkjMDbkmSdtPwXU669MsSqZxe8cMV v3NwtjqWvNwE6gJHboWZEo0mwVQJ4MXyDtbFfKxu5e00pQRwu7xNq/jdXaFT6JiymEPg Tvbqu7yHgTIXPqShGtKTSVs6fyzf8MmqVdlKBpW47+tE63/Gwu43R9gEdg6UvRWBxpFN b+b55Q0M0BcrSdqAjPjnOK4qDzT/7q1RPK8loLO36UbpISsZWJE0kRyoPjETPmEgOZx9 543A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551349; x=1775156149; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=6v3HiIDRukL8wqePVR5l3Bo2Gj7Iv9DgR3CyiTeT7DE=; b=XnIst186OlRqaIG1PMBb2KyzzQSvvdO2j6cbtt+5ELo6O5qVRGZXZ6OtuhXGm1raov cWGM11BZlS7ZyAqR++aF++mNXU5LlmZenxXhZt9odfCN5vpmP5BeqtKS3SFKBW1VXnMJ nN6jxcIj0+I8rXcy1D3ubX6NPKnNxNjeWVWWndXKuQVDtqxO0u78MSxLxjTUpJ5MiWqn fnzBYECNisUzdt/ELu3MQeUZAC8B0rzae2gWXhAGQ8nYw+H9nsP/uxMzBc5jIoTAi45u C1B5zu1UOPkhJPW/2BGxYzntGnBl6QceP7BEi7BECUiI37Dzj7dBedZFwPu1OZ5ajwtk 4VJw== X-Gm-Message-State: AOJu0YzNQJRaSWd/UCy6GegozedILxIdr5BsYBwLL3y3O+jpoH8C1J0r NJr7jHwIWvkibktBtqj3QmGwfGNyiJDD1eXsPrAajyFAr/bi8BMK1C4dKEE+hg== X-Gm-Gg: ATEYQzxEUyTrmGT1Jlf1QH3mSkLEDXuR6bo1OL45VStwN3C2rUjRGMFPlclfxAqa4zl QCOlPUsFRZPssLwrbrrlUhab1PNUA5SYkWiHfZ4EI3frQeBPMGEv2llJvwhjEhmTg1kXG41dy8T qn+3OIxzeQePYRYv3zIQCWEHIRcAZzEbIOAdI5JGTQdN/NdSSZG8gmqUJ0LC9DPrdMSGDpy9C4r 178z0YYO24FCDlKLK8KvLD91IhBjG5yESaUjXtYNRePIj3CmfklI4BWKvFtUk+nwK2RTagRCa+V pIxbDnxC6UFkg78Xvj1bHoud7gy6ayst/0lQb3BHA8yrG29rM18Mi+lr5M2tWLUarB/GDTAeLPc l3SyRw3A/mjHpWRCWenVdz92zV8+zLB39JASaek5fcrcd8tezer5KotzIKf4EIae9W2Q7H8nPTr MqrmHVvSQOcVnVfH0o298ptr9SZSHlgDVzbG734jbof9kyJ7u/yk7UjFwq7eg= X-Received: by 2002:a05:6870:2f12:b0:417:a36a:6074 with SMTP id 586e51a60fabf-41ca71894d8mr4456214fac.51.1774551348686; Thu, 26 Mar 2026 11:55:48 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:48 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 50/69] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Thu, 26 Mar 2026 12:53:54 -0600 Message-ID: <20260326185413.1205870-51-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Invoke DRM_CLASSMAP_USE from xe_drm_client.c. When built with CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy, this tells dydnbg that Xe has drm.debug callsites. 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 84b66147bf49..3af476f0449f 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" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /** * DOC: DRM Client usage stats * --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 775E742E002 for ; Thu, 26 Mar 2026 18:55:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551352; cv=none; b=GwzKYlUkk5Fv/8AJp/EdYFRnVR7JmkH08vrxnThycsLZNx5kRGODCDdDeZTs8at5zGjnpb94be7XkhNNBQakmu0q8jI4fsOzoMnb/LFSQ9jPklY4QJcRcv9HHCZnO8a32y6jSSN8q10oIFFk/gIyT3nQQkYlJS6ZLs5FqKZjxWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551352; c=relaxed/simple; bh=rIbhSa28GWK8AGaDe/Qk6pwqJANdKpFi8pxj1zud7jo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R/6BBsN0+tx7jcGzQMNXk2m2QasEo7xxcHto/v20nAi3Vaplzh1qZJgDaInfFWJjf4l3mCgYMECMshdZW51vd2HMKQIkVu2OcP7ZLfDGuATScxXAqBKYr/tFRo6j0B4/AN9/4e03mUgs5sCYdXewzeE5FII4zM5TByH4IFVk1ZI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k8S3Pal0; arc=none smtp.client-ip=209.85.160.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k8S3Pal0" Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-40974bf7781so1893834fac.0 for ; Thu, 26 Mar 2026 11:55:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551350; x=1775156150; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RCYC336WoUNdVp8/EmNZcTjPfopk7zVSApVc86osLdY=; b=k8S3Pal0Z0u3FT5xHpU+9x6QelBw4Umk99XjQzIWim/AAYNM4mVs1Mret9imQckuJg +T6Z+y3o8FUy8/n2Vh/7Czg1sFD+kldRRN3V28aXEsQg80WHm+7oojVrYT1FGpMWOGxR mfNIKZyUj6+7dXZvR6SFtBuaheWzsVXjeJup3fOE4A9IMBD6OoYx7s25HBId3eBrbzgy DYmU1dgWv75TazBPOMraP3qycR6EWxTJRtjhDb+memuOgqaIfrc+a6JP5UHy3ECm4JjL Wm9KN47jSvz7k9TWvMBAEY8aV/Rh+/+Db8FoymCtxpgfednG+hwL9P+ohPZ83HhBb8X6 mGyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551350; x=1775156150; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=RCYC336WoUNdVp8/EmNZcTjPfopk7zVSApVc86osLdY=; b=A+O7dOid1eIzjbuez/W2Q9AF0tADrfOwPYFGidyQgUN35MZffnVY0K6OMvFx+kwl2p 5ynQVBP2+eUUwYXL7D2S+Rb0Uf+mnVbtt1mtCDj0huKIb7voP/B4fUj5RjSx7fQVBwhS kBFWwbQlnL9jhkzQmkdXA/YLpARy+GiYVwtdjR44kOhZO8v6IhRuciUsO2iOCOal9R1s hvIvnIjQsaA4MosYsffhJzwEea6mGUrxA4EujABId+0oq++stL73PPRC/Yg5U2o1U0hS rF5tRpT3R7iFH1TK+NejqVELl4FS1h6aLb/Z2G92lKYjo/7wgHRHEYNX5GfIJKX40zRz ho+g== X-Gm-Message-State: AOJu0YwjFcPS4w/1fMNa56DjLKV/SboDkfQDl9EGWQeEZrzMrdzeuZVZ zMY9xCbAR+KM+viRt0H0kaEFL/y0AZPylKeRdAv1BmMj14m7PWNS6wQq53blxg== X-Gm-Gg: ATEYQzyjGBgxNZtsw3DsWkjvyPXjFGypHNwv+aPOT9DT6bLWZ0GQVj8AwilpRN+qpaE js28VReS1ozUO4SXwz23TYEDMP6IA+sKUVYA3Z15Vxr+7Bsz0JFDvXhsvW9iM7birKEceLKcHVB 1T9ViYIKD1TYRErrn3ueiiH5jNVjrZknaofTXnWxGm1fwkP+UhV0Qf14rrLEwzbDRTyfpMv6fV5 nvLFNg8TwhWZG5uOaGI1htJl4lPOU4W5AmMvD3BPosw4MVELkApvfmbMISG2diUM4ORPwXmND3p au2iK4ArfinQvE0IeobsrWOUl3K8BeQTXuBzfZ6xqDdVfvSMlzhhFH9p3afnJ0wE1Qb92pO+h6z /oy7KHQYYG+YPq/G0iBfpFP+z5D48HizufNeBmsNzk1n5dh3+GnfiWF1YDvdz/Gf7TAtUnZZBdv hdjtBsbOiGLHlui6fx0eZkhAgwdTO1ED8qlltjD/13N8ZCHEpp X-Received: by 2002:a05:6870:8992:b0:417:43c8:a58e with SMTP id 586e51a60fabf-41cd7a6c632mr1282299fac.3.1774551350152; Thu, 26 Mar 2026 11:55:50 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:49 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 51/69] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu Date: Thu, 26 Mar 2026 12:53:55 -0600 Message-ID: <20260326185413.1205870-52-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" virtio_gpu has 10 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- 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 a5ce96fb8a1d..aea4c117b006 100644 --- a/drivers/gpu/drm/virtio/virtgpu_drv.c +++ b/drivers/gpu/drm/virtio/virtgpu_drv.c @@ -49,6 +49,8 @@ static const struct drm_driver driver; =20 static int virtio_gpu_modeset =3D -1; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, virtio_gpu_modeset, int, 0400); =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f43.google.com (mail-oo1-f43.google.com [209.85.161.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7DB142E013 for ; Thu, 26 Mar 2026 18:55:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551353; cv=none; b=J9CeU0eDDSA8DAwcAlNRitW5oF/wrN4dbvUweZddkiYhM6TJl3vh3Pwvi1Ae149EroL1iJY/So3zZZ0jlHQ9GuRGbTtZqdCSR/DYjqKxyiAx7Ut1umHkBx/cEkplGP0VqhNl54U8aWIgPoDVEWEb5ekGgaQWlNNwlySKMWEhgJI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551353; c=relaxed/simple; bh=T/cL4Vo/Z+Gc5iUZKJ6aeoLySt21gG9U4x9PsUoDqEI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bZ3S1f9uvCvaUO+tPp90B0l2Hfe7YuUkqqg7YIYsD12z+wjE+caA26Nv3OpCR9kztCo6wnQDSWpU60nBQTVvDVQiIXsUjXjhqWrzCbHkUjKcIf0T1V84B+QbguEwomr/GJ+EYPqzM1WhAbLtOyUiGTjDNDri6ayHSdJ690JzNx8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=gFSHrqER; arc=none smtp.client-ip=209.85.161.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="gFSHrqER" Received: by mail-oo1-f43.google.com with SMTP id 006d021491bc7-67e02b821cfso804922eaf.0 for ; Thu, 26 Mar 2026 11:55:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551351; x=1775156151; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4Ts/LFRGubV+qE5nUbczy5fsPH9e9tt1w1L0GvmpB2A=; b=gFSHrqERZlZxN1BDnozOHTTtRlYgykvCXVluOoB0RN6gCZwvfHDeexE0HuzIxc/YAZ WaoNs6/y08aPuANP8wB/IqUJNmUYxIQE7C+lAAV7V0ZhW16Qa3kZqpubkZIOrXlpjh2g lWKxNS0fNsJeYs2YOdKUGK6yfVe+c4qBdwX/JSqwDKweEjfOClFIkrbYT58/RBuBypgL vxn/Ma92Jt6oW9M9ZVKp5x5UCFFs4hOdH8NFVAysR2+Ap0QYIPJAu4CAA2EbizQk2UWL qKn2vCZVUC55Ket30vsuIlZGmeydIg4GnrpsGGleENU5fyR2MgHXlOWY6Z6n9t4WnUyi WMvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551351; x=1775156151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=4Ts/LFRGubV+qE5nUbczy5fsPH9e9tt1w1L0GvmpB2A=; b=K6X1eluqT3QYni0xm1+TKLGtQuaqngGu2JXID9nIXm5lRk07yXW6fkIsHLgxS9siBK KsW5CpZ398IfrbEtbvjjty2LdKFrOQ/q85jkcvEI/u24kqH5rWoR04Ia7Vzf5t6MlfDp NE4Us9rtf6fTEwFAZXOiXa/kcO4mLMfSPX11CjLi14lbx1Y4SgTQFRZ4Ka7yEf6crvut /CXjJo2lp1UHRL5LnIjWFRn5dWSwLcwYn2F0BLKdiey/fSwgnTN/3crwoOYlw0mT4gxX 3wyEQo9lFs0+KZADVnhrtRue/i5qySDEIXSR3V91tOfBS1z9Rpw0+wUfIniNLlgpTxR3 n89w== X-Gm-Message-State: AOJu0YyKWjAGHAY0m+QQ2hFZDxkFKZ0HgCt8Ga/qDSXejYGHDI/Ht6V1 32EW9hW2B2kGqASAKLpOk1zdabImjrpIgSluiUAUAMEb1TgkXC1rgBDQCJ5+Aw== X-Gm-Gg: ATEYQzxuJ/EA61S0QgV9Y/je7uLF2fSbpUJ82bljO5crNjBsNHJ96VCOjU/CB0TguND ClAMn9Pr6PHUBrDR2j96kEpjES+tm3f45QvJ8TkSzXqYCPKv8tvEV8lkLaIL/B4qZCd+p3DZTmm Vl8ku4KjL00a3Vt2FIBiW4hjVRWsr5kmT8Kz3jnBnsSAFxVAai6gYKiUHJOGfBKrpfGsLUXdYBP y56pK14Vjs1Y9ieYDMqSA6eoh377zihlvilDhbNx9RGbW7Law4X71J5d8tApNvbbRIMqQfxHINb S1OPoGxXpp8l00q9W3G7DEOR5UP3ONgwxx0PXkr3PnKXHbreVqCwjqgJ1bXmgQhPom1qf5C7NWH jvd7xze5JCVzqsvddsuf8/WvX0VKKaV4wskKYmSkNFiKF7kExvs6CT3OkU/t7nj3r+ZIMDMdzwq roGPk+rsth/eEc6+TVWajlnRITGHK4dZ2MPDPK4uwsJsekoHEi X-Received: by 2002:a05:6820:152a:b0:67b:af3e:b1de with SMTP id 006d021491bc7-67dff5a94a4mr3770147eaf.69.1774551351454; Thu, 26 Mar 2026 11:55:51 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:51 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 52/69] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm Date: Thu, 26 Mar 2026 12:53:56 -0600 Message-ID: <20260326185413.1205870-53-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tiny/simpledrm has 3 DRM_UT_DRIVER debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/sysfb/simpledrm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/sysfb/simpledrm.c b/drivers/gpu/drm/sysfb/simp= ledrm.c index 7a95d2dacd9d..8958e115abc1 100644 --- a/drivers/gpu/drm/sysfb/simpledrm.c +++ b/drivers/gpu/drm/sysfb/simpledrm.c @@ -35,6 +35,8 @@ #define DRIVER_MAJOR 1 #define DRIVER_MINOR 0 =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * Helpers for simplefb */ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3575C42EEA0 for ; Thu, 26 Mar 2026 18:55:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551355; cv=none; b=ICCqjOzccgGwSWcwdnSbaLDY/fePNmD7GStEEyTyGDIekaEd4XEnRAn1AMd/MlDwGQskVDFtNqx+feAC/rNqn/ectORDwCijfUnWn7hLWK9G0mgzpS+sFZE+tXyLgKswvSrdGE8TcrBUNLCCJDVbxD4WCBBtMjH1yWuV/gVhId4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551355; c=relaxed/simple; bh=UoBL10SvM0bLgaLHkjX8LJvaOP7DJ9ez9zUGRPln8S4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ABXH4CWmmsYOCFPfgOyHKcEmnoh2LrCWKWEBTpOXUizW3nzzEYc0uWuOcUA5z846V7z7xvC/ZKIgYZtvT/HBgrxocjnwBQesLFZulhY9/tIro6QIEl3B5Txz5scOss2Ge0E9ShNNkx/1pV2i8eTGt0FSU8T1XZ2WYYDcBQXpKUs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=L8NcO8H9; arc=none smtp.client-ip=209.85.160.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="L8NcO8H9" Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-40438e0cba6so843025fac.1 for ; Thu, 26 Mar 2026 11:55:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551353; x=1775156153; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v7n8LRPhTnKwHNdLKddxIC02c+MckVOPZFH0J7I21NQ=; b=L8NcO8H9sW4of9F9MeJKBdJC8oiowlq3ICyTWglXWHN9k3Nx3u7jVpflLDNAsCVemH ob3IfGDq04s0RTCfoulLiA+TZmWMQEEPycyFLGkEoXyWdyjjzzrVeImWZRetEnvcjqwi wZMtK5q10gdLP3+FA1BGilKvGLK/ceK2KdpKSRtB6qL5jdKVeYbLK+84WAVHwByDooOs WoQc8nM6f6k9uEriKwERUYgohhZQmkWXZvuW2k8PlSbYtpqMRotVQnbxFGjoPB8H4cZO c/HknMzcFkC1oLSZePB9BSslKio0mv7MpkhDhBQz5lMvjoai/rnkXmKEHrR/4mYxZ2LE lhTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551353; x=1775156153; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=v7n8LRPhTnKwHNdLKddxIC02c+MckVOPZFH0J7I21NQ=; b=LbctNLrKxAj7fYrQiWKKtQq/TGaY4Rr54IuSCsU5rqI4WxO3TEzu5Cs88IkNL6y4fU qDUc+bVZlFa48DROGYTBNlWpOvYKAcwRXDWZ4Oo7vv0srFwBfOwD68S3GkZxZK5Ql0Gj IKTCpj92nbXD82+a9pvukPgBjq92FQpKN/D+c/Tqz+ImNGsdNttk/K1w4lkPcW53HzMw nahBdPAo/1XniElyBILw4r6tAGxE6/SLiB5KIDAVwsY6fbN7vRQ+jonoO/rqpBej/CDb ioqMs1M++TWeVitILIVWK8VgYd/kfkh7oVv8kIwgtm0DHYt6aj784BbyC3EZOLVfNDmx PtTg== X-Gm-Message-State: AOJu0Ywcxxz04OLlDTOxGRCbw0UcnFYMmKjt4gkNa13DMMA0gknmI+pA Rky6oed2fELoKOW3a/xBthyge07mqIvJLxV3NtoKpvpXAXEqZOrugtVB8OKpvg== X-Gm-Gg: ATEYQzxPO2kiuc9AH9KECwl0fVZGNAJWKUFTiONKCBFGTVJRps3SMD4A3U9ggc/De9+ I/+Q4WK21G9lf7+kly+4WrZm9fBVoe2jJi0BMTazRMUTJ/ICcxyelx1ISdkFoXJDzO9xXORE1uz B6o3yC7brtM87GBDIJmiLvIgMKm1S1p2VlbVDAqtr+pHrfvs6x+jKtRbGALs3RNzNkqbnnl8KWf 3/7LWqNEvg4+Rvu1iQtgsTqiiGRA15z+bovnd2zAIA4dmIp6Na74hLFjdFxADtcIL/79EVJnEe5 esJbDR4I9PXL+rlT0FgdBzBBp0qfc9p7yj+kTH7d/FU7BEZ6fXrJDouvJaaqcAtWiyVHVkUqAcZ 6/WaWuvEHvzdUaOpswFSQBJ31545VXMAbhd9YaS984qo4uJ7g4BRoLOjhvTUpzHj/lTRH3eyHML qNrWqC88FaQiIxwkXtR9BtFZQrWvMXbGIk6ocY3OecWL7zvitL X-Received: by 2002:a05:6871:608:b0:41c:305b:14d0 with SMTP id 586e51a60fabf-41ca7049e58mr4680983fac.35.1774551352968; Thu, 26 Mar 2026 11:55:52 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:52 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 53/69] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Thu, 26 Mar 2026 12:53:57 -0600 Message-ID: <20260326185413.1205870-54-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" tiny/bochs has 5 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- 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 222e4ae1abbd..8f04666e7def 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -63,6 +63,8 @@ static int bochs_modeset =3D -1; static int defx =3D 1024; static int defy =3D 768; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + module_param_named(modeset, bochs_modeset, int, 0444); MODULE_PARM_DESC(modeset, "enable/disable kernel modesetting"); =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3ABC42EEC5 for ; Thu, 26 Mar 2026 18:55:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551357; cv=none; b=ZnOR1mFoRE4eJEpQnIwivW5opEvqmMx+/Ui/K1i7UnNEZMrM/BhNGPrBNM3MTkG6a8LbyMJ2XG8RMSKjA5Beq65kIyLk8UiPDI9xoTYuh4V1HxhbDJKOhMgMej9OlRAz927jAP/hRm9eMr6Wsh9uXriuDIqyFhTxFba6QkSR4kc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551357; c=relaxed/simple; bh=NnZJGdg19edfkOhB4skb7702Ncj5zS//C5JgtJzWrpk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jwvSQ/DkwDbRhVm8EjhQ36TirT1A+mqpbx5+ZNP9XuboZmx5bg5sV+d9yhC3U4zOAmZOCjNnX21rYMH9CebzPxlQ9jGXG+fKKXiKNUCBAJd+Ad3iAUOGtlKhQBWKPQP6/HkB7F/99Ctx9fY/wQ3Y+BcofeJg7jHoeXXccoHHvZs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=idUEvUr2; arc=none smtp.client-ip=209.85.210.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="idUEvUr2" Received: by mail-ot1-f43.google.com with SMTP id 46e09a7af769-7d1872504cbso1158869a34.0 for ; Thu, 26 Mar 2026 11:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551354; x=1775156154; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rnDJitpTduufuEe6X95vH8IiBFUBoxeB6eQQOPNaxFg=; b=idUEvUr2lqiqv8ZcQvmQTK7OBMl/6texsxh5Uoekx/VcFoajULDkxI+7l+QMb1Jx3v r77BNhLX09bDJ2HJEqCUXmK0yus3evrP6+XtHA5sIdSfQXh8JohPLbKqZWB7jbppE05J /UMyxxoegAA0hNMIIDJvqIJB5CfzOGu16iisKaTQqAU5IqBgVg8LsdwVrd2XjapAMiI7 J3cdMzzGPS7foYcg6MBFuDoLW+WImhvMMt48HUZS12/EG5Z+J2dtUARY4zEEN9DXJvQq GglDJXAIsRgLrLDgYxWGiCpZ+HD4EylYwVTtMyGxP06u+7Wf2pcrfbdsbzI4JMv3zCnV W2jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551354; x=1775156154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=rnDJitpTduufuEe6X95vH8IiBFUBoxeB6eQQOPNaxFg=; b=ZoH92HlCJ3O+Nf085SzNxS58xjJEF6ep+a9LTtzMim5hcvjZAYuh4pR7iOeVhe2/j4 CreEiunB4Lr8nXc30ZqqYbRJ0IMMOcM9YfibNGKiQEwD8AEfZrwa7AK5miqG1iZ8lH4J wLZPJ4PtyVLrw687b6zUwdvkbdE960SyF8mXRLFU029rHBtuN37Tyx0HGeOdK5JWmziQ YhFMlWh9Y5TB/vXaWxr/dMzBBXP3BQGCwGVPRyHer5fqnE/XUZrFFQ+bezlcqfBQzTmu uGEgm7Lo8W6deyWOnkR2zRTknuLUPftPvYdHjPzwangXIO6i8+gqCNZzpOuCwuPvmL/u zF9Q== X-Gm-Message-State: AOJu0YyR1oaistMA7jkFfzcw/Mw/SZnO3FffLMwFgQs773l2nCQIDyNb 0TJJPQuO0diazYJDdkzZtdEC1rzLmuPzhmC61upC5vP7g3XwmhcOa9epobNsiQ== X-Gm-Gg: ATEYQzyCaxg5TLPNNA7h934SD2jYPGcwZ9FB/dbsW8+F6Br4TDxzQrhvppIPbzs5OW6 mjLettI+sViLo9hK8/wPVZgK2a0/vd7y+0LljNdPM4IpcK65gHO3XXmPyZP8f5L7+PQfUswJ7zn xKw1wslSU9MWOP2dwuVyh3twUO9COwWJlcxbdSan0FBU1VEUA03NQL4rDf1pUtIeMAdqGBMLO2R YAKNK+FZoi9XcMUCjj1xaXZprtbMKBGnQVT94prpWXb9CcLwqP6gkaAxs5Ofd/yQcdewwdnhxMC Oil5Nfbm6rexk0T1hKPzKrxnSEc5bDcEfWq/9mO+tBSWD0wTEMcQge3+a8o4Nzhnh82UuE6LOOp v7UzlKNYirSPjE4qaMWEVnHTP9pST/H4brhHuHKaKG59gahmCiMWKB8VplTzIVV7TWTL3HsdqE8 ncx3kjCD9lcX0MTcr45O4dj091ZMFdavCJP8A0I/wEw3hXhmmS X-Received: by 2002:a4a:bb88:0:b0:67c:2bfd:24a3 with SMTP id 006d021491bc7-67e10ce7d8dmr943404eaf.20.1774551354565; Thu, 26 Mar 2026 11:55:54 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:54 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 54/69] drm-dyndbg: add DRM_CLASSMAP_USE to etnaviv Date: Thu, 26 Mar 2026 12:53:58 -0600 Message-ID: <20260326185413.1205870-55-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" etnaviv has 5 DRM_UT_CORE debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs as well as plain-old pr_debug()s Signed-off-by: Jim Cromie --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnavi= v/etnaviv_drv.c index 08aca9035fc1..ef4423d4987f 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -26,6 +26,8 @@ #include "etnaviv_mmu.h" #include "etnaviv_perfmon.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * DRM operations: */ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F93742EEB9 for ; Thu, 26 Mar 2026 18:55:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551358; cv=none; b=Db801hBRUkesr8Z9V3srkfuhk+AmJisRb3PI2N/NZ5Jj3ScALTS/4H1eyXXrHVX98RKzDfrDNCxHK/yuEGheG3jdvkjaAsp/wgiSoI5J/voqGobrpV3xyeD5FPMVFi1dFFRRicGAIJoVsYF17AsRPovjqJEpijjdOziSeCLwN3Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551358; c=relaxed/simple; bh=qPOGx2VzOCCLF7JIH0b0UPZ4KMwALEvqQb+lMoSsoks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m/xpGVVM5KDgLOFOuRwFqsaRV3puNhAIA/kvZo/G/kqWLcJPPQAVvPdb2rJHbWDnw39OcrH3U8QNp0uNHEpg8Mh9bPqOK39dVjAkXAokDcu4ZSs7t+N1WuSrWjjL/wpFIyx5f0GABmnGCr+QfJNOVkP5hi1Cs4ZVM0VRJ51Xyac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZhrzpK0j; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZhrzpK0j" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-417571c6083so747158fac.2 for ; Thu, 26 Mar 2026 11:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551356; x=1775156156; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iu46xPMmyhe3j2aI3EiB0/ULgdgDrucXaD4Bb/DoM7A=; b=ZhrzpK0j9rPgBleazrO3edX0+YFpDLJNzI2Loc4RWUqnIfZ7yFGDq3if2bhD0BJMby JzP4ye7goerq30MLUJsJtFvxi0//Hw+8Fs3SHFgm1519SAMs3vMXCmCGtfL40b37eGoR CmmzfpZ+Uxm9wrgDA77sn//0yiaigH6KUCvhRFdRP5pSf+LPQwvko6r0GkVpy6DEvIKc quwpj5BSQf1KzXfQS/QDn3Xlp6tdP2HWgzj5YUdGx5QY++aBsCVgzZWmlLzVhhc+gkUS TlFl6U5ZMAdYETAKKr477d7lCV8L5u3hfFwjjn2766QJvjXa10Oj+GMkP/g2c7GnYfZw Ivfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551356; x=1775156156; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=iu46xPMmyhe3j2aI3EiB0/ULgdgDrucXaD4Bb/DoM7A=; b=pcYuqZrH1Xil63cenyz2jNjQCN99/45MlQ2Xa1C5LTV7Vdq61NSSd9vCDsxgINontd l6AcLL/NK1pZ015D9fWqqJV6hU6Ac/DGEB6oK290JHDdynnkuc7QGHR0KYis0x2MmdAZ Kw1Jmr6L1ssdVRNOTokAy2IUQ540QyH/ZRsGv3ZyugfpgmxHf8eEbIUVcs8UPhN0lfKP NWMSqle3GVPONPHNOqogdP5Qx3Sz69tybJ7OpLZ6Fnn0+wfFEaNkYm6DNInnzd0n0/Yo FWB/PhqCSPfjWE7fOfu01ONJoC6jYuHSLT0W9joS3tHWjhqYfuc9m9Gnb9pslNG8SkYz +xug== X-Gm-Message-State: AOJu0Yx5I7mPNFE+dnUcJenFF7ktzs0CjEGn294LIulAD6q8wehxj/hg /ZVGyuTORp4z71HkEgU3uVP3BaE5xCeyJwmS+MdQSGDnFhnEBLeEPF3dSYzGMQ== X-Gm-Gg: ATEYQzwkBHxjHSKAZI+TvCUM+mrelYCsTGm6WgwJdezijSt23zPgm52FaSNLm4S1uSS 7xAHpSEn2WtXDy4/5dizABalIh17gbGqOEfDGFTNZpGXddES9dicjja1AM2Q4yI51BtVIkc8mu/ 69V/E4IiTfRETIS7pkQg8PHCKB8TsnxPdLa4DWwTiu+DNr42scie609Nnyi3IbdDPspLVMGvRmH ea0YoJo//cUZ5fHq7eX9BNj2ZJm6C+6k8Ib/GJGBOuso+PhQ/nWbrN7WOebBAoG9S9z6JBzqo2+ HPZVJhQCdrGPGXi6qZuGzod5lUPKgEMEBn1sRY1Q4vjzMwM9YzKbBpdBQ/QHrW6QJ12lzlm6v45 JPdN0+52WfVZt4CKqlvCC0v0Nbe4g8PwOyNsMtm6aWf1hRKwkkq+DH4LVaiVDozR4SD+kkjAV+f 8rMXgR4PXiPUUEG9dvHqkVTMyg/0Z6dJAFxL93cN0isjw7mGW0 X-Received: by 2002:a05:6871:728:b0:3f4:fed5:d88b with SMTP id 586e51a60fabf-41ca7078b7dmr4565478fac.35.1774551355832; Thu, 26 Mar 2026 11:55:55 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:55 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 55/69] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver Date: Thu, 26 Mar 2026 12:53:59 -0600 Message-ID: <20260326185413.1205870-56-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The gma500 has 126 DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module has class'd debugs. Signed-off-by: Jim Cromie --- 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 005ab7f5355f..92b18c76b44e 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c @@ -41,6 +41,8 @@ static const struct drm_driver driver; static int psb_pci_probe(struct pci_dev *pdev, const struct pci_device_id = *ent); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* * The table below contains a mapping of the PCI vendor ID and the PCI Dev= ice ID * to the different groups of PowerVR 5-series chip designs --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f48.google.com (mail-oa1-f48.google.com [209.85.160.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C14A3A3E8C for ; Thu, 26 Mar 2026 18:55:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551359; cv=none; b=TsiW9gag78EqzGYprfh0SzEATriXGevvNWse63WYOuRp657JDj9SrRt5tUVlHudvvcviBaOJGyhYX1GZnI7ywl0mTJh2Xt3fv7buJsSJdL8EoaVSgDJaWd4ROf9YJI+FIvoMmrZpdCEDftULTbBDTZ2JfX0ZNtZ5w8wIPK8emRY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551359; c=relaxed/simple; bh=D7C/me6Rf8n1ctUCXgc4tboTd3BpbTjff4eXSTp0eHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sTajY90igR19RV/5uHGOlV31dlFfAUjMLRwDeq+bi+IahKTTcPSeSGqbO6M28S9lcPvKFkX3KHcAfHzPGcN/sku+cUbVleRsOMUGzjexK7T2e61r+p7sEqhKT6yuguGozXtorO8ucj9FFS8WkbOoVIzaTpaMBSwgubhxNEtH3Xs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=fnusru1k; arc=none smtp.client-ip=209.85.160.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fnusru1k" Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-41c5a81d4b1so1626541fac.1 for ; Thu, 26 Mar 2026 11:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551357; x=1775156157; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QeA7b49GNmqPBpy8bbweHTxpApMcFe3iFgz41hqVwCU=; b=fnusru1kvspwikuQL196TuzpyQ3zj5eeSJavESq5u/GyGU4dOSibswlfwhst3txVY3 YdOtGw2Ih1VCVFPXV1LK8SFSS4P7WhUR2cubry4wSUzeR61M8hKVm1yzdMJZj1wRiWzD /P0tXjhZrup1cp4SMRRoGtoz48w2sMavWSK/33ClWdfYp+A5KQR/SZygUiq9+jfh0Sp7 Q0fzGZxROHSe+gklbwQ3P1knPdHwxxa9g8htWsblHk7HUb/Rs69j8Vqy7I4VVvLLWc6w nGjaCmB9vdnJupNzmpn7H8GeFyWhAWsjks9aHBmKV1zpnotRcSzIPQ2c+JZ6T6vrmSOR RGhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551357; x=1775156157; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QeA7b49GNmqPBpy8bbweHTxpApMcFe3iFgz41hqVwCU=; b=C/MdpRtha/VDsXk+tAdghjlhNnMz+fieP6JcT3XgJ1r1sQYQXL5X7DKBk7twfY+VKF fd8x1KQe8opDCAn1iEgq6K8SvQYS1b+0YuZ57aHN5RcJIJYPF/poBDvzJQeRLFFEQyI5 HE3WVznC4t5cFx5R5z8gUvi0CT/9jj0dOhb1cck5CH1GatDLC8smD6CcKyTJ3iayqMCS aY4fk6LbYQDM4bjTo1VRUqzuawtrbbC/4LFcXrpXfR6+jvyoPoJTi3ZPVcnwUHmEdzuL apPJkKXuv2woVAtU9O7l+Eg0p9E0cIZASj6LlHT/RrGcO9JWDI5bVVawYHK0qhNpaq1M 4xHw== X-Gm-Message-State: AOJu0Yw4ad1mWvCocPSBBLrH0ZUonCRsyS/5zwLTq4oGz6DNC4s29Uwv 1MoXl31N2fP3jib9E8vvDqgUBTqlo/wpa9skHR1WERJiMvgCYsqyJRuI6PkmxQ== X-Gm-Gg: ATEYQzzIGkCD/wF6809NByk+VB4Nt/5KVyg+/F3z6sa0VFuVcC/HEM9c9AoDzVSSp/e H6L050isK1Cm6rHaKHmC+TksKpfjm0eAHIi6SJlJvXooGALsGjEso5Ie7z8QxV94ALLCz3mmARj YY+vuabgb6w4Bx5eVM9SxwgLfIRqo6A9kucsD+wz5NE+QpqX+lfxBG7cU7CSIJyeetC/h6nzeTY KpIfg9D9mzy7xATxOkVOKomWh+tKdlUbj8HnwQoQP4lDgZI2IHRAQ7kXOOqdUzKAYa8A07zr5DJ yhIJaA9xRrGbs5eiSueZdnziD+FN7YqSfmDdpDuPy9xwR3ij+OQ1i4J/JYHRJ+acc2OblF/BHH9 cd/ElrTJuaPmoGYcnmU8Af1YXFhmle0Gy43y4MSfBeBNuAUwdRaDQoVlaBnZb1C57cNgJJfLJ4l 08Ca2UkyXakKNlQKoSRPGHlQMI1Lj2b55esWIBXhb3gw6d6+zF6/jCeETGYWg= X-Received: by 2002:a05:6871:4e41:b0:41c:4cd8:4e8a with SMTP id 586e51a60fabf-41cd7bf490emr1301986fac.15.1774551357153; Thu, 26 Mar 2026 11:55:57 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:56 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 56/69] drm-dyndbg: add DRM_CLASSMAP_USE to radeon Date: Thu, 26 Mar 2026 12:54:00 -0600 Message-ID: <20260326185413.1205870-57-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" radeon has some DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg about its use of the class'd debugs. Signed-off-by: Jim Cromie --- drivers/gpu/drm/radeon/radeon_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/r= adeon_drv.c index 87fd6255c114..a7133fb6377d 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c @@ -254,6 +254,8 @@ static const struct pci_device_id pciidlist[] =3D { }; MODULE_DEVICE_TABLE(pci, pciidlist); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static const struct drm_driver kms_driver; =20 static bool radeon_support_enabled(struct device *dev, --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6C54436359 for ; Thu, 26 Mar 2026 18:55:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551361; cv=none; b=Idx/QiFtYzXVM02fFC2gc50zqbEDjWYrzAM5CbStOOp+IlagQ3qXn/EKXf/njU/kevU6aIkycK4txd2EtYVWHYGYi1sJbXAa6YCxDfCZewHQmPbsT6I1bz84fngqpK4pIAwsoMC9yLlq74Ayt0pmT5hYtBVUaD20uuQtIp6ckzM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551361; c=relaxed/simple; bh=wgGQRuJ0rJEX73O+CRHPJbJq3qG3/Wx7z0y+q3IWlk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JwOAt/dLHAPR3UaZAr+r/Y2tFwzXcEkDLyDqU8Fefffr5pHxuNCE36zrfbwl5rZT5MNs/bgkYyUlDp08epLdFviQGteCUOJTq2YXrAbICwjeJeULCz9aazuA7SPFyvePZnINgFycKn7vbsA9hwHbWdp+PmPs5ebhAgN1DaN0b3c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Vs3nYDT2; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Vs3nYDT2" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-41c0aae84e5so971207fac.3 for ; Thu, 26 Mar 2026 11:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551359; x=1775156159; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TGwHOHakhEHhnxVqmZq5DXxfR0MylvY9XafKKBqzVj0=; b=Vs3nYDT2/6Vm5vn8bWCnEh5PzbOMD8oCNgpMwTjc+SMws+bjGPVS5FAoZYmc8umfiu 01A1gmojtvZS+5UTvyPOqC6YoRZLsrg9I+WrQDR3qIIN//tQYuiZ66DGPjxQ0EG6mUoB +knUsAciiHaEQQ6DPK1G7IfD1ap63g9M033DxghqQGOSTU3361PfBSANIv5WJUZDYzoM WHuPFK6ZxuwcoyIPrvUB9Wn7SIYJSouPdhnUQeVQQSBIv/kab/MHQ81WJkWekiWj/Myi ZWKwSmU6FnoIB+pjnVSiry8CTy7Vd7UUqXILQegU1Xsm+xty3wsSnv3eEFphG+aOFX8d 9cIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551359; x=1775156159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=TGwHOHakhEHhnxVqmZq5DXxfR0MylvY9XafKKBqzVj0=; b=sniF7WrKptWiRRFB8KZFRtyejfIY/IhG6BEwBZyz1gz0161MkvUanjwMUlhs56oTNM bWb0r1RCRAERaEaO4/95aLzgeVW2VSYmEb0mrsf/KEm/CIqiOJ1UpWxJVY3x7uuGuHug zw2B4HzKzkOsFv0QWebc3fs9nXmQRPo/GKvaafT+4Q6qvXBRJZLWxBF6AQpmDXssiFsq 8oEt4varcttXXonKzQtFGFtGNoUnZRg5I9EbawLKdUUrzT024HufuN/Pq+5tzPd5oGt4 SCgr5R+W3qq1AxtP4uvF1C1kQdO3we1Hh4gWs5cKjmAzel4YY9qFC0ZFlnmW2wNrZjJn HWOw== X-Gm-Message-State: AOJu0YwUR9Fu1JiKxRJr4o5sU8K+9jYIWcgt5nOCipKDB09Y9u0ajnD1 i+wqYRb17Iz6ScdaS3VAl4WghKwTbHJ4RDlJY9BCK0tvReama6MY0pQTkoomeQ== X-Gm-Gg: ATEYQzxT5Y+DbBtoJAt30Fxv7XSAJ3LGPN6Wpa/l4izK2otFZCTnY2Q/yIz9shVC7/C FeH+mRVREru6dk+idvb9fH7so+xWb2NpGp+XuOB3tY7JDIArMlu5o/SHKbtCjsLti71lzxB6oAH son01lIaoki3TYbUCOMYzeAz2nCWxN4FuTxohtR2n7W/Cy18g3jScWU/Iun19GMYgdI/IjH0xf4 ln9w4Tbwvy8qzoZBKR9KDJlElfURGF872Pv4DbleEK808MJTOkVswLSy5YDS48cXNqw/VKUCzhY Paw5v4ZiarN27sZdrK92OtSUovMrDn+CULiJx+0uXG+Bd2n3AOkO7JHsvURgdUvXgAkekOgk+xH dCkISaUvUlzVsmob4161aU0qmuXjwSSfY7X/1pN0OVRIwQCHjhEURk99Sl2zBt7tC+H2s2qzz7d WghQ43sorWb1hgPMnQRUYI6oX8nBXaOCOsqdAXuOeVfOi9pGF7 X-Received: by 2002:a05:6870:458c:b0:416:32c1:4276 with SMTP id 586e51a60fabf-41ca7005de9mr4737216fac.28.1774551358609; Thu, 26 Mar 2026 11:55:58 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:58 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 57/69] drm-dyndbg: add DRM_CLASSMAP_USE to vmwgfx driver Date: Thu, 26 Mar 2026 12:54:01 -0600 Message-ID: <20260326185413.1205870-58-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The vmwgfx driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/v= mwgfx_drv.c index 0f101aedb49a..d877d0a8c830 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c @@ -259,6 +259,8 @@ static int vmw_probe(struct pci_dev *, const struct pci= _device_id *); static int vmwgfx_pm_notifier(struct notifier_block *nb, unsigned long val, void *ptr); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + MODULE_PARM_DESC(restrict_iommu, "Try to limit IOMMU usage for TTM pages"); module_param_named(restrict_iommu, vmw_restrict_iommu, int, 0600); MODULE_PARM_DESC(force_coherent, "Force coherent TTM pages"); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f54.google.com (mail-oo1-f54.google.com [209.85.161.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B78043636C for ; Thu, 26 Mar 2026 18:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551362; cv=none; b=N2aPX7QPK4WFIx4OT8H10uCTU7b70tJPJskEqaxA0THfYqRiC7jMYfXWxlqIl1NV7oVx0ls/Ll78GtI6Gi/lxDU++xfKSVH5Ch2FU1lZawR5PNmNd0J4QoHHEKs407AOrZ8aGk4uUL44mcSw2I/ICZJJHv5Ca4Ceyw5zqoowi9I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551362; c=relaxed/simple; bh=bqWZYtd3TP4jdKGtP2Z9oJAYm/sX5AdsS0B14OGKjIQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BDtYx1XvWByiGQTVjuhO2HyUOaCjRHPhlP7TQHjX5+B1UdF+BXVdjTbVDO5DCA7SpM6ZCTyjklBiXPuoNujn7aoam7QZKfN4tqwAYgzG8GmMt/7u0qkL3Eq31fzbLRaOuhgO+cq4FSyzxwovM3/DPEqRN6/Kn2k63NjyYhtdQe0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=c35leRE4; arc=none smtp.client-ip=209.85.161.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c35leRE4" Received: by mail-oo1-f54.google.com with SMTP id 006d021491bc7-67bb04151dcso794370eaf.0 for ; Thu, 26 Mar 2026 11:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551360; x=1775156160; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0ApYYz6FzGjXUWRVflTKhpBjuKsTkjzi7xxuPDPmj4w=; b=c35leRE4Fg+fqjZF/1D9A0DmBhmEbH63WghxfqXqI6Rv7wPIE8AQmxaQikaLbgNDsg FOPICcb9vL5bueB+r5HxlphKFCBBlhyZ2/SxfZRmKZ+PejLvPAJRC9/LxdL6uEBt7JqH 7I+bv6fSg5RHnyKPkp/qN8mZ0LsPmDkJErq5xweTad1NkpVoXrtM9JIQXGjbsgVDun0l QvSTqvRein7XyRFD2maA/FKgNTTpJHUTYgLZyW/UooncWX/sNijyCodsvOiAigL+4NrB hd515u86446IlyWzyblayhWlCQI1qEUCn8M1qptGgiQOBZ0gE+fBap5DYMY+pi9LbUz6 NrVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551360; x=1775156160; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0ApYYz6FzGjXUWRVflTKhpBjuKsTkjzi7xxuPDPmj4w=; b=hyWX6pjo/XybQSndJ7hJ7J7R4Q7rYvMZ6WusC9TWhAP4dKn1q18P4YL0f0Yz1RdwAu CVu110NThTyddSc5nhMbaFTrAIvXBCPTLPVFn4H6wHwszE8zCkjU651jiH6q00X6aZm2 amOE5pI3xWyoRPdoG8Z2qJsRC79bUoyg1UngC4Z2b3WpL+YGH0enokyDSGus2/8o0GNm jA8Vx61gIjtf6HkSqNYnFhgYfnnONSQB2FGRJIKkNJQBRWk47SpGq7lY4foXnsmXuB1y ZiZp/OyA0f8n5xAnP+b3tizLMUU2B+01iJHxEUdv3lVlxfr797YX/wVQ1A3zIJ1J/56x iF7Q== X-Gm-Message-State: AOJu0Yw2LPSIs+ooQNOwzvtK5FFm+7ocMEMonrT3kHHMDl1iEZ+9F2UN 6ujrDEyGZBM0jQVHGnTUmUjmfmIwhCHVdg+THT9OCCDjY4oW5G8vPs8bxap4XQ== X-Gm-Gg: ATEYQzzqBodMT6v3rbkmi+o3UxkP+MpXGhLj5WeimXmCtVag/N5yMsj286554GuSxG2 5GEBv9qNVsJwRRjEW51Zr0hHpdLwllNBcCqCGZhai4pq30IwWjbmK3+tHTbGup2BO7kNQuqQtZv XJconQ6H9uOF1qVz07zRG7oKLeuY4/kTQlNNxqnHewomb0r7ME0d4FITT6pLDd5WTJasvw7BC2G vr0F1EYufadtNnbkssOcEf/23Ou3CqfgjPGMYUCJ71LuMjpeo6h2NWlycz092S14TvLP2idfKWg WbYz6Ke13HnQ90FtVD8hfCpjFcnTFspRQ7kKVSNWbPzjs1nJ0j96SunOkJsW82u2sRoop5/yvGq weNKxSZAbt/kD+eXEieVO7Q+gMsedOhI5tl8hu9ja5earvKU3eEjJqEAr8ldsnMjAQbdB4anb2R dkcMqXaUL1TFR2JMjK4B8Rme65qUlH6Jo3yGWzCgOxT2N4JGnS X-Received: by 2002:a05:6820:4b08:b0:67d:f840:798f with SMTP id 006d021491bc7-67dff5a3b75mr4157635eaf.69.1774551359906; Thu, 26 Mar 2026 11:55:59 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:55:59 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 58/69] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver Date: Thu, 26 Mar 2026 12:54:02 -0600 Message-ID: <20260326185413.1205870-59-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The vkms driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/vkms/vkms_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_dr= v.c index 434c295f44ba..02201460859f 100644 --- a/drivers/gpu/drm/vkms/vkms_drv.c +++ b/drivers/gpu/drm/vkms/vkms_drv.c @@ -40,6 +40,8 @@ =20 static struct vkms_config *default_config; =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static bool enable_cursor =3D true; module_param_named(enable_cursor, enable_cursor, bool, 0444); MODULE_PARM_DESC(enable_cursor, "Enable/Disable cursor support"); --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BFB43C73DF for ; Thu, 26 Mar 2026 18:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551363; cv=none; b=Q6A1qPcpgk6tOr8wrkU4rQsr7S3P30pLm2r9lXV1h0PwY7UBHpCVgkpVXPB7clPfgG45xMsAp5SqhIHh0Uw4p1DSbE42rD2Bd5ScBko8PwIcfIyNCBMyo8vRh4ycG3B71lffOP66wk6nzXWn4rog9maV5FlqY5awpPGfTq7L0kU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551363; c=relaxed/simple; bh=pPPq4WfPkkchHNA9UKv34DNMSa4sOM9V7qZhlO4byZ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mY/f/LtihPYRLcZMB3nHIh9o0aIGhwQwSso9XWqSg9rOkrqNKQbAhxPNoJ53TLmligLXZZyAYyd92CxmXQUSArR2LPdpg9u6zfcne4i1FAd4OJFfzejXcJyjb4y1gUt21hQvI3YADds/kdBRSNr0HMqysRpN0UPGlIPPX8lDP4Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=biYhDEeY; arc=none smtp.client-ip=209.85.160.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="biYhDEeY" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-41c0aae84e5so971243fac.3 for ; Thu, 26 Mar 2026 11:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551361; x=1775156161; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hkvDWdY7OmvSXSpjnEXWJTz2q+ynFgJjHoQA2h5Gn4E=; b=biYhDEeY130pjzSBXR2iHG1GoiEcBgNnfA8xy296B8FctmvVkYwQr3P/jxE/yo+n+F lQa8u75u80Si4dqxNRYiD9GBfm8nqEAs6UpAS5e0L+cVlerRlcUpPictuDr7tl6PtCy7 3dWxgQIzhe8kH+Xx/HbG0zAEJkEDz3q9cHzQJBWVl8CHI15b9lFKrGC8DHJThGqJb0ZD lK6f+oRf5KF4lFubKBA4HJ7VO1OAhHAm1aJewZ8BtRYQYoeXG2eP9dZGoxAuEL+21zYH cHdjdwrOBJH/SacqWH6iY0y3QECC5BCS6MaIB13I/u5JrGjt/FxXpob1l+dZtimDRRGo N3nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551361; x=1775156161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hkvDWdY7OmvSXSpjnEXWJTz2q+ynFgJjHoQA2h5Gn4E=; b=QXeQ+LwBiTnUkUwO397PBQKLtgmvbDNf9vG7U8qCZ+G//NHDfvhAYhaG1hjwUpVHj3 N+QyUhUiHgubd+Lu0ecW79Iw6D3DB/mHan2U4q3o7Qm+yQaK3ZrRCQLwiTS34KjjLW0i orvYFYTz7A4V0MDgbPwq4zDP2GH594/OHOM2RcBlWhjQrYckY12xSu1hIBUgPlFPNFcY f1vOyBC54uXiVG5aNh4z7kpULMx78hTMqImBNJabDJkiR2ctK0VKjCk26gSx+ug1WJ9U ZVK2mmV0Tr/bqWJPypPuXD77iQfSVWHxN2E+880SoocJVKigd+IbdxVNyQDNtZkkGjkp K9sw== X-Gm-Message-State: AOJu0YzJ2nc2JybsEOQDiIWxFGGI0A0xoeS1NgYUFCBRA/lqX/b2rgUy boxq9+IUwh3D7KI3H+3PnJXkRdeQkIY2lLowYhdz8KTv8kPKzMBUZJNRMwQsjg== X-Gm-Gg: ATEYQzzE0+8+6JTyOOdy1s4M90N37AuU9M1rMVwKN7erVuBd0ys0TYE+fW0UT0a56+3 nuzbbsMhJBQLs6BjLrq3qJwuFEmnUtjA2V3eyHlKwm7OJvRjIU/oLOLoSeswAwaRfnS0kOecV/A llkZAZcGTh//AcGH+8MqeL5/XhIPqoNeqYxfoL93DGqMek0UVmWCq51yqxiiflv+t+MOgVZU7dn 9rV6zNZSl0flbg1WxHQLv56tv/OzqRpLepZmcHzIbdSw8a9SXUGWc1+EnsQitz3NJqUU8JSXm3H bM/KEFBa2P2xYs3WyfbyweKGQeGY5WUWLMiFEuim3ONtPRCjp25BImz1U3HMl/vjuFFZkBH/TGP pRgcgVG1vGQRa2HBeREtgy5WsMJoXQEr/4sAtI2AcgLWXwb0+Q/Ug0chZqZKRWLlqxR+kwD8/K0 s4ovaKNQ8uiz7UooookzWot7OG1p6+8YUZmzxFYIZXFmti+RGH X-Received: by 2002:a05:6870:b14b:b0:417:56da:593c with SMTP id 586e51a60fabf-41ca715dbeamr4692008fac.45.1774551361348; Thu, 26 Mar 2026 11:56:01 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:00 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 59/69] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver Date: Thu, 26 Mar 2026 12:54:03 -0600 Message-ID: <20260326185413.1205870-60-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The udl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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 08a0e9480d70..58fea20a1e81 100644 --- a/drivers/gpu/drm/udl/udl_main.c +++ b/drivers/gpu/drm/udl/udl_main.c @@ -21,6 +21,8 @@ =20 #define NR_USB_REQUEST_CHANNEL 0x12 =20 +DRM_CLASSMAP_USE(drm_debug_classes); + #define MAX_TRANSFER (PAGE_SIZE*16 - BULK_SIZE) #define WRITES_IN_FLIGHT (20) #define MAX_VENDOR_DESCRIPTOR_SIZE 256 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA18A436368 for ; Thu, 26 Mar 2026 18:56:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551365; cv=none; b=XlXfBQVmod96b3kIASHvuVeAcLXtBnxk2TcFFKf2VPSfrTZMPi1Pk5llh5P7WLJOUfoY+10JRlzV28O7X/689ayaHthuT4OZo2A0OKyOzeoylUp7C3MKs/uTKRA9LcaiMWGzVf2n+aZutfWTl5jaUwvDrkLMytsDC1jRgGhxqDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551365; c=relaxed/simple; bh=/i2gnOh+Iv8Il5o82gQTDukemt+gfONU9mRd2AXIyVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j1XtIm2MFrm0hJBm7RvWJvIMLCbNhM52cLvUWU7Mt2XNJR/th79CxoNgXeg1IG9jw2oPrzJOPXJ6ARI3Csc/WFlWLxnFJW6j0ndU2G0IjTCog+iCr2XV3X6As6vJIgDz9hJX8ndtKL8PBr/maqaJ+m+/BAhNKe2zTzruoVMoB8M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CGOD2WKr; arc=none smtp.client-ip=209.85.160.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CGOD2WKr" Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-40ee9b945d5so940798fac.0 for ; Thu, 26 Mar 2026 11:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551363; x=1775156163; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hVWjZWuErU/TT0M/gLtU2+Pv2Hf/DF/3aPzw5cJbYqU=; b=CGOD2WKrAQmwU8CYsyXOqVkCFuxPzwov3JAzlCf+6ebZ5VyOdEu1SXl9mwIrCA1YRE nWzjfC5ou9KGzP0lvZephQmu6XcKjBn1yRD2kZKQApM1MkzMiHMJfqeHqFDdPyrH6qyf MfMCkCO5HjIIs4WPdUTNWwt/oPuNlKMypO7u38jvWdnrV4ZPeUSw44Bni6wPBTsdTrlV UrYdG0Ix5rvsMZaoHOoCrG6kwCpmul6ok3qm49WGqE2twSpSTDuEHWfDpgTMpHZDWZ1C wJZLnjjchN76FJpHlf+usTr9PdCmkG0UwCc57THRnU+w/yRIRyFdf/t9cLxIdfxrCYyF xs9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551363; x=1775156163; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hVWjZWuErU/TT0M/gLtU2+Pv2Hf/DF/3aPzw5cJbYqU=; b=dMR4ZLIhjGCHKtAv+JFlJtuqCEYJmJkhQudwNjKrFhxy1tQeMVIQ8j4mDNtDSOAwwQ e06omBb6iyNahIiekO/t0kyLBbNmkU2qhX6CNw+HE6MAQztKCtkj/y173ancMqjpsv27 2mtsRnvwwoE7F3CAmyDX1TM1tnNaDJbnESNFVRUwahbWQXgrVvnG7zC3Mcmi1NWI5sK6 JsVjH+8k+hiIlGGIFRMC2py3z4kHzsOWpCRpyppsKdvy6EGcknW73CwCw0GyVlXVo6OS 7G32VPkrvHGMcD9MNQI018zmTnxnKANdbJ0QxXIG6kbL3cIwhK7TvT+psvYczFRC8utW rftg== X-Gm-Message-State: AOJu0Yx2I4NbJR6T4ozhsJNYiQrdC8C4qSEDglCjqgI+TzMFsHK4fnnu dUDFatEUxnzaEtMdEgI4xQEvd6OPPZEx3XYDhszqc/pHFo9SdbsdzehblR703Q== X-Gm-Gg: ATEYQzxJapPoSaKw5ZSzSN0NLGW/H8N6NxPpj93viIY2ZWXx59f64c0rzcdx5Hy1Z53 A6B6k16YlZx8WEXIy5/1F7JfXI1P3F/OEMm2EFHUmA4zdtu+aF6BSdP7DHM/N3lRQBq4JiUzbII GwCcu+5aaAIZBDSOxSyOohkOXSOpDiqe87DOB+BCHpFXBmWaLgJIOtfLWl4WoJQiWLMuD0NCvBH vHD/mDhfrh+IijCm7lRNomI6r50Jin8i4LIy3KuRFMWMDP2nd+56bHKPscHx6JUUmUxl4475fNA 3gzfVbCVZbL/iyC3h0bwbVpfpMxpV+0HLE0wQuaGrYZ1IEXlcz2byMzgd4iyjsj5cMnb6dS5FUe efKRiLyn66utwsU5tJdQ7dpc2WtjW+Xyh4i4H8Eknsk9l0vlVCdvAVxifoCa5zvV3a5RWPH+5DS l/DMED86HqFFgvrvr4h5oRd0PIC2uHMh3lr23Av8aookRLBhww X-Received: by 2002:a05:6870:6486:b0:416:414:bbd7 with SMTP id 586e51a60fabf-41ca6e689c4mr4624024fac.21.1774551362660; Thu, 26 Mar 2026 11:56:02 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:02 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 60/69] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Thu, 26 Mar 2026 12:54:04 -0600 Message-ID: <20260326185413.1205870-61-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The mgag200 driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- drivers/gpu/drm/mgag200/mgag200_drv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.c b/drivers/gpu/drm/mgag20= 0/mgag200_drv.c index a32be27c39e8..02a703e5de80 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.c +++ b/drivers/gpu/drm/mgag200/mgag200_drv.c @@ -28,6 +28,8 @@ static int mgag200_modeset =3D -1; MODULE_PARM_DESC(modeset, "Disable/Enable modesetting"); module_param_named(modeset, mgag200_modeset, int, 0400); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + int mgag200_init_pci_options(struct pci_dev *pdev, u32 option, u32 option2) { struct device *dev =3D &pdev->dev; --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com [209.85.210.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4715D439004 for ; Thu, 26 Mar 2026 18:56:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551366; cv=none; b=nzWk9EsmBPMKXtOTQ/m1TrAxrPCnQ7hI/iIg/5L2q9+zVPULYkA7RchyYkQfnd5wu0WeGgteMKcsPLcO6eM2yTFL2PLEqRXFGkZbsgXj+neDxoKCLRzNIB2o66RZhfKglCFHFcAaIDVFC5FEh4eU/OAD47QuQf4OI09FWsDobFI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551366; c=relaxed/simple; bh=hGRbIRSdFeuc2GbmxYU1Ww/NexQD+bIaRf1s1JjeEYo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E7E7rf9VVbbVfrdoJJd0atsxOTA9CbCU2GxwAxhsiuox8cNYS9WyccTzsTifLoRO3VbN1CQ9/U5p1j86nzoM2Ag5HJg4c2w3snwyGSWaYJDftKog9zAWZKtVLWtSUPG+W+LViZtWwMYNyUHxDFxOUgkzv/gS+NDM3nZqLROUU3Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=YMgySkkH; arc=none smtp.client-ip=209.85.210.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="YMgySkkH" Received: by mail-ot1-f44.google.com with SMTP id 46e09a7af769-7d751ef36ccso747310a34.0 for ; Thu, 26 Mar 2026 11:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551364; x=1775156164; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jUW+eTRlaAbHOLDd6X1oNyvzhDfkwQ9M9VIyPQZn2Pc=; b=YMgySkkHgAL01Pk8V1jI1Ps4+G0v0eFy6Ct4CDsa7cot3xflLi7A+t7MkyMPSbsyoV j1FpXYgUmvkZ8LTDPNEbeMPmwdUy+2UNrAzD7ecPBzIqPAlaftibDgTIxzYV+5iCsu27 c8F2/fEko45F+4VQG0rNflecodWhC6bpI3xUow2hIuQ73/kJfvtAZOMoIJglzZc+PIOq 10+xCY9YUhZu7WZNKAgBaaIh6tVA8Yv/9IEhdLgKxMLXsfJL7yPFo4iWa9Dafm8pnUGs c0e/yd0BTgxoibaVHtTqehNJ+0ifTsnVv8OxsBWg3TPTDzdDTDw4SRnIv+HGuINCHPIr eAFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551364; x=1775156164; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=jUW+eTRlaAbHOLDd6X1oNyvzhDfkwQ9M9VIyPQZn2Pc=; b=jEeWpywK9aAr9vRNVYze3WrnhgLibwNEvb/hYH4PlKYfF2+SDeHW4PfeF093STMCTk rLKebapbmAsC3O/a2MUonFvpY1J9hmVE0j/hDWe+0EQrY/7ICCyMns0qYggXy6th9GKM OIRFOrDpyhdoBX5zqO0CXgG5EPPGQfowcyXTHLb+lRbgHzWPTkBaFJhkkJ5Ya+UfKFGD hrSh7ADUeAoGuLMVXjsk1tixbEBJMZsymG4H/K8iJGgrXQRj+OFkfRMOSGGHorgD1eE3 q6srBS8cu1llUFCo/yhWNfISqTLwmSMzDchB9BFeyh8ZjMn58pUhY6aFyzmAR+6AVj/I hhBg== X-Gm-Message-State: AOJu0YzfL/uhq8VOV1fuCofVbYeaSswPPL0BqTNZbhchvBChcr6t5MGx 6FDZvmnxJqZd9IQMuANj/ZtLHA57i3a1C8mTEdHGscLSaqS/PVZosDlzLvDP5Q== X-Gm-Gg: ATEYQzyItZZi3leYBu3LvP62KP/FIv6RAyTrB0CA3IDjOVwQEtpJp3F/0oIKQWf/mr7 FzwFbO645dCMg61MGAwsSBsFz+OrCBVsfnZYfk6b3eOzej5UGPGPW4NULwq80RSobFH4fmRcLlY HkNl08mde26P6jCIeZbioBYEM7C1cyCwkiD9Esi8IOKwpYV11VBnFdViZVc1akRFsas3C3U9Ih2 iVVz03G0ni60Z0Ck7xlqWjUr67gbWneu/A5JOq3DhD1qyU0xbAPhulRr82ZIGj0W7OlMXFIgfUO 9DhdiY1/y4YXoi+uLlkoviJAdyCaV8TUuw+RWvN5thXN+vY11H20/hbit+4O67sXhuvtn7bONaZ G0mpVLyxdDEEpWk0HxgkB6nSzpXJPe5U0CHrAO6Y2mfbJEFhB9ncjP/QajkvfE4Yk/F8ngyXskG gB22PXVfDDHgz0P+M3L0GhmQ5v0jTBKM4AEENrvWbnNwvCoEgh X-Received: by 2002:a05:6820:1909:b0:67b:be3b:ec49 with SMTP id 006d021491bc7-67dff4039b0mr4290155eaf.21.1774551364004; Thu, 26 Mar 2026 11:56:04 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:03 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, Ruben Wauters Subject: [PATCH v12 61/69] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver Date: Thu, 26 Mar 2026 12:54:05 -0600 Message-ID: <20260326185413.1205870-62-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Acked-by: Ruben Wauters 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 17c2dead2c13..c49f9135dc7a 100644 --- a/drivers/gpu/drm/gud/gud_drv.c +++ b/drivers/gpu/drm/gud/gud_drv.c @@ -32,6 +32,8 @@ =20 #include "gud_internal.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + /* Only used internally */ static const struct drm_format_info gud_drm_format_r1 =3D { .format =3D GUD_DRM_FORMAT_R1, --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 018823F074F for ; Thu, 26 Mar 2026 18:56:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551368; cv=none; b=Uqya+tKZ+9j+yOyol6Ed4ERx41bs3XUOugXrfSj/K19YKgyaSUK5EOwnyJBvvgVQ8y8mebDtv2tLYKDY9jJdiOCPyp5Iq4lKGuz/BO2txAG8vHYr2aiMc78m31NCu/38JEipLqCfL3d0tYLKWlmy925RwukSfVlTVu54jzCH67k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551368; c=relaxed/simple; bh=E+4uKCclIfWDh+d9Qc5K0SsZwoX0QZA/3pGmHnVYNbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tkxe8Q6jgUxWx9yUOYeiSAfSEt8zw1ubvo42tibxR/1C5ERiKiKqp0VBeTBhLo9pkHMhhsj//0F+Z9c5SaiLSwHo3uqOORPmFWZvFAjbT/X9uPQ3hN9yZWB9ZcjT7sufpl9uVdxOTYdEnYww1ra904ZVPXEmPiW9mfIxK3N+qmw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z5YLJnC/; arc=none smtp.client-ip=209.85.160.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Z5YLJnC/" Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-4043b27ddeaso853196fac.1 for ; Thu, 26 Mar 2026 11:56:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551366; x=1775156166; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ves6/eFJLAs0HG68Znj+VH4wZtUdDvx4ZnDak47UPW8=; b=Z5YLJnC/sANuWj3XnjB+JhVwhi4icLvNWNZBzfyyUFNfWz6VgU+uRiB9ZM4KgUi7w1 0C30ZEm0qkI4zS1m0V53YffvrXFp9r6KzspcCoORYZffXrWd7ZdBLHNQu10pjf4Ru5Zx fury6mOiXxetBlgl3hwligxW8gEwW0jkSDoBUkv0KRzqjzkJ8zStBl3iUlPctB9c/5I5 Yv52oTm3zPwMYDiBrp0bhjRleu00oqlGnaocoRdMazGwCMkXfbb+5laGEnY9jNRmK/ti 3qIS1ui4RBp/BHYaScmUVyfF1Movlp3OOUthnDh8jES1wun39IVIcgVVcSSr1OtXc3OZ u+rQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551366; x=1775156166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ves6/eFJLAs0HG68Znj+VH4wZtUdDvx4ZnDak47UPW8=; b=VLZaOPruKjHpbHZUO/Yi1fmEuFq1ryUbz8mVynosbfCPmfyZVOrFkjbzjbYKEXBeLi ToeCvwTgoONBbgoD6Zrvtjqu3glZh7O72Qx8P95wsz/K49J9FdzrWP7i9cpnElthcf51 SYvAsmVGiQG6dtbefk8w41XKEQXAneHNH6kBgGDQp0TrQUb3QnZMrFzMkpe32iBwcS5n wdN0KzBO79V4XEy+QzSJxB4/LAodEDmIJUPRwlXqeTSYz2v2jpaAOQS9Rzan44Cs2aXq hlj8KGWrShRPCTrDeCPbKo2v0DXGFqPr3HpJnMWXaaxpeWwCp6ZQEcrCpJlRVMJQJfCa S1IA== X-Gm-Message-State: AOJu0YyR54i5pi1NaN0cCHAIhPl9xsWIE34pmrsCCo/dngu2kHScXuuh oih8zmPi1B3fAaWjqxYZ/6REcRAER+1yTRtjsb9/nCzKIgKhwWEpT3ppDTsOfA== X-Gm-Gg: ATEYQzwi2+zUpKYm+9d2koSHWkOG21x3oWmUW2PkmbKTevHwn70vCITqckNc2/Zk1jl 7cHqFdRRu2sCf7qAhMVRRZykC/EaOPwEhefmsZyoIvU2gkeU8rXsgJY7ZTyIBLgEXAvOitdhwAG ykEnnt2wMG6LM7Bac0ejLLYs/d2Lpbe3BU6CZEe0gsWYdSdVWUSp/87NZRs55qIpMgxmq/S/FSR QmObZbI1p9VEbA4MvwlU1CqG3HUf9S+IhqafTcbxXRAaSYzws/hsSbagRYYHK5VbyDv27NojRKG mlyDWr3MgbM0zSq3d8E1zXvuE3pLW3xVmm4OTn8q00IV1yA2dWHbXso+yUNSYNdJSOnfp+QCnp9 oNsz4QkfAPuB1NHqkGNefHUh2+R6dKgj6PPEMvYOZ/IYbZh3D2Vk/VtxrfugwPzhRo/d14me5Xx wAVQMrmLk/NcDLStGXtBhSAjdu4oxPheVV9Dy8xD8n2KffyGXf X-Received: by 2002:a05:6820:1506:b0:660:ffcf:42e7 with SMTP id 006d021491bc7-67dff45c71dmr3869491eaf.30.1774551365754; Thu, 26 Mar 2026 11:56:05 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:05 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 62/69] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver Date: Thu, 26 Mar 2026 12:54:06 -0600 Message-ID: <20260326185413.1205870-63-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The qxl driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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 2bbb1168a3ff..73998bb331d9 100644 --- a/drivers/gpu/drm/qxl/qxl_drv.c +++ b/drivers/gpu/drm/qxl/qxl_drv.c @@ -67,6 +67,8 @@ module_param_named(modeset, qxl_modeset, int, 0400); MODULE_PARM_DESC(num_heads, "Number of virtual crtcs to expose (default 4)= "); module_param_named(num_heads, qxl_num_crtc, int, 0400); =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static struct drm_driver qxl_driver; static struct pci_driver qxl_pci_driver; =20 --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAC713F54C9 for ; Thu, 26 Mar 2026 18:56:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551369; cv=none; b=BY9kpvEnRP4mSx+PsY/bFAJpyPFn2i8b58sO/Y6rTugmiYzOKu5qFiPv+3FpEa2APppCqryabufD/tCw8dlgZy8UdP1eYkjpM4kTAk+JtO5PUS1BLn+2PddNe9t4++wMzV8+mEPUGeEPeI+Y5YlAnIGc0QPDT2rwrG4wVz56nxg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551369; c=relaxed/simple; bh=tsVi6lEia85GBA5TO2vKtMgMSmGGVnvxIYpDIIj1rAk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l+iQEJq7nGhiNozPOMqQ0ORPChdfzrud+BUVZn54Ecw5S4p2V3KSk7PHychMzW8tZWSrYSKZUAL2pxmehZitcF6Lkrua5noFt/bEdYUF7y6cp0jsfa/IGfHgNWPs4tjoHUFI/HLwYmu7ZsLHsib9fMBmbB/nOgQKp+iKGbkZlho= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Zz7nYLzI; arc=none smtp.client-ip=209.85.160.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zz7nYLzI" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-41c0aae84e5so971354fac.3 for ; Thu, 26 Mar 2026 11:56:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551368; x=1775156168; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NRlPoGa7+iUNjeM7pxa7WPegOcsigZPqzY0YzlOOctI=; b=Zz7nYLzIH38KXurG7adkeo58rfxIyNhhPUDBPzomU2KwJhhTVxfanfXBhvYjkBtR8d 7siPP7dOm4pvXIhL5X/WcUANntW5QZXRGGwTq8JM8M3M7qTisWUZtWoqaahGtFss3hk9 tFIITpZpw1GnVCa/Cb9khNXLt+LUnuqx6CwolL+IS0yKIVDy9VKSexNuYoaZGanrMMwD j4lRFiC+rxIO2VJFBfBqIVfjVRGte9DOE1xLG7RikJBVSZemPMRu/AR+jBJwaQoQU37N uKceyDvPc9DTuFove1h6YHyrtwM7Op4roZsm7OmYJvsy20yNHHl41HjWtRuvraCy+i4l lKfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551368; x=1775156168; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NRlPoGa7+iUNjeM7pxa7WPegOcsigZPqzY0YzlOOctI=; b=gizFwizD618m3/9YqpFFtndRUK3y+NIkQqUGJz8TphLEq0YUDjLcNAUbLgYNof6yeI 8P4Bh8efvO2VA8lBZOiolq5p36X4SMMxXoonl6tRsOLOM6Hs1WqBpkbl2fqX+L3UqMWA MnpUZ4OQO+lJuMVYu/3/wpAWg2G5vjXb+8aB8VYVzd5cY38/Jm5gmTYDSVVu009QOvhv 3J6PXxqiyI4gGxcBDslSep5vnDas9bRMSKk0ET6oaI1TQ9DhwvpHpvtyK34WeZFeaxZ5 5FO4eDOb0Ch0QgKBrAtkOsexxQuEawmsGFfC16EGawuyWhnUN9OhaXv6+Mhu/NDBpD6X zfbA== X-Gm-Message-State: AOJu0YyLFFkz7uboxXZ7ea7re3MEgp0iFBYJmFABiCnxbNgxR1+xbs5B 8k9kpyCArXXZ8Da0IOk37usA1fJSZ0SvOeX/5wVgDPFPEvMxQ2XTFk3DiyMMMw== X-Gm-Gg: ATEYQzynDhHneDSPXkepAa/numK/5o3iONb/TJO4dHlXoFROdBK1zUKUV8IHExiGIb5 k0Bd6w4Uye2B672PY62L42MJ+zi8s1z1qv0ngbVqL14g9IDNQmOpTpJRijRyIaPRhBffvkKJ3XX aSejKJHKSl6a9uyVBJqPGUb5BXoF4VfAuLagPa6zg6RiDKuLoCkloElfBIZKN7hPZC8xIpeIGOp +6r+iRTBZiYJnCNzOcd4tmuP4odLr+tvXJq4/uJVvgD8hAWpM/jFv7TKVPDzwQUEyfZ2aCP6dlX I+3+so+E1Z0aRyo5ubHtD0fgJcbG2vNjAPSFAM7oD1JbCMXbU3WCqT4YUiYTu3ab/UXac+TVgyN jzw4T3OLyoV63K6hNUnHMBEcLKXyFrSvBdcuaioF/KLCq7ivNI5njwHrdFLsQfkhlBWpTBfMTY3 JTjKl5ZMRhL6tjnH8bu9T2cUrInL43TCzfiE5VkyeZbLFcLgHfrVg/vHt3KOo= X-Received: by 2002:a05:6870:b493:b0:409:6227:d313 with SMTP id 586e51a60fabf-41ca70d655bmr4566906fac.35.1774551367549; Thu, 26 Mar 2026 11:56:07 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:07 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 63/69] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver Date: Thu, 26 Mar 2026 12:54:07 -0600 Message-ID: <20260326185413.1205870-64-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The drm_gem_shmem_helper driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie --- 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_g= em_shmem_helper.c index 7b5a49935ae4..bcc2c870d304 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -26,6 +26,7 @@ #include =20 MODULE_IMPORT_NS("DMA_BUF"); +DRM_CLASSMAP_USE(drm_debug_classes); =20 /** * DOC: overview --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6304A43C079 for ; Thu, 26 Mar 2026 18:56:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551371; cv=none; b=lk/vF/XSy4KDpLs30OIjB6sWHdar4qd/EWrDF13grkgSRaVVeDTzLn/XkZfMp8bDPVPI/W61Z0njkwnhyuMkNIWe6u+vqkmAARqXjO5eAUdlL2CrSB+WQzBwh+MsNJ9ZE7fP2sWn6DVVIl8M8v2BXhc8Kd/JfV0sNKHsnM7pr1w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551371; c=relaxed/simple; bh=gdUFxE70EjDSXy6HqpqW0yTGEdO4a1TirfkhznoQiUs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=X4OHYM//dS+614I1INU2+UxKmuWkfa47YhbIUqQ2OY94E77cyPu37rZ71RvOfnKKrlZXbEBq65k/2QQNrQK1Tk+GIGWPm5dDU+X6gsOtsFs7S6aL/+E6Lsi1RTyvnJ8g8gWOgZ2iYxJz9pocNqaYdyBPQ961ewJzrh1t3ZoskHQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lE8uwyhM; arc=none smtp.client-ip=209.85.167.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lE8uwyhM" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-467161c4ba7so761457b6e.0 for ; Thu, 26 Mar 2026 11:56:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551369; x=1775156169; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=S4W3w9+Cd3LB8UtvA4xSE2rspTRatyv6KzC/l1k+Ff0=; b=lE8uwyhMhPjmyeJNXXvDdHbIZA3U4qqg8ZrPTN53lHnWd/wf+yqT5JEw6GjIszy6Fr /SSZIu5mGqCLIccaeXs34OWYQ00johFZUUVQAQIcJ9QtTBlnyeQTaqSkpysDomJE2hw0 coCHtoIRpZvE3/7pOQi6+xRwudmg4+M++VJzFwFVtluMdcLNVH+4LJfi8ink2u7O/NYR cUNrqgpWNXCaO+l4NUXNnv6fPy3fGf3Xo69CfdfItMir83GLJ52ebLxIJKsK5838RS4L Spsk+yeElywca98TsEBayXy6gEkmwlllgnai+yercIZdFdvr+qJJWLLpNoHw1Puirwnm 1WlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551369; x=1775156169; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=S4W3w9+Cd3LB8UtvA4xSE2rspTRatyv6KzC/l1k+Ff0=; b=cGO0NbMnUs0e2Rw7WII7Hlh4mr5X7xLcUvUhUZLEJUopTQ1rXJg0908DTxFyFTlw77 1dZ8DVcdpb/iOI9YHHzqU4Dn5hyLKW1E+Rc+GtB9Q/53zy0rCIjL9hm0hF6dnYSfgNtc +9GY18LgJ359E6qHPw/Bldr1RRd6OiksV/yadWhNyrXvcK///sEZ4/Va1sWl0C+ekDem W1efJoL7d9/khNcQNwTOUjoPJBw6W/YarrafVBmeN0nyVjWy1BIT0+bTFOJiJfFbmt5L bSIdZFemsc5Ja2R2PVVXrcYMA7t3cwJLvIChQ722VdZ5Uz094jT+Qp+7d5jRZBkVzwuG yQXQ== X-Gm-Message-State: AOJu0YwoVj7LFUvjrfjvL/QWj1CbSYKeV+RWcXVG1GFQCN8mf6SfkG/N WNYyYzuvzxXEbzqu+iIVc+5dMYYiM3rDi+ga7UalbVL+eXvdhrCTb+cpa/iylA== X-Gm-Gg: ATEYQzzrAx+f6ITpU7jo7i9MW6XzrRL9HmGqxXjXU5+WEfktZno4Ibg9Gtr/FPBRldK cUel49dWUe9oGgKnIC27gEP19IFXol8Z5JbP4sfMLEbEUXKPSEHQvazHitSLaRbN3eClYpH5YVu wCmCObXGpS0UGLm5zTfVlaOR0tU3fSclQhovqfixtoVNo/F/JJ78IRfHegzWy4twyDveEWBRsjB ki1Z1+KflhWq1yszQ+Dk95gHao8ob5BUvHF+licOlw2P/nTyXzhiaWZvkEqp3Rc+aktAiEYUeO8 S97lViFJrR/sHSVsbMezxYiiXMpfr/QKMmzL+ryBx1YIInWYUO3N9ce2+0PCgwSiyf0oo9ZU9C/ w3iBUueT+PH9YVVre+5ObYw72Mj0R8MxKTCJ374/Wn41FnL+z8+gJxChd5jKDsPDzj57QO/MJJm LezQbIMVgQrs0hkIW9UL9vyUF+kQuv8qZsBN4MTL26a0akfxtA X-Received: by 2002:a05:6808:1807:b0:468:4b3:d12d with SMTP id 5614622812f47-46a7a88ab56mr1246480b6e.11.1774551369095; Thu, 26 Mar 2026 11:56:09 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:08 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 64/69] drm-dyndbg: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Thu, 26 Mar 2026 12:54:08 -0600 Message-ID: <20260326185413.1205870-65-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Time for some thorough CI. NOTE: the previous ~18 1-liner patches adding DRM_CLASSMAP_USE, can be replaced by a single call to DYNAMIC_DEBUG_CLASSMAP_USE, from a source file linked into all drm drivers & helpers. Heres how it works: 1- drm/drm_dyndbg_classmap_user.h calls the macro. This is a weird header, since it declares a record (inside an ifdef). 2. drm/Makefile: ccflags-subdir-$(DRM_USE_DYNAMIC_DEBUG) adds -include $(drm-src)/drm_dyndbg_classmap_user.h This "header" is compiled into every object file in every module 3. the DYNAMIC_DEBUG_CLASSMAP_USE macro is altered to declare the classmap-user records as __weak, and to place them into the .gnu.linkonce.d.__dyndbg_class_user.* section. This allows multiple declarations in a module to collapse to 1 record. 4. dyndbg.lds.h's MOD_DYNDBG_SECTIONS() renames the section, stripping the .gnu.linkonce.d prefix, so kernel/module/main can find the section and dyndbg can process it as before. 5. drm/Makefile: adds several ccflags-$(MODNAME)-DRM_DYNDBG_USER_SKIP definitions, this is one of the ifdefs in [1]. Its needed to break the dependency loop that is created when drm.ko depends upon itself, or when drm-quirks that it depends upon also depend on it. So this works, but it is weird (horrible, hacky, obscure, marvelous), and I dont have asbestos underwear. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig.debug | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig.debug b/drivers/gpu/drm/Kconfig.debug index 05dc43c0b8c5..6c83b1276870 100644 --- a/drivers/gpu/drm/Kconfig.debug +++ b/drivers/gpu/drm/Kconfig.debug @@ -1,7 +1,6 @@ config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" default n - depends on BROKEN depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FFF543CED5 for ; Thu, 26 Mar 2026 18:56:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551372; cv=none; b=UfEzGtTXx32fNqeiWctynnR2TLEywkd2LxpUCj1yLQ5TRXBTVgFBaNhQv5TzsorxRQhFvW6Mb3t8ELH8sTZtHVKOCFsuv31dOpKN9aXN7L8JolUqZAxdIySwwyhaG0Zb/t7+QcjrAWctpFn+beV9ZGvsT0MGDTnCRr3PACnSdIY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551372; c=relaxed/simple; bh=HuaP7qpnPsUPXeEFF5Yz/dIiqYvx5pjBV01jLdD5EWc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cblDXAwk45eC3LDTEKc+XgeNkCwtgmcs0qgC7LPRQQHMS6AaD5VqmLgqVqlkZkNAe2ZBpfRbgiI0PRxB3rhRCxLrLHplWCTdb0sNgc5dyPoJ3pJ1njJvp4J3Z9xLpt+XH0nzdkCbqgFzjP6Wg/EfkyPkyIhgSLy/rqeIKh56c6A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RpZifa8A; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RpZifa8A" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-40429b1d8baso540773fac.0 for ; Thu, 26 Mar 2026 11:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551370; x=1775156170; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hyf4ilrW4GCVGVmagWACzMec5+WgfPealp/jm9A7WHo=; b=RpZifa8AUXr9ejPXZN+KWD3vt5rQfEEWbXI8iBACbikeC9FEJYfjoUpQ8BToSCtX3U 3D5v8dKdqQq/eqa0t9+lanHnW2IZ/1ukMTCM4DnccadDPmgPI8iGSjj1LEdyRL5QXleO 0TqXIViXVe1x29ARxYDHQ+CaydlfZfGA5IMBFYd1ZcMLrCnz7H0Ltx5LItzn1pQDKw1m c5O+QQp5nSYQv+Kp4nnztTVlsUZCYyDds4lKO1PAMVXrT0aG4qBnQ8qpsov9jNn0IzjN qlsDxOcUXGABsWZdpw1FPrOArg1+sYmg4nJzpmwb9tedtRKnthfFKJz1yjIW4XKCoCQ/ k0xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551370; x=1775156170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hyf4ilrW4GCVGVmagWACzMec5+WgfPealp/jm9A7WHo=; b=Yanwzto2hrDMxb4IN+eGM8X+djTNCK4OtsiXNryqNZtrYM1FW2APlnb727YE1PcsM7 YQih+b8L3H0dhL6geixS8UtYMC2GmU8pDHk7LoiWuptYzb8OcIMu2IL5y9sbPm9HhbFP YvsMHFQK0Ukt0F9zyY656zRvz9MA9dTzDOcQTrtI9E5PJk89usk2WwnhKE1Sig9xwmaD vQqLlGsLwVSZxjMnAmQaH0H1SzVt5zNgVmGXtw0xnZ9Ej6C6OQkYZZmrMVTXTiRUG3zK Jmuzq3CsrfK3EJRD/Fz9wjB9JKkFpDz871+tygNsuwAkkhaEm5S+NaMNPpQIjwfhWoqI ptWg== X-Gm-Message-State: AOJu0YwgHPhwwi2E19fIU+j8p6XLEqOsoBzJap4vHamPGoYZGLf2Gb6w rY5Wk4nE6i0HjrPNHUlbac4G1jBx76PpH15boRd4FL6/Wc9w0cVJUw+kcm+E+Q== X-Gm-Gg: ATEYQzxemn+2H+Unz+TI1gdTYQVsngPhOV6Bin7lURmEBU5kq5bsm09R0AWF66uX92o 2EwEIEztVRD+hLd8wfew2uCS0Npb2/DmDirxUPF6Ncrfpfwp8uMHrSMb7mj4jQP8Fkjm9gcbURV gthVYHPbGJ+stzpQp7Lo3kxoiB/VTr2gaGFxUQ5aH2SvEVhS/ueM7g/FIiNZSRpqFsdu/jBp41l 2r982x3LYx9DdDtlJxY6Scn5leC7lC/MK/aiPd1Rf2Eny0o6Z1H4ztSfCcgMDX4EgVFjGVa5U4P dpPt/HsOkZkeLyTIZtAQ73dCqtGWJBPR2rmsCX8Eaw52WgAIkA+Y4ogK8Ucuvj7MeAcLOo/h+g4 QgqQS7avWbr3UWmgG2uryKi1+kS1nRclSo+uTtBe1RwjSY9ncMhB8mQ5P31XSf7GbUlaMFRRXUp b3qSf7rUt92HuJz/DmuTswPplw0rlrHekho8qc1piueVh/JxAb X-Received: by 2002:a05:6870:8e0d:b0:417:1bb9:c00 with SMTP id 586e51a60fabf-41ca6e3d581mr4428868fac.20.1774551370328; Thu, 26 Mar 2026 11:56:10 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:10 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 65/69] drm-dyndbg: set CONFIG_DRM_USE_DYNAMIC_DEBUG=y Date: Thu, 26 Mar 2026 12:54:09 -0600 Message-ID: <20260326185413.1205870-66-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Set CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by default, so its easier to test with less config fiddling. Note that it still depends upon CONFIG_DYNAMIC_DEBUG=3Dy, so may not be automatic for DRM-CI. Signed-off-by: Jim Cromie --- drivers/gpu/drm/Kconfig.debug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/Kconfig.debug b/drivers/gpu/drm/Kconfig.debug index 6c83b1276870..6d17868b4c80 100644 --- a/drivers/gpu/drm/Kconfig.debug +++ b/drivers/gpu/drm/Kconfig.debug @@ -1,6 +1,6 @@ config DRM_USE_DYNAMIC_DEBUG bool "use dynamic debug to implement drm.debug" - default n + default y depends on DRM depends on DYNAMIC_DEBUG || DYNAMIC_DEBUG_CORE depends on JUMP_LABEL --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oi1-f181.google.com (mail-oi1-f181.google.com [209.85.167.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E218143CEED for ; Thu, 26 Mar 2026 18:56:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551374; cv=none; b=LIVfwG8qt4brAMifkLvX+4/Wb0Uno3jyY7pfh6FzdO74RYjOpLRVLmFZPLoQcj6rAr8586ekU4/PEQa42wUmUo0V5VW8sT1UJ147zeHNjPyLmIVyVqv7cg04H1szYlMvsGqYan5/hAVkokvImReX4VZAbO7T3OSZXGo7Q2x0ACY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551374; c=relaxed/simple; bh=LKk0j98dVImoZelrD6ApXAOrVZl5oRTtqgBbaIjJUQ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KA/FnEUYSe2vp3sf6s1QAK1eoAevgF2khlTFSrtcFxBxizvLAb5iNUwgqmjNmSzJWGFnKBUp7elSNv2h27mqdjHp+1sEX9W4V1EbxyRmno+L/uEEH5r+MWpHTPPo7cu1I/fW5/pB9dD7hCHZwZtex/GdYsyckcheZAIWZJswPJg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QHokIqU8; arc=none smtp.client-ip=209.85.167.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QHokIqU8" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-4670676ba03so501343b6e.1 for ; Thu, 26 Mar 2026 11:56:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551372; x=1775156172; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NDrEVSsHN3/NxzQ31ZhlYG+/I6Z2jtFfe5b8tEwBAEg=; b=QHokIqU8CmFr/Yyw0jRP6T6on+hO1tWuxlMjhhqcO4iVC9W9NBOcTQ5etD4D0kAuYn Gf9KUN+psC4SfUURx6hQbFdn+olxwiKgRGWTzbAH53KGxJl42fnyv7p5YAg1VIed93lb fVy+jJihdgq0+eYMMGz7sEbh+kKuBgvvSoBCj6PoGTdj6KVoqgrDbAIibvho1EG9B4o3 r0INDtixF/QMl6yCO71m4EurOtpJ8ZK89i13JNZ++mSSqb1uy9zwAGudDIiulfsucLQV 3zJBmdL76jtzM0DMULp6QtD7QF9ULGTQXyWmIx0F1qeSKt6K+tCMaCGp4gyg9Pkvz+t2 Ekrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551372; x=1775156172; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NDrEVSsHN3/NxzQ31ZhlYG+/I6Z2jtFfe5b8tEwBAEg=; b=n+onPRJNaiKMvdy1YQpmH84poF/tCL97pQAEhNMpst8MqEUI8R1uV+CrCUR/XdLABA sFMBxpHSfC72GYl2jmv6lts6NyJAOySe1mUQndxVDjp8MSZY1cPXpAFUVTRPwCkxTwk4 G98TTfGDt+cO3fBAnRsJQzOzg8MyE6PaJ8amXkTkJhyteFCr5xYLJCLVy4Yvk4DKVhBq NjpRaWzAUuZtfILbOXARw9byL4Qi9NkPCLdrJyff9rPMpC/EO1Rd76pclxNzQgC7TiCM izwQPBFSQC1LqO+VpPte1/RteL1LJBr0X+gSKfAhT6cYnB3Cnnlh06ijTZOrvcyJ6YdW ikKw== X-Gm-Message-State: AOJu0YwfCw6RUR/0hpQXHPdX0zqhKoCzrV0mlm/bCnoRVgOjFCDtzxdb d2SQVS/kXjT5KhUltPsj13PSgoh2jzCljJ0QvuF5pJ0qFHsRjrN8EFlkpnAqEg== X-Gm-Gg: ATEYQzwOvqYphqPp6nidFoyJiu08jzsgtHHvyF4LSEB7vgoc5yB4rhbKl3zqr1YbFJ9 q4A0rdoIk700yk8KApqAEikYjbHhB1uTueTXu33blcNhTgaJ9T+0uo2VsEsEOWyhG/3P2fBSslt 8zVQ+I5U702hiiQW4bWjwdd4RH2PoX13Q2X2ZhTz8hkMa2al2getZgL8EPOvAA8CJH4j42foIQp fFj4RLzs8zNKd9O0FO+u18uyWWxrRg7MFp11GEWfna3cilO+7cqu4r1+KF7Q8A0ERl4ZmQBoUtn S2w6WD3gS6mxmee2hi5W9iVKg/9wEcdTmnY0NrBv1JWpEUl+hptuKmCAhKoyuvuMRfYr9z0MB8W s7mgwuFOydN4XfnhbS7KCELSjg/lBmQL6IzH7Txxgad63qkuR1xquBsRt2bDjl1czAvIljLoa3i bm2gzQt7fx1SO7NndUEpYinJItPNbk/73L8TypfR2yVybnHOB0 X-Received: by 2002:a05:6808:c295:b0:467:2926:123d with SMTP id 5614622812f47-46a5c77d4b2mr3987875b6e.47.1774551371661; Thu, 26 Mar 2026 11:56:11 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:11 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 66/69] accel: add -DDYNAMIC_DEBUG_MODULE to subdir-ccflags Date: Thu, 26 Mar 2026 12:54:10 -0600 Message-ID: <20260326185413.1205870-67-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" With CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy and CONFIG_DYNAMIC_DEBUG=3Dn, accelerator modules are currently missing the _dynamic_func_call_cls macro, due to its conditional definition in dynamic_debug.h, which depends upon -DDYNAMIC_DEBUG_MODULE. So add that to subir-ccflags for all accels, in accel/Makefile. Notes: The added "indirection" allows modules to individually enable dynamic-debug, where a CONFIG_ option would be global to the build. Several accelerator modules make drm*dbg() calls, so in effect they *are* DRM modules. Signed-off-by: Jim Cromie --- drivers/accel/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/accel/Makefile b/drivers/accel/Makefile index 1d3a7251b950..44db786ea223 100644 --- a/drivers/accel/Makefile +++ b/drivers/accel/Makefile @@ -1,8 +1,13 @@ # SPDX-License-Identifier: GPL-2.0-only =20 +# several accel modules use drm*dbg, so they *are* DRM modules. +# When built with only CONFIG_DYNAMIC_DEBUG_CORE +# (and not CONFIG_DYNAMIC_DEBUG), they need this flag +subdir-ccflags-$(CONFIG_DRM_USE_DYNAMIC_DEBUG) +=3D -DDYNAMIC_DEBUG_MODULE + obj-$(CONFIG_DRM_ACCEL_AMDXDNA) +=3D amdxdna/ obj-$(CONFIG_DRM_ACCEL_ARM_ETHOSU) +=3D ethosu/ obj-$(CONFIG_DRM_ACCEL_HABANALABS) +=3D habanalabs/ obj-$(CONFIG_DRM_ACCEL_IVPU) +=3D ivpu/ obj-$(CONFIG_DRM_ACCEL_QAIC) +=3D qaic/ -obj-$(CONFIG_DRM_ACCEL_ROCKET) +=3D rocket/ \ No newline at end of file +obj-$(CONFIG_DRM_ACCEL_ROCKET) +=3D rocket/ --=20 2.53.0 From nobody Thu Apr 2 19:06:19 2026 Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4413E43D4E6 for ; Thu, 26 Mar 2026 18:56:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551375; cv=none; b=t00UWfKy5uAGNWAwqUwi2122EgqJgYM69Esq6WtcyPcqCfIr/wN40jXHT+snOlPgAbwMMcq5TY8AH0fEYA5Y4StUfahNRnsoP/AsbjbbldA25fRAYfnXTqeuW98DRj7TCH2u6yn/YnPYyXAut1mY9f57I3P5MfX7C5nCQ09xR4E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551375; c=relaxed/simple; bh=Siwzlu//qwBDGXWphUDn6x73A+uGwqd9JhrR8tc5Qcg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FUF8lC1SzGVKqCQ5UlrfWzRTG6vL2IQv1yfe0xLzNbsHdMaaIfrDcp4OABej5/ADElVts2W2kjqry2GSgLHfpHY36r/PKWLXlPkbHzoYmpB3rXSXQsJtSERm7pBG9Uf6Fj/0MLDNFDqDWNt6bjXzn2igwVjTESvDBvWeTSjYGkw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=n8b+fi/U; arc=none smtp.client-ip=209.85.161.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="n8b+fi/U" Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-679b072ed3aso790157eaf.1 for ; Thu, 26 Mar 2026 11:56:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551373; x=1775156173; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wgXq6jE50vtzY84cY1V8ERFkQj1I8fWL7chL4/tqUbE=; b=n8b+fi/UB6XasCje6/yang1pIzPvZVqP+Rmp2/aHd/Og8iY2RuE0Wjc5MqQ+KqSl1+ gjFur5FcsnKYD08zbWjtFgaooKdDmWxpCVJPqF0vCyPV2OXfKazXZn7X3mWJm/vIrePP NNwrQLJ3x9ZCw7dkMWz6FOalX2rhE+7ABg0xHg6C9M0O/0f2PJh4YkQyJ/qaUOJ535Yw iGJgM0NIEDYtjlhNZC1b+EW/cpeVzJJLQp1rtepV1fXXQSwmqg0jev4EdW9VMXzKKNdj CXUL4969SIYk1dWKxt8e7sCFg+UqE1WoMQJKsRlc/73RXh5sSoD+VaJc2xd1Sx5GUcu/ ohIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551373; x=1775156173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=wgXq6jE50vtzY84cY1V8ERFkQj1I8fWL7chL4/tqUbE=; b=R/utt2YgWqnvXvK87VRFWgTsKXG2Tqe/hLlVGtDfQpME3BK58j0fpE/SG5fAxMXtBk kbglitBTSs8Oe60tA1PmT8phKlLY5Ce9maWDclnIqlhF1GLe5W+Mw3E4XGK0TMUb5sVD bN0F0FI9+3M+SDPhWrpxseIHPHJKLhd6CbD9r2d4SL7g5ZPww3JMIkPLIqXVbJLOg/5t ZuQgMjg2AaDdnK367/L4Cz2UU5XO1XrvZm9O90PXkRhqrNJropNt65QY25VGLbWIFoFQ 6NuG32B2HJMvBnsbpVHdncT6DAQPdDw8ewOCHncPH0XLfr8SVwx3lDdBUcSDRBILgd69 NJpQ== X-Gm-Message-State: AOJu0YwT3y+g7vsezu1H1TvKM0hxUNamLf2/q3QoF/VpFP+7/oQitdFi Quym9yMPdWi2DxG74TnUgw5O0Jl9Yi+xdZ81AKTdiD4Y43DcHUCV+8CWov9/ng== X-Gm-Gg: ATEYQzy8YJFLn/W4+4oeAJa4PErHkPJtBIfRaJK1c8251Ddg+AhIAdgcCG2X97FS5So ensmk45XVIRe0hySB8u4QPjGyoPW6NGhU1k1CemHeF2k7SFbIO+Dfj3M4idsbJdM32V78ygaEtE 7kAsFNtq+20a+pP+MQXGNALckB3xNdHC+U5lKwextHp6lvGi4DZFRyzvIfi2L1SFLWalAr4rLr8 etggo6SMFqOLoyo+tbAMInt80J7k4/thhCtej235JFfRFHSpD3NGvH+6Q4FXf4Ei0KpebviC3Ek RnpOzR0ZZtGeHuAUkitBn19PXFydufHXls8YcwHAEWjUHUvmLwxaevLoNAe3wtXJsrKAA4PvtWL gV89lOGQv+q+DPrBnD+ClTXN+vvXOCZBZv8aATlN1pW0kkvokcbjkSE9giGKqyl5k1xpUQyDB6O DUldMdO7sjkZF8zFtYqCpmY1y/SyhUvkN9FzeviRh0sxB6dUeq X-Received: by 2002:a05:6820:3106:b0:67d:e17b:31ac with SMTP id 006d021491bc7-67dff51609emr4069367eaf.45.1774551373018; Thu, 26 Mar 2026 11:56:13 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:12 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 67/69] accel/ivpu: implement IVPU_DBG_* as a dyndbg classmap Date: Thu, 26 Mar 2026 12:54:11 -0600 Message-ID: <20260326185413.1205870-68-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Invoke DRM_CLASSMAP_DEFINE to create a classmap of class-ids/categories for ivpu_dbg(). This brings static-key optimized-off benefits to the ivpu_dbg() callsites. DRM_CLASSMAP_PARAM_REF wires the sysfs kparam to the classmap. This is the 1st real-world example of a module avoiding another module's classmap's class_id range reservation. Its also something of an oddity: it "is" a DRM module only cuz 1. CONFIG_DRM_ACCEL_IVPU exists. 2. code therefore uses CONFIG_DRM_USE_DYNAMIC_DEBUG, so must also use it's dependent wrappers: DRM_CLASSMAP_* accel/amdxdna is already using drm.debug via dev_dbg(), so it is more fully DRM but iirc its a single call. Anyway, to play nice with DRM, we change all the constants, from macros calling BIT(X), to an explicit "enum ivpu_dbg_category" starting at 16 to avoid DRM_UT_CORE..RES. This is all in an indef to avoid changing the constants for the non-dyndbg case. Signed-off-by: Jim Cromie --- drivers/accel/ivpu/ivpu_drv.c | 27 +++++++++++++++++++-- drivers/accel/ivpu/ivpu_drv.h | 45 ++++++++++++++++++++++++++++++----- 2 files changed, 64 insertions(+), 8 deletions(-) diff --git a/drivers/accel/ivpu/ivpu_drv.c b/drivers/accel/ivpu/ivpu_drv.c index 5900a40c7a78..214fdbf06470 100644 --- a/drivers/accel/ivpu/ivpu_drv.c +++ b/drivers/accel/ivpu/ivpu_drv.c @@ -3,6 +3,7 @@ * Copyright (C) 2020-2025 Intel Corporation */ =20 +#include #include #include #include @@ -37,8 +38,30 @@ #define DRIVER_VERSION_STR "1.0.0 " UTS_RELEASE #endif =20 -int ivpu_dbg_mask; -module_param_named(dbg_mask, ivpu_dbg_mask, int, 0644); +unsigned long ivpu_dbg_mask; + +#if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) + +module_param_named(dbg_mask, ivpu_dbg_mask, ulong, 0644); +#else +DRM_CLASSMAP_DEFINE(ivpu_dbg_classes, DD_CLASS_TYPE_DISJOINT_BITS, + IVPU_DBG_REG, + "IVPU_DBG_REG", + "IVPU_DBG_IRQ", + "IVPU_DBG_MMU", + "IVPU_DBG_FILE", + "IVPU_DBG_MISC", + "IVPU_DBG_FW_BOOT", + "IVPU_DBG_PM", + "IVPU_DBG_IPC", + "IVPU_DBG_BO", + "IVPU_DBG_JOB", + "IVPU_DBG_JSM", + "IVPU_DBG_KREF", + "IVPU_DBG_RPM", + "IVPU_DBG_MMU_MAP"); +DRM_CLASSMAP_PARAM_REF(dbg_mask, ivpu_dbg_mask, ivpu_dbg_classes, p); +#endif MODULE_PARM_DESC(dbg_mask, "Driver debug mask. See IVPU_DBG_* macros."); =20 int ivpu_test_mode; diff --git a/drivers/accel/ivpu/ivpu_drv.h b/drivers/accel/ivpu/ivpu_drv.h index 5b34b6f50e69..ef5a96b961fc 100644 --- a/drivers/accel/ivpu/ivpu_drv.h +++ b/drivers/accel/ivpu/ivpu_drv.h @@ -65,6 +65,10 @@ =20 #define IVPU_SCHED_MODE_AUTO -1 =20 +extern unsigned long ivpu_dbg_mask; + +#if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) + #define IVPU_DBG_REG BIT(0) #define IVPU_DBG_IRQ BIT(1) #define IVPU_DBG_MMU BIT(2) @@ -81,6 +85,41 @@ #define IVPU_DBG_MMU_MAP BIT(13) #define IVPU_DBG_IOCTL BIT(14) =20 +#define ivpu_dbg(vdev, type, fmt, args...) do { \ + if (unlikely(IVPU_DBG_##type & ivpu_dbg_mask)) \ + dev_dbg((vdev)->drm.dev, "[%s] " fmt, #type, ##args); \ +} while (0) + +#else /* !!CONFIG_DRM_USE_DYNAMIC_DEBUG */ + +enum ivpu_dbg_category { + /* + * since accels are drm-devices (CONFIG_DRM_ACCEL_*), adjust + * IVPU_DBG_* to avoid DRMs 0..10 class_id reservations. + */ + IVPU_DBG_REG =3D 16, + IVPU_DBG_IRQ, + IVPU_DBG_MMU, + IVPU_DBG_FILE, + IVPU_DBG_MISC, + IVPU_DBG_FW_BOOT, + IVPU_DBG_PM, + IVPU_DBG_IPC, + IVPU_DBG_BO, + IVPU_DBG_JOB, + IVPU_DBG_JSM, + IVPU_DBG_KREF, + IVPU_DBG_RPM, + IVPU_DBG_MMU_MAP, + IVPU_DBG_IOCTL +}; + +#define ivpu_dbg(vdev, type, fmt, ...) \ + _dynamic_func_call_cls(IVPU_DBG_##type, fmt, __dynamic_dev_dbg, \ + (vdev)->drm.dev, fmt, ##__VA_ARGS__) + +#endif /* !!CONFIG_DRM_USE_DYNAMIC_DEBUG */ + #define ivpu_err(vdev, fmt, ...) \ drm_err(&(vdev)->drm, "%s(): " fmt, __func__, ##__VA_ARGS__) =20 @@ -95,11 +134,6 @@ =20 #define ivpu_info(vdev, fmt, ...) drm_info(&(vdev)->drm, fmt, ##__VA_ARGS_= _) =20 -#define ivpu_dbg(vdev, type, fmt, args...) do { = \ - if (unlikely(IVPU_DBG_##type & ivpu_dbg_mask)) \ - dev_dbg((vdev)->drm.dev, "[%s] " fmt, #type, ##args); \ -} while (0) - #define IVPU_WA(wa_name) (vdev->wa.wa_name) =20 #define IVPU_PRINT_WA(wa_name) do { \ @@ -197,7 +231,6 @@ struct ivpu_file_priv { bool aborted; }; =20 -extern int ivpu_dbg_mask; extern u8 ivpu_pll_min_ratio; extern u8 ivpu_pll_max_ratio; extern int ivpu_sched_mode; --=20 2.53.0 From nobody Thu Apr 2 19:06:20 2026 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7BCF443D4FD for ; Thu, 26 Mar 2026 18:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551376; cv=none; b=Hh+UMR92qyf9YLRAX2EIx5QyFa5BHk93BQSuwYYketiY9bDTZtfYTBlYbD6+QKeDm3rzjCu+tWx8XKc5YJYbd7cEN4l2EjErzKOh7ThWKw4qM4DB69SLKqZj3HU1RgYv0BSQAJqtuvLyy1XDcTUVl7rA3SAB3VO70MKuYu6FaUY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551376; c=relaxed/simple; bh=s2yHvRQv2LFvQHSueM4len7CaE0U8GN19rseJ9pfjzU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CArpgkNFZuZCAexTpzhB6sqMvTWAOIHmRP5P2lSY5voqECf0oZMDx10PJlNlTVt+Ofv/6RFFUX446tskMK/Wl5OSdIMkCwdtoETGbZhakkIAfqhJWK8NsqcmOQXb2Igejzy2D1s2xAY8S8JwL8Dg6wxIjtyCTJPY10YcK1qPPqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iPQnk/FH; arc=none smtp.client-ip=209.85.160.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iPQnk/FH" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-41576c5c01cso891875fac.3 for ; Thu, 26 Mar 2026 11:56:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551374; x=1775156174; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZmHuo2gpKk+a4rM0v+S94FJooBnanLI4bt90pYFjtcE=; b=iPQnk/FHvQKqZrVBOSumyUgFN9HNQFNdVebtoip+Vtcz1qhtGcWMB5RPGejn7hfeVB r/gnzwrAg7+cWkGhAzHgfWDklYX48n+D8gznAWAGPQZUobrwxGKzCnf3TrrR0EjLtEGa TB3f1w5Da4mjF5gzHkBy0NM2TPa8xpBWkewfnZ7mqVzVGmpgiLrpf+k4/nccazhiR5uB OxYvPsgmmMeued5TRBW9l/2l0xJ4qW591b15YS9G2UhTtU+440asLG9kIMpvs43jqmAh 3D/V/1HtwNpj6rzBNPNNaQuOxAbywDKgQtvi4BHjM6NhQLxKy3ZpFeLHqBudfFKvODMD 9jZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551374; x=1775156174; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=ZmHuo2gpKk+a4rM0v+S94FJooBnanLI4bt90pYFjtcE=; b=X5HsiaFD+uDTQxjtkr/SR5jmqV/Xy9QRyh4apWZFti5YZSs6rTcnq1VRNbb9tAUn2r qufj7pXj5tGW0eTIqUn9PAcz3rSeXYNuFllw5lePOkEoUmchAtShyJY1jAoOLmNdk8Rf i5y+nA1C3oe6eFuTHfUvyyY5FIMmNuUnBUKnyT2fc6Yk8w56G5VR5MxddD+rylm67Mqd xGtfe5fN4M42rcqsH6d8e4K0Dl9uqyy0TACn6d9+yhDNsJt/wsnuQbggr8jmmUIWf8RO xC4QT2A0SXTmdb1kyV2WQ2x6nYQoBqeUbOaTdvb+AxLzIKw64nvuR+7lmk2IePO6qsXo VQhg== X-Gm-Message-State: AOJu0Yzxu+O2d+greJ/79fMIOZ40URwrpjTc36k9TCr65DEgqe4+xymN PbpJOj7gwPbgqWKSbAY1N0raZBtkrnVJmdYtu9qM9yWERnFrA5hXtB3baZxgLw== X-Gm-Gg: ATEYQzwW/Wu72p2vjuFfOopB8HvsYq48qMrTMSLkRHGw2aPpy3F1Z1VJQM0EoXoo+4C dBjfbAhE3nqbwGcVx2uAQzEjqXDxkeuRP42df+UFx8CbmzbGS/kW7NCinEVH358ewI9Qjg9uLXe NzSYZstKKKxDSR+OUtMbL8MhzKSxKYH8ijNRc/4AD4N8UNGMGv+8QdWO49RBmwykQsMsho/3oqS JpJpOFgBnK4fyYY4csJVVHx89FyJRmCjaKF1VbvckYGqHdjCdanCfNpj68BDiQDP/0tutoOJ/e4 xiRBHgVhJyLJUVhXHbnjdOypV9iZEh/IKgSSmLWk2wlbEUgzthiMJO/91sls8oDpXwtrKPmmhL7 udvMSrZRUzIrS7A3vUPG/nAV+Qt/vA4aO4z/uwf1QR4x/3okYrRSJpCwf9XxVUEn/w+cuJq4dKR CasE0ShulhroEaFkCZp9m+AjeO+AsJjW48ilZq3j99DKZQZMUG X-Received: by 2002:a05:6870:d60c:b0:41c:5a3b:1afd with SMTP id 586e51a60fabf-41ca6ddce00mr5003080fac.13.1774551374333; Thu, 26 Mar 2026 11:56:14 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:13 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 68/69] accel/ethosu: call DRM_CLASSMAP_USE Date: Thu, 26 Mar 2026 12:54:12 -0600 Message-ID: <20260326185413.1205870-69-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ethosu.ko has several drm*dbg() calls, it must call DRM_CLASSMAP_USE to tell dynamic-debug what classmap enables them. Also include drm/drm_print.h explicitly. Signed-off-by: Jim Cromie --- drivers/accel/ethosu/ethosu_drv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/accel/ethosu/ethosu_drv.c b/drivers/accel/ethosu/ethos= u_drv.c index 9992193d7338..a0b8cb81a359 100644 --- a/drivers/accel/ethosu/ethosu_drv.c +++ b/drivers/accel/ethosu/ethosu_drv.c @@ -17,12 +17,15 @@ #include #include #include +#include =20 #include "ethosu_drv.h" #include "ethosu_device.h" #include "ethosu_gem.h" #include "ethosu_job.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static int ethosu_ioctl_dev_query(struct drm_device *ddev, void *data, struct drm_file *file) { --=20 2.53.0 From nobody Thu Apr 2 19:06:20 2026 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D171043D511 for ; Thu, 26 Mar 2026 18:56:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551378; cv=none; b=VU6vmBrih57XIqFSbdnmpprJiLnnsVk0f8UaMWZekuIE90EzSvY1afOop089f+qGRa+4wpGhoVFbyyd5LadnWtddTH6v4QchlwfOJeK/9/Vj/I8ti/qT7ykNGVX97RT+XUeWUeGm8SwQ1DjmLz1CIKHTAN39yf0YYqPfIVnNA44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774551378; c=relaxed/simple; bh=vbo/1J7VXFa6zaUXR4UhQRabjHLi44yC/GOBDm2eBhM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ObLWlaIqVNCUbkvcR4Gzcgru8LD7kVLe2e3hXR1G4jIZV7C9Memc4yNdW8Chkk/0sD6nxolDZZe9uz03JBuLwFGZ0s9aHvxWT1SOsIq9vW1qvmV7tckdw9xFuSMpqfGva01AAChf9iDIM/yLZjqzdNBG8z30bgkPkDjDV7rW2mM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=hTnU3g8E; arc=none smtp.client-ip=209.85.167.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hTnU3g8E" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-4673790ab85so763187b6e.3 for ; Thu, 26 Mar 2026 11:56:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774551376; x=1775156176; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FB+tfLWkD+EbK14YUmCdfR6TCrKrYU/mryJ+Tht/PKw=; b=hTnU3g8EDTstwaaHcKQ5zNAPnM9XDAziv5G1+D0pLjL93IyVxIE+8e1bD7EdX0/1Rh 38W1Y80MB8oZNv/8tU8uSMD09efxHAlkKyMYrxH1fAV1flZzUAwCKHtAwpGpT1bpoHTK m2ZGU8Jk11jb+bTxye0VBKPXGTrYGC85tttRrrtjf2L4fOsg3KCzhGU88MTa8FFKPgRE PU41vOfdCvkeR1EhE8d5uMWd7/SqA14uTF0WmwuCF5OZJtKGNic10mD4Ap9Ls46h18/n /ag1QQH4eHvTJM5tfTLg0Zf0EpYMA1JrWjBakKN6Zp8YKQoExL6xVrCxaGD9D0EX/XJ7 QHaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774551376; x=1775156176; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FB+tfLWkD+EbK14YUmCdfR6TCrKrYU/mryJ+Tht/PKw=; b=OJEsDbgfKQAmby3mErLYuj/KQuJO1axq51mpBTxvYVV8l4f2ubpImOwoZurR2yusnI PzsU+BhRHfymQZ9AAg0i3of/cFOIg+MXCZKRnqtj/N4jRalWDpxCvcrZAwcDShBdLAJG xCKXdc3/msBdJNrpqUaaiMvWJ2cQsOEkJbnszQVxzmsk7GkI6+kVlpCnAHOd7tvRLnpY A0wBU1PClD7v6AJC6H9Sr9WOjO6YZMx0x0txop+voqVfh1qrKQCHg45fk1FvjhikOumI 69T6dK9kg4zrunniMSsA7fE0CKseZbW6gyxDKMEMRgJWM+F50fKDhx0Tv5Bh/M84KUIb Zqkw== X-Gm-Message-State: AOJu0YzBIQaHAdMJJuUD+s7f8zNKUAinE7AWRIUxM4nYSZq9BJXtZVrz tErm+q3FWX+Nks89pya0k8vAdsAMO04ql7mkiSTeK1cBnOWu4tNVXBq8x0PGOg== X-Gm-Gg: ATEYQzx2GMjlkJHMHAjrQKn6bFcJ45DT7R1xFb653ZiHdaWTgcECdwJ3WU6wtoM9t4D bQ12WrhhVjuaE8s+r6BnmVfsYMOfk1AmAgAtfbLQleYj57AbfvN4xWMZbgyXVVuh5j+p5y2jYzu xW9mmKdJSRoTkgiZDZj2iSpqGDYigXEgte9IOMzBK6SzTX8rNpQgbfo1p3EDcUAijrdslnnPvQZ s3wjyltSf8lMpac1YBdeuYo9qwYJhYaz/fAvEPK9npgYVWM9kq6dT7QjEep6yzgf8dF3LWwjSOS 4XRdDIjHzzCTDOOWVp/hh6sXd+xt9ULYc+YWcg9rmRr3GkS4Hyl2E7vFC8lKitB6wIpYEq2GsBI 5zt7uu999goWS7wHYdRkuf2zDvX8RAdyFnvyH7wnKCjjFVfn+ba5l4M138JJouia38Ouh3t3lYs rtme/tlnPwmOIxYpERgxiDrkX0rgJ7zq7UBVxhMUn7CyQf8XMs X-Received: by 2002:a05:6808:6f92:b0:467:db5:8b1c with SMTP id 5614622812f47-46a5c610272mr3956953b6e.21.1774551375644; Thu, 26 Mar 2026 11:56:15 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 586e51a60fabf-41cc7760c08sm3075171fac.4.2026.03.26.11.56.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Mar 2026 11:56:15 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org Cc: jim.cromie@gmail.com, mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v12 69/69] accel/rocket: call DRM_CLASSMAP_USE Date: Thu, 26 Mar 2026 12:54:13 -0600 Message-ID: <20260326185413.1205870-70-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260326185413.1205870-1-jim.cromie@gmail.com> References: <20260326185413.1205870-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" rocket.ko has several drm*dbg() calls, it must call DRM_CLASSMAP_USE to tell dynamic-debug what classmap enables them. Signed-off-by: Jim Cromie --- drivers/accel/rocket/rocket_gem.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/accel/rocket/rocket_gem.c b/drivers/accel/rocket/rocke= t_gem.c index b6a385d2edfc..0d06857b96ad 100644 --- a/drivers/accel/rocket/rocket_gem.c +++ b/drivers/accel/rocket/rocket_gem.c @@ -11,6 +11,8 @@ #include "rocket_drv.h" #include "rocket_gem.h" =20 +DRM_CLASSMAP_USE(drm_debug_classes); + static void rocket_gem_bo_free(struct drm_gem_object *obj) { struct rocket_gem_object *bo =3D to_rocket_bo(obj); --=20 2.53.0