From nobody Tue Apr 7 11:17:21 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 1FEA926ADC for ; Fri, 13 Mar 2026 13:22:33 +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=1773408155; cv=none; b=e9DgGfv9LAxQPB/RkODUvjVD+KwEb2nUiPNWhux7jCS7Xd9LULtQGqpA8CjvMv6lPNJafRClp2UyzVxU0zxqzvn5pA1/HJTkBm+MF8oqX14QPSUaG4Tmskj07c9o5+Rmwt5qizY32v5hrn78I1fVzOQ8mP03OnpE4JPAd1x4T7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408155; c=relaxed/simple; bh=IDRek7YZfB+4Kr1w0QgBbJ4cZK+zQPKPw+4cJp1INA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=P1WcIdIIt+R08yOOr4EL1h2rsP7xIjm+01QmmPKT8XVgOwS/71vJKkEQjbYrwCQHFbgMFue53MN4XjcAGijmaOTEdKJabDTyUNN3oa36MdYhRxtY0b5UJML+zI37Fem8teOSBi4jlHXgRngRQoX+WC1B2Yh52T0H4bjbMHMsNJQ= 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=Ai4Wapwg; 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="Ai4Wapwg" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-4671cbce626so1071956b6e.1 for ; Fri, 13 Mar 2026 06:22:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408153; x=1774012953; 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=J7LRJl13Yqup7eJj7JB8u2raYRuugKEd6d7nm5DRaag=; b=Ai4WapwgseEQ6CVd+d3uDQyCFpY2RCuB77GyVqTYCsL5CAple2htyyXfmP5GKp8rxP vEQRdAE5Krt0yEif6tL9DWso3ScpEavh8bsk89zvzJnkXD/kxp2AG2Ji0iC0B7XzPTVU R4m5QzQJhDXOSg400VxP3JCgduQgpvrIXeo+wJUOng0Y8e4IY1wgKo/Nclw5UkgyDV9U T3ztz3aC74u+kCOm30nwc/N8qD31YHKyju5jBlmjzrQJlL3FJr3C7DEE/SSmd1Utwwa0 41hDueJQB66DR/HPp00cDRTMft4idMgtpGdHkbwBsK/BXKrYTlsE9j2xNp/SjhmUW5O3 raFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408153; x=1774012953; 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=J7LRJl13Yqup7eJj7JB8u2raYRuugKEd6d7nm5DRaag=; b=Mf8414QEC6q2g8rsMOrudeq1YVgUMjYOhE/jPVrY74Y6jfV4XXZh+/DnUES6ndQNpy vaY7CATuDiruKm8btEW4IQhqJdHJQ6S/IocG32VExM6UUjD9F4mUrEzOoAXFsjQXbKQD G2ZcADsPSWjLnTVJ6YVFSMzutrvGadc9mvI6QoJQuT/A824cqZ250ZzlqrivP/ADYjux 4TcRNbgu+YT/AOjlVR6jc0lhSg+0dm/jE0PFVMH5KwAAdfljA8Pp1ws7zdE+YTjXMeLY Ra1T9NJYP/IBykZJ/30YagjR/Nr3EyDBZCqa2RxDOOYsbl6GAiOYHtChnfoUK289fMgP plpg== X-Forwarded-Encrypted: i=1; AJvYcCV8hV8M41Z8myF9Z4x0cXdX6Ss8kNCcoLccJ4WVHB83J/Ku2ZNCPhdZPoflehgPQUQtUlDPwas9umVSpbw=@vger.kernel.org X-Gm-Message-State: AOJu0YyVq+SJK013ez8ZHPfmhccSWEKQNS5j5KcgCab2g5bKCp7eKBRI VDmsy3wkfPcF8Y7TUlU6hc0nWKWpNm2o+3goJLNbrjU02O7l1vzeoKIa X-Gm-Gg: ATEYQzxMcDy5/gPoUUlZGziFnULjcDWJ0zFQ5hBOHjXfrU1rjkFaZSYffi+1pQSa6LW gLQ8wfuSjaXTYf3XuSeifSGD0wD2E0ZRY9MDiDfJaIa7ER0rh8o1Xj9VZaOHiGXpUx9u2AiCGc2 E9OaU0hKfEuVkGh708ET7rtfRDTw/9C6QKMm3UcheSidH3MmAE/g8K6dkf4xRIdoB92THTneCAR nj9fogLZO5awtIBhF6lY1oSbtAKqNPmql03k3T7Ooo1pELVBRm2XMxiHFdidI2x4Jtk4ay2KB+u 4iBuoNQ5tpN+NwnIP9iwvx4DzGnl8jxhnura1KmUewIbPA0zQajmNLkHlMqg/cVb2Twbk8hObnO JNKFeQx6YhOD62NXzlGijWNCGn2+TyfH2kbQm8SuqRJdUUJ2ajnDVbXeYmRNtaTchzrIYuv+sFq KbLUw1gwV/wdjVn6jqr5u25s6Fl4SArqJAfcUVKg8ymvXSq8Ub X-Received: by 2002:a05:6808:1b24:b0:450:d471:dce5 with SMTP id 5614622812f47-4675701babbmr1567747b6e.6.1773408152897; Fri, 13 Mar 2026 06:22: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.22.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:22:32 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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 v11 01/65] dyndbg: fix NULL ptr on i386 due to section alignment Date: Fri, 13 Mar 2026 07:19:26 -0600 Message-ID: <20260313132103.2529746-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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(). To fix this, employ belt + suspenders: 1. move __dyndbg section above __dyndbg_classes. This restores it to its original position directly after the ALIGN(8), and fixes the immediate problem. 2. add ALIGN(8) to the BOUNDED_SECTION* macros. This aligns all existing sections using the macro, and also fixes a future dyndbg_class_* addition which would suffer the same misalignment on i386. Many of the existing macro uses already have a preceding ALIGN, these are now redundant, but are harmless, so are left to avoid churn. 3. remove BOUNDED_SECTION* uses in ORC_UNWINDER sections. These have smaller alignments, *and* scripts/sorttable.c does not tolerate the added ALIGN(8) padding. 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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index eeb070f330bd..a2ba7e3d9994 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 .; @@ -383,8 +385,8 @@ *(__tracepoints) \ /* implement dynamic printk debug */ \ . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ @@ -867,15 +869,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 Tue Apr 7 11:17:21 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 8E4812F90C5 for ; Fri, 13 Mar 2026 13:22:54 +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=1773408175; cv=none; b=GiO73BvkbI6MKxg18XC3axOvrZxyUEK25f7YEIPg/Vr+FKyHjsOT3AEiDP0elizZ1vMyKEmAyENinnkD/edTjbFRePmkRPg9tS0VHjkQUE3ZllRK6VtRh42PPR3WvjO+pYZUfSls1NM4u8LNwnnY35+JvgH+Z7kcjmBVJaDbvsA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408175; c=relaxed/simple; bh=m4l8y31rHp314wh/pOxhDrUgtpeO5zShqIbyCammnKs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b+118IpwKaQIa5XHtFMUdTGOMHsGfTPPm1FvdCUiyyvb0H8D7nLtU3a2V1d+IQn59w4fTXu2pTmzmCkhthIbOWPkQBC/917l8QWf2MSv5iLhrCpJdTxgue6BBVXRyNvSuJ0/9EWushZOAa9DRTRPFyDvg21K8eWEAeuWZm4po/c= 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=BAjUQiUv; 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="BAjUQiUv" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-467161c4b89so1364615b6e.3 for ; Fri, 13 Mar 2026 06:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408173; x=1774012973; 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=vePjq7+VFJ5ZhNc2ZqKhZQksj6wQ9j47ntZTNCfs3mg=; b=BAjUQiUvPCMqwRaoTiNYNTxYQWOcyNjEgj28UR26P2EAjncQPFcHzyFo+nhIW5j7Ol SitrkRWOykf87NJmXVK8AYt8PSlkj7wrPd7vFhPL9GHwY6Tn4H3Svg0LpJZx8TCcdTnd PMM5ULtVPdB43Jrt+a1a5B+af0ZwqoD2g7YAJcoKpW2/SMfcWnTkfIHtzQLKjPR2xVk4 oBZL6wWVh66ep0vQFoCBrhYvdbAZqMgsQKNCJIncGbflEsD5/ld1ivaevjuLaX2ytPFn Fdm7me9C6RnsVc7sYLweXLxlwv/PzWxFgvCSA8WDqhj8XX8rBzxa0jiWqGIq3Wcsv8U8 Cq9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408173; x=1774012973; 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=vePjq7+VFJ5ZhNc2ZqKhZQksj6wQ9j47ntZTNCfs3mg=; b=Ry8xe3C0KzJ/bPnOR0izmPkrCmF/2OMI6hFvNyUS6TScD1c+tKeEyCAf5zyhjd2uwX IFjRA82+mTpQg4ns2iCyHv28dA0o1mTn6yq8d4PWyzTZPSZ9cl67+tjo70ejLhKA7eHu Aug/Hyk/+2DEiA4C4qGPuYhbu23z6LBqokUpcMjMkJWNCqZb9RVwZrlllBmW0MXOksVH Twe4cTYb3sLMG/iVZEZtPDYqNBWsSAFlLC0ao2OCto1O+U3RzIXoXpLyMnuZDk5neM40 EUZH3fKD6Zjtem+CyKAMY/h2E/UnmxJsp00ow0V9UEjHVF48S/j62YqqxbQpKoH4HJOS Cn7A== X-Forwarded-Encrypted: i=1; AJvYcCXvBzxo8rjbG1jp+sCBcSh8DUfj9duTu2Q2QFkBQ5vfHd/GNNoV7yHFcd669NpWvLufUzqualJK0yxn1xA=@vger.kernel.org X-Gm-Message-State: AOJu0Yze8+GMgmIe/z/N2VVM3BML+cd0IobNA4iwns89dFRYMENX0Zhe ZnBVAaL4vJRB4gGgGSIQ6ZbTb60YJx95E+FsCUvMlPqs5Zeq2zlyTANT X-Gm-Gg: ATEYQzwkvm2RyiK8dMPK6W61JomdfWMo3seaLeH20QhSXZoAZ/Ffp+AlpOw9kc72j3P r+DOzPOESx2OPp1MGpBq4pGkHiXltyYj9Wr1kk4aPmsPu404hmHzvqRa8pTnnX7ymozMYESkSqM Sl+V+o0HIHKQfGz/JtIWVRj0m0ud2BWmbKpi3rEogTANah+u49IDW2l/HQthGhjK6yJhYNd7MXe tURtqWw7njs5izNPjoK7r5Uyl/MgYAeeZOptYt1CLtS2w8Cn9hviI/IDsDyrg6WvTOU2nWDeF3q 1QCcpRaXM25K57/ghWNM9aIwAmILuONbUw3NyzXOeh7+ETORZcpZh7QK9BHp0jIlTMPxPCaohuQ ZZUp5xwBe1sHaCCXc17WfhMoB5csxPZN7khknc/PAO4Oq2t2P64rmMgMZ5TTaqtzcsGKeyxR1vK BanCqYbC3DhwF7VU1WqpxlA7EwPri5lIFkWu06RG7gLQZ+5Wkr X-Received: by 2002:a05:6808:158e:b0:45e:e07d:85af with SMTP id 5614622812f47-467570a2be8mr1583016b6e.2.1773408173272; Fri, 13 Mar 2026 06:22:53 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.22.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:22:52 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Andrew Morton , Jim Cromie , linux-kernel@vger.kernel.org Cc: 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 v11 02/65] dyndbg: factor ddebug_match_desc out from ddebug_change Date: Fri, 13 Mar 2026 07:19:27 -0600 Message-ID: <20260313132103.2529746-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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. 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 Tue Apr 7 11:17:21 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 5FEA9258CD9 for ; Fri, 13 Mar 2026 13:23:03 +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=1773408184; cv=none; b=TepzaClVJizjNElYktxwfoFnlffkNi2vZPPcvDwdLIbGl7DW83m2ffxZCEr/u+j5jqeWWejdOtZ9IEDKpUC7wfCpdZhgtd8jw0npOs9Mj79GMhh8WI/QVBJJq75rmHcCj69ZayIXRdjQ5VfmukryCz68Krup20Sf46v2uwLHCiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408184; c=relaxed/simple; bh=+qoPaqFMZANZ5GO9HKrP/DwHGbD+bYFDH9gWrXYcZT4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B9g8x1hOsxJF5KnmMis+gAf9xUPjo+drYMOP+1KDe0PY6nzVm2DCU8/MC8eJUlWhHQNdlkeWg/uGk7DtwZHlXtNrPOzxrcXbp/ZgJsGWz95SpS3jgn6xzF1Qjuh6WJK6UwI87zFWzjXnYylDLkMMbteFVmuwEuFj72+u8pEXGBU= 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=lAKsXsxR; 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="lAKsXsxR" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-46702742c99so1400989b6e.3 for ; Fri, 13 Mar 2026 06:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408182; x=1774012982; 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=lAKsXsxRfg3awgQjGNj4uSoz0qUztu/QwYs47VQFWE0X6tHFFo3Jp0X41jW34rg1c+ WwLznqkWtVoIdoKe7nTW2c2nCxi0GMwGZRqVzwYP1RZFn13oI/NTHvcqmrO1rc+dfueY O8NFA0td9uHoe0NaC1tX/z17qMNbOMnY2wmsrWjgcs2lum/Zb7ZLUzlXh7W+qtP+dDlR tCPYLYLMT0gbto6pMO/Z15iJTdEOsuSur5c/agAQFGPa8v5iHVapJKoVj48ygqtBHqDZ hujLBQp6DPCCcmDZEfWMyP+r8snlN64icYPCUR97fVvRyVLFzYb1FJLVhfBRhUCxrm5Q uAKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408182; x=1774012982; 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=NkN+3s/Y8/1ylyyYp5/lOD7afhZVUtJx2WRYljfwwaKm/OFKQHanOpKklvliFcWhbm rj9s5qG33VFTrnnltAyEGMW4CnFLjNhpOefftnBGVrON/Cfg/BzvbuIuQ3jhzFDci/5e BAWsGHfpY/grwnPcmVWkG7OQarAObdNPlJCSB2qfMiReKlYj9SID3BozrQC+NX4dQDTg +bbbXcBP6YhJmdWIvnwnmBNcb8wMoWz9G9x7UsEjo7V57YFFY1NF4rq2oU5DT/njsCz+ 0SJl0v0AejguNVpISl0TZ5cBzcw65Z0YTKaRVPRDb7/QV+S49Jgguxhnqv5GbZqySpZM ZcVw== X-Forwarded-Encrypted: i=1; AJvYcCX+pxzH1TOyc74+Ki1c8tT12LDl77+bIxK+J3O+AVqxEhuN3FtSb9KHWpuvLiXNoWouGEvasgDR/tHQCVI=@vger.kernel.org X-Gm-Message-State: AOJu0YyrVgE4OY9PiZyd+4YPePnH4j+66pAB/fQJkOe4Wv2gM9ghgbG3 cfv7NguanNnIc3wcOrGvQYNnfeE8+kJ6TA7jCbYUv4Y+yfN5atIyMVwY X-Gm-Gg: ATEYQzx6LgOhvW+1iqjsqZwU7GVsaDR7KumokRUNaxjHt2q+HrBiUFOiIfgf1MfrIka IyiBnUnS5b89iqYiFrKz5BZx/iSBZXmUYD/RNJ4J45JLyieFvagmQMdm610g8yR1hvZlHsDxFpK gNpjdsZNYWq3+Ab2d+rZXRNNN5C6EEtH1Z53eKQnLCC4dUFWFD5tbBFjZu2ks28rnqNVjFMn076 j/hZ+yW2HJ/dDjCp8AqJIJ7isOGo/k90xeSh3EGwoJZEzJ1uCQZdAj2QdMSs1Wz3yVppJu9UmvS GGwaq/jqTqEwnCsU4UfIZi/0bOfIVQIv5qK+ZRE4mD1e6RJztfRXt0oWA0JGpJ0lO987p515FTp zzDOlOlhDaFIIFq4RFnol3x4wL3N4wNemZSUnJ+LT4dZNRGWF3U02wXN2I5tvmb9WChRVCVQMgq 9cDles3oMXtzw4cLC1i9SKqoVN99RseKD8GzTiGdoF0JKcioOr X-Received: by 2002:a05:6808:19aa:b0:467:284:b3cb with SMTP id 5614622812f47-4675701cd1dmr1817809b6e.2.1773408182075; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:01 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , linux-kernel@vger.kernel.org Cc: 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 v11 03/65] dyndbg: add stub macro for DECLARE_DYNDBG_CLASSMAP Date: Fri, 13 Mar 2026 07:19:28 -0600 Message-ID: <20260313132103.2529746-4-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 1A8E6330B3B for ; Fri, 13 Mar 2026 13:23:04 +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=1773408186; cv=none; b=Wl8n4l2JjQGrzrATEFWpDMvOPYznpjpXvJO7N1G1axucA7+McHlbXG94y1+rq/ZWhWh6pDDhtWdPgKlPhAHujK9LLUWx5xqMKBdFcrijUhFl1+kR7VmXxuf6iZbOSWK9+Dn/PsYs5VBAxGIIeJCPORT0qz4EQ589FFv1ijGXNnA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408186; c=relaxed/simple; bh=cyuCHdINxAxB3Q6Ll+XuNXFb67j/pcTpl5AcamKnQbE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LiWNwXKB0cECLIh2Sej/mEYQPxGxI+p8jmRbjs7IdLZU7lyS20YO/C6EETpgNMGblXb57gQFJFiz+DTRzzOS9Qr26YnkvGfxFDJm+ixVGzIT7/AfaOTQZV+XyQwfTuo2rwBe10Gbp/Lw8BUfncaEyz/9D3o5W8/HXZYKUhVRtf8= 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=G4q1L3cj; 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="G4q1L3cj" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-4673790ab85so1445049b6e.3 for ; Fri, 13 Mar 2026 06:23:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408184; x=1774012984; 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=G4q1L3cjfh+7wIBsaUQdBYz9NOyeDWfd3PfYkzIXD3QVKPDP2eMjOVdYFczU1Qtktf QKAG/kaUfV8CfExK5oj2OeRoZfFfNre4MhV07gvPe8gdLkcn/ZrqaERpembqMxg2qomu rVZyXcSfc5n3mXQZozUplim2sHqChyHQjx/ONn7Ii185HagDIybYpP41XQG1O3gvYJR2 5BL1/SbsaHK/as92iJZYT0RqWvFhwM67cbPUzQ6QVFik3r4pVaAqc/rBkytuSuEmctfc NJoYv05yq+L22Tnc4ufDtKq99Fb699oX+QbpmSCWtOVWXVBKUwiaEJGrgddcevUCWNt1 6ZiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408184; x=1774012984; 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=V4La7u6Et9mPcIYl6zm5VJqVE5p2icofm1O6tvWRGxjz+lHVqHIV9SbTLFv7zjPquy kG16hK/ONxNITeU67qH2g/HMRf7fXmmDAr5c6Pm25l3l4Qc6wasjaKX8ix6YqfEYqttx 43sW+f0gXrQ7QtkJfNI9iejB3yyXevOdt1F4zcSm9fh0dCS9fEqSKpfqcCfI4+W0aodX 6RzBEf+hvBUZ8sidAvgdDwkX5tBRHEe/y0GzBt4AjeZVbl6smVoNZCb2QcSWR15VUsx3 SIg9qmZxUSFk5PV1h6KRPFqBoh6TBQJDowGI32OvwW3BzsfVluzdfy9SkI7m18S53nCO MQgw== X-Forwarded-Encrypted: i=1; AJvYcCVu95VI1otoa4pctXRphpKL+gwpqqpJDi3fWwOJPADr4twsHBJ9v9HLsbHeiWLHCUWNLCBciZ9rOoBazvc=@vger.kernel.org X-Gm-Message-State: AOJu0YycHr2I8pM2WSyKROmS6vTUtnYLGXHLhv0LqEnWp0XyqydeO2rk GBk+g9tL96IRccZSJkxx5Qq6jvdoeIwFRFkCVa12vbCST0CO5QRr5T1r81twcQ== X-Gm-Gg: ATEYQzz14bjdYWXi17Z8hpj4Txf3Lx6DA4TjQqs2K9uTVl9FqVglz7kFNQDXGKqM046 hJkXq7hSdjNUN6LRGPrk+hwbBdddZpFtkYLGA7z1PT4E/bvIZS7cZxYMFUi/iMcadTai5YnE5em alpffdO0vUQaobQgjBNwJ+RasC1JZdNbL4yPGjxb8Ttly9K5D3NwOv0/FpciUUYhM8yz+Ri4xVO sLowrLF4ir26KNgSZnbkbyEF1HqJND2Jp0XqX3rltwhQFmRZZFq3Vm0V4NqLL7FPULr2XwllN8C D9GiQpFlTDp9l+UjH8mJOT9I+cxqKn0Fop5t1FuQbxeJEp/AytJaOwGSMg95vqo/XIXJHf5Oqu4 vuRciEeD8P6TFnn8kM5JbVxZfgWRjyn3q/P7ZXhvka52zM/KWNmi2FF71YLv9RzUAwneiyx31Uj zP6HZcnTmYBiXJUKx9gv2qaTtNmLEFgYO/SxYBV0caccQyLXiPnQHd760hkcU= X-Received: by 2002:a05:6808:1203:b0:466:fb74:1ec9 with SMTP id 5614622812f47-467570ef685mr1573218b6e.4.1773408183890; Fri, 13 Mar 2026 06:23:03 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:03 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jonathan Corbet , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 04/65] docs/dyndbg: update examples \012 to \n Date: Fri, 13 Mar 2026 07:19:29 -0600 Message-ID: <20260313132103.2529746-5-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 F238F39021B for ; Fri, 13 Mar 2026 13:23:06 +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=1773408188; cv=none; b=tsmBB6CB/7Gndl0xEinOR2ZxkEhRgEuNI3hg+5OnWz3AZD0O65//eS/2+McXVgsAZoLwJum5fGPRn9SjM6VYW9TxsBsfZLrtKt86xjek+wTh2mM4hidyps42ZHcnxEnAWuFOXOuVmrQ3f8ZEX/KF2CsQz1+tvEN+mxcKt3/BpWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408188; c=relaxed/simple; bh=E1VF4T7M7c35q9Qypwa46ANAajyN9sx88/WRdouByGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fJL/HW7i5+ZXlXEP2pt4DYq0EyJZiTvg81JozH65ZlQEXLsqcK7ccf2l5iXfpakh48t2EeJhFYNn/jUVo//h+yrzimOrwPPoyoRn4zuzSsa6L+BmlmEqvTkCfrAInUuRhlut9Ju6AZviGQClfFw/rJLY7gf76c4/NI1VlUCQDKY= 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=cCS2F5jr; 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="cCS2F5jr" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-46704177508so1464973b6e.0 for ; Fri, 13 Mar 2026 06:23:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408186; x=1774012986; 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=cCS2F5jrWy3+pT9/v3IFHHzZRS4ryUIg2i5U9DlQ3jvYgExUV+hhfaSNFOwja33kyt tDbbvGXw9k7Ax8T9XzYUNYpjvSVOwi83ch0X/idihNFsJoB7oyPXgXxBSDlO2ghS15S1 Q06mKVbT/q1WoKwM9js3bl+m+OyPSsV4L8qxzkw/af1srfOm3uX3Xo0WQQ7OBTh1rq5M /SNbhXVHtjENZQDlx4cb52hYayqCMblD3RnVsiHeBwEmrZ1hUyyUTV6JsfcDu4kPB7eG iMXPf+rs/1kDiKN1SpsaIQuPtComD4Y7vOKKGWDhgCLFjuORGnktQ1ew7Tp/i9vrZ4nL m01A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408186; x=1774012986; 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=hmqAprXXhKnR1Y/Z1q2CEgXj4nwYaTPI0zMXoIYpORv6C3v5tt582IrwtJv6yqipTc 1aAmg3L0oN6harijXxWlcqXja93QLvIHsY3Yl+QPYk1L/6l5D7IV/TJAzhO3uqkXcwEG npbGnOE4n93cxeXrGsdFnDl+nDGsnD7oK50fuk3tkBv8ZjetI8ppSpqyU4dM+9eCEodu 9uZJK5xrtWdahJ28LQj9Qqbu37LKPNSpIOTN/gryTxmnHfgNbptZCzgohrxkoSYUAfQS 6bw2GaiCsCToWFSW0wTmEI0SrFhqhtdoBdx5XP7ulASHsud25uVGICRJlm7TgtywBQP1 KuDg== X-Forwarded-Encrypted: i=1; AJvYcCVqnjo3cnLjjD3ncI6i/17rULPVeS04VN4zo5AW6VkX1+k8iLK9JOCdCA1vKmsatUO48/8FJkT2/Qonkys=@vger.kernel.org X-Gm-Message-State: AOJu0YyG5JdQZaOhZEz4A40DqheBDxV5aA2/zJYAloDngaJcsRXlhU6n sCGp2KGk7Ae9pk0dqdzC+EmqbS7UgD4PXRZos/3bYbOIGuFyzl5HLgy8KEqycA== X-Gm-Gg: ATEYQzwtP6gPB0LW3zqrBT98tnJuAzXLLLyCN7XB24pWODpyrvhSvpljxaarvRy1Xem 8h3ZyzXVRdeFbqwSpVG0yo/R7eY68C9FwKlrOX6oZZajXCT4fEUcmJ/M7AO/DvSgtFlr4QM3raG nfZZBtQUOF+MjyZ9eGd+GwgloiI9pS2Yj8BCfln7ZlqAniousUzJ9F8JeatNE9zFiZdhVhZo/Hb 5oZQH31L1nbFsiQK0dSA0xSlSHzjcFH9cvNgAFhClW8Z1F3VJZvfD6CmY+LHTF1UU4+UbGPQC/G /2eRSovRLGjyixf0OIyM2zqxhlAy23Tx42hpUo5bK8ajnzLYfB3QcFcxU9D1paBIjDy0TfiYcDj rZe2VuBUxkHGBXHnUFyL8hh6CdmoqbKjhchWI2759MDYIEc/9zHYfkO5TvqDsQKZ8XZZNKmA6v2 vFR0LCU0X+5pDgodOcQieYsKLCxuDigpqPxwj1qnzEBc24nB5S X-Received: by 2002:a05:6808:15a2:b0:467:1e5:6766 with SMTP id 5614622812f47-4675766748fmr1758674b6e.45.1773408185885; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:05 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jonathan Corbet , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 05/65] docs/dyndbg: explain flags parse 1st Date: Fri, 13 Mar 2026 07:19:30 -0600 Message-ID: <20260313132103.2529746-6-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 C52F832E137 for ; Fri, 13 Mar 2026 13:23:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408190; cv=none; b=qf4A19stmQHNJC57C6zoPwUrOpXcGk1ZQV7uZgvJuazjLI31kug99R8apl9UU9RNKP/V/EvOsJ6tw3Ky1sVPKQR5M1BY49AAQp97508/bx0jeHTcjjIPScJHpNZFQm0DULvakDwtzPz9Ctf/VapfJSnmXos9rVPYFYj2hzHkQUs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408190; c=relaxed/simple; bh=6qEnUlc0QW37ApD+4VV5gg8sRlLcSuU7c6UrMPZMZns=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IqkfZpHhWqvur4oJYxZGefQQOO6SH6eUMwAsVg5zFKi8nDBMGhwR5FK4YzPxSnyZM5+fWji2a1dFEtQVtndhCpRNpwvWlPvHCUZ6jM+UXz2SlLHifTITqwqd2b3q2dQjdmCnzJJmRHsAZ6z/EpEGAV4exu/ofhAGGaLoxj8iK08= 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=knyMHfCv; arc=none smtp.client-ip=209.85.167.170 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="knyMHfCv" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-464bba3a9easo1493120b6e.0 for ; Fri, 13 Mar 2026 06:23:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408188; x=1774012988; 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=knyMHfCvskvxcUnNvR25PcJVNzVPIXDUa7xX773rJR7HO3ZzG4iK1gCpSdMpNLJvIQ HsmvROVJ8dTuvp+JI8wNQEe41DUVmdIusijSqW38HlQdvOtS7N5FDmmfuBdnithsmiKB 2izdd/Xwmr2ixK1pSBLvlmEgx6VYZpoQb2WPVWAeYjF8sInSrgKtZtu+3mTYlcfkEMgT nvRjPhSX4FlXMRSKP4GjLFhx+eJlCT0FJhOYuncJwRtNgtrfK/i2pMjS9vNcGdCgeMNO AmWGDJ65NqxqYDUqcRuuPCC0AfZsMG9R38lBLi3aPpPRSS5cBmnhMCXQssvXopPbnpvE OfLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408188; x=1774012988; 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=rMI8O7PN/wjffhl5lzZnB7r5tvAhSLuzDamtD2jHwsHpU5bHjNHCSFirDSAAqYuJ+L jDV72J6LUOvEwMwDdC5eVFnlCxC+HefVbX707En//qFp7gYQBz7EOiEvOW51abPLtyGb K3ohBz3H3Hq0jJ3u2eW9sT2lQMgRwOsO5frFNVDjEYAKTTU4CESWeQFsAHoFASh0BJs5 0WEwAaZ5OWdJfZlUWCDzd1w2DDNXVQyG3Okt96ArKQ31yvZPAuq/QYgaFUnEApBWoQl+ bQLQvX55GCvVFQVA2pfmervNd4ubsNOGJmaMRVG0KZsbR9u45wkN56yqzjtjCxgzVROZ BhWw== X-Forwarded-Encrypted: i=1; AJvYcCV06bvBuEuXd7CetGgYld31Pe5EpSBbiEHGkosecOmy9eBK8vPf/HjXkgFpB37ejTHz78Rn2+lO4z1zcgk=@vger.kernel.org X-Gm-Message-State: AOJu0YwMb949Nj3+eOVEVVlNV9dWJZ1S7Yr6BlVbfEUdbsFcMthRLCRx dJSkW32Wq6ZbNh8wnNBJwcNzfuXTvfbYK+hKIqwW4v411itkwfTvqC9X X-Gm-Gg: ATEYQzwCZMeQMhL52chMFgDEzzislDYItnMsAxUwEXBdKRjyvVp7d/7w1zDyXlEvByX zydc73O6GeFGqXNDePP9XGNbYVmoxkFeL+1hWOH/hLB5dLcNDXuv9tXmfb1xvzA2KEYPHRxGsHk I9R8AjeijmE4049+FtXFxgvnv3BALg5CdQiJWlSSBwZowYbYBIInffxBFi3jdtA5gZYurGkqf1+ iupfbZs36mrmUaIjyAZ03ctgcM/lJaDSQ0fYOUnNExNpX1eMpwTNwTgLMaB5LOsgTGMzTd15U1v xQN/97shvu7Q10XKvuLy3Fl5HzJSWX5LQbsN7DWJYiu6PHr2cLYQlAPmsdqwoCFsg8s3Ewz430+ Q/Rry8mTEu3S9DHjlHr9BAjQaKuKoDY9zHSAtcCxsULca77F4rvUB18kkh/r1olbjc45QFq12Ef 2zkJMn+lfqqEsVWSeG8Ji71pgygzmjeTnZbUq05y/rAR/5pKMF X-Received: by 2002:a05:6808:c188:b0:45e:e088:5f3e with SMTP id 5614622812f47-467575cda13mr1872198b6e.49.1773408187615; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:07 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 06/65] test-dyndbg: fixup CLASSMAP usage error Date: Fri, 13 Mar 2026 07:19:31 -0600 Message-ID: <20260313132103.2529746-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 8DB0739768E for ; Fri, 13 Mar 2026 13:23:10 +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=1773408191; cv=none; b=EuaTj+eKJlvAe1E1i2C4YYUCA9QqauqQB5A1TCroDbB4gmNI4wpr5zXPVaJYSPVS39vQEajfHK6mUkOl+W9CaQbSUDNSjZWFb0HQChlHAS7ODdDvYMTA/82BKSUL+DAhlXPCqyETioZpeC+EICuh3WEBzj81WJL2Mm8jQreC74U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408191; c=relaxed/simple; bh=jvrncrmm4HxGPm4Djs0mIKZWZzF44X90wc3C8KMjy10=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lqVV0fdqXVy1lxvhESKoJBqm4v546sVQhQD4yUc/8yN6hsASH8wrX1S+PGWcG6Nyg7RwNHGWynZ944G6qysZB9/+hFGZq5bQ8KfAAwVmlrIDbTq0PDcltVWufet0jdlsMuYAR8Exjwj0/x3yim4MRDhi40f29m4LEu15AbBIhow= 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=CIKglHUo; 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="CIKglHUo" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-466f1c3c627so1552526b6e.1 for ; Fri, 13 Mar 2026 06:23:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408189; x=1774012989; 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=CIKglHUoUvLHKjbCQgo+kWeM4Dubu9u6wUXY42HYSOANX6OxP5Ws5XS3rZS+DSEcJy zawGWN4leg4arm8wl8gJq/UfJGTOBbR8EAr9FGyYeDhBw5PeNoQxeJqyYLS1EMjChoFh JeNZdsxxJ7da9pZefKqMtxwydiVo4qycfwx0JRBWZ43XjESLQE1V5q1/hucQH8g34oex TX2T78t/BPlME4n03LK+hqtLavjGko0j6djqbsc1UztbEmxk1jW6TKHeF+n75M79NBFU TdoF4EpFr4BOP5PiFrYID4FCvFiBGL42J5fUUJAO+0q41V7Wkkc9ZS6PQg2bvQcPUISi g5aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408189; x=1774012989; 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=UKtNt1vzqiQJVH0bz5ruSFW1UDXVyxXLx6oWrkQtUZm1dLr2XqIcoolX9tNrE4Zjzk BvlEP6+PWy3m+7qPjST2BIyetteh1wLUblEWfTfMgGPBRpDWUu+Z3U6cmFUiAMvbUPSO cS6hpMpGjRE124/y4H38wigziw1dHo66BEMFA6OX4trjP8kha9qL/17hIt7R06a0cnYr Vb6PJiRr4U30qDdy2t/Mn027HGQak03CWFPsdg6cetwiC3h8Zw5TXQsQx20pf+J+59FL YbBscZqgphjLEQ/iltoRFd2OceNhJabS7HNAiKbAVakfcINQ7aiE3gBVAv5d7Q4VjYwn Dr8g== X-Forwarded-Encrypted: i=1; AJvYcCUXo9pgJe1qKsCm8LWWR1KUEKA7ggpav7tGcZPuFFYWem88pwIPQd31T3NwLxaATtAtW4PoG+mrNi5WAyg=@vger.kernel.org X-Gm-Message-State: AOJu0YycyqXrWhhBtBe7mPM2orOkUEmeZSVQO4fsxsEmjWeYd5noADRj 16npPUbroAUGw9+XOLjJ+kpOdTCkr6vfAAUvKACENO5JzhiFj1gyphypChEx+w== X-Gm-Gg: ATEYQzzbmZ4n0TPsTVksG0/n04YCH5jsZgNJrIH9HGWcnfmZTzLf776Hx/Haq4IiSbZ sPmIv5abqsAdOqrZbAhknRqyBaQDfU+5CXWKvkuXE3Dtz5xNp9A00tGitLqOi83V+fa+2uWZhxt RihAnYuJnRU9/EZVQOsd6e5vdlIidYzgkJitaIiDe8IFal7ntn89ZulwovcZ6DMJkh34zQ9Gw/Q 3k+Ei53WvjHX8HLegvxBQyhXkFm7PtcCn+CurlgC1IEyqX8++0ufr4xcbgWHNRZGzJAMW5LFj74 kXdWOQJ4X54CFz9mlkUG6qxEmVRTyqtqr1XdkytepLtwae1CpzRRfk2fN34AewqYVbkOcbW2nCH V4a0SUFHuPPPa6qB8H2bit35W2oDC6zBIq6tO7fryQKj0NhA6Sy9cvI18CRS1SlY8sFvnQQt5Hs bQiyChZPogat1J7mC46FiWyNckxd5dxV5CedW0UhmopgpOHgVETt8yAwbqGis= X-Received: by 2002:a05:6808:4f49:b0:467:1941:1f18 with SMTP id 5614622812f47-4675715ea52mr1607049b6e.14.1773408189500; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:09 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 07/65] dyndbg: reword "class unknown," to "class:_UNKNOWN_" Date: Fri, 13 Mar 2026 07:19:32 -0600 Message-ID: <20260313132103.2529746-8-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 DD30E397E7A for ; Fri, 13 Mar 2026 13:23:12 +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=1773408194; cv=none; b=LgsQZxdMl6ASac+k7PeEbQBJhoePIOt0XqEq/oo4PpMoHJcefqTnRxicZXcNHCoKyGwHO+I9jhxjq9VUG/+6nOS3UJRrfxWX4Tuoi2jP5IJlqW6GwsdLURmjNT99snTepP/dYb+f4SbLdV08e2E8QnkyaD3KGsrOMI6RRfos3h0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408194; c=relaxed/simple; bh=nT2X+0ltTDZpc2Ke/Nts5WB2aC9+0FZsv4JIXPNa2T0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UAvkpFrdng1kj1c4/PoSG8BsTiEDGs63K6rtof/9TO+UNUzn7XqRJbx2U/a8KWtRam0FVvCWYCY/LK522v9e+X/S5njLaZt3F4jwD4O4sHryMwXy9AqZN6B/sdSv341akU0b0H/KYbnHgvwhKQfe7IbxceEFzyygCWpYVi5SVLs= 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=VrFpQf8p; 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="VrFpQf8p" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-463a0e14abfso1411933b6e.2 for ; Fri, 13 Mar 2026 06:23:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408192; x=1774012992; 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=VrFpQf8pGUr+Vtf9voUUD6dCK8ftNs++iRmZj0vn2dggdL/UgJypoo8SSNs4EMY/kI EchnYI/rYEtpl5WY9FSJBcQCqg5K3lZK9q1c7C+pfRo0AOwzAMoBmuD/9+ROBO7Yw/8P KtMMizLazoqXIUsOpIIjxOimF8jbdLY/jkrCp9OzUYZoJqFX06H+/cH4p//Wyzrm3YGF Sugm+rx3KjpynYc3F3z6TrBaLlLpyMRVhm/hSaQ/yFKeaPekF/o4xbbMX+4K2ADcqP+D tCI765ddHHAZ9HQxcP8jhPq6vZrz0o8MFBRa+Rb/VBkYOussm8dZFttVAeq2G0fibF86 n7JQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408192; x=1774012992; 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=l6v7ij8ofzfJBXt+k/aoFLu5aY0y3foiC9NwEPPZTRqz/LnBEIBZBv1QQlFnk3ooTi zjCPiTwy07SSnID7DRZ+yIBSYVBAq+qJ0fgTSXEtVz8CuWKUZ5Z2U0A89Sl4TCTyyynj Fo+U3oE+EbIMRNG5nC1vGHT/YgwWgeGN8i5Ej/ma1f/Z+6bBYMW4O+JBgICE+tkVrRml PYt81AI1ZY3HyYx137S71xjrX/PbjlCeAfq/JbPOdJ+OSvAcMFYxgGMAOa36UzW0N9pW kwiSfLYyKFUtFwlMrr4nSGhKnEVli59xWHSVmIQF66tPwyr/lwT/Tz7lnrWBWcyXuqR+ QeHg== X-Forwarded-Encrypted: i=1; AJvYcCWNmhRCbtZa546zs3hIGjg5sh2u4832zcp+MxeRmbdYynk2WLcqD+cnTHEsfGJCRvRu+9gL/4dSC/+lzaI=@vger.kernel.org X-Gm-Message-State: AOJu0YwNNOHVTpha/0VTJgfy3iGR8WLOkWs6yPOAPNQE6xMgcNrgKQy3 ooMZCAagd+6mhIr1xijeqZE3OSuGFDRZoLpLSrsPJ5aDgJOJnteb4x1a X-Gm-Gg: ATEYQzzDM0oLKE/k0/B1Xoi6uEK6/Nd8NUTTS3LVRgUus2eNx2/k+WKWhprT148TQnO 3vivQ/a5UcixvWnqaW71ylowgImtRrOxLAelruYXTMr/Vr3tilGDoIhv8/KenO3hxZXCKMfSdrk 5dkNt8BAKbR7tQnlj7N9mgVXnJB3VJ//iYedhM+ZotKzFjHk0sMuZ91uIbr3T5X2L66+RvG2+bQ /JZAIoEItNcdTRdoiV/wJsdRvO7peuTNO3qYlE3xxBRRzB02lFW1E5FRKFoehMNVlNK5SlfWUW0 Tloguti4kxpRODWVRXi52rccIw1jd0aT+vsNK0rp9rqJx1HwLeuJQxsqeORqfc6aGVw9GordZS6 /mTwW1k7W2LUoWEDdr9d4El48sDvOyBkQAFyYuO4v87XMgM+wOrkP/JiYgsTO2Kq7DUAKxkc9F+ XceYzcbcl6yZtvkJmyv+gWGjjfHPX9+xF6CWGFcOfemdha30kNlvqeYCCBJXg= X-Received: by 2002:a05:6808:514b:b0:45f:59e:1e06 with SMTP id 5614622812f47-467570a2074mr1690601b6e.4.1773408191750; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:11 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 08/65] dyndbg: make ddebug_class_param union members same size Date: Fri, 13 Mar 2026 07:19:33 -0600 Message-ID: <20260313132103.2529746-9-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 0CE61397E9E for ; Fri, 13 Mar 2026 13:23:14 +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=1773408196; cv=none; b=KkhQcyK7lcfNDvkYLWhjq6T2oVRbR8wmh/Al12Uazsh2E/QURbXube0hSg/cZD8P3AOvQWcfxJEy2Kdz7hjiYtytWmStNwEFaMIRu7wZKl+CI4Lpl86dxdncx7NaOPKQJebDLv43UHiqC2oaO9jNxGfv3EVDtimeQJ3gTTvlp1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408196; c=relaxed/simple; bh=SLkxALPzv5MuO/ZLVMcQnhi3lAgSVUDUGPYbYC6Snk0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XrSD/yzgbQOeTnoIBkxLSgeEBBKLjwcfgfLH8j3Xmx6eQSXmygEEKbQ1Ggi1vRt4uY96u9S6PLreYFhX2LDLtTfjukrZGA1nkt00HTtDciYEXsiP5ffKNhSqz3GfXRswq0mCQbJhRUQhltuYHBPt4vAyfLAXWbsI68E8xELOM9g= 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=T2oQLLAD; 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="T2oQLLAD" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-46702742c99so1401117b6e.3 for ; Fri, 13 Mar 2026 06:23:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408194; x=1774012994; 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=T2oQLLADL9tV3qllhxkBJN6+iKGGvNoJlgBVpxHM4cKXmTYbaoa47RHZZHPGYrq5Mv xm1OHP4r9YZcjpDcIsZGUMR3sJTzJCVYqS9hbaZs27vtVRC1SJ3pMOkKNwWKkNWhgegn gxo2Z38sJP0chNjP0nqwkvQJ77t4xHfYcXuUDQgCrWk6NGoyNNom68z3zJr97Tlu63j8 2wLV/rMN8YjiSt525C2861TVvan3iBn0WgE74b99lREu5iRzAS9JRT2dod/EvL9VJm6Y EP50R0/fYJBYMc5bWT8L9gk99YjV1+AvB2Ca3zOpLHSlGNRd1Ee/cijj+We/9YxZO5H4 vD1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408194; x=1774012994; 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=VO5QFGJm1uDMzNL+V87kz3gXaZL7xE1VyTxNj8t5CtAAs7yr0GWPoN2II/UYXin3SF cywuMe+Hc5VprnFxAacMfTA9A5oIcA0/1N6c9Uk2Sxhw6f2Q4pwteSymY5pgSi8tM6lu y5X+xZmTwnY3KWqZ64dlQ7FnMGpzLbefWlhqMfC4FSKnDTIlOBMqd28RaDxJ8g/J7fmP 6Dpr7W7S10VZxoD6jA+MRzEJ1KOkQyRd+yinJPfW73lg6ggkA3LlEj9wY8pnJ8CY60fJ F30KPJaIoFkIbmbXDQcIxGp9NEq1YqC7Dt6pluvaKca5ZhdmiWzGmt+oByjdiInN5R7X UV+Q== X-Forwarded-Encrypted: i=1; AJvYcCWyqlPEr1nrvi3Mn1QzUHjPIuW2yEHaS9v1Gbu3X3OeerrFUSoN9udngqezsEHlx0Nf122UoCCldMA/Aug=@vger.kernel.org X-Gm-Message-State: AOJu0YxUGMXojadKk6pvZvEsw++sIpBtPDlclIXfjtw4k85gFu5DPk2D RHK3ugTuSPNQ8dlZSC3ysvWYyokx5idKSdwVNXxAbQoJrqhCjnSqk8YQ X-Gm-Gg: ATEYQzzW8PcjNIcObaeMwlWmsDHjML/ODDHUekblr9++A0Z/yDhim+iu+jiMOiKyOxO Ehl79AdDe4CLLeyQQUHdgenPzIXHYy/cmnNZOGpnLSrO1JFB8ctMDR0vN7VObA34PYsOP7Scej6 28pxCVhqDecwc1HHJ1cw0Q5Ip+cjt5NVp0zGJ4gGdh5h/QY7UUAdC2xWdsxe0mliwwqMbNF3blN mQSrZEwoCOAeCDk47FzxwRVA2+iDCmmjIacSaPUtgOQLmytTR26YmnYvK2XRwoTStF8DokUjLTu NBwIXYRDoepYLKF4yuD7IWuJYnUZbZpA1KzW9qiuychR4DaVBGgwczFdFTJO9wY7DDj2IY7NgcE JoGA+lmosJ0doRMWI1PWR0YBsCJadtpKQeHlaYljVm0znUAJ2TUDeN+D3RBHZASyciQgPgWBfFs 1DyPbNktbOaAzRpDxsss/5P7umKlcIFKGDSGzrp67xyK3lP33z X-Received: by 2002:a05:6808:1b24:b0:450:d471:dce5 with SMTP id 5614622812f47-4675701babbmr1568851b6e.6.1773408193868; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:13 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , linux-kernel@vger.kernel.org Cc: 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 v11 09/65] dyndbg: drop NUM_TYPE_ARRAY Date: Fri, 13 Mar 2026 07:19:34 -0600 Message-ID: <20260313132103.2529746-10-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 3AAA2398904 for ; Fri, 13 Mar 2026 13:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408198; cv=none; b=XwnoIIEqpPR5f9xBO5iZUcMM7Mrk7R42x2s82SHCP0KpnnLcSfOsonAtUIsCtSDJ3ymf5SthrdZuQ2HwllaAn4l7sEBB4J6XrZDjkORj6Sp0Y/RL59VYLmUSwvkyLW+qgfJW21gSyaEP/bLdnJhloW2v2uYxz0S+TMieBvFJR8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408198; c=relaxed/simple; bh=A7NW1lcioeZvkxFMDB5jn7b/13wAFRirdZ/+LAy3Fqo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HX6PkJcMZMLxdEDyLMD5RMvlxRh4PZefIX/gOPBaK0Qs4KTq2cbJwBdRFhOSUI9dp2uqwzB1UayBklM1DsWeN5zFFaBG7Nj1fw/ckd0dgmETqVpMjJ6PtPdjsL6ghokduyL+bjauJgBYWAH8BRnt2LXtaxey+lXS8LhADtZVZyQ= 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=WtuV8t0n; arc=none smtp.client-ip=209.85.167.177 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="WtuV8t0n" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-4670bcc40d7so859391b6e.2 for ; Fri, 13 Mar 2026 06:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408196; x=1774012996; 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=WtuV8t0n0U7R5vccH++Nu2pELmXzjpoSzK6cwq/BIlGfMZ72GwnbwvekxCR5Ekzuj4 gxmx4NquacKS76JtUKaKh7L+agQsZ+bPBnRxxxroq+dqg2ClKgDLpJmgdkratJwnFs5i AfI/R431zB+EHPCPCxI5xoViAlchdtTBT8jhpsWlxsv5gY1sZKaAIZTUqPG56WLjMRax hdAL9QMl0nblq9ayLBUKtD06nD1wmYYR+dqWFGIJgtzYjgLLc6xtjSp2U/eJbR9SFClE kMWgMJQPG3G9Mr0oGPgMrOVDoH5kKvxEz2BiUqHtKBhOQzTiunqJ6ioBVXHp31W1eHpD QPUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408196; x=1774012996; 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=rsbDIqI5W+zZdtIHiSrYVTs7e/6bpI6TKlp8bwM+G2Xdyh15aQWffRn8dQ67GA/xYM O3sIlroX7v50JU/ys/TrCVzWDy9h7gVVnpXguGd0UtYLA6v3sfhWC0TfMv6/bL3e/IeO PYvOf+Yl54nXsUohoE3HFaVyOrXCiFNPO4J+DqxGD1PprZniFb1blqWWUhw28NipMPO9 ekkE6P7pMsjylFR0leMnBQOb17vVGERHDiVQpKx1Gu3sOTfMaSVHf9lDIzSd+ynin9Gg ZdrF/ZdkvSmlx+eadsMAIcd+YCSAKCPvJMnYygvNIr1n+iD6dCDVrm5IlBHj1rxoy/g7 zU6A== X-Forwarded-Encrypted: i=1; AJvYcCVrOz/AOliJ/hzn2WNKb7D/EvNLEe4FGFpDcfJv9wZ0oZlJ5CkYGXAnOir2E2tMbg6K3evFtSrYMt7E0VU=@vger.kernel.org X-Gm-Message-State: AOJu0YwX3j+HUQc6MBtrHjX2Gh82opgmpBFZ+04p+RfRab62EXuOJAe5 9xgpNTJg3R0d5tDu25l6Sv/wYKKOZFQ+d0Mg5/INcm/kq2tCEZH6HNaJ X-Gm-Gg: ATEYQzwrxUMnhDVFPw2XDmYI65698QsyqX8U5XPH1yDFnbIk/w53KI3iQVvmjTs63l+ 4T4aNfOeEvzMN037P1HysGtRXvQZPNIgCh2GpuZ14TemZopvOUYtJj+0YcfGXjN6lNSDDREHH25 p+yUk+ws+1MXGUJPN65gAp67vjWEjsGj+EGlmOsZtN6qPPiozvJneWYzzUgXIJyZwoqzS0J9Hue fzyvOa7NaHho0XTD0GwZUnP3AXuNgmYl5rfmbT5w2rkzHxNSRaxHaLo7TCetW2nEtfaVwMYibzl mQKDoFDBqqdgFiPbnKTaou4C8RXglMtL7LXF35Fn4s8jDQcBEuUjnjRLFkTTQgjDmS+tr68V1GT iaUncvxYVLav2t52NdTYwImTjCf0UlCANxmjGoqbk3pV62Q+iW4084ERHIqV/yQSrYThBMyzg7n Wo9KHpYZFtF/cIImKr9v4QaoJ0yHmnf9I1gfTn0zV5JTKESw4YZj1D9q/uJk0= X-Received: by 2002:a05:6808:c3ef:b0:466:fd51:6a66 with SMTP id 5614622812f47-4675714c79fmr1554429b6e.20.1773408195957; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:15 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Andrew Morton , Jim Cromie , linux-kernel@vger.kernel.org Cc: 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 v11 10/65] dyndbg: tweak pr_fmt to avoid expansion conflicts Date: Fri, 13 Mar 2026 07:19:35 -0600 Message-ID: <20260313132103.2529746-11-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 144B9398918 for ; Fri, 13 Mar 2026 13:23:18 +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=1773408200; cv=none; b=U1rbxOf8cAMh857/8nQNBM5e7rzHz9zB4iqbDjDXRwNY45KcRKCgq2/98c/SFmc7P/JAkAcYZojgVXYmVv/QjmNepgjCXxzz7aqUtkthACgpqFCklFVjG9TNTt4faeAVBNnw0jIkI/P0uQHpRB8Oa6AILQ+zYLEnn/FIrs1Z8fc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408200; c=relaxed/simple; bh=S6gUrn6AElwN551VfXZR8sAzEWfpnwUQMkcCkNtZGhE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ngdzXAO0nmbppzAJnEQWcGRaff6O90vZ4H/BP6t73+a8HhE9MIqJxj4LJ2nCrnAo0LHPwD8T2owWts2g0sSF4a4ql6eKYpoS33mRbL+blPH26zgUErsfmSIqBhVpCoZA+YUXPT/0KvacYDeUgjVDI6xUQ3IgcEMAzFyA1cK9AfA= 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=htlovex3; 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="htlovex3" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-46704177543so1450550b6e.2 for ; Fri, 13 Mar 2026 06:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408198; x=1774012998; 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=htlovex39/4lhBYpDc0VZc+ZdVntj8eQtDp7W4fYnlKvzxekycOMHPbKLj7G1UJKET TLQSA6cU1l6r60F74XO69+ny8tXIavjoaZ3ds7uXdLMmZd/iwg0hTIH6c56qKWwT90bg KMFPaksqg8vb0m1X6/EqLKRXi4IhhEiespSn6QHRz/pOWdGOlMwM9f7X9sp4U/H0DukT Q24VxU7/E8TnwElGYKFTMuGvrGyNpcDrMfVpyFWvuxK9gIwQI6MqbSGe94BHwOJYC1lT Skz81s5X8lfZGiUvZTSDcvTl+iEQETiJLD212H0Du+GeHvlw4y5x0NyqlwAlysJ3rVbN JO5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408198; x=1774012998; 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=KrGVKvcty78YoSEO299cGt0KP8/mQYus9Ud+8ZDqNmXitCztspW6fbiFI2q39T5eeN ynO2I6dnZq3VdED/H2Ihs2E0RyyY+uS+nPf1p7r0JWqyeFSAsGGHph/MyhwTdTBDXq1u Fr4GnoYVQdS3EHcsBzjIm5/HLKSVdm+rlN4Sf1Tg+vo2rJ1nPCTBhZTFTGGQdseugVYp e++tmscR/fjUCPYaz3pfoawqGDX1RCes1QpoZDjD4/NkqlWSBiaQEZY9DIwQBIeOtEwx pAaWFqg2KkJQKWk91V6Tb692lnbX2SRf7Is47lft8vSJkrQgvg4FFweQOwHVInzU9YBt lLmw== X-Forwarded-Encrypted: i=1; AJvYcCX6hy9YfSbJHV6hSNcv4ryEmp8yOGKXqp0fLhYt1vzoK6w+MdIS+4qBpP8173NH5Rf0DkEqLWiU6vXOhng=@vger.kernel.org X-Gm-Message-State: AOJu0YxLl8AHO4VlO/nVKMw9r9VN7sKdXpO8T/7NhpVPPiomrG31BsNN ZpIURAp+PV9lHLXq8OpWLYKijN4PdYdZaxeLWDq7/lHc5otEoX+6+3uuIzlqLA== X-Gm-Gg: ATEYQzzT2eFq3gbAm5ueS76n/pKpR2oa9D2QOvYl84g7ZdcvE+rnVExrtu2nOZyt5+f v5zbTWrEEpMHSP50Q9GUyk9zfErkKbUcQnaYsd+3+JJuVnye350MHc9vMK0c6EoV8a4nKQnS7o8 2LicTi7jkgdXWVLFO1X5JTCAK5wQiksNRVTbYl04Do/Uaf31MWsPkN0DG9LhJu5XacGU12up9yD CH3qxRrXgwhQU7aLRXgS+cUNc8Fez7JrHFn44c67/qquub5yY9RHR3DtKdqEes0MM87b6xNSZAl SVBPc5Zi17ix0kCFLF5dmNRGCQRLQbXkoswCp9Lp7+lOIty7/MqZiWxGZpATx2m3fTN1Ge4RZVE axup9y7VNyHQIH1F0I11c5wGtWtK2A1esqCNyQSOfAmSgBJuZmQdQv67XQNEBCRk6h+KvMs2Ieq Fetmo/RUIHn498ZwG8FhtJdSbhNzW4HW60fhfIvLwqlZocq84O X-Received: by 2002:a05:6808:1b10:b0:467:254:b90 with SMTP id 5614622812f47-4675704a335mr1610159b6e.10.1773408197894; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:17 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 11/65] dyndbg: reduce verbose/debug clutter Date: Fri, 13 Mar 2026 07:19:36 -0600 Message-ID: <20260313132103.2529746-12-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 4E97B399342 for ; Fri, 13 Mar 2026 13:23:21 +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=1773408202; cv=none; b=dLV5xPtLNBfYN7gC+qI+mpKdg1sj8sBLHaHErx1+OPJFiANe9XQO2DLRRYYKSaF6XZjFeopfKUubByEHfDlascMRB0SapdaCBtgfikn9ttIHeXljmenhwCuBQH+Sf74IiniEROZEIkZVN4KIB/jJnqwuhstn5OchrvyEXWeZbO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408202; c=relaxed/simple; bh=SoyzrIXTJl0zhkZLXioIJtb1P9eJp/0gNMCq5+HdwEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bJXGa7FSBnGbQWOHC8Ct/V6n9SI8VXsZ7MnMFnXETR4N/YVnRAyDVXr7xPcGNGrCHRnVlZApx4MrUiiox/Vj13Rm4xGwEN+kJmxhI2eoDAV/ibxPB43ah9RANFjV46WMD6gfvUj2dX92kz3yGQL+v43NDmsgj512lhmrYHiIMvg= 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=JR77j67J; 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="JR77j67J" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-4671cbce626so1072377b6e.1 for ; Fri, 13 Mar 2026 06:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408200; x=1774013000; 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=JR77j67Jc20mTsIi4UIb//KiRFx8VnYkAoC3Gcl9yAGNfTjkuTI86Tw+ueliCHZqfV J/0gcWbcwMUP6HohoOzE+PFmqoUwqr2Y9KCUZSA4HOwr9X7YAPDd6KMd9QFNS+djI4b7 sJTTP5FYhFAEfHYlDXwU8JpDSY69NVT/FdV13oTWiSoQ/6hodQBKWkEOMQkVzmnI33SC A5GeNs3xGONK2UD1dvp9Elu1tsvSRvNVCzPylqPNHTYbuCnApjGSWzoFtwWCzt9H/H9p HOrXxsGCjeIHweXewTynej9ZdArUmOln4MOZzHztvT5jGhascsjmaBzMCOwG33mj/yQS V88w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408200; x=1774013000; 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=dVqaLLO+1D5UJjNDXgSj8mMVZkuipVAHEGU898a0cVLQyi8K1MsEYzVdwIaNfre5mW 7r7k9dfPcz86eF6baqPIQ/5+/iJucQtgrHrRro0clhQ0ajTyCXQ8nptptQQEWMn8ofbw jLQTpw2dL1vqLh0HrK4OmB00luZcmcBfQBTjuC/0Q9XjrN2a5rnEBXnXrf4DDKpRKo3X 1dEpnlt+1Ti9CHMRtjPr1SfSOYn351uZFUxhpuPuy2oZ2slrMXxIRVkTNFxgL7J3fC3L HibKG0Stk7+C+bBkKz/nIpt1yjhBOMyL+y6s7vlhXQebTSNzZ27uHLrxvNJmMnG/2yTI XYOg== X-Forwarded-Encrypted: i=1; AJvYcCXppwIiEHQ09/qcDH9+m1cp7uOs7aHGnX7lJc+4oSDxybBYbOx3zOm3VMhgMVokM10JQ9O8Em5OeBtEE1k=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7zeAHvPCbSUXWebLFLZ4Dmkv0X1sYkfQaq6wK/+45Z4GikOB2 0sNGV7VUY4W5DOUNPwmOZnAqaFaM+OuKdnJFcihK8xTtYRFyxkM9r14+ X-Gm-Gg: ATEYQzyHQKMXTlQ5xgDGwJvuDn7Zc7ZkGqx2amAwxNYh/ftG458epDJhomBoVHeCYLx qcBbo2kBrbAg5nrINLaAnbSSb5OB6z8OahKVmULPlR4B067cFO+0oG9dBJPJir3cI+Bw8PO9yt5 UyTxGHcrRi3Lt8WFuFiSjb1cFI/kw3APVtQM6uYX9R/p9HjYbPVXu/jcDNFDVcjGDbxZyVJzJBd ++67IPymvfvthazYzl5vgPZ3RCiy3OwOVAjG4vY4zdT3SWiAn7QeaEriXI/M/Dbb80sGO+K4m+U vaRlwgUIO43oI81rI/hsSFNosv/6KTr6Tu5J6+dZHAoNCXaBmxLhWSjMx3wRBjSG8ZXF9EDnwaK JZSYLdBxJ0tTTiIpMDlyK4ymgT6rLDt1uwl028jEODQrzLaHM3FgGmjq5MZfveB5vr5sJ6nmirR ma9GedrmEDY3HbbQw6XWrd1+9M3MPHrnspl6a9UhVhbANQu8Z4 X-Received: by 2002:a05:6808:c2a4:b0:467:880:7441 with SMTP id 5614622812f47-46757088cc1mr1845607b6e.18.1773408200088; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:19 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 12/65] dyndbg: refactor param_set_dyndbg_classes and below Date: Fri, 13 Mar 2026 07:19:37 -0600 Message-ID: <20260313132103.2529746-13-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 5B6F0399346 for ; Fri, 13 Mar 2026 13:23:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408204; cv=none; b=lbhmsNnwWGyI3AEZruKFUgBOWghtpYgX4S5mLtTYbKC03lVJd4PLUvOCfx15pS11ShqA2GoQj2jfFauGU3N1ndA1Vor7N/B1t0Xn9if6VrCNaM5IiSeqKjB9MIlN+WDR1P9Coc6+Zs/tRrCyE4jjcHCvVWrYb1pj6CzMOzzksuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408204; c=relaxed/simple; bh=PBAFi7y3YRuwq9TlfBtroorgB24BQAwGr2rvA4abp3A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Eb9HslEPCI3voELHl//S3z/y5EX3uuP80Bjk6+vIpjKU+bC+llItQBOdqTUlIC9A59+UdpDq9Vd1sSPdiI4Ff5xzkxK/Tt17umWFRgOdQCgrRDx5qmb78oH6wN4tWEkJ2CO2rEGHP109Ymq0BC9hzq05/KBvZFI1a5FUlekRae8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l+zj7EBk; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l+zj7EBk" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-46726528f1cso1546012b6e.0 for ; Fri, 13 Mar 2026 06:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408202; x=1774013002; 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=l+zj7EBk+i93DYqbd00IRf0SQw+dZOur4l4lmHYcb/RnSkZH7RHxMiVpqyZWf+WvGj kp8dQVwvJ37+leCFr89EopSKWo8tFvy3n5/63Mu+ZhhBjQWsR8wOfVjQeniK02Ya0jzB hUTPjcfe7x7qBJTBrFWOxZO4F0CH/29/q9DEqYGgBKepmNoZRLvDJE/FdkQwQzKxQwma //p2MBpq6b3iFg81B62IA6OUcNLn+yKc3j3uHGEIRx5COlY+3OTalhyckOWF+CKpVM6F RuN5pWJkqWFZINL6D4JAknbGVZy0ATh6mKaFdhvOfjAdvDZow6RZXcSkylDHKuABZY2Y V1Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408202; x=1774013002; 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=Hk5sfA9YVBMyo9CZVrsdbUcpIBdN3RTO37u/xLhMI4TRBvm1yO/28av3ZE+DR5kliU tTKo+1GKfLbNp0KO7PYga32YxawjZV2H98myRY2r9mbJvEWef4K5CGjCO8pNzUcNIQCS x7QZJxyUVfRHga/lPNwtac8/8Z9oKmcV26t8Jm6PfCiv8pyTJBioFE1Is14QB3+j2Fgj IHSB++5VNbzXbWi4EH9RCD2vXy20/NeL8UD9UT3hnW+uTaMdBBN2Nc5sZ7+jIS83TY46 4Kr0JiMTG0OWHB7o1NpYQTstRhYdZutfCXq4zBU72sCFnn/V7kT1pKFvzN0unlRx7frU 2TMw== X-Forwarded-Encrypted: i=1; AJvYcCV2Q4iMlx77D81HOAlMenJaQi16Icsaf+IASmvvNvj99xodbckFp6hvaFVmlV3jPlvDFs21dWfFAkzQfH0=@vger.kernel.org X-Gm-Message-State: AOJu0YxlWLb3Csk7WDm2IGu8uvZOF4zKTkhJHlg5w/KWc4lflx0KDk8h maHUZ20NC6KASidZ/dBgOEwTlcxU7/WDIbsNqyqF+2wKBaduyK/8Rhrx X-Gm-Gg: ATEYQzwMxB7DawBHTwSfL7ZvXicic78q1KDM/9w7cGbXoht/8zRPMR4uVawb+TkF2Z/ Uyw307ICN2O4er/jinL+7qghhBoavxwlmf5u68FUnU8gVCvmXvdJuylVEey37SFUvOdmjEAECNT GD9iY0tUE8G07qN+iPKILyfRNNODB8n3TOrfr0cNR50Gm5+lvZlUvqXTN/O8A3wXms9mhjcpvMW BP/PtYFKs+4oACFk0a3ESgSfiVq4D+wjimtWeyn1ANv7VppD46/Gg6AaPHNt02C8SeY0msIPVDm kc+B2I3VO/ISUww6d6fkJnquimX+gG8/RZDYnXEntTqkG2VufTfq3OUEm5UevvRacfwpPSPqsxK DAc7nAlXEtnPypibw08KsRlXfU2qVOaJmxhk29mqmI67QwkGpYtAcmoC+ZtW5Uwa122GvM0L2WT +1s0EFZBYcMKDxaSCcONv9DG4owxVv99Db15WO3kAly9GNKrnZGgJN5rmshaU= X-Received: by 2002:a05:6808:1a21:b0:467:13b5:8ae6 with SMTP id 5614622812f47-4675704ae1cmr1541416b6e.4.1773408202078; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:21 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Andrew Morton , Jim Cromie , linux-kernel@vger.kernel.org Cc: 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 v11 13/65] dyndbg: tighten fn-sig of ddebug_apply_class_bitmap Date: Fri, 13 Mar 2026 07:19:38 -0600 Message-ID: <20260313132103.2529746-14-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 50657330B3B for ; Fri, 13 Mar 2026 13:23:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408206; cv=none; b=V4wJcto2EdCA9OrspyOGovPDJZKuQxy5e6GWXv3JRMAXO/pZbw+uMJjuCRMn066dO5YYo+daUYcs8C99XdRFsF5cgPxihYM7Mhnt5g7f7JiClPuLxiPdqamFue1454A1UWrIQq/xIcGojwcgSi71yb4p8CBT+UdqRcjUM2dEI1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408206; c=relaxed/simple; bh=NxQl7h9bWLiIoq2p4gJ9qOg7QnNWnUPnOXXB1pgHnho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L6a2U4LhV51o7zaOsUXY9hAbF7iDQSYwPr0W3nKBNtPUy0hTXG+MzSAL5+Xq/nPnOjLv3MsaLlQAkUuLY7YBlNttM1DURGyRWfllHw8QesL2FH5jyDcOkpWEYNn3GeXTAVERgEbecFOU3Xh2DT2JCLX1c/hXqQQzT3I06aLYYoA= 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=NVABEWSo; arc=none smtp.client-ip=209.85.167.170 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="NVABEWSo" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-4670676ba03so829421b6e.1 for ; Fri, 13 Mar 2026 06:23:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408204; x=1774013004; 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=NVABEWSoxsfdxgtY8Y3RreAdftZWjb0omOz4hF/3gF+QuZkZFioNzghINVXzoNAC0z 4KZE0OkD7L+rw8s8CF0ugQUMyFozl7xAWm9lki8TUwNl8oy4c9PvDA6sTq5jHOKlRRIq OyeUkzcC/YEtMJDG6ldrc/WUhHhM8OFCtgv5KVYOlXG7fy6WpfqSsiIvn0TvLUTXO9yo bYzjcxgJiU2d03dLU+gUdKr/MYpf6Gi+wR9bRXIoeESGtmZc5hwBpyFfMXmZsIXJU6+U nAKA70LGpwUD3pqbvtseGu4I15ppMQwKX+ZngDrgpfVv269w2H9fTVqxztxO3lhEsT4/ RKcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408204; x=1774013004; 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=BsmPUXQuuEEbfEiuFkwHhNfUdq7UDF5xQFEXSBkTgKKtjwa4vehqn9kuNgotdomiRZ YC7igO3n/F8laGqZUldvLd4kJ/gX5Hosey/poGGn0XfI2RupWMgtqn/DsaRPRtp2XECj bL1RE176t9WWU0RpqacUWrDjdMx+1CtiZUPnRN3k2QHXOYi32P2esUF4MVddK+xieLDL L8AKsUMF6lpKdNkJho+NZhhbW3P41u9+WXYJIk87VUcZxCWzYTu88s0uHlvnq+lPVs/V 21DNROaNSW8tFIl6ZUrNW0nHfMJLPUEsJdFwh0iHQSPsocHAujFJzc1Tdvrz7nZitks5 O1Bg== X-Forwarded-Encrypted: i=1; AJvYcCX8eyUIfnhCHi9G1MBM5q11YXbSmPjixNK4dWEMJ1lKX3mYai0zWXE5ly34S10Zlewz8aMwhDGoeZjGzfg=@vger.kernel.org X-Gm-Message-State: AOJu0YzM8avkKz8dI4RFz3v6Hvs3w5ZShTzdcId9U2CQBmaPZgkRYu9J 7VqwFgP3NBrSOTFVXW3/X4/T0DyrxSTu1pG2KWiKeT2ZV0KawhknIRAS X-Gm-Gg: ATEYQzzfeLYtgRs4B+CYJSo5Jd3qrnGlzNHqE+8mrs95wrnGAEXGRvtCiyY4fLVcnKz l/bOf07cDXkmaUp7uN2tatqkH9LHZ1/T5T6airfb8hHztQ9El/9CFFh6Ugos0OBc8bZL1u83kw6 bJBw9bPgfSm1ZJodDprDQfEwrqCOAN90vBcUDaDPw5ll4dcD3l1JboykiuDuf4Fu+pnG0Wqe7ta DiEZ9mayPhOn9O6fmwPL4MwdAOBRuZo9U2IxI4xwY7gKgZwfj2Fn39aTeU38A9UgjdnMorepxYJ xg1ZFaKmO/CRdmLvvg75Xj4JTVmKRU+ZXHXE9S8gAoo6sbOmI4hDTI2OkgYjVxsrNx+QhVNewI7 TYuxeja3Us559VyfESgWCbf6QRgxzTnhND1J70pqmFxwNjMB1BGpaMimEJkr/ZjChmrHdpLEOvj nj/NQ3jysvciLwyTWUTuhqQ9J5BNqDlKL6A370w4WcnN4DqVuMBUvzNvsz3VI= X-Received: by 2002:a05:6808:1641:b0:467:2be4:9e39 with SMTP id 5614622812f47-46757550476mr1689903b6e.39.1773408204096; Fri, 13 Mar 2026 06:23:24 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:23 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 14/65] dyndbg: replace classmap list with a vector Date: Fri, 13 Mar 2026 07:19:39 -0600 Message-ID: <20260313132103.2529746-15-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 331D439A059 for ; Fri, 13 Mar 2026 13:23:27 +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=1773408208; cv=none; b=Wfe/vADI/Lc0xhxgADYcEYbmP6kvId9ufj65ljWsC5MZk66JgLvqFn91ZPz7F3Phoim3niajRgDTENosatc4eHrH2ZfOrlo8tAyNiOu6jUOmhCuSDAD3vBycFHsIISKeiJZagrWpzZ6Yaenh1A6oSH46YKvYw4ynmyOBk6LtyNY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408208; c=relaxed/simple; bh=h11SMXTTqtXfuGn+BXShMbaaEsHk1UVnXJbNCNEPy+A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UTtd9UgZ52aaIrgTB78QB+yLT9cOpC6K+OT6L5l2ABkVhYC0oazqllX/Vmp30l5FfZCJH4J7FFWxFHKcAUaQ+1bhSIfTLtBPolbhacMeOnAyyabcCKHOL+t5KYBOZyf5fgPP8NIOZA5fB2Xbfc1cUipZVcVMce4TohIljt/uxKQ= 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=JGBQEFoO; 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="JGBQEFoO" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-46708149af2so1223011b6e.0 for ; Fri, 13 Mar 2026 06:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408206; x=1774013006; 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=dBYomo+y0fMuoiYBGpthmpNvx8Y41pycbs0VlWTcMIg=; b=JGBQEFoONYEzKvZpADcuoM/DlEZ04sgngt7PnIlZELhRaqh2uBM52PJawkAEVqkwCY kI2QcBDdRNkMoH07scGBcJiS+QIMYcRR1lVGWOSgB8pRcdd1MijEUPNvZbjgCtRqOt18 ZzsOuXRdao3bYWYbcBC8+L+AEs228qCUYcDkaYORBRt0HZGcJB+3TEVdj9yE25jfTH7H bJjTvlMcGOWCWUqTKRenbiKr8AWA2c6LF69BzTGLHH1UZjHNEpGqNY5hKu9enFEanLgA /mezKrtrOy0OUdIQsTMdP2QAKam6gHGL9JwS56isp3l1Z0L+Ag3XlMjKExdLmVXQIWk7 G+Dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408206; x=1774013006; 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=dBYomo+y0fMuoiYBGpthmpNvx8Y41pycbs0VlWTcMIg=; b=XRIQX4mFSCf2WcUCTCdGou2AsckigkoaPwa6du/O0dJcnbnHK3SFtIeZzDitmRsKAW tpz3TWRFC4jsoj3RC5Bik5FDWjr969omumFPMC6wEordUA1FBKV0ASJ1yDC/3KWxpJ/H ktQdXcsNskuCD20bMN3EjeZoLqg3jl3belkiLM5uZWHJgeIxXXy3m+hYIwuzzCed29Q7 SooHSW/QksQtDLBEyqfBLE9gtAzIA+bTWzFbKvb0+S1e4mIKduFF65rnHntYdWS6EzFp 9aZez3VAZXiptRWQKmr7+ipNi+/kLxqo1c0y8tTl7g8L90yF+LW/YHJnYYExzwbPM++m GMgQ== X-Forwarded-Encrypted: i=1; AJvYcCU3RdMW7wCVAxPDSz6v06Zkts8wM7K555dGHAtbolkuTiBZKXM2SNugmc0YtxqsCdxPqGOx8wnK5bw71m8=@vger.kernel.org X-Gm-Message-State: AOJu0YwMsIGt7pLkMo+k9GyVGhR38xTb+oZWSzILA3LXkfWS7yKQDoEl RGMXRPCgS0qIXrcng9GROKsi9O60K1lVfIFjh0HQzGYeIa4+DJUeyRJ7 X-Gm-Gg: ATEYQzyqYeGC8W/hfHICK8+jPasEPUwG7qlekf5eTZqEEF6Aj2S8FNxiZz0dH18xPXI gTeOCqMNrZxP1n9iSAXL4Kufp/a5CsChNcq4wAa3El3uKzpn35UMpBdGCiNJI1CfwOyW2nAKCw6 taW6wASDNhcRVpX1qZ12F36hMQt2xrUi7PC6E1crtWRdCG9l4M3iHcSXkWiLziTO0X+FPuZdbvG fH5Q/5q37FnJ3wJAtJHODtZIa9RNO6tCDUcp9cRyKHIM3kwevEi7RUaampD11GNBuqgkcbiwubY vZhThXwef+YghbHN59Et2NGLHHnpNQgnh2WQ3Fn8BY16z76xrXwF7ITRkpuGG4cuHYideePC8E0 64EtohNjC9gg3pbTDVjnQPb1MlgEDjY1gENYEX2hR17K5iAQh+zSJ4hDfunDmJcrwF4IV2/6xt1 FiDBTYDQv/ulM3jYdPH9gw92sCvzDEgmkrd+Lado5NkudBfeFZ X-Received: by 2002:a05:6808:221f:b0:455:d5d1:8ac0 with SMTP id 5614622812f47-467574375ccmr1562149b6e.53.1773408205979; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:25 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 15/65] dyndbg: macrofy a 2-index for-loop pattern Date: Fri, 13 Mar 2026 07:19:40 -0600 Message-ID: <20260313132103.2529746-16-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 before the for-loop itself; they disappear at runtime. They do cause a "complex macro" CHECK from checkpatch --strict. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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..cb7bfe8729a7 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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 6976839B94A for ; Fri, 13 Mar 2026 13:23:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408212; cv=none; b=ByM7/Fn982X6ZDYEZPM2xuJ9Kr0NHmpgPhpPbSvfzsEH7tx0mk98AeKwZneQZ2H+msvMJcsiA+wIJAVAwZKtjKbE0K9LJaBDkVuGXxYr2xR8EyZVonJgWzFMXbz/9WndrsjnvlB2Ivehg/tQS5Hm8jyG35yXdiriRgKu0VnARYQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408212; c=relaxed/simple; bh=MjAC6PEqlOM43RDw0j6PAFV3gq3gZ9RPxx1yr9/5TNs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bwuTsU3nwFJFWCPEPiiqG2xU6r5GcUaQVdZxDr/chmAUjFPjHkSEUk94eoWvRxck9D3opq5NfHatuprciKk3nWeVA3HreGumhLolcLprSvSk9loMZtCNy+hfZMOWe1CTu1pcl4vTXuYsJxu2qHiR2VWqg3gIdSPwtTSFa6h3Smw= 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=PayQsuop; arc=none smtp.client-ip=209.85.167.173 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="PayQsuop" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-46704177543so1450703b6e.2 for ; Fri, 13 Mar 2026 06:23:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408209; x=1774013009; 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=CvhXvTMwFOlaChFVmMkeshJJV2TW+zG1PQRBrPvw3x0=; b=PayQsuopmIdKLRDboQKeacdU5/6Q0HTGn2ls/a+UAAPtuXiDc+5kJYlbhqkHF5ggxv Yqj4cz5iKzNa0m5+B4r1OffKhaZkDydI/Filr/+77dDWuw303ROCkAyR/a30qI584MBm /uBgD2ns8C0iZ91E1nH3Xau0HwukxNUq6a+ZGIzEa4QKYRzzHMkq1mbcLjCSxtF9tYSj 3nR6y1L1b3gBw1jETUbMaJjBJzSjX5OWMBeQlIMGiuI93aVf+bceQXpGGiSh7yZdF7/W Bpuv6gNsMV9M/uyys2HPCFQlxZxvuF/Ay3Yj+UE9cwmwOu+jSiItWO31/sggh46Gcm53 aqNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408209; x=1774013009; 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=CvhXvTMwFOlaChFVmMkeshJJV2TW+zG1PQRBrPvw3x0=; b=UcQqT8gVaMXPZrKijZfPu5sRDi0kkF+oRmlL67Hnlea9q0kUlFWYGiVODE+XwH8QNc oKq1XhxedfFkMc673tb8a+cHJE40VmT/2MAX/hwVy/zdAAZ/miEXPFEQJnz0tC9bToIO xpFI+t7rqGoNtrXO9zV1iMtRcEf0geDit2XthqfCwLNT7qXk6BOvhkKszYSnQHcBkJTV VWLhRc21PB+sqAEp5himsnbBQ1cAWowVjLx5rWgDdsgcO1MksLEAzvnGupa9BVIIgDqY Y2DRMHROdAZ3mDQ/GFebjCkxBFKwSwc/V/0GVwuw0BA58Zp7zQTGPSnBWs2PNlmwtKsZ p0iQ== X-Forwarded-Encrypted: i=1; AJvYcCXXyajq3s8ootvdxifkhSjYG/XCJt9ia83iAw+zvUQJNZv67tfRtBsk12rSA4IseWo+tXXWO+HI9gg89/w=@vger.kernel.org X-Gm-Message-State: AOJu0YzDlEbAQEUp/gVEnqCdj7EiPdio7jZoikaFdesfD0Hfziga1jsY mjXBhMLxjmMUBAhRGDbgJKp5mJFf1h8Hg2FRosTu/hA8ONNffacZ9hhJ X-Gm-Gg: ATEYQzztTao2DHpobOd/qE+a99wuhY27idMRaQiCaaoMLo5gtlDA7PCRAU+M0a16r+z fLIg5cmRTZraSGghwJFln8SdE3qQLNFZWQa3HAMgzkL8L+04xkBXVKPtYpuygpQ5rKwS3JSZjJV SuefSezCJMBpizyYjzxzj17ukxxJylCur+6aR2fJ6cpvab8riZG6wKrDzYnePaaQUaCo56gtNje U00qtftU/N1KtbRg25m7m8D/bbTTzqZiv90ZFfkeFGOiAw+pIbMKZ7wsnAG/dsG7XesQI26ABaw z0szjqLvkv7H5eg0RJF4rmk11xunfAGWJrYbTvqxrto0FA9FTND4StSJGnKOZEvjRoHIYzc/3Wa WhizehLSxqYaK6qTBQrb6qN8xbsz1f7LVBj2aiPzcgK7xVrpwZrVG6z8mejLWyTMGCRCXGLFD+z SOsdCrqvJmYkYvRyZd+ymySulyqkRm/Fcntc29JE4qB0mSJygD X-Received: by 2002:a05:6808:6f90:b0:466:f5d1:6fbf with SMTP id 5614622812f47-4675709942fmr1586648b6e.14.1773408208887; Fri, 13 Mar 2026 06:23:28 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:28 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Arnd Bergmann , Jim Cromie , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Andrew Morton , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org Cc: 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 v11 16/65] dyndbg,module: make proper substructs in _ddebug_info Date: Fri, 13 Mar 2026 07:19:41 -0600 Message-ID: <20260313132103.2529746-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 rid for_subvec() of its 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: 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. Fixup names: Normalize all struct names to "struct _ddebug_*" eliminating the minor/stupid variations created in classmaps-v1. Also normalize the __section names to "__dyndbg_*". struct module contains a _ddebug_info field and module/main.c sets it up, so that gets adjusted rather obviously. Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 4 +- include/linux/dynamic_debug.h | 42 +++++++---- kernel/module/main.c | 12 +-- lib/dynamic_debug.c | 120 +++++++++++++++--------------- lib/test_dynamic_debug.c | 2 +- 5 files changed, 96 insertions(+), 84 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index a2ba7e3d9994..62fc2b0e8d1c 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -385,8 +385,8 @@ *(__tracepoints) \ /* implement dynamic printk debug */ \ . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ + BOUNDED_SECTION_BY(__dyndbg_descriptors, ___dyndbg_descs) \ + BOUNDED_SECTION_BY(__dyndbg_class_maps, ___dyndbg_class_maps) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 9fd36339db52..b84518b70a6e 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -83,30 +83,42 @@ enum class_map_type { */ }; =20 -struct ddebug_class_map { - struct module *mod; - const char *mod_name; /* needed for builtins */ +struct _ddebug_class_map { + struct module *mod; /* NULL for builtins */ + const char *mod_name; const char **class_names; const int length; const int base; /* index of 1st .class_id, allows split/shared space */ 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 2bac4c7cd019..49f7b12c9776 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2710,12 +2710,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 cb7bfe8729a7..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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 1213D38F636 for ; Fri, 13 Mar 2026 13:23:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408213; cv=none; b=mRimDNXjfmNsP5ZW1oJNmeybHniVrPyjmI7ycbJS2xiqCH/yLIRK5GTzUvGS6Br+bSGj/gfRWhPaGMwn4yhRQIZr8kYY3WmNV+KO7BANUAgw11AAtHugaoNSJQvT5a3XJrc6qZ4an2YxJ/BHiR67c8W3dZeoBnO67TcI2/5Eyb0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408213; c=relaxed/simple; bh=hQSWH2C33w5JtsWzjpP/Kl4w16w5C+lIPPSk1luBD5U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PLIBJ6HxDHy5eg8ieCI++tDQbAjoHL6hAE9YbcgANt+QjJm8GBCzcMsAlgv5xqpsULUig8780I61XbF/OKkOmfOB0ekTUKsZpH1TQBh81hxhMxns4ev/fAYz+V2cpc2e/Z++UXmOj5plBah0eW+EHs6id4z4gitS/vzi2jceIYg= 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=bmJcIC35; arc=none smtp.client-ip=209.85.167.171 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="bmJcIC35" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-4648447e29bso833783b6e.0 for ; Fri, 13 Mar 2026 06:23:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408211; x=1774013011; 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=MaAiGHt7PLiNFokoH+wcRTOWenkuKwVpfHhxx7Kp6sw=; b=bmJcIC35w3JZz5nAP2vmizpzJN4Ss2iBxbUYmmJkIUqoot3UpTjCediERby4zQuzi4 kde7pZZFiFbJc8AZokDtkhgkFH6yBl8SmAmWkUHkc8CYiBrmI16b6awLu20JxRYj5zIb /H9kJKaRoPIF7l2LpTtFafg4JUL1tRGG1lqER1wgSr06ZbYOprBbN11bS8uVYLGcQUIV 3LnzM/tv4nr6zUkx6TUepCNbKFn0jmKD8YiT0XLqNQ+dcxpEzQnKZ5TFIHPXm/nodiX2 VfSgcZe9vAC+1Wrw9g2JdjNixQfnzkYJ+mkgXx0rzysSDH67U/sE1KkExVdE2a9Yt8n4 S/KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408211; x=1774013011; 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=MaAiGHt7PLiNFokoH+wcRTOWenkuKwVpfHhxx7Kp6sw=; b=SDumz4bbK7nV/owA9mX7gNLJe/CRdVjiTensFwa/SgqeZyRMev9Srz9GLVB0lFLWjj CkXDL9Ufj3Xr1atz968KLByiTfDJHoxMQKfTd6FxL2Yh54HAZ1DqkTZ9YV80QoV/JCEp xpuAcRiN4Yl8chtit5gWrTqdgAztumPUL+NmUaaA9Ab9Jgpwzd5Kvcw2qQLsQaEqoxJN DZvjfp4bTZyURGcyW+Yo7NbVlrmG4eA6CiI+HtY12jRYGuQ9WJiZtaKSebJZFtXxU064 wmEyRpDNobClUbncMnq8Es6MV+gXqg6LoMf+gttZlvOwyvzAu4NOU/wdodmfrc8bj9ur Wrww== X-Forwarded-Encrypted: i=1; AJvYcCXMqyEzZ1PhuIqkH7GzTd+B28mM3pfQowhYjsSYhtIg3M0JpPHtxXwdenu9/kinY6IlS63oGD7gvXFE3po=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5TOtAz+Xor+ysCY4NRFShyUTrYnHvHbaBavSOxPfgJXe2oHUH /v5/KGYQ7KQyAqL14Uwt36x1QXBTF/tLDwta3zP5qbijxgPcaTqdSQaQ X-Gm-Gg: ATEYQzwVafqiYZqAXSNM6gU2BKIJvrfaFBXZXW9jKK829FX5iEcPxHruSyP6bR+ev0b Av2s6WtR2l9cW66pl9LECGNeDG3Jom8wVAmrCEk7qFaX/nEDV09ow8j9qcsZzG9aR+drSfZW9Tc 2n2Gv8fJerCMTSfMuntJLEzLGAt3aF2CymPTjw+pRLYvVUxOOFdBpqsuidJQD6T+jspbwK9xgJ+ 60pKWoulChP13+tiPI349UzGjLIBH/7j+kOQQDbYL9sifV0KfqJGouBRutj1SD066nvo1iV+O6H CIwVkOTwylxcX9E+5/OMCq3NbmHrQVebpVX5q/EKRhfJ8MB9wSr+pW4/TQoFtVIMenGMT+JtzM+ SER8l3xHwNjxqV+1KgQjBdXnbnCrxZQhnB35RqNjE2HeTC1CvQerSmyCoeJp2lPwx2NZgNlIveA jjWeTChzEMG4Ckjn1UMGecu/yqhY0GkcyHrq2MK++bfSz9cpV7 X-Received: by 2002:a05:6808:4f4e:b0:45c:925b:5848 with SMTP id 5614622812f47-467574304eemr1623103b6e.45.1773408210779; Fri, 13 Mar 2026 06:23:30 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:30 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Andrew Morton , Jim Cromie , linux-kernel@vger.kernel.org Cc: 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 v11 17/65] dyndbg: hoist classmap-filter-by-modname up to ddebug_add_module Date: Fri, 13 Mar 2026 07:19:42 -0600 Message-ID: <20260313132103.2529746-18-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- reordered params to match kdoc --- lib/dynamic_debug.c | 57 ++++++++++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 24 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index f47fdb769d7a..df7223532cf5 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -170,8 +170,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; @@ -1247,30 +1247,35 @@ 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; - int i, nc =3D 0; - - /* - * Find this module's classmaps in a subrange/wholerange of - * the builtin/modular classmap vector/section. Save the start - * and length of the subrange at its edges. - */ - for_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->info.maps.start =3D cm; - } - nc++; - } - } - 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->mod_name, dt->info.maps.l= en); } =20 +/* + * Walk the @_box->@_vec member, over @_vec.start[0..len], and find + * the contiguous subrange of elements matching on ->mod_name. Copy + * the subrange into @_dst. This depends on vars defd by caller. + * + * @_i: caller provided counter var, init'd by macro + * @_sp: cursor into @_vec. + * @_box: contains member named @_vec + * @_vec: member-name of a type with: .start .len fields. + * @_dst: an array-ref: to remember the module's subrange + */ +#define dd_mark_vector_subrange(_i, _sp, _box, _vec, _dst) ({ \ + typeof(_dst) __dst =3D (_dst); \ + int __nc =3D 0; \ + for_subvec(_i, _sp, _box, _vec) { \ + if (!strcmp((_sp)->mod_name, (_dst)->mod_name)) { \ + if (!__nc++) \ + (__dst)->info._vec.start =3D (_sp); \ + } else { \ + if (__nc) \ + break; /* end of consecutive matches */ \ + } \ + } \ + (__dst)->info._vec.len =3D __nc; \ +}) + /* * Allocate a new ddebug_table for the given module * and add it to the global list. @@ -1278,6 +1283,8 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug static int ddebug_add_module(struct _ddebug_info *di, const char *modname) { struct ddebug_table *dt; + struct _ddebug_class_map *cm; + int i; =20 if (!di->descs.len) return 0; @@ -1300,6 +1307,8 @@ static int ddebug_add_module(struct _ddebug_info *di,= const char *modname) =20 INIT_LIST_HEAD(&dt->link); =20 + dd_mark_vector_subrange(i, cm, di, maps, dt); + if (di->maps.len) ddebug_attach_module_classes(dt, di); =20 --=20 2.53.0 From nobody Tue Apr 7 11:17:21 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 0557839B971 for ; Fri, 13 Mar 2026 13:23:33 +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=1773408215; cv=none; b=ei+tdtqRElWStzimhVWYOdiMLTyHFIStp04p2ZF/8TFRgcO6r+P2pccIX1IrY6tVoAJXxShPgKduD/mE7Ms+J3SGrp62eAJjKAwnZGGxaaw1ASdt0yVrhascnlEHBIxjh++F3V4AKxZdIvczWdlC76n8EE1gHgqS+gunawBQ0Cc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408215; c=relaxed/simple; bh=4O8EaX5XnNoPvjOdiASMSgJbPgA6ST4ey21C1nqFksI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Bzqs/x2RhzN4zsGkbvrYMV0sXe4X4bGjfjL0RfqcncVI63edbqrpNzUK0Ct/dT1ZQpGTKoeQqs5FBc5CP6HuuIkVEy5ZvzCFpm29LQ5j5OtIUq+IPfVUHeOYH0amMtKGZAVvlFv3EjU20gwrjktDWKVfyW/TkHvOnzc/nq9FKqE= 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=JaNjXGzc; 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="JaNjXGzc" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-464bc03efd8so1514748b6e.2 for ; Fri, 13 Mar 2026 06:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408213; x=1774013013; 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=1Wq1T+ME15CeT+ENLeTMFVu27KuUi0eR6wJ/aa9tW5E=; b=JaNjXGzcQv29nkyMsrD39QfHl3njnw8vtuBVCC/ZALqZbB8Y7k5EDfnqEvyH1CQTxn fBf8yHHRs7Q6tc6RSgowJ+rBGdltreIM3jP4X6LLlkEFq83TdGzrILobuTPt9eiUE3VT 1EABgs4l7BMbz7JuhYs7VgG21AvxIHpI6kw8/0F1MWjkRWEaNudyS1+xvAYfbJJPgeAv apezbNfXwhx52x5mctz2TvEG9B8LCuOwFcBh1GZ4tjyQEeLnPhjQUr4oJU/sQrjDzmMZ 823vYuB0kl07g+RqxxX6o1WrelJgfMI0lvmUXh9qkTum7MGbrIBtODFWL+guxPLVJmUt gGNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408213; x=1774013013; 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=1Wq1T+ME15CeT+ENLeTMFVu27KuUi0eR6wJ/aa9tW5E=; b=QPxVQqleYimq4Uol4/2dwm+rIUwqJFHzi7tsHZ4hWz45WCYYs8lYPT45Cai1hzn3b+ Hmv9Y9DwomJM+d0vZetp2vB1aNqHU/cuBVjXu6vtvJjria8LImvdfrR4UiKNrhUZQA6O h0335ZTD5pORS5HdrbwieTbW5h5ObAAhfy6yByJWP5KOjzYLytULlwz4pTNmQgWLbAjL crQs20H05NhJ2+xY/OwvcwptGnrGjQrUANwSd1cd38xYs2xNDkjBii2ixYu5bh9T2/g1 aNhcHrQqDtSmSxnXT+FEDRFRRDcM0H5HyEpzzABa/AoTSx4RaTaGlGiWIoWzkhT1OQ3X FKTA== X-Forwarded-Encrypted: i=1; AJvYcCVTwhNLKPArPieXLc6Ss4N73csg99PxH/NElxOh6s9hL9zVJhWKimD0lXbr/IAk2SLQDPMApWuG2N44mIw=@vger.kernel.org X-Gm-Message-State: AOJu0YyhzT/4tI0gn5GyO2C0xgUXMgxZGVhqK7lcSHXeH3QvQeaBacT7 HnegQm2YUyEqg+jQBFpcuwO6OJofsYDusugMFRfknowa2VkaqcZgeQF1 X-Gm-Gg: ATEYQzyxe7Vo32mDEAnCqmTc1I5L+DRJjzD0J8cCOi7NTCIIq/E3iXU7xZ5fyPzFwD+ jia6XXlkF5QzLV+wC4agfgrFE7np9G6M5wY5qzs4igL+I+fwGlYaE8AFyec2+zmI570W5taHzPD Sxy2mrGKjk8Fk9tecPCoFi23Ofq/6MkVB+yEKDcKqldRexRCVERrYqkoGuPpk/tZBDdnGXZCpE1 9q9wpnGR+2tgWaiLRGaZcrHJ0GGjBXs8rBkmgHCoat+FmjQpF0KCF+QnrEVKYddj2YcuteH5Qol WUjjawNq+NPqkeInsPun9k3mQ1xfbLUZ/5RkTp+jpVem9IKibnPWAyo9ihRHvmfxdGftZkkonMI pJsbtg4T1gofWY54P+oAXjRcJzVHVPLULdTPUiSugsDNElwmu1jebXzD+feYTjXm76UUjvhEd0Q 7+3A7IAGrcslHXE++5yqm2RAj+onZmeNnLQyotBnxR2CML2lne X-Received: by 2002:a05:6808:2386:b0:450:89ee:922c with SMTP id 5614622812f47-467570dd9e9mr1671520b6e.27.1773408212826; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:32 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 18/65] dyndbg: move mod_name down from struct ddebug_table to _ddebug_info Date: Fri, 13 Mar 2026 07:19:43 -0600 Message-ID: <20260313132103.2529746-19-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 --- 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 b84518b70a6e..34dbca0beaf8 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 df7223532cf5..34297f658bc8 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 @@ -1247,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) { - vpr_info("module:%s attached %d classes\n", dt->mod_name, dt->info.maps.l= en); + vpr_info("module:%s attached %d classes\n", dt->info.mod_name, dt->info.m= aps.len); } =20 /* @@ -1265,7 +1265,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_table *dt, struct _ddebug typeof(_dst) __dst =3D (_dst); \ int __nc =3D 0; \ for_subvec(_i, _sp, _box, _vec) { \ - if (!strcmp((_sp)->mod_name, (_dst)->mod_name)) { \ + if (!strcmp((_sp)->mod_name, (__dst)->info.mod_name)) { \ if (!__nc++) \ (__dst)->info._vec.start =3D (_sp); \ } else { \ @@ -1280,7 +1280,7 @@ static void ddebug_attach_module_classes(struct ddebu= g_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; struct _ddebug_class_map *cm; @@ -1289,20 +1289,19 @@ static int ddebug_add_module(struct _ddebug_info *d= i, const char *modname) 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); @@ -1316,7 +1315,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 @@ -1379,7 +1378,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; @@ -1399,7 +1398,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; @@ -1497,7 +1497,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 @@ -1508,7 +1509,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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 BE66C39C623 for ; Fri, 13 Mar 2026 13:23:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408218; cv=none; b=OAifqPtlfhc7wgWiL9Oy4nhX7Ve3POHf/CCRTnHnLTSwoOSIenHQGIfs9PW7W9T9byO9B9AP9TWUmUysv42HJuxWp8p+Tjan612YvAb6GIPHchntecQINX7zlDDJB+ac+oDJ8TGbzSXGXL/SxCpyi/fkZonB9K+DjOBpeML1ljc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408218; c=relaxed/simple; bh=o848vWQhbJgQT+bi+J+7efxvWlzb1KWsPpehCVmw7Z8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JAhyK8Nl60SPifrxdMFLSJ+oZhE0/wdEHu2mQ/a1oD7cLfyFz++SirdhBPg0djsGT6/KRRVRabhAEVrB5l9D4+uponZeMFit9A28BU94A4lXInwWsyXn5JUS4jViVu+RupndrMF9Nj0jz/4FtM6knSUK6TeOEkSfL1tjRQPd/7E= 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=ZcnJMNoq; arc=none smtp.client-ip=209.85.167.171 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="ZcnJMNoq" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-4671119c1c0so1595297b6e.1 for ; Fri, 13 Mar 2026 06:23:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408215; x=1774013015; 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=OcJXGqnsuOO9Xg5FS/rnxA0pG/BimILzK8l4HmhOuOw=; b=ZcnJMNoqnBu7XGoe7X130SJ4c2eFzhgaB4r4II45piYpQl/unM7ymT8jwRVvhXBnpz GqWIYc7iIh6y92CepkqaAkSCSQ7H5QS8v7Isu/FaC1ALKhC7rE0pry21AunlaHkmQTG4 lMHZCErdbry3WgGwGDmrxnZ0ntwKnFKjbe53wujHfsHqa9UsV/ZCRTONOVDERgwLZRob RPNEvdBgLvI/EWQNTU9UgEgSLa8dq/z4Lh/UaC7LJD/xzoFPhPkuwlPuLOl2H0Gi//RG 7vFwz8BXO8J2lsKzFiHSfu1bLw+iz/NfTIc9FTlyMkxQCjto393M7CTpGUjHp8WsS8cs LThw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408215; x=1774013015; 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=OcJXGqnsuOO9Xg5FS/rnxA0pG/BimILzK8l4HmhOuOw=; b=Z/sF79NfixENaVPVF7xn6pvoi4D8cBOwwTIF0v4XTQ2fXvNtZPh1dB1cbz9yernpxQ LENkhFprz+BGEsmMT4weCBa6Rf04E5Bt4NvvFwiiWdMiuwKLZ7pSFhbRtaYfWc7IkvyS bqJ94YqYxN1UNB5a2a0hD4SqwOqzFG+OMKXEQ4csBYFKMPjXZgsBYyXNjwb2VAy8BSN1 kUHFc7LEAE9cd5e8EisxqHvDxIhK4KiJbxWYmPRvGdpf1KKpdgvuTJDrbOiNZ13gAlUJ eCvN1qv7eG2tU8Xz6BdWPsiisuL0Lx7fVSs6tFo/XT26EPdV1+ouYnuQFoPJJ/BBsKdR daQA== X-Forwarded-Encrypted: i=1; AJvYcCW/NgNefQ1jgbtGY9Hag2MqFrPr3wUXvDCFs4ioqQOaLaSl1qeB2sEgIsgn35SBy4SMZTK0R/t74LJb+Bk=@vger.kernel.org X-Gm-Message-State: AOJu0YwNhz3Gu0CbZH00O/AQWqyIiVRdFdmGu1j33UQUmluRBDvqzYS4 J6Oc+NJbwvotMvYC+2/lmYjxgP4Vupd2JItMnQlLdBFnDwqnAqoDod1I X-Gm-Gg: ATEYQzwLS1wfHLHya6s9FE5JjI0WyZzaugAPO23EwCwM/N/f+Pr84ryMlrSHkrZ9ZJN crQ7/xXA4Fbud7HEW8AjpKuzwa5PDI2Oso6BfT3OPhb9sAuwY7sNTtXETiP0wy7CreVyjlYepEB dQWRvMNOeRy6JNZuW4yqCOQfB0WPnKTfqhAGOd0bcolR/VkOUd8BL55v8hjMzua0CaU66qowJEp VmhcoXFrON9XH6D2lDPK4KZyMACvmqrz/q++zGBAZgGNFBGjKztskFcUcf4AFbD+pjQywNfQ7dd cHdMiiMDGXt0MrQ4ThPkG9hl4dPMm7GTOloZMW4DLnBkIYzKK5D3/K2VkPbOWWasspcjqmrXM4S oab3Eha6oNhzQnoHQplkeKMkCFoYhCjoj8mdJBygeHIl2Ow5vl7DrUn3lJxDbfQ8qiKsCKiFw9x KfJNQbxBaip0UK8Zd8kr5os/Jt0OcJM6cHdgFOznRpaZis6Yr8 X-Received: by 2002:a05:6808:1a07:b0:467:5571:7f3c with SMTP id 5614622812f47-46757048b54mr1479926b6e.6.1773408215390; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:34 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 19/65] dyndbg-API: remove DD_CLASS_TYPE_(DISJOINT|LEVEL)_NAMES and code Date: Fri, 13 Mar 2026 07:19:44 -0600 Message-ID: <20260313132103.2529746-20-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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 34dbca0beaf8..b6198ecc854d 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 34297f658bc8..e8ffc2b5b330 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 Tue Apr 7 11:17:21 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 6B8B239D6E9 for ; Fri, 13 Mar 2026 13:23:39 +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=1773408221; cv=none; b=uXnTt/+LyFcgdw7wU8tBUN5OGkzbwLNBQsAvb6DfMMl5eq9s2hWYtWC2oZbxZIrEdUTUD3PDMGPlWae3LReBn/mg0gI08fthMi5INI3kqjSBGE73G55GPKGAyCasQ02GNI+M1E1/guDmYXoEduKXizrvcGRXj8+czrha1c9XYpo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408221; c=relaxed/simple; bh=EgXbhfbc5v+qbtiSkv4PaiJfWtgaZuxGPhdJeXkivfY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mR+RGueVRWCQRDYXUCWVDKcado0uwAGzE6U9SOtp4gmwgZQ+hunZKoV95ybCRXgCUp+MwqgKE2JmxFYn1T7a14rA7OgtlBOztCA9/AzjU5DGyCkPxAFgKnuGGGnyAvjZ6JgVtJAIj6+i1fBJPmOJzmcLPnV51f9nlhFB7GfCCos= 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=MjQ28hnC; 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="MjQ28hnC" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-467161c4a1cso841592b6e.3 for ; Fri, 13 Mar 2026 06:23:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408218; x=1774013018; 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=+SnZ0lMlFR/eDwLoN2XrBemykJ/zr01c3NEwcnjvW9Y=; b=MjQ28hnCrrOEaVREA1/BRH4Cg80eS0Fd4vwkF+V4AovHh6wEuHlOHvP6xhKxYSYOUZ aYlYW3Nnj403qbWqPUG+rggdygb3Bw6zEQMKBk0CTWRetLS8RQ6tYKA71f7klO8cHqeY 2Qf+MvZSmWorc9m9whWpae6OGzoFJj3MAL0Aep+gVsgROSbfnz9AO/QmaTjNQO/rbm7H 9cfE7ApG43JBUqqtgpAe/upRTwMg0C5jBNFb2bn2pI1HRwgwbVjNhToc6amlCQMmayhh eiZqedi8bv9WUfA2PfzQs0tZaSwQlyeFX+D0iJ90g4GZGKwxv/UX1sTPe/6Qubb6wAGQ An+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408218; x=1774013018; 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=+SnZ0lMlFR/eDwLoN2XrBemykJ/zr01c3NEwcnjvW9Y=; b=Wn3ZjHypljC1sP1A0r/qRACmJjKpKB7cZsa783ycMIXlSpdlRUT66amK3wS7H0W1Fh 9DPRrKlNgYsvaYhoqsWMWK79yFogNS2+1qsI7C0svjxHa+Grp2t9mgP9UuFIhmGFpt/W Kw8ywswfhgiwJih5Ix7o3k9eqzcXiBIHgP4Y7kpjE71qJ6B25/fMF/GuD5hsiNZ49yqN 3mea89klMiwRPjrCmi41Xfg79ps4TO1SlM34WbKH/Y9srHj8MambcumaEk6aCciB7Ix4 R5lRpsfg/iReHaGpJ+8R9HcAn41QShgq1kZUmEasZPkWv3y1DbJQ1H5eDn6gkeCsgPfI Oo3g== X-Forwarded-Encrypted: i=1; AJvYcCUj70bF/f1F0UVIW0Fty6oOKLWDCifqbiBIp/ItH2YAA28XWEei79XXpzPdC8yG7tyqtlQbyAG/27Dr3BM=@vger.kernel.org X-Gm-Message-State: AOJu0YxDg4kscIk4B8AOi0V3LSEwLWh0jRs8iiI4sYCexb8Z9DVPGije ezsTjj12Xua2jzO5pzIBjhC4B/9fEVlgJixosLrWjQ+nCQoRZ1UOfbx9 X-Gm-Gg: ATEYQzzAWA8nrXwTU+rY+hqfJgX7Siz6lJpJeF+lIMDwjmbXGeeXexm9kn6zKr5mr3K U1H5o9Flwvu3zEPj0jZDvMYfPsGZR49+ip3Bq++IgHHLU2ozT+swl/tNO+zfi5tv09aWLW4fR8B D9k2dfZkVog0TCkbx9vFOt1Jk0x5oQ+9S6JHm6Wy3HlaCw+veoLKP1zR/m6Qg+mZ3FLSfMoVtes kyC0U/vhzq4wI871s9O9qGyAcHcIeNYampt8/BVu84Iz3qEPEOwZ/7l7FNVcvDcADIeMsxqlvx9 sHL54Yg9VB/44CbCKs63boYAnEJWLGR7rrwX3TmtRgza4zc6QeYtpbwfbtJWxEBCRHkCs4+5Gux CaA3G8LULj+s+BKJ2buLJhmXvUCihG0JcqOEI1G0wQzu/3thScRDBNCRedAy8G/7WyyAuv6VaO6 C1+VkGHoV+W1tgkuZXUlCByMbShcmXYN1HOPq9wfvmAHIhUjA/ X-Received: by 2002:a05:6808:1508:b0:450:5e3a:6f20 with SMTP id 5614622812f47-467570a474fmr1594354b6e.10.1773408218179; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:37 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Shuah Khan , Jim Cromie , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: 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 v11 20/65] selftests-dyndbg: add a dynamic_debug run_tests target Date: Fri, 13 Mar 2026 07:19:45 -0600 Message-ID: <20260313132103.2529746-21-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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. Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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 35c1edb67551..af1d3f246962 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9047,6 +9047,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 Tue Apr 7 11:17:21 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 4423639D6E4 for ; Fri, 13 Mar 2026 13:23:41 +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=1773408222; cv=none; b=V0ckg0AknlcD7AQYoIFcWBwnZB7FxmWN4XZJXUnZJYv1JKtezPb97Dqa9RCaQNxYv/WhHheTYd6AAplVx0xKvvOrfKDOMhSGQQu1HxzJ5PUN/VzQdACjQ36gfDXvQplc9GM+RFTEREwbchQR1LVTEP0UhDYe6PnUFy9n1dmsCBE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408222; c=relaxed/simple; bh=By1JXffxmAy43iPfrrj7xzanTYb1AnrGPmlJ/GKVsB4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sL30YnU/nnXJjBxlOd0+eSxogf6/AFET6ghc/N/AsqJVpHud6VqsHL/RMpiewtO+xw/H4Rt4OBtKveJSHLEQVJcpAorIGoYOPLsGiCJ0RRVQFfsoWN1MC3YxHEJkmQDsANyC/sl3gcyPs4CGd+7eK8jLr0swhKgNLATvZx5Bffc= 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=aFf//Npg; 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="aFf//Npg" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-466f935a82fso1463810b6e.0 for ; Fri, 13 Mar 2026 06:23:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408220; x=1774013020; 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=o/myr2hp6uBA+KWlkM+krb2AJfDnLypCssuuL9Sraxc=; b=aFf//Npg0l5iNhdmkcdkHv2u1rCcPmL/z8t9fFy18Hiyx1pgC6wwFxbw+C4/dEUdDg rbVUHPwZdiLGk3FRNmCV6Hp/AsZAwnCFgB/yOBpfy31EwgklKBWR212INC4HcwC4rqNC B/nHmqfNJepdV1STSBUDgNcaYwjjGu1jbpHuA3mLxATpWdTSvd/AGV9Qr29yEdbiJXJ1 RZEpx/83W4aDSLgsVURuvf19DIdfcwNrPzL7cIe1QR0hZdluIu0sjKu/h7CnVsYAsS4+ e9YpGc+prZOCb4hV9hsqJANj/nE3APMDvtkfT4x4ywlRhCNzAATefMFSHV4z3wADjEe5 17mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408220; x=1774013020; 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=o/myr2hp6uBA+KWlkM+krb2AJfDnLypCssuuL9Sraxc=; b=l7PpmotKXrAc4w/0t3CbbWjlwjsm1SaIBS3Ohw9u0HjckJyEh/udfnVDXsjf1xfv3Y D5yDmhTE9FwZ3FyUNckubeXY7Hr87HQbWwjmH1/BXdf+OTW9czFxG2Kp1glVDYN6M567 X+mwMhuKh8JbFqklDFp8hRcVsMHtU5GheJx9zC03y5EatxolcAMbcXxp83tcWijxTQyE tBw0sZ6pOqIG0CRH1R+tcGdhE2V/+y4XuYzyFYmPEv9wReSSJAuwL1f9dolKjT+40nJi JjOrJVLv60WhyrVlLZeg+poVDAZA9zuUXeFCDvLSRAHV/DE/ba1OJ3o3dg0ykGeyLbKM 6Vyw== X-Forwarded-Encrypted: i=1; AJvYcCXoqgi73QYo1W6jnMbPyGKjxUVGCdgs3YFcYkdSzs3ib8btcUg6N4MzIe0kSukVdaqwjnMGwjNDl1fWArw=@vger.kernel.org X-Gm-Message-State: AOJu0YyBSbkOCJ3iW1IQ0eG0Unkv8oS4Dluep2e0TaYafqQDXY9JYBnD vJIxKtRDRPv6zYRYqIKyJQU7u9qPk7IePUAE+Jqed8E+PlOX36AgiohP X-Gm-Gg: ATEYQzyhTaPCb9H95cImYZKJYgMLO/5LWyST3of+zhuvL8SRzzLtwzjFxunbCw0FmRf vQ/quI6Chw8qBvy8H9i2ohJVelHXYX+LA5K3tHnbgR1lW+2WBGHNRVWpY6HB6xHAN76ie98aYGl zMiLX/5QyxSO4wtCoekAfc0RLcreVXJzCjtzCoOMuRN6BRgSl8LM8CNJuzTvSClVIJJrBsOaVgB TDNoPTS7pLlYMKIXihrLvDNP6IyV5y24dEbaqBYquBL4h+rqWJJzDjeecHr3sVpz2RNBROj6KHo ZOp7lS086V9OCp8Q8VuOy4g8pyCU3bTFZ36FWCgl/3Tw58g5Stu8FzTZpuLmBP+jwaoMY35w7WV RxEKpnY8svh3aCrRP1xSsiKjvyLBeIrxVhxKQxoyJlcK4VFIhrwKQaAMP94mSok+m1IXxq+30qv 8ifuXRi9jXWuLGKu5ojrA32e3widQpSQaUcw9tN6CKLSSy0Cuz X-Received: by 2002:a05:6808:6604:b0:45c:8fa8:7497 with SMTP id 5614622812f47-46757530482mr1581686b6e.34.1773408220142; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:39 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , linux-kernel@vger.kernel.org Cc: 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 v11 21/65] dyndbg: change __dynamic_func_call_cls* macros into expressions Date: Fri, 13 Mar 2026 07:19:46 -0600 Message-ID: <20260313132103.2529746-22-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 b6198ecc854d..80160028461a 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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 CD2BF39EF16 for ; Fri, 13 Mar 2026 13:23:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408230; cv=none; b=Oc/vVV3WGMUqAtzWFURZiEF6yZPjUPJBJTcSnAS6ri566+zg7I3obLgh5WW9hM6QX4FRVhCzx+V266M3o4uwYxKEcLi15uBx4xRtmsR7dczAWTWvTtx47J0CFEhBIveJL16V4J3MALCSlJ5yGyTwx5MldtDLUGjmCAUOrkmMy18= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408230; c=relaxed/simple; bh=0v4Z6ahcR8DyEpsorA2Z3hqAWonf0ZM/gpsitCEHZjo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZTU/nnrl/AZwcU4UvAbPIUbmXWHcO9huFecB7P6n3AarWD1gOPmuf+yy1yDoLxGRNLcZJaz0LiJl0BzmJQvd2/CuDGxzM9483AlPk/VZLSos+kkzmHN2+Ttev/vi8+TBjQ/Y5XDW7+Jt2KrCC7DXPPMSpJATX+ycH1abAdbjxoQ= 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=GpXaGHXt; arc=none smtp.client-ip=209.85.167.171 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="GpXaGHXt" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-46726528f1cso1546339b6e.0 for ; Fri, 13 Mar 2026 06:23:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408225; x=1774013025; 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=lB762FeEpTmiwe79svqmrJe7D/XsTTkp/IbU6vqNYr8=; b=GpXaGHXtP9ouaUa3pfx01l8PrBnYRlKmAg+nmsznqPIgD8HM5BXGGPGjaBX8svyo3S M011PGdaZ053X/z34BxIgOxjioaGVKrWsi6hGA0PX0YCyVySb6TYxuqSRM9khR6Tm96G JKyUM1mkw6GVSJLMXO7L35wBoa4SzeeBdbzfz6j7+yEi12CS2wGExDI+LcVHc1Ivyd48 jLZSf9r+UwAD6B/U64NmjRrkkw9SgRjI8U7zxRQHUzNWb/MdZPwVT629IQxlHE9dqMIX EOePeM8POPfPkidBTZcSG5Vgp+vbAj7kkdQ35M1sQ8/iqrdy3LLoHu/2HhsjJEREByeM RZlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408225; x=1774013025; 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=lB762FeEpTmiwe79svqmrJe7D/XsTTkp/IbU6vqNYr8=; b=aIcbICdP5EYOaaeaQm7LKzy+LHXuYwKBrWAbZvoB1M9HkXfl5R08JN6itzqAzq0GBH 0+hVoqjKIh9yExR80mhr0nY5SUuPmq61HtsCqAQYUV5t+DANVzNGur/+DC1ETrb3Uoq0 bcLIbNIXHcypu/fyoDzevheqAd7fhO54QnU/1s5RB2MNl9hrVi9nWNCUhJ1tWJd9+MnL oyuJefG/sdnRen2Pb54MgHtsq0UhHWNkZTK1sPD5QbyvhY1zN+uFW/FJwwKIlBCh8RTN 6yUK+wkdQHXuGLUcZXY8hnoUpe0daPEEUm1zC1EvVeNjbQoID9keRC9au3MgTu3kPNJh rmXQ== X-Forwarded-Encrypted: i=1; AJvYcCVu5jO000YVfP7GyVGCZtRh+NPbSu/44PRCXHU2ns4EtgpZ68V52IQLExzgqVI8Q7UjH9GKqxKsNikOwAQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzK7IjQHFLirzovsUB+Cc4h6OgTi5nHvTmduyByj4QEVERlPOg9 TbhbDJtweZ2VRKx1Zh7VmF6S6BPqYzXCw65OYJB/2YJfLq7mb4HacY5Y X-Gm-Gg: ATEYQzzxU3dXPMAmd/DhiZbe6Y7ZCKVoL9NitJXlshWdMX9LByvlZHsBppGc+P7iR1m nOcp6DDeHc9QPgRo97GAfalmiYVo4aeztCMsh1uZRrkHXk55i+xWskNE29gBoNvFg7OdIK1UcIJ AvUPRjXY3DKm5wC9Y8zESDbL5cROglTpi5XQJs5TpFaMHvjsZWur3b/n1qZ9L85SOumMPTdTSUL x3C08SGbizhTlKt2gWh8VMNNUFOmw3KyM62wWhGKhm9QbSdJ8ltBXSOnlww2XLmel1LECKXZpTI B4QYI2u9kDSLM0rt+QUCPWgZBV3c+gcWQxfvcRXgHtPOrrnp0FaSKtIq9ByNNPzMKUChOWXVULf 6rbeWEpzCVFnTb7+iPel3upLuK2GEYdksJDwXThj5+sudqYHUnP9eKETb4BcA4pom5nG2c/Lcza WgUl2C8i15gNZJXD+zHETRyBwG1uEPmmUe7wZFqJvMGmEEqN6nx2QPvbnLP3c= X-Received: by 2002:a05:6808:1b14:b0:464:bb83:2761 with SMTP id 5614622812f47-4675755e8e0mr1657630b6e.53.1773408224314; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:43 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Arnd Bergmann , Jim Cromie , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Andrew Morton , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-modules@vger.kernel.org Cc: 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 v11 22/65] dyndbg-API: replace DECLARE_DYNDBG_CLASSMAP Date: Fri, 13 Mar 2026 07:19:47 -0600 Message-ID: <20260313132103.2529746-23-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 gave us: 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 new BOUNDED_SECTION for __dyndbg_class_users. this creates start,len 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 Signed-off-by: Jim Cromie --- 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 --- MAINTAINERS | 2 +- include/asm-generic/vmlinux.lds.h | 1 + include/linux/dynamic_debug.h | 138 +++++++++++++++++++++--- kernel/module/main.c | 3 + lib/Kconfig.debug | 24 ++++- lib/Makefile | 5 + lib/dynamic_debug.c | 172 +++++++++++++++++++++++++----- lib/test_dynamic_debug.c | 132 ++++++++++++++++------- lib/test_dynamic_debug_submod.c | 14 +++ 9 files changed, 412 insertions(+), 79 deletions(-) create mode 100644 lib/test_dynamic_debug_submod.c diff --git a/MAINTAINERS b/MAINTAINERS index af1d3f246962..67da16e209c5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9046,7 +9046,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/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index 62fc2b0e8d1c..c29bf967ad03 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -387,6 +387,7 @@ . =3D ALIGN(8); \ BOUNDED_SECTION_BY(__dyndbg_descriptors, ___dyndbg_descs) \ BOUNDED_SECTION_BY(__dyndbg_class_maps, ___dyndbg_class_maps) \ + BOUNDED_SECTION_BY(__dyndbg_class_users, ___dyndbg_class_users) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 80160028461a..74ed18a038bd 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -72,8 +72,11 @@ 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 struct module *mod; /* NULL for builtins */ const char *mod_name; const char **class_names; const int length; @@ -81,10 +84,18 @@ struct _ddebug_class_map { enum ddebug_class_map_type map_type; }; =20 +struct _ddebug_class_user { + char *mod_name; + struct _ddebug_class_map *map; + const int offset; /* user offset to re-number the used map */ +}; + /* - * @_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,25 @@ 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. + */ +#define DYNAMIC_DEBUG_CLASSMAP_USE(_var) \ + DYNAMIC_DEBUG_CLASSMAP_USE_(_var, 0, __UNIQUE_ID(_ddebug_class_user)) +#define DYNAMIC_DEBUG_CLASSMAP_USE_(_var, _offset, _uname) \ + extern struct _ddebug_class_map _var; \ + static struct _ddebug_class_user __aligned(8) __used \ + __section("__dyndbg_class_users") _uname =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 +403,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 +422,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 +470,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 49f7b12c9776..bfff5b849966 100644 --- a/kernel/module/main.c +++ b/kernel/module/main.c @@ -2716,6 +2716,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 e8ffc2b5b330..66f4bfe39e89 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; + 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]; + return NULL; } =20 @@ -1159,9 +1185,85 @@ 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) +{ + const struct _ddebug_class_param *dcp =3D kp->arg; + + /* 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); + } +#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); + } +} + +static void ddebug_apply_class_maps(const struct _ddebug_info *di) { - vpr_info("module:%s attached %d classes\n", dt->info.mod_name, dt->info.m= aps.len); + 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); } =20 /* @@ -1190,6 +1292,22 @@ static void ddebug_attach_module_classes(struct ddeb= ug_table *dt, struct _ddebug (__dst)->info._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. @@ -1198,6 +1316,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) @@ -1210,26 +1329,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_mark_vector_subrange(i, cm, di, maps, dt); - - if (di->maps.len) - ddebug_attach_module_classes(dt, di); + dd_mark_vector_subrange(i, cm, &dt->info, maps, dt); + dd_mark_vector_subrange(i, cli, &dt->info, users, dt); + /* 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 @@ -1379,8 +1501,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 Tue Apr 7 11:17:21 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 B55B339EF28 for ; Fri, 13 Mar 2026 13:23:47 +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=1773408229; cv=none; b=iUt1ZQ6KM/CtpWOKnHf1tNtwrrKbkym8bhJMoww9kwnAMAf1nH6jxTRwmj8C6BhGX6t/S7YowiuSZ1td6NhRpktIwhIhrt/WzUdAyIEZGTEChtlreThm7/dIGhU0vPqoDsmh2x8TPXYOkCUXyvGXSiJVxwBkRyoF5Np6t1z3R5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408229; c=relaxed/simple; bh=E3BuBLscHxCEFbwBedt+/q2/52T+sJEIsVlq6h+6omI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z9lEAs28jDtrqBhPA1FOC1If98SaeFTnzofWT6vgr+VwggeeLGvcJaGs/iHDUD3GjrHkFp6KukYN2NOTXOctMS4Q+XJ8LcltIPZxFLqz4pmIMc0zKhhspfE7NBrzmC/Px41vaQAkS7ZAcvO7Q9z2yUlGlnqLW6pXcYUVbZKdtmc= 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=QgOKa3pt; 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="QgOKa3pt" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-46703fb602fso906685b6e.0 for ; Fri, 13 Mar 2026 06:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408226; x=1774013026; 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=So1OTSMskFHrYYWc+bNZ+5Ly0eOy3XxdufShv2uDEDM=; b=QgOKa3ptQXk/LdtUFUe/2qHLPC5yd6DeWbbzX/tVbJ+YomDkqEdSduhE4YiOQbm2BZ Tg6yPnM3uz5Mu5x7xQ++MPgE/YafthAhvPfBKU6mZgcVQ7QrOrQTXITJq02su5GsYFnp moZMfa3+zeMfIUOJuCmquyzKhH/zBAnuh/OnmEVmJJpIVvRdkj2jV+ubZYVWkHX+GvKj sU7xE7tQua7+IyTmaaBTCEDN/2X7/TVeLEw9RlxTZCMFl+ArAdgfjwe09tnAUFtzIawC nT2s2mGdvx6IOCH0v/kh1OJ4IYLQX4SZyG+R3LmJ3m7xIhUloP/X5W29690hGvOaoo3R KXtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408226; x=1774013026; 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=So1OTSMskFHrYYWc+bNZ+5Ly0eOy3XxdufShv2uDEDM=; b=UuLZfe91RhKKCnDc2MUyX6AuwrjPE5JQiVmr9Lx5LwkE/G8qYRa50+WjL8mMVMXfxg vz1CJjV8BYviYc4QydHxaPQqJkzrWSIr6Vpe6ZsEbBISi5tr+ehFmTi/JnQBE19cJBvJ 5Jcu2SeM+ns/FeSlzqjoAvMVNFQVMukAJk3nJhC7RKCS5tRNVdGoZbkCBOxZ/4PqZoic sFkSuRO7D2+BJvuUnB2tZa/lJA+gytYdwtm5cWKyXHRJiYf2XOEKUJYzyyelRqxfb7kV 2D/wQPuEIhul86JZhOW1W3OdxQoQUQ6zyp2eY7qslJe6/iVvXav/2/29K2arlEbheD0D Ypow== X-Forwarded-Encrypted: i=1; AJvYcCVn+4cStVdn6fx0xOEIThhvSga+DUEoJBB6r4utdc4tST+I4dv/UiWZtayMdvyPDAQhv1iKsdG3CRrYeRo=@vger.kernel.org X-Gm-Message-State: AOJu0YznV0SjdPnvWU3mfSm3ohQWVMi9zpOl5vpsBthlCl1xNZiypMys ZGu8KqfqeyOzpEiQ9sWA/EevTe/HJo1mHt+mRvHpX8FuM+8l/5IHzvZV X-Gm-Gg: ATEYQzxsbbVqCSwS+rgi1qnfqvN/XJi/yFMr7YSyTunIEpB40NvOiNFwAyuXcZn1rit bMdETtMbzTl6tMOXjVCfDyPz9DqakHIxMkvrMebVys/e7WPGsiOef5koIJ27qTy7oJeHsNwU3JZ +O5CyiOBiqANoaGIStMyKwHD/73Jdz0XiIOhvo9dGjKtlHnsIhD6XPRYJPc+HihiW987dXFJHRq dv2U3ZB4OZPP4oxQjM63Mc2h1wOttOISJoHghEEDoQVuwI4aQibQQ+MZKAE2Di/Mt/y8BKU7y82 IXbxEMOXKZp+H/WVFrBpoXJ7Skfyi9wOECPbmjVLSFf2Ddr/trNYjSrIojHrfus1GEZS4wSqmLl Xf0ECvNaccRZnJHsKA/Koz6/imjEFpcKgUNWCoKdCRsgClc93diP9M+z/KhG/yX2Ixmr0VTybci phLM02O8yFqacEM9pb230J6tAGXX1Lce7+e2Y0vAuSa8P8gOWh X-Received: by 2002:a05:6808:6717:b0:467:462b:ab0 with SMTP id 5614622812f47-46757050cfbmr1535486b6e.2.1773408226613; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:45 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 23/65] dyndbg: detect class_id reservation conflicts Date: Fri, 13 Mar 2026 07:19:48 -0600 Message-ID: <20260313132103.2529746-24-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- v9 - fix WARN() by adding new 1st arg 1. --- lib/dynamic_debug.c | 10 ++++++++++ lib/test_dynamic_debug.c | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 66f4bfe39e89..ec0d1c427d59 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1317,6 +1317,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) @@ -1341,6 +1342,11 @@ static int ddebug_add_module(struct _ddebug_info *di) dd_mark_vector_subrange(i, cli, &dt->info, users, dt); /* 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); @@ -1353,6 +1359,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..1ba4be9a403a 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. + */ +DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_CORE"); +#endif + #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ =20 /* --=20 2.53.0 From nobody Tue Apr 7 11:17:21 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 1C379398903 for ; Fri, 13 Mar 2026 13:23:49 +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=1773408231; cv=none; b=GSdNh0tfMsxOXB5QvYJw7fZDWjPUPJMiQcillHdhFhq2rsz1CF3nmlLN44dtNOoJff0ngoLafKmiY2MccG3D99o2BdPDTS720gxIzgOOtSUs2VrT6NcWd154KWvRbbl5Z4gbhV33Qr/M5MlVTt05e3wKxN63UrH8WEOny/M/2UU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408231; c=relaxed/simple; bh=w5QdxPIetOuaGsRy91KWMP3/BGWkuj6SOGrMCM2jKJs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DScmD5Y8+4LhGsbzaQVryxcg7bEusNXa4SqJoKj+ni3hWBw/LCxHv2UVsZ9nTmzp92CpVqli7cHFo1HCEJ39SNRjGdXi+pUv9yUXgMcuHldS/LGK2sJN27FxLFKAxK8hBqGJCfDoz5k65lPK4pNb4gSVYFGm4QfzdoV7X9ntc/g= 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=BBDKG0Gg; 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="BBDKG0Gg" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-466f935a82fso1463921b6e.0 for ; Fri, 13 Mar 2026 06:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408229; x=1774013029; 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=j2MYJzJHADFhmDlQmMQlbImDYfLHhfEQ7IriPsfmok0=; b=BBDKG0GgBJ2fAt2oOTM3o2cq6d5FdfY80+Aq9vVAf1RNN+kyOouq9V+I3ZHiVfjsnG 3bwoQjsVfFKS3Y6vGjx4LkYZ2meEImAnw3VHSKlHLLD6hdJrJ8lsXrliwqtqYjRNL3+x FPKt6YSc/IF/6Dslc3gKxXnPoVeSkPfkP3CQC3oW8eLd9BhvNJFAwimQc/y4HqMA1keD sE4612p7Qo0yDWTMUTzayEwZ279cJx8IZLFx+YoY+ju2Yni++rNkzr903ln7SKgEsJKv mhZZu8hHH5m1r41ls/Dc//dMxkx3ayhQTBQCrb8JjYd0rQ1s1l+/Dv3I6Afj241nG8yl TfmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408229; x=1774013029; 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=j2MYJzJHADFhmDlQmMQlbImDYfLHhfEQ7IriPsfmok0=; b=MQS4Rt3KFQPwrXHtLtGBoyZU+oezULKG+976cFjozIYpnUOrd4J3wiU5Ud/lyI0Auc VyhiEf0f/OLYGsQo4mfWLQKLOzY5U09dAeItHcN8QD/sLW57e1EvDIBnUg8kcQRG3h9+ t83j20pLMplEwLtXQBezerFr52oaWYfIke6zdD2OtSut+OxkXlAECOdPYy0wrxksyOHb o4k4grcDZv/DRpiSjpIo5T71jMLOQkxotu3bBFhmaAPlxSPxElCqXbfZkihYPsi5XH2D ghlOYWSO1eQgYfKUN0/ELVbZuQsRaLR6rfiW6JSM0utLYB9XLmaCbOIH66hHu13+KDAM /iHQ== X-Forwarded-Encrypted: i=1; AJvYcCW4qcD2Y0qx6Sjo0N1wIkCLffqiqOL4LxXGf7SVywoDukhFus7KApL2jglHbW2mZ1DjR6uGBFEpjOAMvdw=@vger.kernel.org X-Gm-Message-State: AOJu0YzaZzA8G6OPCqrHWh04PvAMwVQT11t9ZJgiWzhXJEfYsRbpkOFh orgVywsz7WPOJH8uPKzTutmww5nurLRBE+IOru8Ei7R8B6yK0v0n4JAr X-Gm-Gg: ATEYQzylWOehOoZN8Ke3MD/tvc15CVyitIls7SwEXNnBrv6kfy1lam6NTRj1j/Kfh69 iPAcc1DcpQUSjO8lRiFtQ0TLLjTEu5vCeOeLPfSj7qY1DofKrRUkXcWNr3dD1wGqmioBUvoUhEY 3Uv/qA0XyP7Z6iESws8BIYTdbkAtpqyblT1wLsLFI3EaUBihK3g10moTtJnO3vvobhXFUcd6Jc4 jK9QlyXSoY8d0IapA6MZVGMIFqskSTsTEvl9ZVRm7J6AG9yQ/TJz8BuWgRCnpOxO3yOFJBer6Fs r5fD0OES3QqGQcnMx2x8fGC/tKdS+YNnu0LwznzB8OWiP2us2ExQkoK58R0C6b39Pt5mv0Kcj9y dlUlH8DiT/7UX9QZfsrb3dWOB4EfNMkc2gEPrPT4FI12TKUttKnCj+UabWMKaWHkjLFhZJn7AdJ T07doK379Lkq/DB80lR8TlRybTLhvHd/Qwg4WImW5NokOJGcyw X-Received: by 2002:a05:6808:c2d1:b0:467:26e4:728e with SMTP id 5614622812f47-467575c42d6mr1645259b6e.49.1773408228837; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:48 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 24/65] dyndbg: check DYNAMIC_DEBUG_CLASSMAP_DEFINE args at compile-time Date: Fri, 13 Mar 2026 07:19:49 -0600 Message-ID: <20260313132103.2529746-25-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 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 --- include/linux/dynamic_debug.h | 9 +++++++++ lib/test_dynamic_debug.c | 13 ++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 74ed18a038bd..d3889173abf3 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -181,6 +181,14 @@ struct _ddebug_class_param { * __pr_debug_cls(22, "no such class"); compiles but is not reachable */ =20 +#define __DYNAMIC_DEBUG_CLASSMAP_CHECK(_clnames, _base) \ + 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 exceeds range") + /** * 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 +202,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)); \ 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 1ba4be9a403a..b2bdfdfb6ba1 100644 --- a/lib/test_dynamic_debug.c +++ b/lib/test_dynamic_debug.c @@ -133,7 +133,7 @@ DYNAMIC_DEBUG_CLASSMAP_PARAM(level_num, p); * Enable with -Dflag on compile to test overlapping class-id range * detection. This should warn on modprobes. */ -DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_CORE"); +DYNAMIC_DEBUG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_CORE + 1, "D3_= CORE"); #endif =20 #else /* TEST_DYNAMIC_DEBUG_SUBMOD */ @@ -146,8 +146,19 @@ DYNDBG_CLASSMAP_DEFINE(classid_range_conflict, 0, D2_C= ORE + 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 */); #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 Tue Apr 7 11:17:21 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 3589339FCA7 for ; Fri, 13 Mar 2026 13:23:52 +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=1773408233; cv=none; b=Vevw84Lk3GvOLVRl1BxROR+b9vnb7Co4wu/Gw9izgn4aku7u+N7jz084NMlv+jTLfjJXvSDO0hOtB+Y/BkmhSaA8Na5QqrnoAQsDGiB1pQbsaDzShiD5AnO/QYbzwUyMRKuo/IvoWhzbW3+DYNSni+dHsiGffTjmRsl0nqv1HyA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408233; c=relaxed/simple; bh=RqZ2lhe9aI+UbgnAFhOI5pRR1Yptqfi4sFzKiq7tPdE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c1lAWteWUNK6zj37tsiZVpY0UYEBmxOGBWJLQLNpKUhqEwCSmYDDecnPrM+yGXs3fFAvWi+NRVlhh77605Es67sbC8gXoLB6onNsOM4rb2ml3CEeZJ6DHZb61eR4YnKmxnI0v0ieWkRbWo4sUceIS1lpsPeFkQ25EBJ75eQpZg4= 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=D3EFvMGN; 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="D3EFvMGN" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-4645dde00a7so2693191b6e.1 for ; Fri, 13 Mar 2026 06:23:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408231; x=1774013031; 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=6HuyybZs7Z0tHabOQHGkaDjwue2hifxy3VAIL8mPUeE=; b=D3EFvMGND23pNXqhRlv3hLg0Y7pAuNDXJ7glQQIvK4OGG6PW8M7mJRVk7m0MU6yQyC krZTf29pHQiKe7Er5rMBYp1gFDc7wPBLhtbr37kaw704Cwxy/R7u805lAKyG7ZEVKyDz n1jt5BHGpAzBG7sZ3grv5KSVdCj5SxJNNmCKRY0WnsqEDv0U6MchMsYgj7DBsVWufoIa avMuulsrPFOzs4GtmBLsd+eX6UQ1JyDUbOCZKlWoOujEeAeITm/Bx+DF836g22yEufAl QNpQARl1ftPwILkKzlXE+jiuOK7CM0IIYbyqCdp6tbHGLNnOCeUM86iugdECnFfB3Zo/ NGhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408231; x=1774013031; 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=6HuyybZs7Z0tHabOQHGkaDjwue2hifxy3VAIL8mPUeE=; b=SeNwb+O09iyg39letSw+xn0Ye+PIxYkWDboMhye3lYYusD4G4MM7I6Mto+fgyx51AR 8xKmu8psqrKMOIDDJD+zh+UxYk2ASgpjA4ipkeWAn1n7AxPWm7BXtj9bWmN9y0qkfTcc duw/NFJ5jrpTliCI1hEuXb5COYADpU90K0FHT+fKTcpsUr2682d/MD2R6WcYkU0/mvKE gh/xAfI0ZEAS/WHHRWUsuqDeyloJp2V6NAcFNZouVxM+bJO5Hl1wALG6I+RWQMSOhix9 Q/QXin+Xhv767nGdCrfjWq430tZHSsOlyDnHXTr5l7RTBzexrOu/Vd2CVxBuqhg4y0Vs vzsQ== X-Forwarded-Encrypted: i=1; AJvYcCVpeLoHgXXMXM6ZXASvhyzShtBDjJ1SesvIp3k6IETrahpNnFqHhn6GbF+knGE7RiVmir7hMfzpZPh5uSA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7O93cYrCMWoa7LTXJJC7OMfh8Cu1FLPZhnYOR1IrfbGUolNld Wm8LWJ2fFbUB3oXDkfQnqhriRH0pgl9UU9Bt8kT8CmJqYpGDyTgSUbig X-Gm-Gg: ATEYQzxlEr90Q6GDn+nLxTadLHlYPH0ZlUh/g+zNW4HFb8YoBMi9CM4Yw/Oad4OXyuj KnSnh78hGvZuaVAlcUNUX5L5/ap4lzyIqI/yVvZkrir6OKDTdeNtfRLi1p0cD4gz8hQEgVlAxoX yAtmHIi0bSGc9Ux2ckcMcJDM37IWzVjXi2EI0JyhiMrhVYb+i+nkQqrOD0g4EcfGbZXxx+SIkPX CKzrD0seXqa7Jycu/v8an4FJA+DvykanZWhZ0jByDybxOlZHoV6mp3yv6zcoEVox4ODXACf71x9 Z3uUUM98QL4xniYC8c0dNJrpCy7stV6yJVR5ipGGWf39VWauPC+0zCLldmJnlBfiNHaZRZO0oqo YnWnUl59u7o8FPynFXfqNIRNWPabIZHkzPUB9EPcQjYkhRx7hrJsbUXBAwFyBfyl+QkTZBwRl0l /9TwH/39Vwu88hc4uXoGp1sVLVtOry6bA2i9iivmjZ4FBkBL9c X-Received: by 2002:a05:6808:17a8:b0:466:f6ee:5bc6 with SMTP id 5614622812f47-467557ec7d9mr1854894b6e.27.1773408230845; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:50 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 25/65] dyndbg-test: change do_prints testpoint to accept a loopct Date: Fri, 13 Mar 2026 07:19:50 -0600 Message-ID: <20260313132103.2529746-26-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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) to the-log. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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 b2bdfdfb6ba1..fa81177e8089 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, @@ -191,17 +198,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 Tue Apr 7 11:17:21 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 BB9923A1E6C for ; Fri, 13 Mar 2026 13:23:54 +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=1773408236; cv=none; b=e2LF63OPSNv7r2kwavr4XvIpEclsftfWaLEhSjOGZA66y7gzboux0Y9QXjX3NOblTMfZwnP/5H/y60wl+uDdB0d8QJw02Dx3BptgcBMylDQSy1RnKlgYivI6ZhmDQ1mFyji3gt5o8czuZOWbUKsWX/JhCc1FxLGa1mF0elKTUzc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408236; c=relaxed/simple; bh=0xDDvjl6TbgTB/h+p1aS+kdQxjLYAJGWhGegSH6fHZU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D7GawYxjkGDWoJFLIATZIX/GyyGr2iUtEwated9PpCQ7Ov5QG0Q9eynrNdc3GfPW6tnyHN9v9n9zb0krJUUXE42zhdMp58VE8Odm4N5kTFZlBSNXBUVu07vXatkWJ6i0nCeNySs5B0Sr/C6aHkRRFabmK0Qr6SK3YjPgvpStI+c= 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=BantkTHH; 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="BantkTHH" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-4670464029eso1289350b6e.2 for ; Fri, 13 Mar 2026 06:23:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408233; x=1774013033; 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=V9yFZ9wAUE4hTpXT/LXVTRS1RyTFtZKLLeGT9vvXBBQ=; b=BantkTHHYFKvgwMVPJAVx90Acw2ZlPbZuljUErV8MyzfH3kgQ4C5aRHtfxX/G3Qe7M 9w/MjKVLevEjdD4RtZj6sanf71A5cAOIvYftV8ByiOd8LbO2MJPNP/H38N8BSnE+vmuj LZGnJLqBxOA4UfjVqUVvbgjqhufAT2y1/oJA/UkUkavpajY+BvxypmhBo8jCt1jceEPa 25m2yud5DU7t8Gmn7jtg4pFmDTvqz4w1Zidu2gFHqw/geXcWVMW5/BQUpQa2F0kEbg6g zoFxvTtygU0cRBKBJWrhi6LoG/VdKWfbTpKoho/YACAI/sM2/s62M6yFLsKB0lVhGDFm gPBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408233; x=1774013033; 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=V9yFZ9wAUE4hTpXT/LXVTRS1RyTFtZKLLeGT9vvXBBQ=; b=gUT9iljzvmiZvJnZZvb6CKjk52vA5jRPGPGaPRbxLXb2PDMWNtsQcKDQ4IPDAX0kqv 5ZhUScm6wfK42bZgmeBFU/Ou/pyrl+sltKM4hh4g5nJTwS5GnSy/XEj34UeBveVA0jsF NR95SKG0Ix4xdySrr/fykRi5xGLngGyoQPli4NO8VcdmjNK0yP52ezKDKLj8w7e0+fS8 Vf5GSTg0v5Xv+CZ1o7Y9K/dgQ2sJNhOjFNZEkPZRpNn9XKRW3iIjqfr5HLVMJ4RI8wke LqRxtDKctMsu5zdxZ3BVhLbOPFE1MZbP4WiE37ows8dzgfHASEL6DqC4YvgXyp9LMXSu Mo2w== X-Forwarded-Encrypted: i=1; AJvYcCWppMRxhynOuh7YZ97Fw6isVnMBuKMVdbDVUktLhclRbiUcZKH1663qdsUCxGURBC78rEyu5ozjO+1H0fU=@vger.kernel.org X-Gm-Message-State: AOJu0YzoS0fqOAxhr8psD0K3AGA7s2g2QLVPPRXkVyss7FiYkGYvtdC0 DUEsioJxZfBePkg/5Nn5GbgPUFoRHN/Ri58bwaUmdD4btuYf0bJWXSJt X-Gm-Gg: ATEYQzxm35QJPvcJt78gAB9cfCX8yQ/q5O8lrD7xi0pLCMRAMj11D+sjX6sgsBpAUKG OBM3shokMNhdHq4Cf8Lo3hjl37CH5NF6sfrtynYdPptpfzPz+I/9u85rzKiKKxyTiQd/LDjnm4T LRnePJn+Ac7LuKwovdkxl4ctHS0x9T/T000Yww0ZPGggeAzLf8fF2Ph4Wb+kW9ILWkVKcL9XUpx rOthYapKSDOeRZ7IR8+sD23oT0EjdReLlne7H+x1w6ZA6mEAgmSIfRM6kwyl09VqPXpy2vkRf2u eszHCF2f1SLBAMnT932QpCRipGwxgrgD+1/pFCr2fbIxq2G6hFYK2Q9iHRxO2ssRLIgd76aMmE/ zjBW86n3IYCMByYKJ2aNWTVZa615Ys+eGuTk/QgfMOQFQlVCO1+3V7+V6CAtMFJ+vJj/dJsCUnO Cxvv7Bsy/gHCThQLrmzObTYd0p/rbbopJ/4JUTc1WrVt93txpEaaW8t5OO5/M= X-Received: by 2002:a05:6808:dd0:b0:466:efb5:9443 with SMTP id 5614622812f47-467575b0900mr1335243b6e.39.1773408233393; Fri, 13 Mar 2026 06:23:53 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:53 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 26/65] dyndbg-API: promote DYNAMIC_DEBUG_CLASSMAP_PARAM to API Date: Fri, 13 Mar 2026 07:19:51 -0600 Message-ID: <20260313132103.2529746-27-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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 d3889173abf3..4c36c2a4801a 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -251,6 +251,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 @@ -433,6 +471,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 ec0d1c427d59..e383e93dc784 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)); @@ -1195,15 +1208,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 fa81177e8089..83c4d571a8c9 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 @@ -224,6 +210,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 Tue Apr 7 11:17:21 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 E8F443A3832 for ; Fri, 13 Mar 2026 13:23:56 +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=1773408239; cv=none; b=qx45AmZ0Mw7yAh/tI04R5miPmVToPpzY9z++RXaUHtLWiMnuo0yxUZO/HfZS5oPeE89s+2bWu85Djo6YJ3gBMsmfItw/Dt6Hrc7oRum03ApglosdgHXLLLxa3f231CIKHuCban/lIo71elHLhmicAb3rgHBA3TI0BlTGT2OyEpc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408239; c=relaxed/simple; bh=/DeIXqJLu0dhqgtEH5faf5593G1G1tM77qhOiecPIIc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=N9EtUvZjegAENjQTIKPZToc5hvN0SPKJb2U6t7CWY14E7TyxyqKgBW7GDwN6+vw7Rf071BxHwtzGrA64lXuAtzWVnQGK0qZxl2OvVmAPy3Vi0tdVeApoXV60mDXzM4/Q3MQyI24jVV+czHSKUi5q4OiqCkOOlLcgVd6iNvLqNDM= 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=e4o3DJi1; 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="e4o3DJi1" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-464bc03efd8so1515138b6e.2 for ; Fri, 13 Mar 2026 06:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408236; x=1774013036; 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=fLJ6/kh9zV3xnzIvFpZnDpL3mZ5cCxT808iTivJti0s=; b=e4o3DJi1DLsxLhW6GfE79wnkHY2D8OQyr50Lne5MMObKo2GQhLIliCBaAt3ynCBjA/ IaNSbJSBMMVWZHzdxMMPZl3/yeM49N/0VU2apUsvLVs3RjKDKK6xu1b5F5GaL8hsCKwT hUmdEpzyu52e+y+PoQNGieQvu5JSBh0W5r7NH6Fl2XsjODcBLJxfS0Vq2C18S98nkKL2 4BwzNRaC7+xZKTrGbUDaS71kQmekmPPSPakDXpJVTs5yyZHgpQeVwNkJxJOW2+ItE0OA TkPFYdFa32et4irF/5dlK7KBWaRGoriZgLCjFT6LP6UFfh1KgB3B/NrXGBv+SaQUNq4u YRLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408236; x=1774013036; 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=fLJ6/kh9zV3xnzIvFpZnDpL3mZ5cCxT808iTivJti0s=; b=KnI9V/5XqY38Nz0VLQj0RxDJFG7Gi/Zg16WxNVbmWzOUgeOisFXX7uYAekxfSPEhse WCq0vuXCgcflW2t3H8kdowirtHjoB06Py3NJ+OICnCNO+d8SbsqUsyJUl7ujkIkUfMSD ySOaVkcxPeNgJZuXZczw6IJHzkODPULg5QJUXo6MhqkPiyIPZs7cwuphwzx2SSVuM22f +YsZJ2zsQ5RLU57dMIRwXXaRGb99NaWG6F3sYlpayPO6od+NuifmPNXYhWcQ+dPjJbmG gIdy9ZoLewQojYTTHbypnlf2uliJq5XVNFG9+j4e1YY3CXLTuKPg3qV1fo0Jb1mH0GD2 lexw== X-Forwarded-Encrypted: i=1; AJvYcCUra/HJr0jRZklmzcKuouWIalD/ZJMlf+zZSZcxjlJbMceRJCYFvCfnXgpY9Ht66kcfoCPq0jvWF4n5Q6M=@vger.kernel.org X-Gm-Message-State: AOJu0YyRYzVn2aNdAtEpxZCwklmq+cU4OIGlIJk+JJUtvA1PT06Lv2KU En2mf5UAfGdltSil4UxVMYR9wvxhxQv3ZEhOeYXKOqmE1bqAxFYzNlpU X-Gm-Gg: ATEYQzxrmA0BHF+JLpjH9nUxcUJJC8KAHmGKKCV7AQmSbvKQoVq/ZDSiPsEuayUHbYF VThT0wF+ZD+/8xufpYsy/GQKdEazXClaWC2WuX/5TRh9s946T73q6Oh1PQmvC3/IgbCDl+Phbyt UUrx1AnkeQAmiHroM68GzoDmm1gruqVMKhGx9fRcfD8umKzhCOWDyop8xhDe0FIu5yPdyWmHQlU ObbyxBYBFbG70S4V2tT2cfRi1nDYGWpIX3KWHgtBXith/QnDwn87CHVwp/waGV64w9E8hxhU4Nb mvlAf3vkCPOnb2t4wqvnYyeqB98PuopKIO9NZl4IXiwDzETV5qodrzI/Y+ElfoAiQrKpqo4QlUL 6r4KntuvXcgxlxMIqr2CjlqazZnikPgdnOWiHNIJRqSP46mdNkH+++ROET1pmMhs1zINp7S2MBa 3aCBmhMs5tgxFxizK8Ptba9ovnCt27JR5h/ZVfbEnPUqd0ObcL X-Received: by 2002:a05:6808:19aa:b0:467:284:b3cb with SMTP id 5614622812f47-4675701cd1dmr1819155b6e.2.1773408235774; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:55 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jonathan Corbet , Shuah Khan , Andrew Morton , Jim Cromie , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: 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, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 27/65] dyndbg: treat comma as a token separator Date: Fri, 13 Mar 2026 07:19:52 -0600 Message-ID: <20260313132103.2529746-28-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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. Co-developed-by: =C5=81ukasz Bartosik Signed-off-by: =C5=81ukasz Bartosik Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- .../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 e383e93dc784..a77c6e9ff90c 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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 742093A3E96 for ; Fri, 13 Mar 2026 13:23:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408241; cv=none; b=PKn1CoovhLHSztkQEzMeJHG9B3QqAOEXlZ1jZvvh70jskDM0Jv+jNJCUnw4UptiWlTlBXbisbvGsM/fjrPXs5FEHeYYb4juTMuEElxNJn/JcI3UWC6INwVqC9t/m09W0gBvs0GfZjOwAcnHOFheGGa+vTqaq4Dx8P4919xtRZcs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408241; c=relaxed/simple; bh=gePKOP5tnt0R8TPIErv3cmLoJ02zcFPQDivFAVxPdOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NiOCQo7pUsh39uHwHOQqJaDTxyV2NVpao6WUnWNaB+02MGh6TM2TZ45AbmovXuKD9IF9Y08D4Ar7ot4a5qs5Q3SJ+SblB5iCN6zinGBdIG2A05NJxoW2L5XS5w4tErjQiDb06Q4ZSoTc7rCkrexCRT9KzOn91LowO6ru0QerHXo= 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=lLOAFyE+; arc=none smtp.client-ip=209.85.167.177 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="lLOAFyE+" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-4671cbce32bso548427b6e.3 for ; Fri, 13 Mar 2026 06:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408238; x=1774013038; 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=hpMXv4qahUc2uiZbMeFCgErFRwXSuQXuET6sVgGMTXM=; b=lLOAFyE+/nGkPiUqjMqbbVwfMgf+T6WTq9aH3Q2ZHtb3jPY+9Z/oEAsa+g48KYeVLu b6paICTOrf0Ek0jnjpyO1gAd+MDznuuYWc3ia8X7zDbwnt/qX7PkRlOgKw1ciswq/+ic N665v96eC94iZB9u1Hay3wR/o+LF9P8jaxKRWRqzj96JILEYN0sx5oTSzTfi7W3KlBrW JNA721HSPPeNKfRt4l5m8CqdnqehcAlt0LW1RdTaHpOHahdHquxKynKn07lPNWQfREsV A5khXCqFh7CIaD1Bbl2PLTlyrwgPrP3Grslgbf7N69JAJ8OY6uATsD42eJ4raTvrUycP efmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408238; x=1774013038; 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=hpMXv4qahUc2uiZbMeFCgErFRwXSuQXuET6sVgGMTXM=; b=ZxxyXIbKPBPj0ZN7Wl8I1WGe4AqFLxVF0ytjQAvKAtNgpIEp+/14ZVlNqg4oHlsH23 4VBQvYZ6/PYT96TfWoZLffoMQQ2lfOYzDiYNT3pXSPVTTKQcRJi8vqgYQEiuKHZCSsS2 5GZ3qY3HH/0ABX5HONRTL+wpATQTfpC5VIgcTGd5RtfHj4eWNwcGZdpsf/fBGKisJtv6 i1VkWJO0MculMYLYNCZQf8bh9yJ2N+GyGTeEPrwdugCnyDP6aHhFkOi/NFHXdrwKs/vU ZhEelEkUCE1AL2hbfKBLJlRcOJOGNsL3mMgca+lWyczWNnXZdpmaug28UrFRzJkx/MkB 3Ctw== X-Forwarded-Encrypted: i=1; AJvYcCUMO3sp9P4vnQHKsSm5g9yfoCMQ5/r9gxNh1C00iVDI/ZDoxVO5DM49a4SDEVZa5wB72dLDnMKXDTF4JiM=@vger.kernel.org X-Gm-Message-State: AOJu0YwzW7PDequMrhorbJ89JlpHIFkpdKiL546K/bs+dIBjBqg96uZ3 MA00+DlBkRn9JrVWryuYu6gKx7BAcJvBEIA3bN2qrqKsvPDJaIHMab472XeqBnle X-Gm-Gg: ATEYQzzvuLpJduxN5UyWfZ4UjI5a5hbdirhY8UNyb+bBxMI+anXv5/3NibOuyJb9dui s51f3/INqV/Sr/YJuVKUVaMGOQ7f0hpFBoaCENEkuyemwlAItBux3y5zXbKVPdEwJKqmUOynee4 JHEXZm4U+EjRMQ9CRfrYHru8LVzlJJw6w0XRkJ1oVmnOse9DWMO499whUtMMAeRmK9ipa1D7u7h yOLZzJHlZxd/SHmRAgEiGoMK7yqVUUY0wfNrJ+GLCIwu/r66DV6LYMxKpD2OlFK/F5B77JiFxyl WXlDnm8lONwuxxurR4piHbg05VXsiIL8WA5ua7biEq+q3eZsMszkxAxvlrwkDMgh53XihlOTHgU PFOVAVJ0CKCR1O8rtarbBXPiOA5Zc2W64/uvbbGxNvgwj4f/0/mxiNAd4I6JbnTkacNrleh2qQW XMAWTaUO9famL+H344r7FY5I9yqgjl0w/XuncalRhh4xXwOjZacsgptgYJof8= X-Received: by 2002:a05:6808:1b0b:b0:467:a44:dde2 with SMTP id 5614622812f47-46757583573mr1661703b6e.56.1773408238278; Fri, 13 Mar 2026 06:23: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:57 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jonathan Corbet , Shuah Khan , Andrew Morton , Jim Cromie , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Cc: 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, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 28/65] dyndbg: split multi-query strings with % Date: Fri, 13 Mar 2026 07:19:53 -0600 Message-ID: <20260313132103.2529746-29-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 a77c6e9ff90c..a1c3141372d1 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 Tue Apr 7 11:17:21 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 9E1C43A4F28 for ; Fri, 13 Mar 2026 13:24:01 +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=1773408243; cv=none; b=emFYQYFKUangVwVtBOBlpeoU1NIIHWfbMBxR9kvRro+zWs7B6W1AU5rYdTKelVzqvKJNiNf8anlUxQJN14/dwccvuOFDGC8YqRcmx6ymEnBrXNoDx+olnAUprFzZp2jDKKtH6R4coh9CBs2BfhuDeGZgA0G1zgEyS18xr8jp5x4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408243; c=relaxed/simple; bh=o9XAvjSs/yDZQc7WmR2T+j5cz0yKThRjVBgsLtPQWN0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EQ6A+VDCjmhQhthOMJH/R+/BeIlcYJv8JTUPrDBcWAYpsmktjNAP+OHmczdFYrxx7NrrtXnEDImtDht7kZIxKEOM7qPvYM6wP3QrpJNx4n49UtXvtZ9oy8dnvG6xumpdU/riKMmO63Z7IM8D55Zol3NieLjHEjZ3ScRP1PxCo8w= 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=Ef1I09q3; 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="Ef1I09q3" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-46704177508so1465608b6e.0 for ; Fri, 13 Mar 2026 06:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408240; x=1774013040; 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=Ef1I09q3wzQpb2D+oRp91ZPkPNEOXCI7EWd9mq+NvYnxmmFe2XQ3LEov6SiA+1GBZr lKFvlEyyjzG9OB45gkw2xD5yXk9aoG+TDyVxyAFaa9/HPHR+2yB9AVDikW9VCz31Fi9F +anpfJhQgPNzVV/MIjBUi7K7p/NO2ncUTGJzQiu4vSF90Y7JHOzjVQIGr1d0gIkK/XTD Wv/tgYm0rvQgZ6pN3hF042fzAup3JnVdAr8bRq1w+DVi3L6a+rh8WaB48L9+TB4D28DM FXekQ/kk6lkUnV3iNfKqpebRVJhx9CincBOff3U0u4L1+yhW3JZSvdcY3Fac/q9dnnMU POJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408240; x=1774013040; 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=iTqyZ0/UM9HBUxUClqIHn8QODeqNUXiHHcIj1BlJS9EnoASTfLT0CaanXX9ASIyq0T OKsu5jomm+jKJ1PJBKoVF3ZsTu0Y3W2jiM5hwaH8eMSRZXiz6d1IdIYVM0wXCJhlen97 ia7A9Z6KOc4E0Ez9h00FQBHJfzcnPXetWO0Wn4BguqF52Fyv/ShSV5bz0bcf7K9OsbzB eQ/ALScHbl2XkJVOTyEPMHbT6TBOdRllWSTEOB8LkGftqu1ee4K7OrRVgrfm0u1Nemvm WfwvZfw8RSDweJS5UKGwUo+J8JfrylOi3TPZFMV53wsoCeHyyFJG4aX3TBRRHhKXvGCt OHlw== X-Forwarded-Encrypted: i=1; AJvYcCWUjlcXJD0F2O/YEx+eIbQJjQEvZa/OwCGgl6OUj/7KGT1sLBtKT7WSgMpCp9lx5Y0ongKGTvL4LrGKf34=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/aYEpMSu5as38rVC8hC76zArrH28FxjMW0zb+TNgOrpBXErpB MzM7x4gBPLaHNjsvWzWxp8MZFi4p+OGXiZd5zAYj9bPRmN9sO/HczTrw X-Gm-Gg: ATEYQzwal2tnrIL7s9tivJLLMMWA6MSH8zFZxiRgP4SuARG1eHqlSi0RWbar6BNBhdX vQTXid1mEiGiQB74qtmWMyLVaubgWGXTPDApRLjOXH1L4EjWVcVJMBU6ZmSUQ0c+jWW+fDx2n4r EisVjN6eV6PEQsNyHOh6kckMElR0N+EvK8CK/FrqSonBQ5bwcOQGz52KRAZOqU1tH851QIuySl8 piLPnxbYBxJu035ckeHUf2zeF192jW8McePaK8eK1cAPv4VeC4+PFw88kmj8Z7lob3IcI5kKbP0 GsS+KW5GWmXb/1RSsnm3ox8vwEKDFYjLWbtc04BHgv2Y4H1zxuJpiLwOobkoPUOVbgSsbgmH3AC XM+sOGJ2HolFi0MjPMUyqwquNYDyjJWTno1SD16AHb3rw1m6+Vd9xtOFjMjWERFcEsDv5Kj7PV4 2CR92+18aVR2gNpoEhxJvR5ax0OAGuW+YYRf4Ff6hH7GLuQIVa X-Received: by 2002:a05:6808:5292:b0:45e:bfe0:21f2 with SMTP id 5614622812f47-467570ecc8fmr1454885b6e.10.1773408240480; Fri, 13 Mar 2026 06:24:00 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:23:59 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Shuah Khan , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Cc: 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 v11 29/65] selftests-dyndbg: add test_mod_submod Date: Fri, 13 Mar 2026 07:19:54 -0600 Message-ID: <20260313132103.2529746-30-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 DEFCB3A5445 for ; Fri, 13 Mar 2026 13:24:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408245; cv=none; b=ZhqafMJdgafEy5+vN6ruDrGoKDQVQXOaQ1jZyr0j/wx3ynWNRh7KUT36NYq5yidri2lXnOeI/b04UBun77GcOj5qCGBNqW4pcpA0ZoPfuK70b5uqRPByD0PPJmvB7xd0UVb0ZtPVvBfgxXmpn7ITb4GcZm8nsqOh0M7FMa6afAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408245; c=relaxed/simple; bh=CduuEGzBuc38NaBjCBr1kA0bdo0xfIsESb/2u6pJm+g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HjiLXqKw4MLBm7WpJbrZ9MVSPJltN0ZM7wAbzbqD9YkEaPumJCuPRW2nHt24xVTg8X3a6xsMh/SzWRUoaY3wS+RupT1OYCIcZREC0PeXaO6wDjk7sgqScKCFjiMvxzlYMe46hHZkxXkmtCCGErwX5temF1O4Vv2GgUhd1R/3jQQ= 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=me3ykdeg; arc=none smtp.client-ip=209.85.167.171 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="me3ykdeg" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-466ebbf7ff7so801933b6e.1 for ; Fri, 13 Mar 2026 06:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408243; x=1774013043; 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=1lq5jaJPqLqnk3f4baOzmy3HWsNUAD6m3P658X9bd80=; b=me3ykdegdv1a+d4bka4OCqwEFsNREKj175JF2EV06dt8TVDSEKK+ll8Zmvpmy/+rfZ YGZ96RtWF+3mJNP52PYWc/JdJ6KL987Htu7vWQcPxdj3insZHeb3eef7IIL/xroxdceW jlfFT/KsJYyVafYMwlQrsXdvew7TVQSrpAzgDamI0IEj1+gmv9ZNnHjPMU+vqcO70RHF 91oPCNlkPKVgHlehWfLDFqJ8Wgo4SUZmBLruntJBH8kDjIrTADfC9mXMkO/IwumT/o9v xvsonMYc7StNWvGQC7DX9CgyuDEZEBnWfV6RtZwdWQ4jwxBsMBYRd1NBcVKa3hQYrtgw xoqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408243; x=1774013043; 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=1lq5jaJPqLqnk3f4baOzmy3HWsNUAD6m3P658X9bd80=; b=SeDqPM4i7jF+z1bBGxsKyzDCm0BPGeGTkhxoIYFMzg21Es2DD5Eq3VFbfi8Cm2qRmV saVLApo4XD3JlcYVxKdEDGf/COqQPZFIzQZMq3CbkLTquBcUGvvFnydJ/+FQRmBTdHCG 6R6zfWiOjqM1PCVM2LeUEFqv7ftiRfzIPRlR4y1X8XpIywn4kQbdBoff2IQopzzKMnAc ByB1+/TiMVrplR0Cfj6xYhDyUw+jo6poOEzmDaO5VEsk/a5BaQijFa8OHknPx9iGDDqZ mgIIyICIbFgYwIPuKqof/xS1UHp+jfhIZbeLQj897XT/wm4iYd3HPT84us8cUivqp78j Ay+g== X-Forwarded-Encrypted: i=1; AJvYcCU2I/ng5kRXUyI4z+7eIPCftNGtvBffOAubBGeAoR+CWwdQ9NbKEoX9dNp2uMNXqEmDEi+llUBZ5IT9oRw=@vger.kernel.org X-Gm-Message-State: AOJu0Yx854ZINhN9Bk10hL7rWKEcq3IlMofDsBAipoSU1c7rqkMuMSY7 UVddt/thHTmwm9K+rg4W7oWTDhpEpRChZbd5F222MOA2YT5jM3vO7eGw X-Gm-Gg: ATEYQzw6iv0rdcFsMi7QJHj/flIqgjPo3b7utCwQb4DYbd9+tfXM/9C3TTH3ab4AKu2 CCHzlmE1aLx8qL4NLB05w/5NPitxxOUZS3sQVSSrsVtPrLlZOtHOGB8qssmPmH+zGmJ2ue+Z8Jr Lo7N3uTPxpXE6h4R/eo9uVO+CUXApDRXzvqcl+KqzNPignotZKnKmxBHGsgIRawr0+z6NUBtNBp M1v5m7Kc7JaoSiAHYg2hC3DPhSwUsTb767dhLoA8gZFsuXsc61tUDx6VPUY+3mZwFhxdGlVDXhJ BMydOHF0wywNYvoy21n1ghqSAy8VkQBB1WlaY23n/qk9yqt19BJ31da9buBhGI5E7XxB3jBm+JW NkU54j7RXr29AVXnrcg0/iFJQiTAGlC4NiMsqXv/2XXLpeGd5oC0jqGJmIR3lYqInuIMXrsC34x xfku+OW7K82VH3e7WbIckYg4w03MIcx9gAByIRhH2a/9eeIVZ+ X-Received: by 2002:a05:6808:1592:b0:467:42ab:2f69 with SMTP id 5614622812f47-467572f2c8emr1586112b6e.34.1773408242720; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:02 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 30/65] dyndbg: resolve "protection" of class'd pr_debug Date: Fri, 13 Mar 2026 07:19:55 -0600 Message-ID: <20260313132103.2529746-31-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- include/linux/dynamic_debug.h | 14 ++-- lib/dynamic_debug.c | 128 +++++++++++++++++++++++++++------- 2 files changed, 111 insertions(+), 31 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 4c36c2a4801a..a1454db1bcb0 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; const char **class_names; @@ -259,7 +260,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; \ @@ -272,10 +278,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 a1c3141372d1..e9fa0c8868db 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -206,6 +206,50 @@ ddebug_find_valid_class(struct _ddebug_info const *di,= const char *query_class, return NULL; } =20 +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); +} + +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_in_range(class_id, map)) + return map; + + for_subvec(i, cli, di, users) + if (ddebug_class_in_range(class_id, cli->map)) + 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 +258,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 +298,29 @@ 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 +330,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 +719,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,12 +1171,6 @@ static void *ddebug_proc_next(struct seq_file *m, vo= id *p, loff_t *pos) return dp; } =20 -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); -} - static const char *ddebug_class_name(struct _ddebug_info *di, struct _ddeb= ug *dp) { struct _ddebug_class_map *map; @@ -1237,25 +1295,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) @@ -1275,6 +1344,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 Tue Apr 7 11:17:21 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 D72F33A5E79 for ; Fri, 13 Mar 2026 13:24:05 +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=1773408248; cv=none; b=e0K5YTwPKfaZz/bfDmoJzofaH4xNeGMyNVLEFoIldx0LsH5l/gy+CjwwwEZ3nn6+PKuBTaRtea2jsm4LSu1V/RMirultN860pnuTYbHPn5O2nrZV9ddsSWaUj4TOo70SI4Tr3QjRqI0JSWhXgtbzd6xKOrVdIeV9n9wddh9HA/0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408248; c=relaxed/simple; bh=D/yX53Om7UtaCAARmzXSvsAdQ2fZm9aOiO7pyGBbY8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PmDnMfbjZ0gHYD0ISyZ9ITHuqKPSX8wIw9fqaVQ/RVuuaKpH2gNOE9Fxc8mPTzGUnb1GzujBeMTiQc8FpxYAuAQA2NI3t5O2XmXZzWT80mrqugY2x2zkLOOhmHlIb/Xlaz5IrXNTQmRg4BtHMxgTO/62w+656XtH7yrwlyvYrQM= 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=hTG2uQHl; 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="hTG2uQHl" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-46703fb602fso906868b6e.0 for ; Fri, 13 Mar 2026 06:24:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408245; x=1774013045; 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=qdG+Un7f/ck3xLwdvB5oV2R2xxQrjM1Me1J1P6bJ/B8=; b=hTG2uQHl/JMH/VScBOMrwkmpgZTsfhPDdjZLjgqzRNmfFcFquhqlOuQ6w2PsqkSgSB 92yyj8RsVeuEZhXBS1FYztfTx3KkkqS77Fj3ymEnTM9lA0ZMWZMxvz3CCi/iLz8s6wDc p9JgfrtV7FVO6Gqp3LtwUjIeQTQvoZ4xDIxoiEudbwuDB54vAXk4x1kQE3j2A+w+UQdc 5qx3FRKh7JVpu1su7GC2O421GmvQ2Km6SIXqG81NCnU53QxJcwXzvQI+2i9YFs90aKmT EwGyeFvJX9qUHKS69AhDruJkbfBy+eoh8NGQ2dgrxW5+D+bqGJrxf4PAIMJHGg7P9pPI 69iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408245; x=1774013045; 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=qdG+Un7f/ck3xLwdvB5oV2R2xxQrjM1Me1J1P6bJ/B8=; b=fOWvMZlZ8PXq3SHQ1nuzBmuFsjnfnLH1guuQv8pf+f7AwPKyZjQekcY4rs9bzR+2yT sGr6MJ1jHGo0Y3h1lJxxZLQLd84qbYgSf94t8IpDkwkovXnqRD8VY9kwNgMdI5lMNL2T biJi7OmJvxoJf5rsZMbYOBAhC/MHEOosSe++ECoi96p7gt/dNpHRdzl7fRHtw9GAnXUV Pf3eG1yTvCeFoMb4rVFimdRsL4ahR4T/pZp5Q1OKpGU0x1RVlC3kF7njFMvDQfxUasVR gIZztuLb9uEbkuyz1jVVE+leqn6loZftPLNTae+E19+Ly6sR48lAFQZaKcZ8zOGzEAm7 3Ltg== X-Forwarded-Encrypted: i=1; AJvYcCWTq2iIovO9h3ZBBhZiCxy9OZ4WN82XXi+DYtmRhuh1Xm+mXWdue6yRYM+RJLdYsHeRDK3FPmGPVN5Ca0w=@vger.kernel.org X-Gm-Message-State: AOJu0Yzk9UJ/0/hb9hCmVHGlyeDVZoeXPnSxl5Df1qTnAMFyDYFxMPPA g4fusGa8yQfWeKtNDwuHYLYwXvL6G8uCV9Ou6d8WS33j/FTiCtdXUb2O X-Gm-Gg: ATEYQzy6ugGVfmNphm5hbXpbrtdRWDARcLZQQFWnxs9YjsVltBrEXzRWN+Io9AoWnAs 9+xtu4tHU97MyIdPIoiWAJjJb+mbznaFUi3vOBZgTAo80onpgnFn4U660YzCta45WUjrUX4hsDl PWtY2cTbtikLOduBuQy1YN6dbCiaWB3VU1nPcgVxtc5UZ6C1AyRLxCw6uTYtHyXvpvna1IBCr7p U9ytpweymvaY5EUkeTy09wobLMjN7wmysEjBVFCVFkvRshw36XcAqRtCxoQcr9jH5IFVAFc1Lgh W6raXq1t6pz1Oq21EEcWDofP4NdgdHBFH5jEt1xFpUs+nVsqL4Z4Hup/bhkYGkMkbQ3lP50HVIf oeOmM9szhjjgIPva4dpbKCU2NYsMGDXU3y7iGwAicrTUk/ofcSrwfC0/VU6T57ioxQlKUEDlYiy pRpaRAX6esNlzSKCwUuh11dDKIaEdCt6NOTL4iRJjXfK0pc3ZU X-Received: by 2002:a05:6808:4783:b0:466:f60b:19c5 with SMTP id 5614622812f47-46757052ad7mr1017669b6e.6.1773408244642; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:04 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 31/65] dyndbg: add DYNAMIC_DEBUG_CLASSMAP_USE_(dd_class_name, offset) Date: Fri, 13 Mar 2026 07:19:56 -0600 Message-ID: <20260313132103.2529746-32-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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" 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 foreseeable cases; perhaps a 3-X-3 of classmap-defns X classmap-users would get too awkward and fiddly. This is an untested interface extension, so drop this patch if it feels too speculative, knowing theres at least a notional solution should the situation arise. NB: this gets a checkpatch warning about unused _offset arg, apparently because the arg is 5 lines down, and out of the chunk context window. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 27 ++++++++++++++++++++++----- lib/dynamic_debug.c | 19 ++++++++++++------- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index a1454db1bcb0..0d1245aefc69 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -88,7 +88,7 @@ struct _ddebug_class_map { struct _ddebug_class_user { char *mod_name; struct _ddebug_class_map *map; - const int offset; /* user offset to re-number the used map */ + const int offset; /* offset from map->base */ }; =20 /* @@ -239,11 +239,28 @@ struct _ddebug_class_param { * * 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. + * 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, __UNIQUE_ID(_ddebug_class_user)) -#define DYNAMIC_DEBUG_CLASSMAP_USE_(_var, _offset, _uname) \ +#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) \ + __DYNAMIC_DEBUG_CLASSMAP_USE(_var, _offset, __UNIQUE_ID(_ddebug_class_use= r)) + +#define __DYNAMIC_DEBUG_CLASSMAP_USE(_var, _offset, _uname) \ extern struct _ddebug_class_map _var; \ static struct _ddebug_class_user __aligned(8) __used \ __section("__dyndbg_class_users") _uname =3D { \ diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index e9fa0c8868db..2083a8546460 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -198,7 +198,7 @@ ddebug_find_valid_class(struct _ddebug_info const *di, = const char *query_class, 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; + *class_id =3D idx + cli->map->base - cli->offset; return cli->map; } } @@ -206,12 +206,17 @@ ddebug_find_valid_class(struct _ddebug_info const *di= , const char *query_class, return NULL; } =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 struct _ddebug_class_map * ddebug_find_map_by_class_id(struct _ddebug_info *di, int class_id) { @@ -220,11 +225,11 @@ ddebug_find_map_by_class_id(struct _ddebug_info *di, = int class_id) int i; =20 for_subvec(i, map, di, maps) - if (ddebug_class_in_range(class_id, map)) + if (ddebug_class_map_in_range(class_id, map)) return map; =20 for_subvec(i, cli, di, users) - if (ddebug_class_in_range(class_id, cli->map)) + if (ddebug_class_user_in_range(class_id, cli)) return cli->map; =20 return NULL; @@ -1178,12 +1183,12 @@ 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)) - return cli->map->class_names[dp->class_id - cli->map->base]; + 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; } --=20 2.53.0 From nobody Tue Apr 7 11:17:21 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 D336A3A5E69 for ; Fri, 13 Mar 2026 13:24:07 +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=1773408249; cv=none; b=iWsDgfWcB6pQjJJ6EzMY2JqPpgvYAAwC088Bi8Wlu2fNTTS57MBgz5isST/c1+IyiAyJ+ETc4e4AeRPWoX0lQqhxHQAiyuhPTJ+IgPiksPFiiLFuIOlL3x4Bdyfr0NrdW36+pjeN53u+R+QDE+bHjDN7BSSb2uuI6s9xE6rLVco= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408249; c=relaxed/simple; bh=fP+EsK53N/PWkXCnRa4DfhoWQeYgPtbOA1Yy/AusvkM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aLlUZCq2JVwa67RjdcdF4uxGfMqEhPKKqs+l43z1W78rkDDOrupo69IbXXz2LJwM9QMu+isyQPfWXaPB9JEcxkrZu2bTzkusBonOKF7mTItJzXGcZLdVZTSAKdEGIbzfAuSiRcnFzf2zIutUqx9khm4iUNLE2V6T+M0kgc5WJ9Q= 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=W3MjAA/z; 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="W3MjAA/z" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-46704177543so1451153b6e.2 for ; Fri, 13 Mar 2026 06:24:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408247; x=1774013047; 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=RUFWI26wJ3+Z57HFFsxefXkK3D/1IEaVOdGJ9g+Mjso=; b=W3MjAA/zxdFHATor+W2jQwmIBRHChNlQ4LalpIG60IqGOzAqVnpMPESminZT0tHxmy rhywNbY0D2ifiAVdljysKRNG/QwufYBdz81VwRAusLQUBnOZN2uS2CyX16lhbuGrXFZQ VLGo/d1rKVZ36MEtovGZDaxqdIoc+kh4GE7u+PrRqOJjqOusjhh7ScUcwih0WHOkmif+ syYZ9IOVPvrZMUDDZJut9eIoh25r99+jAbo3J6k33TJ0X7zRSiNbbkYfO8GHARIYWc8/ R9Da8EaaB0qUQCw6Pp9gQTAz75MUIZHHRUFzGeXQm10juOa58I34LyFaD5PKE71yKDno y3eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408247; x=1774013047; 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=RUFWI26wJ3+Z57HFFsxefXkK3D/1IEaVOdGJ9g+Mjso=; b=EmfRNBgJstQn2QA5iqiMm4l15GGkf/ctc6R2KB11R74EPyru6J72gnbiVM6M9CLI1v vI+k/5y1Ks9W4xFUlnMcAW7jF6wMnRsd2Lxv98JS1rrpzDF3aN810HbNLXwwf60PUHmz YU3gksQhlBBe3MCuGHTrkP95dWG5aB5cXfvBrOsb4ZXe6xu+9e3EmwuAR33mttiBcv7c qDQXRysJfBwNdOPncyThGh5mcgHucC5LLAURTlhLhVzXomL9aNRSkP3TG4IW48QzsOgO NhtLm1LU/4256PqBbzWj/GNSzDAubjfTKeNnkF7oCg88O0er8AVL8She/2n+I8gi/RpL 8svQ== X-Forwarded-Encrypted: i=1; AJvYcCV6sh/HbDZfpKcQv13j2yR/8i61auvR5uFJEE+k5FVmBpFzk7KXyiFoyvAj1KEwA9+MQp36blcNETGmCSM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx5fxXF/2s15R7oRqb2dzROZhdCnZGFCwTQiWaXhta3yBti0u45 gFPj+D6UdL5UBCVrd2qkIt2skQYl1+xDC3v2FB7CL2fGA+SCog6+wwle X-Gm-Gg: ATEYQzzMjOf3IrAgaQgNMLMqvWTpHoCUebPYTNk8hnheaMxbwXnwmPW+8ssVrlnt3l/ xvqmAs5FpzIwGraqsDXri2FXj3yIPbXFwH6szK4yR5Yr99+OY94FXMYmcK3OQjZqEz9ParsE5Go s7IfKrBAxI4HUuZTlEtRqIHxLnqYmm5qi7USScRVBXQd/R1Yd62uaN44gl5lDazpQ0HcA9IJPrK TrOMBbSRdoIiFMlfu0ridk9D4Q0uKQvFvG4NoiqsGdMS7xVMU1qgPA0KDIx6a1utS6xNFUWLJ4t wiyZUeeUhNuSxpf8QpPTmOlVv4Mgjijw8jQ/KDq+fbMoDJdSvmiW07miBe0+T2JQhXko7HHCHna W9em4sdkflSSY85CQMa9F514nz8S45/1Slcq9YTLphBl/QRkAKjWuOAxe9bpnRwGa3xMQG7Ze8C +0Roo2v+fxotMNtKuP+b9qfPKA0Zgq7wl2zLWW/R9r1Rrenh0mKlpkYpjNwSk= X-Received: by 2002:a05:6808:2385:b0:450:bcc7:18d7 with SMTP id 5614622812f47-4675704dfa8mr1712441b6e.2.1773408246581; Fri, 13 Mar 2026 06:24:06 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:06 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jim Cromie , Andrew Morton , linux-kernel@vger.kernel.org Cc: 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 v11 32/65] dyndbg: Harden classmap and callsite validation Date: Fri, 13 Mar 2026 07:19:57 -0600 Message-ID: <20260313132103.2529746-33-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 or _USE classmaps, which map classnames to a range of class-IDs (0..62) that they are using. This names =3D> IDs mapping allows many modules to use 0..N independently, and even allows (carefully) shared classnames. Previously, class validation only caught some violations in _DEFINEd classmaps; 0..62 range checks, overlaps among _DEFINEd classmaps, but left blind spots in _USEs, for out of bounds manual offsets, overlapping _USEd classmaps, unknown map types, and orphaned callsite IDs. These oversights could lead to ambiguous routing or spammy warnings during control query execution. This commit hardens 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. - Validate that module classmaps use known enum map types. - 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 --- include/linux/dynamic_debug.h | 2 ++ lib/dynamic_debug.c | 52 +++++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 6 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index 0d1245aefc69..28684cfc0937 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -262,6 +262,8 @@ struct _ddebug_class_param { =20 #define __DYNAMIC_DEBUG_CLASSMAP_USE(_var, _offset, _uname) \ extern struct _ddebug_class_map _var; \ + static_assert((_offset) >=3D 0 && (_offset) < _DPRINTK_CLASS_DFLT, \ + "classmap use offset must be in 0..62"); \ static struct _ddebug_class_user __aligned(8) __used \ __section("__dyndbg_class_users") _uname =3D { \ .mod_name =3D KBUILD_MODNAME, \ diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 2083a8546460..635df6edb4cf 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -320,7 +320,7 @@ 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", + pr_warn_ratelimited("unknown class_id %d, check %s's CLASSMAP definition= s\n", dp->class_id, di->mod_name); return false; } @@ -1404,9 +1404,8 @@ static void ddebug_apply_class_users(const struct _dd= ebug_info *di) (__dst)->info._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 *reserved_ids) { u64 range =3D (((1ULL << cm->length) - 1) << cm->base); =20 @@ -1420,6 +1419,23 @@ ddebug_class_range_overlap(struct _ddebug_class_map = *cm, 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("[%d..%d] (from %s) conflicts with %llx\n", 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,6 +1446,7 @@ static int ddebug_add_module(struct _ddebug_info *di) struct _ddebug_class_map *cm; struct _ddebug_class_user *cli; u64 reserved_ids =3D 0; + u64 bad_ids =3D 0; int i; =20 if (!di->descs.len) @@ -1454,10 +1471,33 @@ static int ddebug_add_module(struct _ddebug_info *d= i) dd_mark_vector_subrange(i, cli, &dt->info, users, dt); /* now di is stale */ =20 - /* insure 2+ classmaps share the per-module 0..62 class_id space */ - for_subvec(i, cm, &dt->info, maps) + /* validate class map types and the per-module 0..62 class_id space */ + for_subvec(i, cm, &dt->info, maps) { + if (cm->map_type > DD_CLASS_TYPE_LEVEL_NUM) { + pr_err("module %s has unknown classmap type %d\n", dt->info.mod_name, c= m->map_type); + goto cleanup; + } if (ddebug_class_range_overlap(cm, &reserved_ids)) goto cleanup; + } + + for_subvec(i, cli, &dt->info, users) + if (ddebug_class_user_overlap(cli, &reserved_ids)) + 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); --=20 2.53.0 From nobody Tue Apr 7 11:17:21 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 BB88D3A6B98 for ; Fri, 13 Mar 2026 13:24:09 +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=1773408251; cv=none; b=rVagNhE3PxSvNE/vCNKX6Bs3LbCh4y0PE1l1kC/b7srgJ2YoAfkfiqP9/owMnfMYohgNsqOi2uU8cECpQgb+XZ9zhNTUyttRKrbXttg9sJ+LKcrq+2gnx0vABhuBWhdeM4zCpSe5Ao6fisnkVsEMy5O5FipZe2HQLNXkS0mLTlQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408251; c=relaxed/simple; bh=1+Gk1wrp2G7JsJ3mKRZOtQ8q8HMv75sNbrro9fnWjmQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CK5n/ZFT06rEdbZddHm89OFqrLIi87dCDNRCJuMF9F7nEQzP776FYdnl8nIGyUXZFqdQ06bQQSjtVXdxGbA62B2WEMs2MjJfD5/qPKY1thORI9MZbciDqj4Qs5UgTxzJ0btRQkIXJYwuNdJcziBbEcMVeDjyCLb3xnH0/m6x4VQ= 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=WBEeMtlW; 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="WBEeMtlW" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-4670676ba03so829734b6e.1 for ; Fri, 13 Mar 2026 06:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408248; x=1774013048; 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=ZMVfUVm5fgbPd/qSnAtgDoNjTpRp4guFY8KxOPZIX64=; b=WBEeMtlW6oVP7uLVtM3LYdSMwfXKvnr0Ya4E3FBVOLAZLilc34sF5XAr+TvgN2BWNX K7d9Amo76f8BTD7NzHFFm3yoUO3HSnnymphEHS1LFlejkhVCG4Gf0fCmmLik/qwNHtG3 OwZ4fE1el/TDoolAWsMTYPu7Pp3KAiJRmG596K4TYPbTrb25vPAv14YsCbpYPl7m7ovD z0rVOTsEjtMF2D35/0xjJQJSrQD1NumxMtvkrfQHl4cMeZecv9k/2hy+7B7NXciRqR3p fuxhwV9E5UslXz4ZjBiRnE0YHt9XCgz5bCZ+aV4IQVnZAj/a5wQySXZSV/R48GTy25En cA8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408248; x=1774013048; 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=ZMVfUVm5fgbPd/qSnAtgDoNjTpRp4guFY8KxOPZIX64=; b=WIgump8LGT9GvdwN/EXaf6B9q6r4bHw/QPIA323cqxmQhYszKLrOHCWkHl9g6F0KZi 8HXvKf9UO5qS4atuiwVtHUhsXQM/eR8j7CTXO56DeQ6eGpXrmw8emKkNIawX5rHdSatX s2ZGI0Tlrzuwc5GjhcfVHchP0ylICTNFbXPEgl0TVsbp/sv6CKzv/eIX9U6dngLAEuCX QMc+N4tTYlpfas2w46YXArmbqcKzA8DVEk9F572BshQvoO5jNESrAAJE2wdRqtdphuX1 hb9vkwKvDG4C+xHpWDyWZKMaaNzfQOEleo01x65QYOBZeeEqPlrvJbK2dSUEA5CVDzKg 7aAA== X-Forwarded-Encrypted: i=1; AJvYcCUOz8qedYosfpcJpjXweVkWykJA/2BpvPqpQezOLAdlzFa9RW1sJUHrCUctFfkAgvsGYpu8n2XH/kA5k0I=@vger.kernel.org X-Gm-Message-State: AOJu0YwmZHNDV0pwkf+Uqojn4lcSOmPDVltZPuS0i7qZ195qetXnoemJ nY1ScIl+3oTsw2exw56fHY96n87VWhvrJUXRVGcLyyMdvAl8DchrQsYFpuBFDvfO X-Gm-Gg: ATEYQzzb4QnCEX34aLl0JlN2EyNPOnCRlQgarogQ9BUo9DYou3zYaD/9DsqrgDjVGW3 eNSHxcTVseTdYB+clOYjrQ+A91zqjs4vOYZ0ghdhEiS5Fj+q7YiZubFldeVH4vdy04MgVdyFrZ5 EPn2VxeWCkMVRmxtHVvRiblh7Y7gRlfDspdZwMsUmAjmumIT0ASMzHJu8er6cH171ko7/xcW78u MonXm1SKJhlRqtbivTcHSCczvaB2joy+ESVnPmTNDsnXRwtSErMX/i864djwaKtJ9R7yln8RNi2 /oSVO5mxC0waCZsgS1aMRlNM4PmSZD2drWQqqp+UeDUj9COSzKwLEb3xEOJ15t5ZKJ/9xCnR/cD VH2iNceyDkfcXrw4qH2gnx1C+FUNXzr+7BjlGVVuUn7b0weu32vjmKlBhLLyGg23WYJ20j8qE+6 9wRIv7NRhl18oNSefXj4fUu+En2tXLu71OK/O0N/nDn3VCGMMGqwa0Oa1SIaU= X-Received: by 2002:a05:6808:152b:b0:467:2926:1228 with SMTP id 5614622812f47-467575e9301mr1863785b6e.49.1773408248504; Fri, 13 Mar 2026 06:24:08 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:08 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jonathan Corbet , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 33/65] docs/dyndbg: add classmap info to howto Date: Fri, 13 Mar 2026 07:19:58 -0600 Message-ID: <20260313132103.2529746-34-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- .../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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 5FB8F39658A for ; Fri, 13 Mar 2026 13:24:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408253; cv=none; b=Y7l2Gil7fKlwW0CGIgjzR8D++1fwhHfBOQBi8hQn0+posyatS/yRG2omYXQ5W3/Fl21TyeMLwnINaeqOyO0AbuJtZP2TbUZ8MrM1MUwZuOT3ODkQ+QAJHKNoORtfCg9hrQk+bE52xZsf0nBUvLHo6cAFBdCpMSge+Cj6yWmRs6o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408253; c=relaxed/simple; bh=prk3vpqpnuBHKsO9CwSko+vGXhCHB5kfSODrwDb96/Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=phB6XyVesFflpWGxwqBLL+d3aDYN4ua6rxhTDflJp0gI7RwePTvbeZigpJfOGjwSMG+3okHrgGI2HRSK2tJokVzD2XJE3S24S7tVaN7Gkd8ipZHLDsqTs4H8hFpXVD7UHSkln26P1D8nhyOdSkemTL1HmbBFdvTSXw/ozUkarvo= 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=bTOwf4R+; arc=none smtp.client-ip=209.85.167.170 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="bTOwf4R+" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-46708149af2so1223594b6e.0 for ; Fri, 13 Mar 2026 06:24:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408250; x=1774013050; 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=Q+DKhn/7Y3l3C4FKBxAszRLz9P1Pf05n9UBGOlLEX4s=; b=bTOwf4R+nURCi/A0XlyYEfXOdtPvOr8STJEErRacppAc9MJhw9o9yIqECgaj7hKxeW 16lf72Cyzza63YqlzBASinsPGPiIKroJ3+VwTfgp6QAOJdjhTArCtLFjTbWe+6TA9FH1 0Vgr9R1iKScHvN23vieZcoKptpM6WBcLaH3u0oqtBF3AvhR0ougHtGW+eNzABO9xt81x UzcplKubuVraoNG9ST+8+ujBHQxwoFEypguDrFnSCgVL9JJzIM8Ei38hIyP8ycMIYVMc H4Lql+7fw08mOOLDjWnn+uR+lP5+/p7lryz/NQfrpp2vtekKzUypLGNq1YU9ZuqelLUY 6yrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408250; x=1774013050; 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=Q+DKhn/7Y3l3C4FKBxAszRLz9P1Pf05n9UBGOlLEX4s=; b=nCXwEPht6/3K2nFRlmpRZZe/X7i4VSN2B22XchJX+8ZRtkBH/A2qfooGQyijc92nqd KIPigkvIeJoga4LyiWgJiROLbTkTo72/xZ+WY++R5Fvh2/MY3NMsIgYGaKEyoxWUq5o0 fmBN1xWsdNgRtDxPGnvKiDJmH3Tt1vmPRggi7mLx4bIVZZPsrUlERslspryJmalVOhoX 32lypyq8Vs0ltr8PZ4TL0EzrF0y0oxETR8hCdPpDzN57k3xTPg+bONpuoPjnFZ6n5jBa A3q7NNY5WoTglY8Y1nMnOsaI7yXYnFC9Gs/r42Mlnt2ObGGSptrtHROlzOIvMn3KAGOb h2wg== X-Forwarded-Encrypted: i=1; AJvYcCW8j+aYuZfXLcMEGxb22susZ+H5Kx2+VMx9SxxkvNytsueGLhD3psgNK80Im87KuZ5y/vUSGKzPITPamAo=@vger.kernel.org X-Gm-Message-State: AOJu0YxzuUKKRXwSUMIRTdpeqc3zZPiOS2JnWBunuG+mqZNyXtM1MjDg 52CiVuIydu7wyKxKRAKQZ61efGSgPkBCamA8O/5KO7z/40HC3fzlTSq0 X-Gm-Gg: ATEYQzyznUH6R5Of4zJmW5Ah5aiO62kaBV2sXAjBjnC555a1rCFTH0uHN7uOmVkHlCl vNphRK4Z/iMM7zymwKGph0xPiCC0aAZ6Y4nLKDS1vlDPPhxnfxzQkcOLqNXX2LNJTlylzwK+mOD /R9Q6suWIYPDzR7DNyFJ/O3TVHEV4B1deSTt0KO09PJxv3yCATmhxX0Zsa703PB4nM07iBQX6u0 tsYwZ0adhSChi818WhomC/0YEi12hgcLfw/mtADE8MBue6DwJG4MhCXRbPFf1PhnM4nCuQdDMCU 2o1EKsqJDZfCxiMQsczs2f5PyKJf0vrud01gkgtqYMbyaGY03CYKSxEaNt4VgaQvkegIqsNA/aj QSuXYERKUnGdFOC0HZobKKNVV21hIGSKVImZveGeYxFkNYBtrxdWc+bH4IIMSA7s6P23RWC8N43 qiM5XWeMbukVarMJDTbUwQC3TUtECmAdUAO6h96fV9/FfhfjrF X-Received: by 2002:a05:6808:15a2:b0:467:5571:1b0a with SMTP id 5614622812f47-467570d9e44mr1817008b6e.26.1773408250365; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:09 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jim Cromie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 34/65] drm: use correct ccflags-y spelling Date: Fri, 13 Mar 2026 07:19:59 -0600 Message-ID: <20260313132103.2529746-35-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 aba4bf542a35..02e244688b48 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 Tue Apr 7 11:17:21 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 799153A63E2 for ; Fri, 13 Mar 2026 13:24:13 +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=1773408254; cv=none; b=PpG/XAOy61wGC2+KZAsJkqjQKQVWmlvrIjgJopbnVFijxrAv74oYiSk7U2A7QzIzgbhyKaJJGkD/In8acv7BTULx+6gelZMy8qpX2nxt593DYen8AwEBtHBK0+VXp1ZHU9A2tqW4zHQfIkM+ltVPaRSAMhzcSFdT6p/M43zYDY0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408254; c=relaxed/simple; bh=5YpNEAU9yD4pFs1dEI0OtOw9q7fet7iB15qvtenR1tg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NP3K2GBeRE50+dqrzDb1Dldclo2fQVzNxajIShYzjaYbbcUH3KQRlRIBi2OK2OuIkEXakgkZNplpnwHVnzqS9CqrLq5xzb6wBlyeeHOfATQEphLITIyOzw7sxbEPKn7Wwh+pmGwQ70UccwmX6FeKT5Rkj389d/vS9TGrDCA2Q94= 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=Rog7afNN; 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="Rog7afNN" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-467161c4ba7so1423855b6e.0 for ; Fri, 13 Mar 2026 06:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408252; x=1774013052; 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=ctYWbn5zpBxXKFAUFmjBfsapEiOXJnCJVZtfjZFl2eo=; b=Rog7afNNoFHx64+kMVogz9117D2mlmCQHG1wwJrx/6GAni+oPgZAXeA+btma9xjdgw +GWiBJVAfW5yUk6L7N6L4H/KToaPYCQ7tb8wKsJ0QBguxVKg+h2v7RCTzHexJK4VrsGg Z2U086MTZS5zcGJuF4c0KtGv8miAp7kBgddPa388JwDqfNbKYWykFar/hvqVaHNcRFtD hBqctufRqPZVMei9i58BOZtefVzHdi63KaS+5YO5DNfvrEmSvoYfur2jf7ydfNuHRoe5 j4WvR1Nlu33kWbocgu10gncAPwujUugsPdN8QxlinYrrRpTWNtcviXXFUpQV6fQkPCse vTMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408252; x=1774013052; 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=ctYWbn5zpBxXKFAUFmjBfsapEiOXJnCJVZtfjZFl2eo=; b=SnOVrFRNLqk11CJa7YXeHCH05mqNBXkLOGOjsBU3y2bjmTWII/RbmUHAAWWRO9/LF8 MeL2MLNA2p21DJLZ1duUSLfOJA4Ze0FJFWAwM93eavSIwySzNMzlu1f1tdr796eisjkd yoZN+yfoXgTfcfZekSUaJQmCFpsStbNhBM/7Q3gL/Meqzgx25i1RMjqF4Hf4o97nzuDt MtNTuSFukVvI805fyB2zNoE8fGCaH1YizDtIT0PZ0CLPIfCU/2hvOOuylZHw7NQUI7g/ 3CJhUrbwFxA7NH7OgRPrF/ZHgItthRP8TxQZc0pVmHI9il2+emQqbGXmsgpfGjE8XbOa SRqQ== X-Forwarded-Encrypted: i=1; AJvYcCVqqLGdp9vdWkDaKf21JO3SeoaVu2fIUsB/FVPu6pL0IDnW6MbsWTbyUUaMTChacu1kyeLt6K8Lrm+cZmQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzWO5qlK9q9vtduI4quKQx/ERf8n9c1YBsRqpVmiiqxf6qnllJU 0GJlOXJEmvbS9HiT0f5INZKE12owZuNWQE90afVsejX00emoeIarYAEC X-Gm-Gg: ATEYQzw96rbhTT4MPEiRnJkb2rgJRa5LXdHjGvVhODWxZMv9icMmYKXJlRgLa21fclu jWk0AoT9OxpZaGe+XtiVycHOj1ahCGu04lJP6WEBxE+hW20TLis8YBxbY8sVCGFDTyDJGZ9k7Gf 3QOcg6hHGet2+dQ0EpEvxy9Je2LioioGZYpZ8D1BdJFOrxwB1Fp2JiSe5djMCTcZVtYsYD4Xrn1 55E9jP8a6qDxoHG4y5C/9mE8vIpI7ypNjKYw1Jw74LJzhwW69cjiZJAaDq0mJk4TtaR1flc2UxC ckPmw/RHuYozG6LGpwDiUSxuDVcEuAdW92EP1akuHQG+Zo0QPy67XD90yHnoAA5MWDY4ZQqwrdH 6pl6navud41xB0/2YmLVkHg+NbOGxwEfKV5ye7o4uyq+pfp5iPhxgYJSP6YuLXllQKmDtFGGdOS KRNZR9NRNUMo+EzyTlowID+QhCpdSwOkH1ofC43duuvQsCfP/O X-Received: by 2002:a05:6808:14c8:b0:467:5f1:fcac with SMTP id 5614622812f47-4675552aa1cmr1830167b6e.5.1773408252422; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:11 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 35/65] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Fri, 13 Mar 2026 07:20:00 -0600 Message-ID: <20260313132103.2529746-36-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 ded9461df5f2..d07e7953c9fc 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 Tue Apr 7 11:17:21 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 843D53AA4FB for ; Fri, 13 Mar 2026 13:24:15 +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=1773408256; cv=none; b=gBO4mhLAWgDEvLbgqsjMujIPjGJlJAO3/9qxy51sikS4nPwkpRqq+TNLxcdpSF7FSI5Qnn5ML5bIEXBUZm0dBVzqmfdYJI3znK4ZjMAC4aNpn0rkyDfflqGLIwDlbNVzFaGDhElZEtMx2pKkZ2LgQLtLOOmA7zaKML8OMr0INTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408256; c=relaxed/simple; bh=PWsLMFeqiOwDiP3Au8Hs7cj14MAw3N3MFr4ud7pxpkA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eGcQHmf3PVJuRxRqQpuahJPJiapMzWWnNthtdhtMXKacs/T7T3qwDjbC15ifLIW2v/r9lcbY27Gp0Q1Fbg4yoiwMDJWyXxrrUihhB27IRJ/wLyoiLm2BtlfWSFEyjL7A1V0C2s0Mei+mZ29KGCUzX1uPSsg6lMeAB2lx31xrmw4= 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=VZVp6GyK; 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="VZVp6GyK" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-466f00535cfso1535012b6e.1 for ; Fri, 13 Mar 2026 06:24:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408254; x=1774013054; 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=eYpsGA69YUPtgoC1KVPx5M4LxWSwSB6685GdZ08v/j8=; b=VZVp6GyKLZ9xrx3d/2axYxa8s4uF/4+EelL+YHZIf5cBlfsBMbPgqoPNT3RP1Cn80G hw/x803i/Xz8CHWcwy5Iw/M6XICSCmonprvlUaK1wyga28khS7F0IAbaqls1gtMOUgy6 MjcsFzbDvIgcRg7D1/gNQjf/CiEPKZpdOkuYa/uuGwu+i5IPqlTEjEjibyXcIYkXKn3q lKc/+faKTEalf3CWLrRGtlx8/L2eHZZw83owPieJ2ipX43K/y63V4p9mMqNRdVjpSJJP NL7NUoKforXesHD7ouCuQFNx0BOqEVDD3hzBw8yCQ7AumadNi5E0DlY7+REW6UspcSM8 Y0KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408254; x=1774013054; 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=eYpsGA69YUPtgoC1KVPx5M4LxWSwSB6685GdZ08v/j8=; b=PM0+v2EPeANS43LSscvZpsObc/55yRlxfpCuy/gi+FBnnYgmrHr69k2QxursrppKVl g4Fpgc70Odtcwksl0fW01AGbV0KW9oF13TARsPF4E5tBBqRDBkLNgM0IorNgsmX9rQzP TGs523cGWVcjYqcSXaJRAXVmfhY7hFn2YieIMBiaCS5mN0x3ei7u9FvoFMDmyIIdmlZQ lyp4oy0HFVOCMPeo984cXKxSSDQmszTnxhwSty3dN59Ffigg2W1wE9gEfRuUNl+wzLpn jaewwCyGhV+wMHQ4cc/MiiHFGDBbiQKnCc+9R68RZfEmyhIBnwqlBnan4CqK+bgrCgTf mEsg== X-Forwarded-Encrypted: i=1; AJvYcCXs+ZaWqHimHw6PsEjNTtSG1tYsrcrpbt1ADmrdCo7Ic00yKQ2x8U4ukLH1U2Xq4u9ERGSHly42m8easYU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5HPv6MyzXDdK8lwVqxD7n9hjQYHKADiAGhF+QDMdaLAyisBp+ Cae5sy2++Lvah65CM8YTSvEbQWAr5z6aeXoqEYHxR+6xy18SEwEM5VEQ X-Gm-Gg: ATEYQzyi7WEsc86UD8H1t5W9BpOxtPSIIB92KL5/mTnPx6cNHYejfd3WyVR6XieJZUX qNM+KhBzroD8B63JgoXePvPPXDdhLEmYqcxb8vZZO/uBAImp/Du0BluFincnWlIzyLM2ee7N2TG CQ12wouwZETpm+y/Fshoj8CxbPaUGpHfVxKr9NkNJcfhzjamwSAY4cLgVlSMdyz4ixCOV0sXtxW CYZTBXrl/D1hXVk4SLhiDqONeZcsIAFxJFdjk3cW9vWhtK2/fspN9vWSUIfnR1d3ZiD2eOAPbgS 4bkA3OXIkzHRh51bQCpMtrSKTBV+OfjO3YC5XBBjiP4or4rU/blCtFu5xYfq5Opr40Or/MVQChH X4T9Zjp3J4bZdGG7YT8vyGt9f+zbjCqBAqd83ZYv2S3TRa+Lrx5wjiIK8bjn+Zn1u52AiwonMCQ qXkJxKZEP8lNTDIW0ekoapcsVf54HgMGJZPrYtqnikLn+iE4do X-Received: by 2002:a05:6808:191d:b0:467:32c1:ad08 with SMTP id 5614622812f47-467575feaa3mr1733147b6e.56.1773408254397; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:13 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 36/65] drm-dyndbg: adapt DRM to invoke DYNAMIC_DEBUG_CLASSMAP_PARAM Date: Fri, 13 Mar 2026 07:20:01 -0600 Message-ID: <20260313132103.2529746-37-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 d07e7953c9fc..93dd714d4533 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 Tue Apr 7 11:17:21 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 7F7FB3AB27D for ; Fri, 13 Mar 2026 13:24:17 +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=1773408258; cv=none; b=XvbFCWfKfxRvEmqo7X+1GfTnxLyGXLsn/GEPj6VUo3Vi9WO32kjuhYYow4Y8xKPbtTZZ1F2F7ND+5yVrZlA7vis6gitGRVjAQVNn0PLNJuOEsWve2tQSATvGU0wWBB3uASzLN7qjcys8MEc1D07Eh4qEaj3AuA+xCBHX6w02X8Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408258; c=relaxed/simple; bh=KZkwS/gASrRe40Fg/Uo592wLx6Gm5HyNR7dkCn3OSGY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HrTxj2Jen3XfL63wjQMIpHIaVyzYkpBXmR0rIwTP0rXOkM0JXxRmI+i4wJshoF6Y/PQ9eljZXctkxsjVJa28Jf+sjV1BWL3fAFF9ULKe4/fDAUc8dR94wimBGh0hqXSHZeNyVs26w1njArDRPvE+s01xxmXiSspDJF80MPqLq4U= 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=DbwRYaAw; 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="DbwRYaAw" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-4645dde00a7so2693611b6e.1 for ; Fri, 13 Mar 2026 06:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408256; x=1774013056; 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=DbwRYaAw83FphsXmXPKlHiMwHSKE2OArt20GVngpfDjU8qGw1Atwvv9EQPz+y6qR+n mpUdWYaV6wrzSGZAr6EcZQzsMD4U1Berra3ahd4c8WZVoST7EBICc9ugtttmviWC+kWm c1wLuJ4dWyoXrSq4BulHGlOlJtZDm8DM9Pz3JEbNqr59m6s7IAfsuHCnDzEhLKkJEPx3 pwLKiFP2EtO4YJTuABSmeJRUuXgTgjwVVmHne2Vpp3jmQM57y+Pr8gOMOGAToR4OftfU MOkDCwGU4cVLD1uj8GvIrY3yApD09ce3AFHui2OoamAXh6kC3q9f/ie57gFX7w2aBtNG 18tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408256; x=1774013056; 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=dzIao9dsCQVqMG5S3GOqfyZmvPQokipwFM815dEEFrQ8wnUXpMHQ5mFCbMFp2TFcCQ oN3YleW8ByD7mRxLZqfrawEG9B+6iKLckPZGGR44XtktX4a/u0LTFR8FgZ/sKFHljG9J vkyMwHkwo1ZeuxUJW9p6MH4oYYPYEg7xZj0V7L0HeTzCOacvliIMreFJyF9CcrIiZxCd rLffII7n7KiWqYvoo+qqdn0L345JQkm1NsMxG8MCah4udHBUY//SPuOKc/GQ7okf/7nk Y7QWQexAD6ZyxmedaLMnLPZALUgx8rB7iu4rGpqsNUWG3GCdGYS7Ps3ir2sZoM0l6pT/ aSbQ== X-Forwarded-Encrypted: i=1; AJvYcCURaJmPh0cRjU0U7qfu3BXU8fYNacIp3sVeCiFXECjKkRWd3Xzny2UXHOWZFp4FMKVHWIjZT9B8DtuyZP0=@vger.kernel.org X-Gm-Message-State: AOJu0YxSzOKGgrlhG7OEs8uEtMZQDGchU6zd7w/Ze41F9pReR0nGcwvM 4h9DRc7ShDFbolAWrUc+yS9uH0kS/A7vc9RdyjCDncZvLZspZYdAW6BI X-Gm-Gg: ATEYQzxFOs6AqF9seDb826FO1DIweZuqT+c447S+bbKD44+1vqdZ/UAvr4ou4Ywv6jO LMZ/O/iq34NoCg5h/VR7kaADszvKlQs+qfr7YeJ2b9t+dwtFqnerQ//FNIOD6eGGz5KuVpdpwR0 ccRRjhDzdB43VcSWR/G+WNcjlxJu7fzhskBJ//ppKYIwCwU2HRAgnrBpwxN6RSEf9jWOgDldT32 SoVSxtqLeZyLYfM4LwJ2QhcLQfdGjNfaZHRMjPJDte8y2l0/jygIAVR85hnCPpNl/L4mugT6o/R P5zP39Ibz2XZstZvyh29r2bcGoGPfojOhZVO4XmUOnsIdk8xtSFArl7mzjNk0vngmcncfoVikMv P7yHDARSN7Z9Vl2sw6VfnZ2Lxzo4sZL70KfXgC/GD94VARa3F8BwaLYtHYPkQh3nWeYPUyzx8Ny y0obX0DUYOLOTxOAyuHQ+hnYa2fXAz+aR7/rQvsxG97/MZDaJk X-Received: by 2002:a05:6808:118e:b0:45f:103c:2478 with SMTP id 5614622812f47-4674329caf4mr3963254b6e.30.1773408256475; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:16 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 37/65] drm-print: modernize an archaic comment Date: Fri, 13 Mar 2026 07:20:02 -0600 Message-ID: <20260313132103.2529746-38-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 DC9523AD504 for ; Fri, 13 Mar 2026 13:24:19 +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=1773408261; cv=none; b=IMBpzGIpSHZ53zcV8o1yaNatHk0MBld/G8TY9AaD0XiawitQgh/+wtQ4fxsZZot85+3qOfpvcjvI8X3ewgtgYxbXQ0mDSLjbD0BasorYyQPoVW/XgWWnmQ4nNO1XGLNi1/BYQGSeEeWj0VQOQH/qAC5WHIF3PRza/W6+WRMX01w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408261; c=relaxed/simple; bh=Csd2CM0HaJUn+IIK6OsrgeEsx6KdMluk1seR2yy7mBM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BskgtO/Nd0fQXVAvGeD3Uc8xWvQWJdb++YxxQZPPBZgdgM6x1K1TuIXHgsK556dI8ywGaKgrdbqNqYCm//lc6FUa1QkqEdzVtlHRCu9sqf/F9W+Y7zMiCEY9CZmW8NgLGz7fGNQmE5XYnLsPxsWEeZ7xv446bDN22K4XZMFx16U= 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=mFYPAt54; 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="mFYPAt54" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-463a0e14abfso1412725b6e.2 for ; Fri, 13 Mar 2026 06:24:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408259; x=1774013059; 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=vB+cc01KMDy+1bX+9nVaruepBX97i9TSrBfN/R0HMBE=; b=mFYPAt54PrAySyapPas5XEdcBa0eVLKMtayUd3LJ7+mxEaErkg0/WDih4hKVJIQNtV ubaGsKFnZ15HZrsSUXxTu8rhlkiAEJcj8dNDnP1ET/ufZqs97MNAyl4OYhJ9faXQs9cy 7DbbhIe2bRWAgQPlgHk/pai5RQihhfxjGayhg+iX9WMtIPMg8K3MWs8WCSOOBLt1WZYR mp9yNoNkyphrWdblu0fiz9/AcUfPFwnhzU8t/StADvm0MMxIYBZhPck8jvfAfxTGQTHq El31wbzeczxGU4kxVC/jcE/YIgFldPXUvxaHh8zA4rpmG5Jfo11DWYsM9MnvRYU2GpaS NvXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408259; x=1774013059; 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=vB+cc01KMDy+1bX+9nVaruepBX97i9TSrBfN/R0HMBE=; b=Qj41Q0xIzwIO4YI0+/x/1T+Hnvy0e0TAB6UeOk9z7kh6mp1v7PiEMH3Z6MLDzPEH9G hxbUjKNJiCgec3JjZr5zT/ydzZICRb9X1UVky5LIMF+xi7qQpEAk6PzjZcE/SVFlXA3Y /ThkuHO10te9GRkrv7YnBfarcd0Os+hRsCTywTDWy+/PMZA8GAGZn0T9Y0rgK7+ESZOh 47Rd0poKXTFO73t1xsVv86xnRG091v9W9HLLlD1XG7oCRt1jJ9832BrUm4N/SApfkGmd 5djAO7anCTIEzhNodO6fPhqvnw4flzpk+VgbfnvdF9LXf/dnG4d8LTsMeu8FfpOTS8dv Pxtg== X-Forwarded-Encrypted: i=1; AJvYcCUNhJ9PFsw7AbwLOCqq7pXQrfILut5OoDY8BghioRxIQCI84lcuJk25JNaFUibZ3A6e+ZKs9z7G8aHP3dM=@vger.kernel.org X-Gm-Message-State: AOJu0Yw6bjheTNd5rJGHyqfT+2hoMouTGsqEk84EMYEWi65Mb6qLvDy/ 1Sk6I+Atrl0T1ay4VsfsxC4zMnxf5DLZ6xUVDh3jiN3nmtTO3DOgD3SU X-Gm-Gg: ATEYQzx7PcEbvzYY31LNF5tYZLoiKgMfzu4tERou2JK0ey0i8ILjcUNFFI0ywWq9VT6 3HkXSfEtkdcDvksbOCY5R0/omwjG5v48xXODtymG5NW5zudWAempLCx2exA4bsnnyDh5Fb+xqWw xzQFal0PI7/7XQdjl9ecpZAJ0XyagT+rtwu5sHwum1WK2GdJWTwNNSUWcgWMm+X3V7Z9uj5hcpx oEzsYrNqBl9UHz+ie90qTH90NXen6GCViPeBuXgLidT89KV+MJFZqkuhMRU2q22hmTsZCLqbcZy EWRKBvUGistnzxtVQqQw2CoDibvCwnEAR3UZlJiDFDfzWIkFZdZtnN3v8H+Hqi21KTKN1wMOLiT eYWxcp8a5DKy08NB0so9HYXyF9hCTRIochhGan4YVIndajdHTaNM0/pZTGYu7bvm5cQnRqa8gb4 iMvXTcx4UrVOjRMNpjCNlYyIjoBzfVqqglOe5LJw2XqLB8r5I+ X-Received: by 2002:a05:6808:158e:b0:45e:e07d:85af with SMTP id 5614622812f47-467570a2be8mr1585147b6e.2.1773408258671; Fri, 13 Mar 2026 06:24:18 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:18 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 38/65] drm-print: fix config-dependent unused variable Date: Fri, 13 Mar 2026 07:20:03 -0600 Message-ID: <20260313132103.2529746-39-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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, __drm_printfn_dbg() gets an unused variable warning/error on 'category', even though the usage follows immediately, in drm_debug_enabled(category). For static-key optimized dyndbg, the macro doesn't actually check the category var, since the static-key patches in the proper state. The compiler evidently sees this lack of reference and complains. So this drops the local var and refs the field directly in the macro-call, which avoids the warning/error. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_print.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index 93dd714d4533..ceede094ff13 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -213,9 +213,8 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va= _format *vaf) { const struct drm_device *drm =3D p->arg; const struct device *dev =3D drm ? drm->dev : NULL; - enum drm_debug_category category =3D p->category; =20 - if (!__drm_debug_enabled(category)) + if (!__drm_debug_enabled(p->category)) return; =20 __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); --=20 2.53.0 From nobody Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 CD6AA39A04F for ; Fri, 13 Mar 2026 13:24:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408263; cv=none; b=OTbsRWeHoylcTWb6bXr+cGCY2mNSJ4bwDD9KqAgrBF/rvkLGvqWh20Mm5YEvEk10p3Qh489XdmGjHsBNFBJx2Fk5xX2uXBojQjNjMjZVD1nOKLYRuSLYEjVq53ngrCNQDqs2z76OQbap7gyRqaqfX5w+mP/NvnWymf1A1WWyo+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408263; c=relaxed/simple; bh=zrYSZbyFliQNBLQwKCgZgJElXJxGEf/eOfLdEojCS2I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QJyIKlDq5sN0sC70nZYBtlNC3bF47XztWzkxK87zTUcAeTZJqJZfR6Jviw7iX8+Fs7HPOdAKITluElRm+gnFZbfFfKn8mxd1hbWb6PGDEh38ccYvBdBam8HjYN9hYJmCCf9aGGlaNmRSKPrX03D2eSYzBn1DtcNuejoDW++x6ag= 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=Umy4m2vt; arc=none smtp.client-ip=209.85.167.170 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="Umy4m2vt" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-464bc03efd8so1515502b6e.2 for ; Fri, 13 Mar 2026 06:24:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408261; x=1774013061; 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=Umy4m2vthUNk/S08Sp0kxco3lZrF5vVYeaejmCxpCRlDdm3/iSR9ZoUaKGO/vDU/iN T38JF/zH+q+G4srisI0OB4SR3RMnjg/h9zX0OdjlL3AQIRdW06z5HtoHNsqU/jelWtPV iTXEyxsRqAHjXb391sFGD/vgi+I8U/WWKr39oQfSlXyLhHM0Hya1fS0DOX/arnFIdR+I 8F9EsGe8FxE15khA2CtC4ronYyQ/+fNxGpB8puuqq0G4c3FTdPYT3wtqTV3lzzBYyotY WKxVgBPvGS7V83Fimw1hGs4JECpPngT/EumcrDUaSUdPReppeAEEMdEPVW4SZ/yffF+t jh9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408261; x=1774013061; 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=ftZ7I4Wx4JabnAJdvinwMszb0f4+HoE7ZfmEdSKqbZna4bluBKZR+iSo0YAqIzIr7j eUdt6RgoM3P4X0u6OoOkwF8TyWyuvDUDKJ+5ZLxCVIme/CRajf8dQpC6W1Y7ehvUcfQ0 eKUAXdWQji1+NmNc3YK7R0klU8CjnMhE5qFodDYR201OZHHLZCRSlRgU4Pd5DC3/Q5LF 54IIDI2d7kii7Yr8krknsICqm60CufcOzPz/AO8933D2ReVGgvJ3xXGy5BJKRhJ1gJnG WN33g/iZkPElXOvcGZRfF0TOUMOAw+Tp/wt4b43mDRmiWpApbWUoTvzwu20c7gvL6mwK rnzw== X-Forwarded-Encrypted: i=1; AJvYcCW3E36XbOUyQ3vStyYGEMUxyzMGuFHu8Aw46N3GuLSYEq4j0Lj6rJyA1lnHUre61EIyAd7tf7dSwbRJDY8=@vger.kernel.org X-Gm-Message-State: AOJu0YyAcBjReDyBRM8liH8YsCkPGk4IFlSAEzHlBqKRqCuO0C42Lg+d wwxvHhEvtZfj1J+HEnjBW5WV6bdvT5w6U0FMQtoz2cyuuL4WF5bhtU1y X-Gm-Gg: ATEYQzzU2k8qaO5A/34VbBU8bf8qh0ynEyWzF38Wl2nXD2t2eYh0/0/o+dc7IcCRsla ru997PK2fymnQwruuicrl0pmekleai5UPF33gMEVsc6PSRSDu+G9tBUw1/wRcQ3SSBzU3qtvUGN FziBKMudoZTJQJ+S6AxjWxp/Y/KzL/243XxyYkVFUWTPSSv9F/E0dii6/0XLvIW7JcvI/9puuzE E9kiaW+5Ln6kdC2p3VwFdAnKux/KmNCALLn0ifFY2mgLedmK+149UAI5bHsoHtGfmJOyi3gFGXs u8+X8eKbxQKEZ9Vc5OTkwURdFD4+PoXiBFVM4RpcX2BPNqPpX6ZJKGJWqw+Cgxcr3k2oPnvxbDD PtIW6HgLZDanpDHfhyWg/tyMMsu2CVauDJDkXO8K8vBwp9WwqR4bCGcAcZKKqYXbQtEltjizCZR wfZ0pQTnDQcfoDpXijUx8oKFFLOLtkPdFW3J7YBNdZKFG1R5V0 X-Received: by 2002:a05:6808:470b:b0:467:f85:d832 with SMTP id 5614622812f47-46757594cdbmr1633762b6e.59.1773408260671; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:20 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , Jim Cromie , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, intel-gfx@lists.freedesktop.org Subject: [PATCH v11 39/65] drm-dyndbg: DRM_CLASSMAP_USE in amdgpu driver Date: Fri, 13 Mar 2026 07:20:04 -0600 Message-ID: <20260313132103.2529746-40-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 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 572463AE1AE for ; Fri, 13 Mar 2026 13:24:24 +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=1773408267; cv=none; b=XaN+Tj4fm+LyAkfBRkRoUTUl9ty3arZQBwWI5OIjjBK3y1yqaKMljLf8x1xrBccCukPx9H2sh2JkzNnP1Hx69RRsHKt1r6r2bqcvC4nSwCytJrVovkJq+wXh0tR4+u+l+bRFqH9Zo7+jXbSNz/hS5O5mXeu8O5i0MIko00hKF1c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408267; c=relaxed/simple; bh=kIneIdJmA/K/guUX/16vxiReuFcXvRmSJJYLDlOxvwI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M0PFI4lg6wQOruagNpJkbBKBJeTcEMQglVWL5AWxRF893sdQj9pzaOowbAQD864vCVCQp37X+MdnoVT77ZPJrpy8Eh5xJzHVWSYeN14yKe1bNj9/rD/D75LilPEYzchPCjNRevBAQDm6vjwQJq0WCb9ay84l8YIklhoPrGbEiBA= 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=fIK/JkiW; 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="fIK/JkiW" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-4673790ab85so1445794b6e.3 for ; Fri, 13 Mar 2026 06:24:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408263; x=1774013063; 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=fIK/JkiWmmC+u2piFD+mKWdA9UZNJDoTNPD8hrD7okr2Qr8cbETQyMynF2uQtsXJrx pGDl5lGObSukTDTR1QmyOzVGZ3HNzZ6UlsPDF03Bvj/5YwM3duUYFwmTEp8U/Sbw0J3j BexKx3AU4QpSqjrEq7rx3zW5ne981cIPmAN+M4+xKI/nIrPvL96UWPG/uGP1RnD16PaM RXjMKEkVE9jbuA8sPD6tUvAQ/lSo101dZ7/VPpBDdvujAB6RBSyiLDC3n6lCE04kdd03 VR9KJHe3qBJk5nO4Nr/66TeL5jw2Y2XnatNqSbJHJxSu8HQYKg7p3LXWlFkDoOenW9/s usAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408263; x=1774013063; 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=E4NpRhHNP47QXbbVsTFyhbRpQAWl0+oI2qIvIDiyM2ZJ/ZOKmJbetjcBUjrelymCbA 05c45JtumOjVDWomIqMXiUVhoTjhqjztVsPfHiYii8P6XOTheu78bL6EkhFmYGPvZQSU DiBet3dMYsdBY58q+UVJV4/37KmB8u1BqF0g8xxs5mhNmguiOfw48sb3Ia2s4CdwR6A3 Lc/bwGsQzUK7ZxsksiTp45XQXG3CZATj+SPwsTbp2+djgLabzGVF4wLweMvQOXs8d6YJ nwXIfJFvNL2QH2QUQCAnI069Y4VRtRi5HgRO1uF/TK6KCK+0Vx6+rV5IdUPi9IpiYYZr Iknw== X-Forwarded-Encrypted: i=1; AJvYcCUooaye1L7ccFR8p52ypM4v6S/mJjzxpUCJH8j3MRnTl9LmnGc/Yi+qPJhIchyG3ZFsfnZbSzwDcEskNXM=@vger.kernel.org X-Gm-Message-State: AOJu0YzCLCh4gLw7mWgqvDOz5bVUGyVFJ/u5SZhQlpkqk2ewnoHw2yXK De13TkOYqvITLf7Lo8WDol2oWyeJHq4iScl5YkJawJ2FeMrIRKJKpSJO X-Gm-Gg: ATEYQzztCil/LDw/yKQ0nQz+xEIw2ZdhVR2FRc2ic2QsHAhOQESCs3Ykf8x9GgOf2+i PjUWizk2gDqt5wg5g5L21ZhuLtxfj0RMGgI8U5n7kdkik4XJYFOgD/0csH22Lj2uzOWBHfqBfvG etAFAYFY8CjNXYW9k3wk4ArZZKp/K+OFpZra2eIBcRWjY2i2dsdfZQvtloMR0n/BSxt7Wz7nSgj tcdwEMFrSqjnXOJ5twhjy6jr3Kl5hTSt/EhRNpW3L8/mMQINdkEv/jyiJic00IJKM75JZ7oa/mv 0pjE7/ufyBZzLYNOACoZAdz1vysnY6CkB3AwEK3Ik8vwgPB8p7X4huVgWOSWZKfTtSbU/5FUeVI aPi2IZ5NSPbvS/isXmjidjkdbescUJo0+UaMXk2hFrhyrEA2ZggdraKHqa9MOldJHulC+DqWVUq /uoPMv+1A8ETjr/1S98AZyYECmoad/RIudxaY+KhqYg6T/FdPr X-Received: by 2002:a05:6808:302c:b0:467:4a7:e3f6 with SMTP id 5614622812f47-467570efaf8mr1550885b6e.2.1773408262974; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:22 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Jim Cromie , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: 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, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 40/65] drm-dyndbg: DRM_CLASSMAP_USE in i915 driver Date: Fri, 13 Mar 2026 07:20:05 -0600 Message-ID: <20260313132103.2529746-41-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 6F1FC3AE1A7 for ; Fri, 13 Mar 2026 13:24:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408269; cv=none; b=rA00Fac4ccx3PIWO1H227l+pdrmW7Qiz0xDdhhzJfUz6n4xyzWIi4yrm9YB2AwIxyxpJ4ONqIDJwqT2gDEzRNZ3pXsrVnfZFNOBODMG+ND2JHg57VyHijdUizAo0FwxzSkwxBcH09NTnQy3hsUOiRUoQR5YjxB4w7Ls4keP2nuA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408269; c=relaxed/simple; bh=Wk6QLcJ2xP6K2Pz0o2P28Q3gwORgkQHcBwvF0pNJ3tw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NQmwp5NzZpwWrJyK3CIC3vljclBK4SKCaJ1r1avqefra+i/fK+eENKKK0+91Km81HwQ48xgkUhzf3q7OSBZTsZb4Kk0yGfB3WzMUgc6AN77RxxKRJDyDE53VepHOnsRtigy/9EuU30CBfXpvr68BcFodqpTVU3HezUCfX23a7b0= 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=UXS7snsx; arc=none smtp.client-ip=209.85.167.173 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="UXS7snsx" Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-4671cbce32bso548558b6e.3 for ; Fri, 13 Mar 2026 06:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408265; x=1774013065; 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=UXS7snsxxBHGezN5g0INnPbmRAwhac8Q9zkrmdrSKHNhniS41TthuuZ150FWpwxJ+n HHra0xKLMUH2UHgyXea8HRfsjz77HQsVEfXFb5AyRkj6lcDh4sWpmv8hAht0YD3mb5KK M1wMmh9ZzdROTcrYOSxfA1kf/AuoPFucd90XDiDL9gcrutLT/A372B/IsXXduwZituak 8t3ep8461GTYx3djj0YKznD41VN4AmMNgDqiq4xXVHVuANDmkAgKMNNG9VnVLK0i2ZQe kfPS2c8pWKJD9L84ikh8gAF5KR7xTt/DeNVKlWOsujjCucggczcf1J5IaG6jPfglo0Ma rmgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408265; x=1774013065; 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=ScuzQqNtzIDTY69ZHz/2Y14oihIjCIKcEsUM+lwZOpVD3qM3cAljhrUf98x4EmpwJE XDKN5F7M6/2LuqJDG6my4BVdPCBuP1aEsSpQoxZSWbZJif7dVuf4QDB/XE6BhaVi9ruw TukmbrP1qMHH1VcRTQO2ngZ+L4r6XJHBmk3DMyXyd8cmMVAY+q1cX7zaEmEt6/zKL2dW bxIQhblpevynv+YMpwf+QvQnp7PlR7aaZcuBaH4kZq7Y+VgMsuGS8O6J1DTP1ZTgvbaA sQN9f9Hfzu/g59wRnDnHnJzx4s9veQHfbxbk4rBE52TmrHVq0182Ul2dJGSf4bbEAQUn RcLw== X-Forwarded-Encrypted: i=1; AJvYcCVIhU8OeihJ3hgfAaCKlEEDBZjgyy9a0ZgrJ6odud04F0G7N9vghjogL5ll0aCU8OEblsNZFhJsLXr2Ijs=@vger.kernel.org X-Gm-Message-State: AOJu0YxTGuQ6WvJaibcIaaJlw1UwW5k1957dAAfBGBG2YCNi5kef0feg 6NJBape1R7rCkOMYAAzCvebUmEWvLIvt+EOOu3/2kUSycz2PifZS92Mh X-Gm-Gg: ATEYQzyCOZxbftKnKqSpijTnNUFQ12chT+yDbWRjsD1pBf2hFPOAIBAAUumP6WIpwIU RNwgCpYanrH3b124SCyqk7DMx52l+Uo7B+28IK5cNEWVysGl1SX4P+uNwOOhFu4OPNi0NIJERIb Zvek0peaWNoTezgfe5TgOsL/2hgFRu7Bfp0CjnyFsHRcLPe6ogFVIlF28u5Up+xAbMdEK/xkrma 8NEAn00mwMN2l/u9CNbsXgfOhIfH1Pv5fjO1AHUBc6toRQjXo4wTKS8w9e7vBO7eWGZ0zqYn4wD 8GA5DgxRZ5HNjKMBgAI7VXPiaADlj8pRv439c0gA9VS49tAKzHllIw0GvCG2QFkI9fCfSU0glXs lK2DC/SJ5WfIoLkdzlVRFi73Npzl4fDBjE3TJAKOqJI/sEI+DhuElu5YceAy4SSfuy52DCdviQY zmXoRU4hS3IDDv/N1p5GPKzwk1uh8Pjdqm/c2F4vBJq9gNXXqZ X-Received: by 2002:a05:6808:30a7:b0:467:100d:22ad with SMTP id 5614622812f47-4675708e938mr1535630b6e.18.1773408265054; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:24 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jim Cromie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 41/65] drm-dyndbg: DRM_CLASSMAP_USE in drm_crtc_helper Date: Fri, 13 Mar 2026 07:20:06 -0600 Message-ID: <20260313132103.2529746-42-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 665153AE6EF for ; Fri, 13 Mar 2026 13:24:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408271; cv=none; b=W6F2ljYh474m4Vo/oDb4zjWqzOEmkkXEJiTOAzUBn6IDkYiNrudn/kIgSQVeyqLzk69Vin3AY2xgQeMwdy2PwewmjEXFLwYPodTiuYx1fuaSoxk71ZsE8UMyFXQVMdEtaCnGOeBAuqRq29IHf1J7umt9i4J2C1YJu240AoM4lnQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408271; c=relaxed/simple; bh=K203VObBwbIrCIpDYuU2I5mJB0BwEDffYJvxM0ZzZBE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mlw9vN4V9voLPx8j4cg+NQiCDT65KsbOTgJ3MApbqNlh0B/z/fYH6tGS8MQwqh3dooL478YMh9UkhVlzhFUhmQtO2OC14pMt2AN8n3yZs4qxf1lfkDc5aL6Ivik97fsvKhoRiJ9Ahxddea3sywb5CDC2BsKKxWm6VsWHNsZBp50= 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=XKT8SsSt; arc=none smtp.client-ip=209.85.167.170 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="XKT8SsSt" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-463a0e14abfso1412844b6e.2 for ; Fri, 13 Mar 2026 06:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408267; x=1774013067; 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=XKT8SsStaORFREhOjnHYpR0DYGRioWei8do6KxXBY+bRB12vrOdbkODlaQnnqxRFcU iEXHF2x79/RqxYOcExj1/v08h7+3T7gNbcRlY9/PYMu2qc4GYHyT+3O5e7NTYUyg+UmR 77S2K1wIGgm6B0a1txkoRfo2B9metWSQ1frl4E1cWhJmq3R3TkzxpgqsQomm/emAunFQ vJgJVHy+OEsLYybcnMgwcLUbqf5d9gt0Di/wuhjR7Q/PmHv/SVZupw6CRALYenENJkIo 29dDEs7kOVWR0mp2N+bTtl1gQDBkvEMlQymWE3liaUV4693SCZJbmVsz3toWeQ6kZAsU nKHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408267; x=1774013067; 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=l1fCB+5IMR5NMisPE/6DRUPjdPM4eYXXQ1bjS1V9ag0S06lhgmBUyUTxG++pUQE6Xt FzdF7MArduoQ9FR5V/QgCvIBsnkFT5rplUiK3vJiFNYdl7V0okHQXo+Cta2m90uzRfXA DuorvREhjH4n45oDyTZcxelZ8vWKEU3uwYe9Fjr/x0ZbUFZx7QLV9Ie6TCsY7tfLpl7f T0xJmheqKJiC1wbwEEGa9TdIHXTqkYqB392hpu9pJKDRLrtZVoKt4EsrBw7Ls9xE1CeY 5b76A/hmm7XlP+2ZKnoj0i0aKvwfUUnyFqxVifgAOr1naRz6hJBlEHu1sH9Mh9ux24pU 6Z0g== X-Forwarded-Encrypted: i=1; AJvYcCXM5uMfnBlRo83UxbT+vXbl046FwQpyII4fRj+jHgyBsbryM5L7Qb9hnkFZ76H/gJYUuRYNNV95BVccmFE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9xFCdFpa8jLk4nA/GsjFrOffH9h00EdhaT5GD43Rz516MgT5f HuD3E0zkRjY4xNxnSW+zuVm7S4gHqAO/Z34L1yuZOBVpr165BKnFeywS X-Gm-Gg: ATEYQzxsKKrqHHSTIaB2xFRbw/HgerVwW1YQOfXLPEste2D2Okrb1mO6ruwRHYe9GxN 5gvyqDxMmW6MOo2rcTGmVnIQWgldBLAbb1Yx4EUO+Ve3t0jnXxWYELrb5qaOBXGwrEj6AF+0gtZ YSC250x2p/08G76Wq7+WMBCJ1Mo2Ghjr/PGulDL5uo0DfZ0BAoOVjtZuxkSXzxq8RTPNei4Gety TrrynYxxPWRFhZJHvI/VBOYyL3LlUANQSABBW3jVN998eDOGc4tQLWNn/2oSMQZO9f761DV+06f oOv1VHMY35mdPgTxkA833gbe8bdQ8ehKM/VkH0t8SlxKuZpTE/731YUT4hI5UqGXPmS55zVi1XZ S3I+4KcdYTwA+rwuPwfB2tSTcb4/bsSOeTSu0wPve9oVgvae/ng3/YNQUqJtSJY1grT/viACgEa bETXz9/WBmy4e6DAz/uHilJyj6+U2GgQoRc7wLRAdtmbDzn/Et X-Received: by 2002:a05:6808:2392:b0:467:d75:702e with SMTP id 5614622812f47-467570a0d7fmr1650516b6e.6.1773408267013; Fri, 13 Mar 2026 06:24:27 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:26 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jim Cromie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 42/65] drm-dyndbg: DRM_CLASSMAP_USE in drm_dp_helper Date: Fri, 13 Mar 2026 07:20:07 -0600 Message-ID: <20260313132103.2529746-43-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f171.google.com (mail-oi1-f171.google.com [209.85.167.171]) (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 2DF0F3B0ACD for ; Fri, 13 Mar 2026 13:24:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408272; cv=none; b=nwgm6+9M0kxHf0qA9U/3KjD/BzS1+0vKQluY01ktZieZiBoNF7PvpQT1Ed8l23la45sErdATeq3yj9IxIL+yl2CDQwkJ/5FdMejrgZC/7Bzx3sCcynHAhm5d8loaKpZ0ZPKkTJJDvdBo+It/9rvCWmkwSxUTsO5PfSX5RJHOk40= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408272; c=relaxed/simple; bh=JLT4ei+XGb/w/zg6Sc2KkFlcjjeUdfv+DVXAR3e+9s4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sKEczHHPPHU6cusooIdOHrOEdXNtH9JIgDyR5StUVWtFLTqxE64qqCJshMnsoFn5wMe26qXgrKxzAzuKrXIpqVRkD0msQiMEs6kINbfhS73fhMmmPfSONNHfbywCyM1uSXdbNgMx1loa9RQN3vDr0fz64fJIL85MLxnfi5tRmM4= 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=Jqz9xSc6; arc=none smtp.client-ip=209.85.167.171 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="Jqz9xSc6" Received: by mail-oi1-f171.google.com with SMTP id 5614622812f47-46726528f1cso1546827b6e.0 for ; Fri, 13 Mar 2026 06:24:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408269; x=1774013069; 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=omqdlqhqg9w8rP5QQ/+0ZYQHRwMpTry/COrsHclV4zI=; b=Jqz9xSc6+Zj6J7tRtRZ3IEyCu8PrFDe+9gaZMYMg/axtAWZwcumRmb0sQNxipdajyY MbPvRKi/uhvpyWXo5cgBMcPqr08woGBdGJPf6g/GdcrNzNVfKvDBhgLp1tFUYIyR+iLi RvtWgcT1ofoDnII4CV/7zJ1ahWoEl8Q8BtWV9/Yu8yWekaBI12vH8ZqMCWZox6OqWhnm P/BN8oVnGgK+cighLhCGDe9Ct7y6JsWju6N9R3JIRzCQV3vo1LImTgyv/64cm3cY2rfk ETtFr6VguL/IAX7FLOGhp/qEO9wR42NEPfFRM91whWtLCbwv2r4VlP5Kn9CTGdOiv36A DWhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408269; x=1774013069; 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=omqdlqhqg9w8rP5QQ/+0ZYQHRwMpTry/COrsHclV4zI=; b=N3n3qiAPRqiiY3afM1vypeA5CQmvZ3cFoPmGgi+XP01wslzC2KTSYLMQ1vlEkyhYVu CwqT09y/Q3+n6uXleQPNBj0BsjK11IKQM+QODgefB/2Ji85kw5XU7XEFMrM0uQ9btcNq WofCf8Uoz5mLENYMckTIaD6bh4SsN5XQZPn8oSWu4cj0nZDM+VMyzj1/s5YF+vHRLvby jE7JD0iYTpDoYIahIYxLv/02+NkZ+2i53FbB5JUfpW9PPb2CcwYwNHbjZJmmr3ieDLUT 0v1JRjFFPiRHWDobAlu468Q5Rnk93C/WDxNRN3RgVaS0wkAV+sl7fmG6yVX+j2zXMOgk VcBQ== X-Forwarded-Encrypted: i=1; AJvYcCWf6x9B8A927ZEw8o7Xs2ZIui58aTly5in6jCXGCgD6GOfud+46IMmE9KO9qOi+BmZliw0/Fv3VeNeHcIk=@vger.kernel.org X-Gm-Message-State: AOJu0YzGmsu6Bu237kmV0+n/OV5Hij1VBydb2o/NFCVdo385l6x009kn YN7ZFtVIeeSn+wFhIa620LoWRNvicUbsEmduf9I2FGPKCy1w/8V0LnMk X-Gm-Gg: ATEYQzzXU1uqj7PwwdeuoBa4jY7EIRJjO7b4SCIenf2bWv19NsKZXSDjc9OsiZTZ6+L zmf1CXFa02o2t1PAxcZAdXcKL4W8x1778ffGKdtMDGjvF4KGR6ak4E2mPIbFRlmQtqYddUKaU43 QrmUffMz3eeKo5o/7aadFQEtwB4KgdIJC1wHehY47C10od/Yr83kPjG2XcB50mlofDSh00vtIXV 6L4uutTKwJYKFZdPNbO4+GRukQ1wL/m2gu4EK/oEXCkwgH+Auf57LPYb1Ne1Ym0+RFN9eak+2ZC 7lHblDqnlNcfntIpG6af+3JsV1lbP40UpjE+XOB0rdpSReZFZtquNaqMgcyFbNexSQiUpO+OaOQ sZJ/6Js+rD6p2DEuBYh2klLfLB/FjSQINKDxYz1Mv3UnZGkhl1O+tHwaeerq19MsjR+e6awqQmJ 6+tMEckyAqwqYVYq53irUYRsG775x1xLerG+jpd87y+mLh2wdl X-Received: by 2002:a05:6808:2218:b0:467:cda:f189 with SMTP id 5614622812f47-467572ede3dmr1790509b6e.32.1773408268910; Fri, 13 Mar 2026 06:24:28 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:28 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Lyude Paul , Danilo Krummrich , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Jim Cromie , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 43/65] drm-dyndbg: DRM_CLASSMAP_USE in nouveau Date: Fri, 13 Mar 2026 07:20:08 -0600 Message-ID: <20260313132103.2529746-44-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Lyude Paul --- 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 5d8475e4895e..d205b58aff70 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 Tue Apr 7 11:17:21 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 437DB3AE18C for ; Fri, 13 Mar 2026 13:24:32 +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=1773408275; cv=none; b=pGOqUi1yV/3U6is1qR/JXHs91gPmOK687b6HdwNpKPnuhFcTEKDODHBihf77xeW7RvFBlEJP5xjHYzgVu2/7O2qJAq10RlvxkhplOALUQi32tsOPi0sSfzg0zBiTmZMSY8rdtH/oWQzb9xRNpZWgskS6twXytPnwZqT26oNzNRM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408275; c=relaxed/simple; bh=uCisBkzGldfZMS8BCfNXt14noun+4sHUlmOOszf1SZ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N8Yud+wtdsdvYonu0H/1SNYPyzqNddqzH1FiXi2/0drbgTYCiFt5RBdit7O26ToRBdSlVrULKk/ZeAhb2XN+awSMq45AVww2klfq1AHn3aJmv7S5qhS4rOcbKoqIecSCEOu5CNF0/QRQALTmupHGhpatjU4oTFqpzRRHiloReAk= 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=f7fm3xZJ; 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="f7fm3xZJ" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-466ebbf7ff7so802145b6e.1 for ; Fri, 13 Mar 2026 06:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408271; x=1774013071; 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=f7fm3xZJiUFhqv8no2qftSc9ga9off8UFG4knhvblW+Ym0f/M4FlCbK2FJsUuAonY9 jVHDoafXNbZrTTt93YUGr5BrM9NeXROGJ5HRWx2mRgtsEune7s9FchB/bnEdOVQaeBZM MUmxmlDb55PqQwGP6EqHHD1FKu98LERbQZL7dNyk75qrXzjDlFEUxpnN7/TRg7MZHSeE Qlo7kLVpd+SP/G8rK8+TdL/AuCzla8+vhX4Qy4RAPJUF0r4r7KUEisWQScrU86omutLD odD+fGMuk+bn01WlJAFNNAtK0qpV3Do83z4nIzTgnnsOeHH9GXf5/4DdJuICnBr1IEVr zy8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408271; x=1774013071; 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=UWvwoq5aekdqnMHqlJ7FqqffhWINOZTziRlKWa0+cL0c3vuHzKmmq6mtBnPv5OxS3c CA0wp8FiVefSd/oT0raTRddUV8PO0dZFHqiDX2TiOh3y3jWXdD1A31zhsE4iSZTZHwwi 5dVr1arU80uhs8T115qKNN/hCwJMadpwsd9f0JVlRgynJSKPHDt3gyfrucGzCrbH1k9T g5ciocK+/2OkRwjbrrbVfnPJQU6/X0J1Lzxtvx6d5IILCidu/c8t3ey/3J2736SDJAqx pH0jhf0UsgGf8Y26uLivMY3SZI/FtkFI1GnfYwm8eWR3HPQM/1Z15uIjjP6h/nQBe+qh VXcg== X-Forwarded-Encrypted: i=1; AJvYcCWx0x0RObHcGC1T4WyeldaGtmlra0ibJs++vjH7JDkXEn2xSGD/swOB3NE1huBL4GKzR/dovDp1rkqfdAQ=@vger.kernel.org X-Gm-Message-State: AOJu0YzqlrDZAzUBveOPiLWWX+9NMedz+E7jqKU0694/ZXkGQ/kkcTz0 xsv5VJ+gKGjAMHZlzjb7YraNPxgFoxGw82FnPT1sl/HZIFGY/NE54f7s X-Gm-Gg: ATEYQzzXLbq9ZW0BpxFwCM6JumnKZtLgYMO+bjtCO483/3wolmox5jlpCYUvoxfCUbl +QUU/HIoN3UZPkHBHSVp1+CmjRxV8daMHDBeGWoRtzmyzN6ar7THw8HnupVtAqPusWsv4zlhkiS 2V9XKxEn7W5755d6hSFWEq/SpByY57OWyKI5JSQ8xEWtq5AqeX2xS446SFKJICG54218dWwWzTz 51pWQH1WjEJOh+SWpI0SYYKWuDiz/SFzsf6oO42z42jKSsFrSDlec9BY0f8Xxann4+TWdg3ENh8 GIXW9IRWL9VZYoorlv290OME3veXNw4lvibSXLV2JmryA0SoXa3mHXikuYgxQm7sTe1GLrbeIvG 67kb9s7q+xJZOo/9HZ1wNKa74tIUXEUVW/iJ94x4UZp8y3HLKnr7leLg5x6At5vSWgz0qJZBX2v qd/XEvXnB4FRVoy5BUc4tlPgwM051uAEHdnWZQIw99thOdN+Jv X-Received: by 2002:a05:6808:1203:b0:467:32c1:acf1 with SMTP id 5614622812f47-467572f2d47mr1467910b6e.39.1773408270898; Fri, 13 Mar 2026 06:24:30 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:30 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Matthew Brost , =?UTF-8?q?Thomas=20Hellstr=C3=B6m?= , Rodrigo Vivi , intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 44/65] drm-dyndbg: add DRM_CLASSMAP_USE to Xe driver Date: Fri, 13 Mar 2026 07:20:09 -0600 Message-ID: <20260313132103.2529746-45-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 43B683B19C7 for ; Fri, 13 Mar 2026 13:24:34 +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=1773408277; cv=none; b=qXEiKTg8psr47CeQlmZoPklARNoLjwfLeuepmw6zMetvTHjKYb9jo7FYqsNEt+1e3eGpYTyP2Ce6Ua3Wk1uF/1UD1j1xXhVXLBgKok05MxpDy5C35Beo8u4zD4TL7MnmlQKBQxz5JY25JI0y3R66yWPiXUdLzUF+gjEtEn27AGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408277; c=relaxed/simple; bh=rIbhSa28GWK8AGaDe/Qk6pwqJANdKpFi8pxj1zud7jo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cg8XA5nEdZ1d+oscRLYH1Vno468mIirDQdWY8T1OCgEmgvpVX3v5oCa1kxTT7NMLbdL5Sxt/hggOG1tfKO8trfDulTPzIdTYV0MaqTopiUSvJTgpdaCu2zl0ng6FY5t67QQXGRu7VY0RILZqZgg7w/ReuxqHDz5yTbE3G/tU+A4= 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=heycxwnd; 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="heycxwnd" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-467161c4ba7so1424123b6e.0 for ; Fri, 13 Mar 2026 06:24:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408273; x=1774013073; 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=heycxwnd7qqnnp6mTQNrTc1zHvtRj3TlKoVPr3sGHS3ReVU1k52bpRmBVSuIyILgrM 4fTgHTlCScz22KxwXa0tnnlfhbJAKDTeYXy4VhHshen1LM8QZLoERgKz73ohnmQLPnDC DsCoDNMxg2yRpvk9Citx9xFMpL1jpTuBpTif3kkyUKF7yaZmK03JLp2YZ4xPegaRfR6z lbPSaFb1BDQ8uqOOnYKlSdBoGN0P4nas3ddW3rHCsYiSzYt4843ZdSvHM8k78y1nv9OS w3i3TPS6xbD8Crb/5IORDBy0BFwPC70igv9HjkvwpLXdU8vDYxMWMbdYnV1ZJGWdaSWi bjLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408273; x=1774013073; 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=UhM0y1zZc2l0y0HcCgKQWi7xEIjmSnHEVbuPy344zRYOO/mHn/BQ+fVmNjUS31Lb6r ek3q+4ZC16vp0smUxYloX2oB126EpJhFsnqla4+CF0Vazvw2PilKDtseZRzto3THBNMa m7VpFQVnZ67544+Rdq5HuuheMaQspvF4lCLnWBbTgQyXJBM1Z/XIj8wmi3q4lUoBRn/C m4x6sQturNalyiCPKgs3v5dOZRaGHkVqkBMYoG++M5OXRAbndKUUQzxErjCMqhev2LDN k53gfhZLTqIAi1rlOGJkIj/OJ936jw1FoURLnabazDRAMNhU/nizcec1376uiNIZQC2v DLLw== X-Forwarded-Encrypted: i=1; AJvYcCXu0Ba3Rt8xACdv9VaNYxmx284llylecDjRlW79L9uu7FDYCkTccwUyJUJrNo7a0naUDB8G20ux8ShQfvU=@vger.kernel.org X-Gm-Message-State: AOJu0YyPCV5xT120JWyd9tmRuFNUmtbtjmWnIDVdKSDjMJm5A24zvdN4 Ojnr7KvCneT8GBkItLnkoZXvXzJ91rZ5BU1boTunStDMhz4q0yGZSIqB X-Gm-Gg: ATEYQzwX7NkFQK3q+juOpr2MkYtlveboVoodMT2VIH/Y0zMq6YIBvkA2VRkt9fSI78c XaMvW52HFmtz6ARSyxUZrT4eduHymRteArvXs60X3k/JCB9afBdsN6c0SEetoNOHdmLhaEYdLgs lB59Nd1YzEO+kmGlsTw/v6egupvUeVTOCEmWzOIoQhg+4w8NF9vA5o7xKcH5aIHKyyrXU7yJjCQ 94OmxlxthV6ujkEwNXBGfL8vwZzED3Y6xNDLt1VE4AAx+ZbWpNY5aLcNnEw50FT6bm1pda94z8I p1lsxXr4M+1/PVQclbfD0+JlTZFgJPOyae5vXcq4e0LyH5ik0yYTC6RP/jDNDcC8CWgNumT9a+V EXgKukHUZZF/biyoMGmAuGjqTRsQDwCOnWyOm35Wai9G7hoRxabGFDyflT2/LrtMezu9MhY3kAv C86gfkW2JR0PyQ3nPRfzanPQAC0ZvxaSMwUgRA/Y8I1HqNmEOw X-Received: by 2002:a05:6808:1383:b0:466:f4cc:2b3c with SMTP id 5614622812f47-467555834cdmr2362487b6e.8.1773408272824; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:32 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, David Airlie , Gerd Hoffmann , Dmitry Osipenko , Gurchetan Singh , Chia-I Wu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, virtualization@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 45/65] drm-dyndbg: add DRM_CLASSMAP_USE to virtio_gpu Date: Fri, 13 Mar 2026 07:20:10 -0600 Message-ID: <20260313132103.2529746-46-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 1CEAA3AD51B for ; Fri, 13 Mar 2026 13:24:35 +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=1773408279; cv=none; b=u45plUQ8Xiu0gwlCEu9lcT7eTWOL2nXeJfvC5g5dOjco9FwsmEfjZDtS2gWpv9fiWAWL9WT2LjxyfF67KGq5GAvxca3WdOFIVKLtuPjk1s5TBkPxk7U7r7Gt0E/ys8xdtJJz8TNognTwjZz627e1hSW4kwrKeHlU0bgGZ5iWfCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408279; c=relaxed/simple; bh=T/cL4Vo/Z+Gc5iUZKJ6aeoLySt21gG9U4x9PsUoDqEI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z0qccWYO1E6FxGHP+xqWPs4tDwQ2Kuzl9uRStmpxQ3YdCsn5/G9X8nqY6of80oDWGy0OTRPETu2r5TWP9Fy+z+vguxMAVgpGmJwaDWpg1bu3eZnRx/dpOsK2G0Ekjpf4jwsKXkq3pzn349LqighnxzJ56Gta1t0AXp8bs+RniwQ= 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=CkI0d3pd; 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="CkI0d3pd" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-4671cbce465so1104407b6e.3 for ; Fri, 13 Mar 2026 06:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408275; x=1774013075; 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=CkI0d3pdrkhBHtJull/celDSeIMK+cXckhpmsQwuHklM59xuNqofQ0O0g2fbmLCYK+ hHqTILff41abanFlsJma2flyCbwVKN/b8SzJw6Of6OwwcmSp4hj04gf3AqANOPIFHAQs izz/SQc8vAIkcYHTiv+WwyWxtmjKlHuJKTnsKVed3spuwmnC6OuufKxtfRq9cIWcQHto joemutdslivIEKE7HJxJ+rK7msStZ3zx2Y5QNNzEP5xovV1MzulEIX5KGHzZyFpxrVzQ 93fPVsDX8fZFKvA1YFBdG2SmhC/D6EN2m9rBuqOWQJnKV2Y34eoW3yT0HLJo8qwMClTe WqKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408275; x=1774013075; 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=sAdWxhr1zW+SKkTh7RVC+PcguTol3Dn9yY6hFW8XOwuo00Vgsp9MknnFRYVTlzEDV6 OQ/QJxX9zt/8YhG4UZdpgiMti4rXzMTWnLZWJg2fN0S91yewbJVLBFeFcOYrXmGv0RWA WHRArqNw5nuOR7GZghapfvo27yqtSSoL58ZOszkTpdrk8mHCs52nqqbbZ6llDWSf1blE Inza0J1Kn8dgoLOovJUP+Yu7ubNlN45IXid/oQ2nTlhWDD5czSdOQwrzBpEGtcKozpIB 57bi8ZVA6/kMcDX58K5HPLVAFbqj+ueRMLzCUzyQ8G+fkQKZz9X1K7wwkbj+d28baw8R OPNQ== X-Forwarded-Encrypted: i=1; AJvYcCXhzV8zXQ5nVKVgF3WmumyRzCiAbFT1dE1i0PZSKxLkAd/XvS3cdrhFWD5wlPPjDSdOQBl81dFaNh4QfWY=@vger.kernel.org X-Gm-Message-State: AOJu0Yye5z+lyamXEaoixfhILJKbc/5R01PpyLpJ19zZ2M+avFYuejtK t1riEhgEZTX6tB64IPC3mjNaatDsywOmefic4Ei1kHkYA8qbWqEREJtz X-Gm-Gg: ATEYQzxcqB4txzqXyuNxcEmpx82mT1K4uHuseGCtNLMaJuRej+t256kPHOgajlBDAqf 6xKGxxe4iPDLXWDRHztxgsoAxjMh+U1KK9YhFL2f5yd+pChm7BwSc7KkpZBc5M+MJ9vIxvyTNSl X9yoK/4k2XV83ihiFaBERTQ7nXX7AQSUAkGimU1LaM25TuqCnXi2Hc6LBW6hq6NxoZXfO1doxua HsCagMoqKyNLRkyPvcogXrUxbglblCdlwlJCZoT2fr0Vv6jEw2EzBICH8S+fjY2UE42VtchBM9S Y6zv1PNvWuigaNLUm5XJ/+Xypmp4cv569TDg+6bO8AENSSh7C0Xie9f6WqOdUsU01dYbcYt1sUF 8AJXbLxTg09AQemKJc+WrXzNonI2H4XdUx+PkytLZr5xkrmpmau6LYOQh+DSFr62v8xgHUdS2W2 Lq+qqOkrcjs8wG//BkspEwZziWJudaRsLV3gPeFeayJKsjTJgq X-Received: by 2002:a05:6808:c162:b0:463:ab56:9ed1 with SMTP id 5614622812f47-467570952f1mr1501954b6e.6.1773408274705; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:34 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Thomas Zimmermann , Javier Martinez Canillas , Maarten Lankhorst , Maxime Ripard , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 46/65] drm-dyndbg: add DRM_CLASSMAP_USE to simpledrm Date: Fri, 13 Mar 2026 07:20:11 -0600 Message-ID: <20260313132103.2529746-47-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 99B043B3888 for ; Fri, 13 Mar 2026 13:24:38 +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=1773408282; cv=none; b=raRe54o9nGCd9Q6tajtnlxJftyELdUb3vjJUrzKsRSlKu51S63TiBt5c3wLbTWPPOLhi8nTyG+4VV+HVKxwcwxB01MfMPSSw7hVAKLK3MRyDYw2eOpKoN9GaWSPv3upb/CqXZXXMwqYAGJJwW+eUv7v4yPPDBaSUxARt8Qqfy28= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408282; c=relaxed/simple; bh=UoBL10SvM0bLgaLHkjX8LJvaOP7DJ9ez9zUGRPln8S4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GqHe33tptv/356VRbGJ3rCZTrBb9/aI7XTPLGX0jS5P2I8LxrGHGwdTseYaqyIpv2cz3GB2gUKJQ9yAik2GxvukhoEko41HwsZEvijgwOBVkfIz8M7sojuuIlrboy50noFhs31npCjtRKwJziTazwV9yx880crL9v92xpkCq7n0= 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=NocfJJRr; 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="NocfJJRr" Received: by mail-oi1-f176.google.com with SMTP id 5614622812f47-4671119c1c0so1595948b6e.1 for ; Fri, 13 Mar 2026 06:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408277; x=1774013077; 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=NocfJJRr86vpc6IWaAgwwL/YcqTa/NRs76OzzLNsuPUetK8CNaKi0CMQvg0LZnZi6j FJrXcPRNu0yBAeOBskK9B12dBSsVo92ray/zPZg8MSWSwLNqIe++b4G96wTdC9+xq0aH h2kBY4R04q9aRqKMrQNDuW86sEgYyRjRMiIZTATGku0zfIeM++VnigrZ/zdwSZLYCTnH FG+Z1kfP6b5vinyg5dEUOuKSTJStRHJqdfy09hIWKP9Kf6BBd7p6WqrCEFabYPLxK/kg kiLQJh8WEWbuWVCbk4gvhVxQKRO+ApSgjLcQ4FMQvhQ+LY+s+DF8aoPpBqvAYJiII3jE woIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408277; x=1774013077; 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=fdDR+Uu2u1Q8eaNu6ZfvHcNwNw1eSiCkY6Ray3ZCK+qlvjaXI0J/IszvBuzdqvTr5g 88czwh315vEuC73Bn1Aw7R/YoCiMt3qGAo+YDrJmwyBIz8kcZyRqhcGL3VEG1N43YDcQ WjWBB2+QG3q5v+Rn9itvuXKNEbbxuLSXWZfAOHRp/P6oIKZO4KNqdtfZ7gqbh3Mvd3HA yobwcBpOTL+i8d3LDRuht8hvoxYhdnXE1Lh8cKI58BpCCLH/m8pGhCGJgaYzWFK1gceX 2NYPh7cGCB91lgoeMziCGbgq2gUT7Q1f0S9qBYdOkMpMqduprcyJWhBh3DQKaNpvoGRX fqlA== X-Forwarded-Encrypted: i=1; AJvYcCUkOR0s1nYW4I6MsR+j/TytfPBmy4dc0qo1Te8EXxeYqp1Lkt/tC5cVexcQyJyY1867157KPt+L0Y6Zm4I=@vger.kernel.org X-Gm-Message-State: AOJu0YwcD0xdpuBJn5VDz4CIv9801rSjbOHK4EDupV7qXEpS9PdJaBjC yo8ek4PtpMgXPf6+BdlH+sjMLZSNRC9JGtyLz11H1XzlyAZ4V/Q2f24M X-Gm-Gg: ATEYQzwAs7sXQ+gBw607zF+MxNW9t4cRtYM9xHZ8u6qyEcEqcpNn0AnkKq4J6QSc1vE GCn9iq2tCMdOltPW63suzs+oVhulaOx10EmX+yxiBwmL4bOx2AsFx4xYhtPtvQZFHWZ7nnOW6kY HksBX0B2LQRYyj7ErH+MYt0I7qyuyT/l10q5Lba9dhArfOs+YKvnf7yCTrmY8QBE7YwE0kKpX2m 4hMbzp/RVTV3oBC0Eozukd5lTqE/xxmDEDKoB4pEY2m1tTvQo9iiEN1my5kA4it9eMvBS8xUEfh 1H+8hfgMAsmlkth89qnA60JniVv2MNUNFNK1umKBMp5sz3cwk3y5ytv2jqz8fFGogDAsa48OdKH MiFYtxcO++jIknAMvYRhY2I1SEpoXNZISU+3IR3weTJXW/E79me34ZmgAl8trs2fLGxmnfgW5p9 U/neZSPSyyW0pVc1EppuSDx6i7quISFAQGnibXmq9VjnGein0h X-Received: by 2002:a05:6808:c2ba:b0:467:100d:22ba with SMTP id 5614622812f47-467570a534fmr1774878b6e.18.1773408277147; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:36 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Gerd Hoffmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , virtualization@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 47/65] drm-dyndbg: add DRM_CLASSMAP_USE to bochs Date: Fri, 13 Mar 2026 07:20:12 -0600 Message-ID: <20260313132103.2529746-48-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 8BBA53B3C01 for ; Fri, 13 Mar 2026 13:24:40 +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=1773408283; cv=none; b=nhW1A7508N11k7p4aavH2S6ig311FG8lRaERsXj3jwPtLp8gulOH+1pQAVn2m2leyjPJYgnhJotR4qLnMkjqyuIkoCobzYpk8/fjkEAX9RH9+DKz/ALUM2IRdyLRDvojNrGGrkKqRU/dJA8c32XZAsqgk7p5EX3/ldbMEuNQrrU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408283; c=relaxed/simple; bh=NnZJGdg19edfkOhB4skb7702Ncj5zS//C5JgtJzWrpk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pJJs48JWAqmCgT46uyFJGTDLOUDBCdS56IJy1shS5FMNO1ujcB5h3eU7igyWQIHiJMHx8+VD03MyorhSfnNtSSbq3n7YCVcGdIfp3XEe895uS0LM9NOEJVKyo+4m4G4MKObvaQMExs8svmyxuW/Zhp/+kbJSTGz296KJSYknPUI= 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=PZ0pj7F6; 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="PZ0pj7F6" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-4671cbce465so1104457b6e.3 for ; Fri, 13 Mar 2026 06:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408279; x=1774013079; 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=PZ0pj7F6uJmqTnMSlOG0fLMi3XoUQahykcmg7TyfIDMBXv3yiqrq+Agv9epSpJnjsS zBO5XDwL7yCbIKxn4Nn629zuDtKZ84h0KrWTVW6avQM3uGWzIque+4WEHs0PEVYUlwRd tqDdtYfDHp9Z+atInNwWWV2gfS2HpQazSxJLC7bT02bAyTTmDw3S3+egr+nHqQl1MLXD hLJ8ArRtHQOQ0BrQYgspC9WszMopopkvkEPpfaN8QckKqu1nrNEs3WUwxegZyOKoDu6D 3jcTjWA8JRboOnXSuA5yFv/zYYgIuAjvhZEHD5sXxZZEYyce2ZZHzMosM2uX0teGAQCg h+Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408279; x=1774013079; 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=LUO2FckWLgd3CJcfE5jfmVl45rnxih1sRaGDRjBrgea6KmMAPVqppL4B5skUrgxnLK ZOFrl5nY+bjWBjKgmXtrG/lnnSUGIwXCLFeL/2KQ99f08KaUUWGB6EV5I5GLhT8RUwFj 6fsqH0xn6Kp02zRkMTQqOMzyK3gf61BISfk7CyKGirw87YLALoKMlfIf5MbcPj0YzkpF 1ByEmtm4A/VBBMvZiVxcwf5xOY+HSGHiaB0HcrdMIic4VvUCBsrZvMBQJPHVAA1ewJ0L jJVai3UrznI3zw8xM4SUbj1RoBhV7YekxOj0DazCz6hZFCbzI/9dlN/XaqbkAPPLZXc5 efhQ== X-Forwarded-Encrypted: i=1; AJvYcCXNgbBAnXNimEny3MnpmjwoHl2MfwNk4HW3NaNsmxifEhwQjgbg0XrDRzNZxg4E2y2mm8UpMX3f8O+MQac=@vger.kernel.org X-Gm-Message-State: AOJu0YwJQkCwHqu1T4rT8OlxPUAUmWSVqadEpoxVVaIDFf8P8JvoEr9z +f44e43XmiLp8TD7NjvX8pN74DHdPDBc3ZzpWgp7CPxbJLvOinV0PGju X-Gm-Gg: ATEYQzxWyc6ipBXylAAYru1Zzpm17hE4BghS/hktC37IVn0C3+S9B8vjZFCNeiDVdLS yR9hYBk8/iymo1y4aqv5VET2dTrTMv1NZXAa7I/B4w9A9xTUmJ8aMcqEk6NduITdDSH0Y/hQjoE u+p45qV9wFzVzvKulFsZKRuKMcAVN+TeHgxTBSZG3G2SEgpWRspKLTmUSnIF1x6h4BeXZyiObUt eUCrqFGS5wYNLfgTODXqZFKnz82vUFeO/bDaViXGUrwG4kBxdY/UHyDjbRXho+gHmeV23IpvSvY GSeIhn7QBSBI8YTDrIcPQJbLPEJ/FSpampPUIJinQFZMcAXEbG4LQVM6214aQ3UWMuzWXwKvuCn oaiI25yJwTqZnpOR4N0LCoZ/v+j9CyyGWc2vGsgm8FfHXWG0GGhP49nk8SG88PzvanP4M3bK1Zm +IFnPnfaoTImXlJvt9S7wC3GVItpfDtgvQ5D2wxygw4gQoFhLm X-Received: by 2002:a05:6808:11cb:b0:464:305e:8fcc with SMTP id 5614622812f47-4675713631amr1649395b6e.20.1773408279143; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:38 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Lucas Stach , Russell King , Christian Gmeiner , etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 48/65] drm-dyndbg: add DRM_CLASSMAP_USE to etnaviv Date: Fri, 13 Mar 2026 07:20:13 -0600 Message-ID: <20260313132103.2529746-49-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 541143B2FF1 for ; Fri, 13 Mar 2026 13:24:42 +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=1773408284; cv=none; b=XHhBMngMpkhqzvltUSGZoGfyXdaUzp6N5zJE4arCuWHzDpw+W+XtvoCIJ1R6jad8/CqZChm2EhV0mDCgm67FaTd4fv+urPu7f8PXneB6OgsAqdN3R9Z0CfgG2JnwNRpHm2lTWRS272KBbzQqbCE9HKZqnzG9iMgPOT0+y6zGlHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408284; c=relaxed/simple; bh=qPOGx2VzOCCLF7JIH0b0UPZ4KMwALEvqQb+lMoSsoks=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fNaDmseMFrplVRILABwD3EcVR0i1R8wfIDp8XeKedNPxrtJp8tFyfHFTYKCMF4bOLpw8HMOFJ7XRJX1qJJcMi+8Kpg1y7IMfj0i6ktUtiHl1k5t9pOIXoyAkPyTOnWQrTSMOJXxDUSSFRAMcojKSTGkA1QaVUNGUNGlXC2IlkyA= 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=lxPYpy0W; 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="lxPYpy0W" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-467161c4ba7so1424211b6e.0 for ; Fri, 13 Mar 2026 06:24:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408281; x=1774013081; 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=lxPYpy0WBVGHeStONF7MkHmDpEevWi8e8u9R4LUyX3Qk1m0Phbpigf4X99glWgqdvT KS6QgH1lGha106Vp5hMe7g8f/hylUsNumj/noYH41V5Rtz9IBkIvdVJeOHfeuXrZYEd7 YJQja85SbFhIaUV9h5/KVCGyhBoyKuxlLY+91K83gn34zJeOcS1u8KFeJG7qdEkXItgz ENxfzrnXwOUN53z01Hxv4s8AHdFm7apYZSx9qo83w1fTrsqxMl17LzNd51CHuTlUI+IL Ij2uOqXjUs9nE2saTVpVtXpz8D749y67BvVgXz/pu4Mn7g+tlRFbKFDljxaULZTCVEDE GRpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408281; x=1774013081; 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=RL54e618brML1jTvSt7t/o/XHPvOxlu+ewCSS+UM8KOJEnNkBmCuxI7R2v8dH8ryDw V/4DfRpnqo9oJq5t5S0q0tNldtuZEtvXio1ceQn8KGt6Mm61VlajKYYfA4kvo5BnBI8Z raVa8xvrG6dz2BIaaqEQv6zEzEmF1VlUyTb5rKWGeWKA8sM4eQEaYKYgUKoITgOPR/V3 3R+IQWYNWS0eGIF+G83T15VNvELy0vKM6p31IQGgbsgUjH9otV7QE20AJoz2UzL+ztqK w4FVb4i8bJNwmrOUZN3nO447GD2P4cf+fs6E14s51x5XVJLootyKzblxDzgF+eEIm7Z1 5iHg== X-Forwarded-Encrypted: i=1; AJvYcCXlIvVSMwMNtw2B507cpoFy6quZbFSZki6S9OPAsNoHj9aLScvgwPB0POLmv1HiI23QR+7lMxx3oVOceC4=@vger.kernel.org X-Gm-Message-State: AOJu0YxmVeRSQJQbV0mrtX7xrv8Rwwut/xQJMpGJflj4SKevIEXeu2A5 7whZM6e+3nMqBbzAquOzatIyMurDs86mJ4UXVjGPsVVCxZOBYqnE/K5y X-Gm-Gg: ATEYQzwAEwEPm2lMm+9QNAxqL8e0TTKwBLhE3iYO48FRTvToycnHau4c2yzJe/YdhnP hSaF13eEZbgZDDobfpMmJb2k+tGkc06zhaRxaUyBndiyDvsyi0Rk+6eZebK5IPF/8UFWM95Jz8b 8qNtmngjw7GHBQzyDCwVDkbHkMsNLrby2FKXIg5QgVLfIFYqL5Wz8UqyxiQGCSrbKJ8LgOJKVCC W7cvy/xkSlJBbeuOCJiUOVj2nOI4S7NGAY8sBUU9o4ZWM1E+6/kk9ps8N++mrrqDVw6hfFnNkQn I3De/I5OyHtvm3KaGMg49DbLetR+8LeklL8WHDKDL45/bGi+2kqxW2WfoxCpua2QUX7Ql95Hz0X oFIL/A3QcPp4ctcaDS3V8qVIVZQ5FaKH2zQBXRDEBmWdhhiLR7gbJ11VEjjsBlEDv5ww+Ok7UvV QHHk4nvpvr0v2IYInK689tUvZrxLeSpV7yoUB1E4ZnirdJvvh9 X-Received: by 2002:a05:6808:c40d:b0:45c:80bc:964c with SMTP id 5614622812f47-467557e5b52mr1847301b6e.26.1773408280854; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:40 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Patrik Jakobsson , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 49/65] drm-dyndbg: add DRM_CLASSMAP_USE to gma500 driver Date: Fri, 13 Mar 2026 07:20:14 -0600 Message-ID: <20260313132103.2529746-50-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 BFFE13B3C09 for ; Fri, 13 Mar 2026 13:24:43 +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=1773408285; cv=none; b=SDBfQ0la+dHrjPHatJnVv5jCBTk1p1Yvj8LEj3eX9Lcov68ZrVJLY78TNqjC+7VgESWpbztaD8ZkN0CgtFtxCKOqG9U93uSkh/O2LgcyyKY1Yyf5t0nMAtl6v9b0n6pH+5APlZ8qAi+gMGr3PqwQXAGVOxgy1A+AKuvwQLJ8goM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408285; c=relaxed/simple; bh=D7C/me6Rf8n1ctUCXgc4tboTd3BpbTjff4eXSTp0eHY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uNfZMFV2vUr+Ab3q5WEN0MucmofusJ1FgMrOmnvtmt5oOl+1Ov/SSvntgdQjHGL4UsnXJJLX4efPnnMWD7g4fad3l+tIuRu08mBdoyxZF0QUsMvjTQy630jGJ7wakQiEA/cMIzJuD+c6+BBC0uklMWRLouy6i5kFUTJb15OZnvE= 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=Q1ylufz1; 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="Q1ylufz1" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-4672076355aso1531118b6e.2 for ; Fri, 13 Mar 2026 06:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408282; x=1774013082; 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=Q1ylufz1HyxnUFTbNUNY4mZPgflVNr2UBXyDC5nR2zVW+M11xxeUXNx4vfvObMQ3ec EmVv4DPVe+TwFqbtgD/F8fGeDGkYYr5sg2+g54uZN66zwE3/Tqnc1SEh69TMt6FUba3v cAb3y9RoPk2RZJVtfXSr3ccNg60eNApdBJWSQ8RrXnKpAaTWPkVlt7wLdzWz59T9NwGa 01ML+sa+9AyCuW1tubAOYWhIU13Uq5KbY4qCCeRTEfFv9n46KDncGEWnJMj+nxCSmVKg NX1hejtam9xoml1qnGu5tEDhNy2o3YJ/9cuRpLatqvUS3MMjbrawubyIBrGqAN4FBPbC QR1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408282; x=1774013082; 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=YE4gI/s+fL7pdhwhd4Kgh1YvXEWsA/VKxnWHfNrJj92mpp/Ip7kmNH+5N3pcFdoMQr Ctg1x5Hhicvz9wE+VcOYXcbmHL0B91IFZMk2NxGrYdoHfaW8fS9+K3WsfPq1ST7JJbRD n/oh/3wLUgwG1GcutrxELW804nI0VvRa/y+zZnqqJhrZQDpeFcH0QOwrIvypxzIucodp rnFA1s78taiTrUAAxqU0SFilSQbs7Bj0OGimDxzwjZCWb0B3vbDh9XGVai0koAMGL38Y K7aIX2mAywe3fQuCgnkpby+S917qu6aRXffNClOJfdyy3T5/zHnCeDzhj5VjogOyfTjA ywEQ== X-Forwarded-Encrypted: i=1; AJvYcCXh1pKju56nWgIngMLS0gV9lHWKcLU/Fluljyumm2iB41PigLTdv+829G6mle1Aa6i01XnZQu7DSReHnJA=@vger.kernel.org X-Gm-Message-State: AOJu0YxQTaSK+icdZxn3KU7viFizE2ILTwWq6ZeXIWaE5w9mRZfDMlNv ETwti9cb5Rz4ESkPP1u0tioJeWMCpCVDy/O6rFifsEDDZNbvc7xvX4Iv X-Gm-Gg: ATEYQzzUPlJyULdiB7g1xU5tOswEpRYtGQ7lnWthYbdvD8eW63DrQaJ3uSaEhk14Fpf ALWWRVYdbkaShkePsbgxljLW2tXTTGD6BNjjR0mqR0MXFMBFuf6H+DWENTutr52VIP0kOxyxxqS u7LsYFQAhI4Oukh+aIdnzU4Fy+Q3lXtKnqw89pQexpjga+slCR1soFogEAzoH9ZCPwlG7K+y7b5 hXuNp/ysrUEEaToj6ADqVt+H1+7zjo4ScLd1aNO0QZp0Xdwk3yQp8yJcfIlX5Ywd2UtR//PD9Q6 SXXxHapzZTuVv7W3Zu7ExHr3oPgRQeBf/e3BhzQqAlv7oLcz6Dlq25i+RBNUA0phcfhHiH6l7B7 K/i+2eGiXOKFgr0haaF44iF7zWt6qm3DeDLlvapAccvQjgtCgQZ/bHNZFmkLZhPH3+dUrvfEZnu UnCM5B7irLPt1xT53HYnp6bsQxafYHlbfEZetD6h3j4bh9Y+tE X-Received: by 2002:a05:6808:c2c8:b0:44f:78fb:7b11 with SMTP id 5614622812f47-4675753904dmr1572573b6e.39.1773408282489; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:42 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, intel-gfx@lists.freedesktop.org Subject: [PATCH v11 50/65] drm-dyndbg: add DRM_CLASSMAP_USE to radeon Date: Fri, 13 Mar 2026 07:20:15 -0600 Message-ID: <20260313132103.2529746-51-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 5FE343B582B for ; Fri, 13 Mar 2026 13:24:45 +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=1773408286; cv=none; b=XC1LK6haNkrTjLNnlM5uWEKomUs6PkYXvMvod1hcZEnzHwaMuH+mSlmjTbz5ZT37B79PjTU2mOSK55p0gBqsd87ExGgRvSXo9CK37IPAoom/LNvCKBTBhqRX8RyehWG4UraqY+zc1MyKI/AAaPx3N6ObthuAXdNo6GvZKO8hSW4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408286; c=relaxed/simple; bh=wgGQRuJ0rJEX73O+CRHPJbJq3qG3/Wx7z0y+q3IWlk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fjN9KTq9XJz7ADNdldJhCD0QBlhul6V5ErlRT55+bML3cIs2ywNo5A+PI/kY2G9hH454oe/+1jGiMPeFVVsE+3g1oqKaaJWRFQp6Zc/+DSjka9K7QsTHoRUW3pX0XKi+uQUcRBvI5n8nPm5i+Vf6ST4oI77MqxhWz1DOgw7CLcQ= 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=GSL4ZVKt; 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="GSL4ZVKt" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-464bc03efd8so1515744b6e.2 for ; Fri, 13 Mar 2026 06:24:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408284; x=1774013084; 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=GSL4ZVKtpHrT/S3TZxUlNwE9IInv+j/maPt/haoyc7OhB3aKdgEddBThLfG3MazIyd 1+TMR5GohL3iIJZOTZ+Wn8uZTFRwNuvgNsChS2ebix2L/6uzQSObmBf4EhPIVygB7DxG AblYqmwv5xfcTqTQxuxw08s/EU115n7DHKr3/ELSSYRcJlr73n0pzr/opnqU5/DIITeQ B2Z7DQmkbzfIbHCuVP3YTSz7vIHexUP9s5tRTc9GNbRFcVwgtVjEycSWj6Q31zV9kmpH RonZ3L9E5VEvvstoB+ePz3IetAxO1QoJ1BHWb4PNvXRQ1kQjVmpIgomaslUsYQqTkd0W qydg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408284; x=1774013084; 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=AhIfovI0TV747nksiS1wtcFfjH+NTHwkGq96H2L9gLSgAmesoK+d1v7CCzPgO3Uv06 tQAkDzLCMqQSjDTCKcok6LNXTlvxycKVn0kjWEbwCXP/fKPBu9+pS3tsTYsdlKcQPJme VVmYresM77UsLNdmb949mBWR2hfg4gPF5Zmi0CIzGTCi4kJP4oUaPHAioAOKKUSttfkk SmVWtH3jlfWxyqiwObcBaFvUXhL6A8tmli+1drkiE6pJz4Udy0MH22kfhtsQT8qAio7U dB2HCpPk5GNKh8C7TnLhE5gAu+Rybst8gRsomf6c8Ku1AxQqyz7rWBUBUfoLfVlrC6dK zXiA== X-Forwarded-Encrypted: i=1; AJvYcCUYrIgsfDlo0xeyBivI/ANG+f1044qdCF5ArpXSn8A2I+AVPQrSp86xCu6ZICLr82djN0jt+TlFLIYV43E=@vger.kernel.org X-Gm-Message-State: AOJu0YzCfelNaZbOMBhY43V3qBRxq/Q3pJgPJN6b50/+rN4ibba3AWyO uPS9B+C4JDUmJxseHyPiE537bsT4m84eI8iRUOb828SQCUz+c3idum8v X-Gm-Gg: ATEYQzymXdqHRmorQA5tNeAsOC2a3WfPrQSCg3CK/O47MvHEIh3/owYxHBcxVe+kmqQ ivSx0K4Hi86e99TgpZ8/SW8aIoVRATZAQOB0r3QHGzmdZfLEzmIZsG2FAOBUCEMuvoVnuwc4+at jqRlk91MDdM/x0taZ2AaqDset+2Lr6xaZSG48y3R31AtJd9zhiWk58koAPQe1b6kwFq3Wr4eq1z TEX1A4ujjNIYOZaQZ/dR1TkrzxbMNj0cHweHHlylp4+2/ip0plYb9eYTch8UIJjdYyu9DQAo9dS FmXqjyitH2W0RiGga8VVMbOJek1QrPGHwnDbfjw03MfIXe0L1Ea/Dzprvb3UKKGwmK73w3LkBJF VVdaZfGIn4p+npeFEv88ddTtKbSI102HPb6yNXcux8/EQ4col/Hm1wHGW5BXFy/7Pc7i9zeRPjv TculPGJ3EljNYEYcvGNLxpgFNF7j5/mfGYH34oAJr7n8oQLIc5 X-Received: by 2002:a05:6808:1a21:b0:464:3d5d:d9d4 with SMTP id 5614622812f47-467572d38bcmr1582676b6e.39.1773408284383; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:43 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Zack Rusin , Broadcom internal kernel review list , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 51/65] drm-dyndbg: add DRM_CLASSMAP_USE to vmwgfx driver Date: Fri, 13 Mar 2026 07:20:16 -0600 Message-ID: <20260313132103.2529746-52-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 67EA63B2FF1 for ; Fri, 13 Mar 2026 13:24:47 +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=1773408288; cv=none; b=XGfNRcXezg0v2wtchigJBaITxBCYGy5vTrgMj2sz3bgSrnFETGll6ck37afN79BnBIaox1+7+qKCT1RFTONBMObHMx7bLtR79actOtqo0BVaPROKjB+vw6Fr+Zp5ptaAbvy/To6VLu/p4AtvwWP0t2hLaloy24EdToyDU/M6yvc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408288; c=relaxed/simple; bh=cTuxIyTFSENculejINJnrWAjzb7Tp9GwG+TsiLmuCik=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=atVv9W+4naKI4wmKBOfWnwQcY46hQ+FHFk6ZqsQtTgLT6ooVSA2B5JSXAdKPa1aFH1NfVxLIXi+rzImSaTBiYQCxrHfPbZf0r0bbVKmtpQja47zCEjLOSYH+hM5iywpDwR3H7tPamScb62+gUVNGDuqXWbijNwUHYYvmJTfeZRg= 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=GuceEu00; 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="GuceEu00" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-4670676ba03so829944b6e.1 for ; Fri, 13 Mar 2026 06:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408286; x=1774013086; 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=z5CIU7Xv1sd29xtDEeVm5EwbYfV92LBvg9qr7+GGg2w=; b=GuceEu00uLGmKK8bbTJWaf3feRC2fSExdPxhbTfZtHyp27/QrSxAmgSEdJMbpoihDa 5FHkBsXriM3XcBdEeHbKUHXkGLf/lNh/uhCrupIEbtsVCYlPmMp+LOFU90T22qzV/n1A TwoZQiBmnAQUCv13cVBnimd46drGxkgT/433qUbckYG4fbcBO+56Q9xogW+SWUqfRj5o 2+BWdP9LojZ1cbGT2BQVJPlPnXFsk6h/EsMOKvYGtMUGWpW0s9LFlh28LzCQoUC/NqZ4 3D+OkdzYA7TdQImD6JA3qGp3QHw+m1DZldVXUYE533gOwn69WpeyE9SU0esrPgFv2Zmm zlBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408286; x=1774013086; 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=z5CIU7Xv1sd29xtDEeVm5EwbYfV92LBvg9qr7+GGg2w=; b=RQYCH4bB2rJDx+e6W1J3+9cBP/Rj/QCV51fp4THXo5I5XI+a9dZoNAVe8KhDIUw4Un MZQG51dklCz6cdeNOIzOT7GwWk3CExhYVhwEkeRusmbGkhkFAgtRDV86H0kEo5uSB/cs Z4XOt9RDCUNWglyCNZsNT5+7jlrKfEF5pvfX9QIfMQ8Q9T6iQiLW7OuhpvO0yLyR4B+H d5nbOvnczJGjkXYidOhX6ICv4/bE5YvUEEBnnmOS6bQBJqBNjWRl+ofC4RABPBZzyYUr xpHgpdNoeTlrYTx9MBYTVhul3T9ZMOVZSEJHEEJhZuULGydr/WZWKcXhEVfN0uGMSJUb 79bg== X-Forwarded-Encrypted: i=1; AJvYcCWg9sSaVZzZ5a2+wYHQSbvxoEJ4KYzkBSFToA6rTy/J9Y/rHrRyDJyrQxqXfb0VawDQ9sW0hWryMrL7GZc=@vger.kernel.org X-Gm-Message-State: AOJu0Yx/PPUKc4EYZ0+jnA8QrsX7LmMji8EczCc7jh5ikCDxhiWBecV0 rHSGvsgRMQHtGg/jCKKspEXoxlroPl5x9EvMl8A8SbJx7vTP8JCNdJ3R X-Gm-Gg: ATEYQzyXCTFqH03SagRP1lVeGpuQiACGDCpxkf06cUKS1UciuFsZHGxNRFtLy4ffpCu mm1vAqej+10au2QwtdjeFMrpF/2tKc0hQHFN31UboWl/UaGY3IC/pW7wOVTOXbaaxlwg6NYIQKF JgInv157eZE88Osy2hhJFd1w7fDggw1EL2Blwo8kUzj8lIqoPWvkp353cPSiD2+BBTkUTFM/bKI /G++pm38LAQKXQGmIefTr5cTN/KZEXngMNUHfGSDH8FZyqvdB3q0bLF2RXX815VIsIe/krtkVr1 5ER59fQ1f7Xi0XTBzOeQ0NjolHskHpT7/xoYJjbVokJAtHiBEHTFfkE9SnH86rBYjwBn20QuGFe hYl2kWwp9iZEKOh0sZ5tjQuK8TmxStNNoHiVUX3pLEVxzA2NY+vzDGw7+53OuHbZt00D2fS5lLL 3SIUa9E6tg0vAC9R/MKirQtidWuK79SnnFXpG+ks8zO2ft0j3s X-Received: by 2002:a05:6808:1302:b0:467:e7b:6fc4 with SMTP id 5614622812f47-467575dca9dmr1665945b6e.45.1773408286169; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:45 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Louis Chauvet , Haneen Mohammed , Melissa Wen , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 52/65] drm-dyndbg: add DRM_CLASSMAP_USE to vkms driver Date: Fri, 13 Mar 2026 07:20:17 -0600 Message-ID: <20260313132103.2529746-53-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 95020765c4c2..e22c15f045d1 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 Tue Apr 7 11:17:21 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 16C373B6C0E for ; Fri, 13 Mar 2026 13:24:49 +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=1773408290; cv=none; b=JUD+KQ7b6oxKKgrPRYpjHuoCKxzB4smXNxMOSBn02QmvoKmydnu8+CUtgkNmLn7nwuNU/spGJf3KHfVLagWl/EZZyftSQipq6wlsD/PXk4LUtseJPxaQevUAyXOwI1BZE38MSzK2zVGW3MrXIvamxg7K3a6wWCFFw6LJsMHPHog= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408290; c=relaxed/simple; bh=pPPq4WfPkkchHNA9UKv34DNMSa4sOM9V7qZhlO4byZ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CxzljYgzQ/iXCMA7xLFg8a/yG5bMdsSanSxeEcHsl1QqLWs4lBVEZJL+pzA5HOVKVHQH+hOXb0qzwWTdADLXwVPyN0MfVOdhpb1OCDQDPMeoCY6oKNQiXagcaynMuwxPf50Cy6dzLl4fsnX14G67TIWJqN6Ns8zvetLT2CTicys= 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=WVqYWHYL; 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="WVqYWHYL" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-4671119c1c0so1596041b6e.1 for ; Fri, 13 Mar 2026 06:24:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408288; x=1774013088; 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=WVqYWHYLcg/alHQPKD0iAuXFa2IupxESv34OlJciJ7L8/46b8nKhdG7MrHST2KuBIs nqjIrZ6zOrWaMM+lAyKnN83AkwS/Jps6tji2uAfxrVFTXIlIuOs/DNLlOqatpa7fJzw4 GRem0mb6qAwtB/yQV9YOMEhh9ThRGCsyjV7vhs8WOUgTTcwVnkUU62ePM10iUfNG/PRv g1EUcArTEfnx5Tzbt/W1X58Mp6RF67V3q3Fo3LTIkfTBRsWyEEjgteKDYNlfg3+bu6qs wWL1l082e+J9j85wfwDz7QU+WgGOx15Cx51JNh3FqdT/KSanGfT38V0aKH6uLEcNxDnF ApfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408288; x=1774013088; 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=Y78Mr/WIDs3EbkQ/fCrjfJN3VtfpbyaUOPTTMgxhkGTqDlvJO79ABzzWyCyjIIe96N 7GOHuFtD4bCUiVvDveMipEsRvdshlmTx7XbiOohZkVjIIf6ewo6jXyMU4HwB584mfxWk 7/FOPxw6051tHHb1XFSU2xqDIpELw9xE/VzLDioBDclzgZ5GJeZ00Ph8APIsF11/KOFI 89lmbFfuKSywSAM76zrEC4nLp0Ph1FZuBrq+Kt5X8H41XPCRuWdAtW8/W+ovyfbscUDc LKSfes7Qh6gy5Vtcr5XSU3VVHcFmMjf7ZSmMkTLSxMzlnFDZt662lLlHatdbZeIoXQGn ZxFA== X-Forwarded-Encrypted: i=1; AJvYcCVQFLYvIODh6hA4X2Pa+6dmSsu2Aimyh5pa7oyf+oCWsFrVyRVgCzEu83M7OGg3xQeanRbt+yPoFAMGuE4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+D/BC1DtwbRifFr2Br2BcZkScJdkr9iOrXNTDzTJAUsbEl3ym Pk+BhexcZKv//zUFPLJuhsL0NEo7BuQx5ZVpmFCjgV6eZTkO/sRxeqOq X-Gm-Gg: ATEYQzz339z/GXm89cC/Z2h5h3gmgDE9sgzyPxwEi43g0SfuvDg9h3ze7Jo+X8F/3Q6 iBdnY9YxM1RXWg/4Xu+xECm40GHNbZ8gbI786gWKnLfFymnoVeSXqu6uLZ83yA3Y13ImbwhsunD PW/VqNnvVAcL3Jftp9KEHIfdB1IxvYqlBd/ftZfDJvdmqalLcZrEcqnuuy4LgZtrTmFLp4TmJdN tN2FWGOyskDEeKu346v633Lxd053//q+5ENMiQjIxVabxAl4ptVObznSbiWJknc26xirlde9CxF uzyPBEbB5NgE3ZFDveu4H4cQNsWBHtrheKgEyAPoRK4ULTns32nWOOVP1bgC3b4zdaMrDtYYmNQ vPEdfTtQlAYZuXTS1YkL06lzx/lRWWDeKjzpmuWvDJmNAurqHiggXMK5ySHTjXOcAL4J3Js9M14 TEYO9bzK+UrhfIDWFBFQ18HJJlRl5KNRf70Uc5MNXkhaZNbAgEDDDhJU8x5R4= X-Received: by 2002:a05:6808:6d84:b0:466:f57b:2ae5 with SMTP id 5614622812f47-4675742c896mr1590777b6e.47.1773408287937; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:47 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Dave Airlie , Sean Paul , Thomas Zimmermann , Maarten Lankhorst , Maxime Ripard , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 53/65] drm-dyndbg: add DRM_CLASSMAP_USE to udl driver Date: Fri, 13 Mar 2026 07:20:18 -0600 Message-ID: <20260313132103.2529746-54-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 B294E3B7758 for ; Fri, 13 Mar 2026 13:24:50 +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=1773408291; cv=none; b=UalyDyZ1fo/fERObHw/GZF9c0zy2HAly7AHK82EmH/aztYqmCJFQnGNrBTJJP+Upex3F5uxPjl2RDJG+GpO4IBOIjcEd+meygB3mIp/29/1pAzj2W1vESEUj4YKsEbuHBhA5TaEjLEIEEAmVaeQIkdtKkixJkXtmHWUcX5tDMvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408291; c=relaxed/simple; bh=/i2gnOh+Iv8Il5o82gQTDukemt+gfONU9mRd2AXIyVY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HStz7dN+yfdo5KQAEykTq/DxywSaKPvqfg8aohXXyD2f4MTbc8fY5eZ7n16VJ+QKpZiqnqelJCQAsdwnDjb2f7nRRPuQVjqXLckIl4MGa0xthelorRKWGB8cMghzBAT1gfDlmtWH2mWpkZ8q31Gjt2IPwkUnyiiTsQZODzrs2vo= 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=NyP+W7zo; 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="NyP+W7zo" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-464bc03efd8so1515805b6e.2 for ; Fri, 13 Mar 2026 06:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408290; x=1774013090; 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=NyP+W7zoH2SfqJULI9s011JytfDhBXs4NkCGd4dS6FVrHbGRxlgX/7hHj5f4if/IRt bQcKKup5KKMf96Eo+w7Jf7r6izEf2tQ0VdPNtDOiMTu6JnuD2huZbZy1POW/fIOTEsEj DzLlujSjc3RUu/ivudMz4NkvORilEEIRXUUTrAPQADPWNYlSjD3lhY++ScJR3yCby9p0 7kzHilLY61UgMkkxpBzjnpq0qG1aLHvIeWYqyxoHa2OL5w8+In3CpmSh6xugM8k82F7w I89I9ryyDbHEyB/saH6hEnhryvyheuP6vdK5v/sG8NR31xQCr9JNgTgRMT0eafSk1hhx sNDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408290; x=1774013090; 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=O8mTgjhe8N34/uvU2bRdb0PbldnM+9vnGJYLkYTPMN6Amm/QpmEHfD+orfym7YlMBu WCsUIS1AXqTPO+JBJjLWjy2Jg0qi9KGFiWygdtQu+PGpwAtRBRWdMWE6DAGZdrxkI2JC iTkfkPRm1g5kFA4jn86fcr5B3jTbsl4oruqP7SDTBQUYCEf7yKg9FtgGhqgw91h8XBzh N3doUN5a9oTwjD+wk3+vXTS6kOt6MR652V63MsZ7s5zhXf3dFCdThCo8chiQxMXWhmMf a232NdfnmRkNoE299kI60K3/IOcdQuROn7GpYpuSaxc2k/gyfJ/QqrpTKdq+Q6sjBGAC xlgA== X-Forwarded-Encrypted: i=1; AJvYcCUDulrXAul3hvrqJfdIDlDEY7NrLPus4tlsR9OWr2j7XH47eKptlOcCRq0kdZCSz+teLEqZQxIu07Sj0NQ=@vger.kernel.org X-Gm-Message-State: AOJu0Ywkx/BNwy4f6uG4KrpoqRWOVGcG2rEISpvflfmZRrRes569Utyf G7eneIPOSUtXI19UFu8IN/e3JsD3saThlc2qxfHZofOxF+OQUVCiAuDz X-Gm-Gg: ATEYQzzNGgcbuon77gMYDbr3dAn7xEBR3Q6bh9+hQnZft1KIBWiGPSbQQQjeKMNwOga lQdNvHkGP9XlGSJ3r7ceHbKk0BQ35tpaqEgOKUnAYM8mMJilJvx/ICbEbvIiO6W16JzzMN/442/ Wb7pkZ6JeftR6L9wpvYWh7FxdFtvt27IWcij5Ng3vYR/OGbsREYMYt1L3VR1g3BcNC8P5ZTEmhB ZCKsGwQAFQqCPg5IQKpK4J1XvAiI8vmg62AIScyY8AQ8YzC87884UMe0z2Ek+3NDrpPXmV8a9Rc O/s9Q5xEt9GRZzwKSdjh5gAktb93MpcglpOvfZjgJBGDMjB9lyUtmX1EDaKR0jFDOM+8vvtSjPZ T5kW5lf250Lr+xga8Jsh3nilTCqi1+m4PR3NDAzMzf4XgI9sI3lDtTqX/jeGuxcsoNmQ6Ik/yWK 2CQUS1Kkd6fB4oGqnkJDjks+T085Vcx4rMJDfM3/VnhuZvggyE X-Received: by 2002:a05:6808:2386:b0:450:89ee:922c with SMTP id 5614622812f47-467570dd9e9mr1673636b6e.27.1773408289722; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:49 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Dave Airlie , Thomas Zimmermann , Jocelyn Falempe , Maarten Lankhorst , Maxime Ripard , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 54/65] drm-dyndbg: add DRM_CLASSMAP_USE to mgag200 driver Date: Fri, 13 Mar 2026 07:20:19 -0600 Message-ID: <20260313132103.2529746-55-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f169.google.com (mail-oi1-f169.google.com [209.85.167.169]) (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 350AF3B7749 for ; Fri, 13 Mar 2026 13:24:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408294; cv=none; b=MfPvRJc++9r+hG38ZSDNFN5s8b970+k5D/FcPXs44FePh+Q0I91ThGSwG+kXPIhBQd2/OWciFWUTRRGdGm0j8OXwcmQa+V19IcfwSB5Vo4/LI6GdGjpuQTFQYN5q8RQPbrHy0nAKfNArOrAhLH22l0jAtZyVF2YZ9x2nb3dPC5o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408294; c=relaxed/simple; bh=YQBjYCGJpjhKbiL9YsvXMsjOxSnOKd7cGfI0YQVsz1w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Af2a50XfDi18i5YUc9JoxYs6ey4RZG/EgynebI3nvGYSC4sk/diXVUDvnoLTHi0gvGXePwmFrR7dEeH8K+akqwO0yS6kbU/1NWolicOOQLjyO/WHFzW3Lj2GwGJhqIJr24MzMwQ3RjzJwEx3UXjUDoWeHaIdKIA0btJr1BVOCU4= 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=CviD5HId; arc=none smtp.client-ip=209.85.167.169 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="CviD5HId" Received: by mail-oi1-f169.google.com with SMTP id 5614622812f47-45f053b7b90so1444958b6e.0 for ; Fri, 13 Mar 2026 06:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408292; x=1774013092; 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=hTjuYz8WFf0eQNRg6nVDQpGTB8XKqFnwBf6Q0eE+UZs=; b=CviD5HIdtk2OVJk2SN57l4A8NbjQ8awtasErDXYGFySYi80DF8Zc0K+CfJbDTFxqIR x2S+2uR8+CDOcmRHYc3lFdxDpLtdNKoyP2YkBckUCHEalghnlHcDI6XcwRL1cehXJTCB Rp9bqRMWM23q4LGp4wTZvCXsi5U0+TPuGRI1CdgPeMvqBO9kLh6u4UhzlGSv39+6lC4k NQ+Sn+PBt9wcvgGlPPW76cU1Zv3aDLxX3B+iOUL6tg1fH/YCwM1HVLEpQd900uBuNAWK qHHHLPnjScORMIhD+nEPcTUYjOc8DvcwigVrcMDwMELP9Afvi6SEXfdDD+PXk9pWI35I qjng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408292; x=1774013092; 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=hTjuYz8WFf0eQNRg6nVDQpGTB8XKqFnwBf6Q0eE+UZs=; b=n02hqWVxrzRBzbf8V1lJEm+fWvDZLTjYMW6xtybkv3IV3QZB6a5ixnZdwPk76MUzb7 vuJKZ48TJsl8fKRVNr+NP02xiw8T8P9duV1mSkbKRM1V6gVTWQj56Uj4muBNcowN/b9j G8Jj1ytelvklzwx7g3/F+IVhgsXF8al90Ye044tip3RXmDeZCKCIyL2652lAsCEG1XS1 Midh6D55frmJQOV2XSjQqN1gzuN7zYclPxss3qq4PZIqG1+FqeIpE+0T724jrZsBIKCa iFXQ6O2WUYCaO/Gf4E9gjL0rhpTCcLwEXg17c3x14AiraoJ9QBLK2tCj9ZujeUbHHnUL 2l4Q== X-Forwarded-Encrypted: i=1; AJvYcCVBr59KUY9kf6gkpSRWoQp3BLfYJgst+sVqojphBhTX2JKSlj46PncwF4ci0RjbK9++eQrfhATjQ0pWAxk=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5WFqfaZbzKjjtzr6uJzYtTUcLPhxwe2Kg+/+ulVZxZpYLszL0 U4AnVE94tZ5zZMxmh+ZV66EnUpNXTbScv5aNmTus1JjQlr8hHiJ+RERP X-Gm-Gg: ATEYQzzs+ZmnNdiFdY8EA1CX7wITDGsOqZeroaHxS+5BouBBc15SvbgePpVLUfPt9Dg SAHIc213BaxU2SvefCONmiOGKy4GdoS1zo+FCevcbou92gPNpjUiYOb80o1IYfF6MsCIEe08Qa5 RFuX30xVKJ6CYQTLCww4rfVwGicQl4JBpRMketPCXq6Qq4nWop70F1ao0489xWEVUeQdjR3oQNE /2RXdB7WzfjFdcFx9i3BjO98Yt9wcxAtdu0/1zML4vmxK1faw4IlGCpXyBJ60GLbej3wi+lSzNa cIlTiGUvmG6Mm8n3Td9lSIkjF0P5U0ETrU7aqTBDnYaOB6vFL7+2lZPnuI6SlS/WgNNkLPomu7D 7eGxE3v/mgpRuszD2emyuLxKp5il2UX60jsvT+SwkgCjFNbdXQPVZhKNwt8lMPbne6LdjE9l6va xAqTuxa06TilvFQfiCTfihrw5eccGuj+BCasj9sBbzMpula7qQ3JONz+HHdAg= X-Received: by 2002:a05:6808:3447:b0:466:f6ee:5bce with SMTP id 5614622812f47-4675763031bmr1507247b6e.56.1773408291458; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:51 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Ruben Wauters , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 55/65] drm-dyndbg: add DRM_CLASSMAP_USE to the gud driver Date: Fri, 13 Mar 2026 07:20:20 -0600 Message-ID: <20260313132103.2529746-56-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The gud driver has a number of DRM_UT_* debugs, make them controllable when CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy by telling dyndbg that the module uses them. Signed-off-by: Jim Cromie Acked-by: Ruben Wauters Reviewed-by: Louis Chauvet --- 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 d0122d477610..cf2692d89bc5 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 Tue Apr 7 11:17:21 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 97CA33B7B89 for ; Fri, 13 Mar 2026 13:24:54 +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=1773408295; cv=none; b=j30a7xtixLptlnX+4KgI6w+QKOpTRuhGijqn5nULEGdYutzmLD1VzW6+oDcMUOFRNbrNL2Q8TaKdfbA4aWdZ4e6UtxMCWVLscl2lvS9xWNOk1Ma0x5eNm7BE7hNRbeay2vNvd0rlrZ2i46KJKOI/gMh0WIC+ZeFHOvm3BKCx10s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408295; c=relaxed/simple; bh=E+4uKCclIfWDh+d9Qc5K0SsZwoX0QZA/3pGmHnVYNbQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t0CQayc5IR/F4EzA8FY+zuu5JvMJjwoyrVvOnTjC0AigVxbwX3rnvbw6G9N0UrKXvzZXqL/ESs04bpUhL8VZEaNXpufW2ddHXo+C4rNvikJ1120x+FQ/0m1ahMlXob4f819RSoCY87eGm5Xh773Zw81UuxJgWRZZN1PPfBXSp94= 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=kJjOqTO9; 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="kJjOqTO9" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-4671119c1c0so1596111b6e.1 for ; Fri, 13 Mar 2026 06:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408293; x=1774013093; 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=kJjOqTO9ugFWHJyjS+3xVonRpDZyJ6YGjUhRGb80snoaAli0mf/lsdL1MtUVKO1kiq LD1LMy7cYEcfTHriwIzjUjTV0K7yASMlrUW9P4o+02XG1nxWYyKBDMmPuIpjF1T6a4HL Af4Rhh0JkZ4SfAHWBok32tX5JsYpOE0tlcj2KOJwfS+uLFKGgxRohgWA5dSh7Xx2n4rR I6ZLmTVOzZsODiJo4G8AgeMRB5uoGQqm6tXYF3ECvgv23vxKFAFxxZoeQqR8IlNlp7No tXDPHkZFzRBRZfZA7lLYRCC/0nINSFZB4+C+nczsUFRb0hH0wyicJaWljAHR/ZGbh4tc pi2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408293; x=1774013093; 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=SgVL0Xa44z9triogqxafbehy6Xr+8dWt28bFqhUqMoFUNPh/6SlwZFfxXmy7Q6GVbN syBUgPNgAyUmS0iNLMoMnQ7G3b8IxgutvXOzgIBmyLsueB+CsqqbMgyjTwkl4A57Brz2 9/tI67BvPpLpOyoD47rFRTc5g2Rvlq0PUSqSYTQCfiSWDmtbucoUiAxaSewb0rSV6slV 8um6tmN1vZsHAkAHjnMPRAFwj7/rO6qHg1RaW8bFebnghqM7TPWypua6QE/zNCmgUXPb bbNRE4kCwmeSTI0mI2iR8b02873wZeC99fb5b5OyVVqaOFM+ysJisIsnh+o8x5oQQsJ+ SnAg== X-Forwarded-Encrypted: i=1; AJvYcCX9KTrJkwXgDojJVrlG3FqNPXwRfz6VXC5AVGg33si747GY2t9VHDb/GpXou6mi34ZzkH5FJ5Iu0YlXewE=@vger.kernel.org X-Gm-Message-State: AOJu0YycBo4nRQg0G+HeEW5i0ST6YmhqjRNSMENt6+Jt01VT+q8IW9Ro XRMkwc1polBxXAGNaAoon1LAhM3nm4cay/KWwG+RgI8andYCEYKhcJj1l7V6WBn+ X-Gm-Gg: ATEYQzyjo7MmVCbLQweD/MT5QEf2z4Y8g6dgBmPCMvIpKQYv2jN6E43CDSKDcSNj46o FMVDbDkmnXShXKhRseu6PNkYWIZHY0Cm80DGXcCetBbQh7dS0IulJqIN5193YjVP85fGYJK32pY DQ/YBB1xo7/wz6TpFPNLAjoM9bEdVuYkV+QFiaeWzb2suEqpAbBkdwvVHqv3q59gI0gIsFVZLnk XnCG0ZlQkkQfdOYwb+2wE+qF6YbjArvBGHERTz8FabqRvoiETcBBfKlebeyHysuTJQP40IWsXBR KNTLWTNls4WanS7AL2KLjaGxv8gGHvFRJyWEpNPvzGd7Rwd7S7jx35+FcmRakfnNu03/1FoCtb3 jMq5avsxZAEFtHy0t3B3swManByC4v5gpqakto8az9RuZo80kBRdgp4/e36xC1oDB3iXSe2juPD JrmwOjs5XN7RDq1LFV9ngzW6jYkYKDzFFkgYRal75RWFbnrCcz X-Received: by 2002:a05:6808:1b10:b0:467:254:b90 with SMTP id 5614622812f47-4675704a335mr1612471b6e.10.1773408293451; Fri, 13 Mar 2026 06:24:53 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:53 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Dave Airlie , Gerd Hoffmann , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , virtualization@lists.linux.dev, spice-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 56/65] drm-dyndbg: add DRM_CLASSMAP_USE to the qxl driver Date: Fri, 13 Mar 2026 07:20:21 -0600 Message-ID: <20260313132103.2529746-57-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 4D7C13B7B8A for ; Fri, 13 Mar 2026 13:24:56 +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=1773408297; cv=none; b=B9RBC9gesybxmXOSyRFEGdfRybrzrX9nrI0IK2E5XpeJFChW16D6F3OcUlKBoTZF3EP2Jzp+/4+2t8K6fwYdMWScGv8nAuo8vYPCRj5UfR7FFUHc8rISj/eU44iN1b7M2fp7FZgDo3+gJSAnxdY6xdxMcCb93iviLDKG5lI8/bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408297; c=relaxed/simple; bh=nGrRzjApBUvnLaXEOUv91L0DxnWjMKCCXChGMLujdwU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZvIg6El5wazVXES0S/qGfwfdjSRukNDqCewjUpIojLxdFygyDZCQMvE9tItm/I/L/foudkGLpmhXAsEcdoJ+QVPE00f9/QP2g8LMJlwW3qPCibUOIbDcKm5n38kP6bgTggrroQgd0+A6y6KEBBHgNF4gIyLOYm0EAqDkK2NbD1s= 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=V9rIIDyj; 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="V9rIIDyj" Received: by mail-oi1-f182.google.com with SMTP id 5614622812f47-467161c4a1cso842042b6e.3 for ; Fri, 13 Mar 2026 06:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408295; x=1774013095; 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=+Zu2rs9LQXViGSxr3LJ2mebc7/BIvYzUYAAic1plGvM=; b=V9rIIDyjhMs6W3ZYKfAMVn6EVZmSmly+GhK/Rbaw7RICPpjooM6RnJQawuFvsCqWpO FSBP8dqtMI65wBGELFd78ck6D0uQfkQvChma9YO+r/CEFD7/Eh76VbVSHJsq8vO5eMGn iUqpXoGvBJPH9iXnWA2NlGgjq1w2RYLiNznxTYyvlle1EzE7kYWW2EULBJVvj/eRf/1X NX9OFwSK3NNUFg9GXSum+o+uhDPp7pW8e4Wtgo+bxDjW2Dfg11yAq/3yuMGV5OGG04RT qTm5UaKx0ow2gHakwZfSw5eIl03fzP3o9P7/RQvVzsAxtn4IEPJxp/iUw0irrMoSyOxx 8lGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408295; x=1774013095; 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=+Zu2rs9LQXViGSxr3LJ2mebc7/BIvYzUYAAic1plGvM=; b=D99i93/bNFftjqcmJ3bBNnBEVwQFtNlGZCyfehrbDwWQx/7CUobvUbKt+hi1L+kHmw an3rMsTO6TmGmEq/noivwv9Xq31E+0rjcl5aJtuvOkg/pmuEmwjGZY7Rz8RH4YkaDGQR l08gKvJzD9ggFQx0l7KvSjoffg7GvZMlJpajaf5ZH9p9aesZl+BjxtkPQJTEqw83cm29 s70m7rPJy9ghC2uecJse1vcnrxuiroaoOIzs3wJEYF2Xr4QoPS505FGfVRNUvL3gdALU HQtzNcDkTcJpy8atV6KSUysycn0avHiPKG8pbvqars+0M0e4tLIM7q/FN10bU2GeDXAH OciQ== X-Forwarded-Encrypted: i=1; AJvYcCV5lctXxvcv7Z4XlqpzzmodmViHJ55oRqqYvo9wAHd0yQQKD8LUm+qxzVAAv0u5FYEpSpOn/gVzDpS6YgI=@vger.kernel.org X-Gm-Message-State: AOJu0YwmdV19Zbk8Zptm7kJoCXpQQJj7ggwvJYz+8dPoMannGTmhpgZS ZmJkGYk0q5a+IvY/zBnocKkAtAJIv2LTaUyMtHuaJWIib7IOh/6JxSfn X-Gm-Gg: ATEYQzze9Gdrs8Ds3+0WnBHQO2vY0viKhku/muGhTFjN0+dvllH30pByfZSt8JOn/cL RIfY6p1uGWWiQcZ46ae9R3MVjJFYPkIprAFYfdnoZfpCkBIkhj/TlFV9ZBm6WHQNxSj5p1aOmyj epmKLypQiSq2V5J5mHv7kzbSe3Kr2C2ixdssd+WXB1uPYewHSoPGIBR/2s/pE++d6KkyV5jsyAR UGejaWZsn+1tb9zVHguHnkeNYzgh94bPo+j0ly6S6GmTmFm8ywHhCqhy8dD56WWtpgCfmmXLYlJ 0m6oZek9unG6kJ6CjjainrD0uo1p8O5C4919p7V1NIF2+7NNtcysYt0BPoJb+0FWbXFu9gEgFqB Q74M3i+8l42J630erXcNu8WXPBxD77Jcpxmqia9R1JzxJju8FV1R5SknbtQnWk0C9n6frVHg3Hm FnJLuPPPyCD+MLv/i2hKupJNfggImeX3DKUmuM5I6stYNaaq3m X-Received: by 2002:a05:6808:2385:b0:467:1cf5:7684 with SMTP id 5614622812f47-467570a44f8mr1658295b6e.6.1773408295128; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:54 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 57/65] drm-dyndbg: add DRM_CLASSMAP_USE to the drm_gem_shmem_helper driver Date: Fri, 13 Mar 2026 07:20:22 -0600 Message-ID: <20260313132103.2529746-58-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 4500deef4127..a0bb6110ad83 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 Tue Apr 7 11:17:21 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 876A33B7B89 for ; Fri, 13 Mar 2026 13:24: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=1773408299; cv=none; b=hW+qKwDaTRRmJpwomkyWs6hoFun81ABESPEZpPx5jX60rZgmuDGX7SkgHp+pC7JCzqN7hXGCqORjvP4flsL7q5nCpIbHQdSzovUQzg3pqr2Ip32fg5+X6kqL9082eCP4gT56hnIQYZR0W/eN6yZcQsTQ4XAfm6SZqoUmudbIUXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408299; c=relaxed/simple; bh=LKk0j98dVImoZelrD6ApXAOrVZl5oRTtqgBbaIjJUQ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ea3D1TxRs7e8RqDWKmd8iaD1BQIf/iDFx/oYb+D28mUHmBgM8y4hnajlDkJfWoJtnRlxigU5lozdvigzJ9BSWlGK4/aL3nG3NcmL1nF/d/oV0EVketAqcJyujv5KGDcBYPKcRTAiOeTUW0RYFXt+rUWqUQtGso2oxRaWq7OHMIo= 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=ZgJ0hgLx; 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="ZgJ0hgLx" Received: by mail-oi1-f180.google.com with SMTP id 5614622812f47-466ebbf7ff7so802322b6e.1 for ; Fri, 13 Mar 2026 06:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408297; x=1774013097; 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=ZgJ0hgLxR0BLNEloJPM8tbJX1vHC0RpKHBFdUwqt0d8rVrr0zYVyOrARUfCp76eEDU rfoBJXNg2D3/UZMRBsgGR9jxjYR7wqGeOX4Pnr0tb/cJ+b29ujM7zu5zQovysnUDNo/9 TkRxekPtUhahMQ9S6qWDeEXiirhVvSKm4LnVQRwXH1RrkURjoIx3taQ+yYEhTxDneGv9 TO16zgAAgHU6opr/BiM4+ab5NkFv4ULHj60A7gbTocqlW1FuGIoSII4W3j6tnBnSSUNP EsoKlh9X7SOa2RS1fDtGQYXwPasbxHgJx3bmF2lq0prmomcrNy2V6zUogxcDpF/bpMPG BWSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408297; x=1774013097; 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=nEgECmHM3QJJ6FOweBd1NcssE6iOODtM9nvIeAOv5xdctGM9vckNL0JVzHkLBgiywa pKa0wb+hBxrcFIypjbenCnyQnEm0+OH7gl36HBFEHHWX84GrEHuTkiW7KuoA/oY13Cva GlT9FEVgE7NDVFbgwd5qJp6b6WWa43CbueRomdZ8So5HyJpDW00Dg6s1nT/wJUUHlLEI +mfEO87B8/saXWaK3j65JvjqwLmiZCqAAcw+jwu3QWVGPUQwhVUrpD2OW9TjuOf/47fT JZPhNmFau7ejop+Y5i+DCQYu384GV5tEBOdp+IIOzGUagHKXqHR9c4xFHnHDbRKvBEX9 VhVg== X-Forwarded-Encrypted: i=1; AJvYcCXfYOQ+UiEvmlshQYy9bXTrOabZrEeTphE1pWN7NU77t2KhQWRp0WlrslwwD+0KCA/6Va+zB58o/K1aoZI=@vger.kernel.org X-Gm-Message-State: AOJu0YyJPou66FI7fUyNdO7i9oULoW1cB9M7VHzE+MKGG8Yuhmwftq/8 QmklaLXA0jwATWlBaFSJVvZwQWfiYcnmxpmiuUXiYcyCTjpJtUnyfSrb X-Gm-Gg: ATEYQzxspOg1Z+D8TTQEHBZqrqOLzezWViHtwTBH6RShluGfR046ecGFrqNYyV1aIwg HxYcF8ddSuAHjpMkCICnu7NHshPsv/n9tVQVAuQ1PRpGEZNnBZTbDRhT+4fGNrobloQgeokeqjL hX88X8KKc5eT3lzeMzc0OgBmvKzsLHx5URs2mjAXhWz/qRPwQmqZ3IGFpnsiClYs1xIv6r7JIVf l3GJkcBQY3kzQL9w5StoUrXryNdqZgdd/SyUZAdm/mjgmtAdGNzcDzi5bKUS45TbTx8FNPJOnEc 5RdeMNlg0wUe/6s3/W68iHY+k0xRoOSUC4gNxT4PxP1Y31hq8TzAZJVBD/dFxS+8QzlekU2Tmr/ pV9rQmCvhXSr4teHMwvxeE+0s7QXZrv2+dmZHfgPsswW1iUbmF3niiidrUnZFjSEONlEo6QKk22 woTANeB8+kCo0NBy1lsopK4lZai7xSpEZyZDZcxrI8sPbrvHYv X-Received: by 2002:a05:6808:670b:b0:450:275b:d942 with SMTP id 5614622812f47-467570374e6mr1313194b6e.10.1773408297398; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:56 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Oded Gabbay , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 58/65] accel: add -DDYNAMIC_DEBUG_MODULE to subdir-ccflags Date: Fri, 13 Mar 2026 07:20:23 -0600 Message-ID: <20260313132103.2529746-59-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 8F6E53976B9 for ; Fri, 13 Mar 2026 13:25:00 +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=1773408301; cv=none; b=JMrz+RvZZzCou340ING+r2BBDGHAK4OvgzwZGSXYueBxJaPdiOtdknYdW2YpTO9QbRMgiu+CCCDIdv6vriJn9m3MkQTb6T6z/KYV/igHWqbk5vCxSB76Mg+LKUOqBfhkXXt1dYkus3ty+xT1bLG6tQql0slfQOQ8jScw84mB4Jc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408301; c=relaxed/simple; bh=D3MyIM2GARPUMC5RqTkF+Htd9Goo9edJVybCeNRnYkc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nLxyWfS/blV+dUvzaVGpTbWzQJgOmFXrOzcEKmU0YVE5sEXBaf7qTj9XLa6YsCLkmQ1Svi9ryLF97xohfda98R6Qo3EIMFozMKOL2Z93YvHxe8kCokqMwsJpIPCG0diqjVrLT/p2kpY0irpPDTv4JKR3L73o/KFTYsPzHa41nEM= 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=lSy+24Ou; 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="lSy+24Ou" Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-463a0e14abfso1413214b6e.2 for ; Fri, 13 Mar 2026 06:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408299; x=1774013099; 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=MSI+J0679V/DmlJlREZ5wQ9k+pFMYu6PsZxwHc99Yws=; b=lSy+24OurMmDkfMCCdZEE/8GMQ6tgQr7kmMzRp4DU5OSnopOBGkbdlB/GIvXqwT5kX EPQgNfpCZXMUbOoNNiy6EV0Ff5FaquYcl+eXwM0KjMy50pbrHm64z+k1mg2aykb09pxC ElMNVwHH/6v/NnH+ypUkCLkgTWw7YNbZLXYAJgP9lUvjhm+kI8iqI9/334mLOSwa1IoQ EJ+IBUSbvCiB7j5dYKfJmrMWTG80i4NvIU2ZMFZLfdMr6fr6KJgmnzKhqOJfd8Tz4Dbd +IackGT5P9Oa3CQ/zp6wdEoUMtBoosVT1L+QfU6sZEHoE47swEz1POHkwXNV7HyhDPB6 5zRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408299; x=1774013099; 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=MSI+J0679V/DmlJlREZ5wQ9k+pFMYu6PsZxwHc99Yws=; b=kcedsHFcbFS9A6O/cnrZiFCIzqhgHDSFH34np+y48J8fpYV98abjt2ZYNHbq4b5P8Y oaYhpw+7eYP8JHHAqDzmFBoQEtrYrp++uBrIc28qp4NUNgmFGK/mJOgNRQKjQRwobrdx c1oChZEmRxOwjWMppFaH48LO+n3gHZe9xOXC8LbZkQgNNTifZB+3LPMAeGhZLItZ1iHs nXX3PU/n7u0uqAn6wQ7fYWehS2Lp4nHYH/QV/RyAVprBS57c9l7EiP+a14+ZEK20jBC+ ZTzo1WOBJNpQCeHISkNrFHdMh3WyALN6CJctTZRPzHofim9J+DFUIGPwoYvO+pKnxCuq iJww== X-Forwarded-Encrypted: i=1; AJvYcCWHswVU+S4HQRM6VCDFDILPUHmzuOhesp8tOsVjuJfcp1fUMHkEYzN/w9bs1Gp+/9A9VDabPTIJvMu2pEA=@vger.kernel.org X-Gm-Message-State: AOJu0YzX8BTvlnoD9n/9EwjNBPoFJGre2jxZxGLPzLyVu33C7Ta/cSc2 HZo3bwRcOJHcmXVTm+BcCRsCDtn1lPDnjQZozHJezeMQm7zNH1VbbaVV X-Gm-Gg: ATEYQzzQGXyoYVYDKHLzu03Eerhdxu2zzFxC3ZaD6gOU7R666Rd9nNHKXLfZkRBfSJk HbITCQSrbwKj0A4axYnvHfLp6HmR83an6wnSOwAQeZA4nqHz/gT4eTa2UOHtMCtS2425uiLUdwo SZk0LikQ2sjui0D91P/VvVYK33346T4u46GIydrLOOijetaLIihDaXMeivcOKi5AhDTrAU0WnTY +VYlV/ZGMU9Eei5z+LardLgCws6THYfJDBaRABiVxdCIm31sAlh3qQjGeJZapQkw/lXQfi5wxc+ Mtd20n5eH7z+is9IOrqY5W8/XkuVpKxrZHDJ+jqyGIj0dzIKNT4DI4qsbybAXR/yzrs1YEgQvK1 PFSuKeGTYP11bwI4i5QHwHDGC9Ww90QXRzo6NDRMcTECFrtu7vHZ6zALjd7FRapQmBbxXSd4vfT Qc61+htyuOIb9NVlDTtXKotsxmyWNkBe7XZrUIMtNnnii4UWom X-Received: by 2002:a05:6808:444b:b0:455:7fe4:b215 with SMTP id 5614622812f47-467575d484amr1587635b6e.53.1773408299425; Fri, 13 Mar 2026 06:24: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:24:59 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maciej Falkowski , Karol Wachowski , Oded Gabbay , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 59/65] accel/ivpu: implement IVPU_DBG_* as a dyndbg classmap Date: Fri, 13 Mar 2026 07:20:24 -0600 Message-ID: <20260313132103.2529746-60-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 dd3a486df5f1..2d7d290eb8bb 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 6378e23e0c97..b59aa0759e26 100644 --- a/drivers/accel/ivpu/ivpu_drv.h +++ b/drivers/accel/ivpu/ivpu_drv.h @@ -63,6 +63,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) @@ -79,6 +83,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 @@ -93,11 +132,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 { \ @@ -208,7 +242,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 Tue Apr 7 11:17:21 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 5DB1B3976A4 for ; Fri, 13 Mar 2026 13:25:02 +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=1773408303; cv=none; b=ip/VA0ywQ1GHRf9XItZasI8yZ+sxbnFR9EiNa7tLmz22RuydRsZ4TrN25M+yjbajHpC7PIds7f3jO5EMzhanDIx8AIUpsytIT+vaHYtbjj0bi4EiOByD9x+VmWwXRvyryv5tNrN2Lw28774FuEa3QgNmjnHGSXifKjJR/laG0jo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408303; c=relaxed/simple; bh=JSUeqVPuWD4XfomAvjxHigz4yHqpukYoxeZkIDyhkx0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xi/8BuoMCGkG9ewrSsbEPkcU+keT3laYzTiuG4K4YMqKtANvf3eWYCryaTWrbh/jJved8OrOGETr1ZcuGG/yz/vqBt7evWcKUqhGDt5cHSfthyq4KW0Iz+rZ8fQ2/PsANpdUZWtbwmxw3FpQyEGNhdse/l1JKOchhZCI65mGiUA= 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=KTpzkdpv; 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="KTpzkdpv" Received: by mail-oi1-f172.google.com with SMTP id 5614622812f47-46702742c7dso500064b6e.1 for ; Fri, 13 Mar 2026 06:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408301; x=1774013101; 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=3MLouRi7A/376XLBTN4RuLKPG3wKNeKXtfBxDJ5SI9M=; b=KTpzkdpvcmFMj9jTrQiLVaq5iNFiPrqX/0lIdRK5mb9EpIoKVx+HUbVeaxRvbc1gnK MTxQ5r7TWFKrPDmXuOimYndVkkXGoar3VkDLWh6NJ6wDJT1ldCRQb4lvsD3ZGPXYlXF4 otnr8syrxjcZxQr2mgQR5o2Iyw8ZT3hRqvIt+Hn7CyAqoXF/ujCuV0qnh+gxsbVj83Kq KWCEXDCMsEK0EpsBrPlvTpiKNKBTMpTXPwsgZKyTwqZsBWm6f4JKlbKu3/L5gdVwN7FM /SNY27jUl/sNe1sHZ10Xgeq3udyjOgjwxuSNgjH+NJTRX3t53LdDQsW2PuF04WBO6/w4 7ADA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408301; x=1774013101; 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=3MLouRi7A/376XLBTN4RuLKPG3wKNeKXtfBxDJ5SI9M=; b=DOf7BZgh2XMBXNyPH0iqq6h44TPwIwunJ9SY3CZX5Mt3/gJNhBeA+ulhMD/W+bsgRU Nn2DeMM2DLqSPqk8akzZSBon3jzueo/bFWyt+RPPfpIj/NdgLJQpz4OoekZP42/cLDWB ar0y8Zdgdn+M81Podg98Rar8JGtddyqUmj7gG8xXLE6KKiH5CE90wyZBcSdkubL8CaMX WMI3kD6HTo/l5NcU2Xk+IhhznW0weUH3jJuZfz/i80GQhQoIgrShMMSoEU+MuXTuWL/e S1LAlXEjs5GA22j5NyOtCecI7FHI/3/rdqPoWfR6zwnISE5W3vP82yO1UGd91Zkdv10L Rsyw== X-Forwarded-Encrypted: i=1; AJvYcCUQt9zI6qXwhBwBYtIybmweUS0D5lwD+L4FLTyVyzJSyxlZ+tRNQ1cI+32/R2DFYvRNN0DZhG5e4G13mvg=@vger.kernel.org X-Gm-Message-State: AOJu0YxtT9kUdtRtpLscdMOyYKyHEFtNw4AkFBkmNmeU09TJG2g0+wu/ QofIXMLg+TKxNf9KmhflU/ukyD9H2qo1nodDFAXMOkw3v+l8jnkGsoye X-Gm-Gg: ATEYQzx3p5BVOf4/9xHS4ImvbFusPierS17czJi778VqAnOL0fXNn57xLLHikoZub0o rw2yf9G46QnRFvGGj68pTgWFvp/sCsKMy/Eq1NJDlJTSTMbtiJajdaE9UqCPyf9aZ6YPX+RD8sR C1s0/qi6/fS9gqiwbkpqxN3Qil5RQFYpPKoqnYod4wmdioawA/QO7jCPuIpRbI1mTEbj2aZYxtS h3y4WuLBjGcom6mxUL7kUXeZZh7AXZhd20pzh79aPK9RwlBe7PNNTC+qx8W/bpv4HZJDKb2idSQ auBQlf2P0HPG95EcMmrlgzDW2zFrai0AzSWZI5nr6wQTuwVINhAvZmw/g8dHyfYYVxOCMUSOnyQ L2PwCv0D+nKN7yKDREmjMoLwFFOynGRjJVLcFrvhXhzRItrxGSN3K25YjHBGFKgSzhw0TfPa7Ym NHLMhXXsR6giO0UtkRx2uKk8nZulPojdRYTUbnEZV4KyF1Gt3H X-Received: by 2002:a05:6808:8947:b0:467:1cf5:768b with SMTP id 5614622812f47-46757053acamr1500831b6e.10.1773408301182; Fri, 13 Mar 2026 06:25: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:00 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 60/65] drm: restore CONFIG_DRM_USE_DYNAMIC_DEBUG un-BROKEN Date: Fri, 13 Mar 2026 07:20:25 -0600 Message-ID: <20260313132103.2529746-61-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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. Also, the previous 18 patches could perhaps be replaced by a single invocation of DYNDBG_CLASSMAP_USE, from a C-file linked into all drm drivers & helpers. I didn't find such a file, nor a drm-client linkage item in the Makefile. Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- 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 3b7886865335..48674fae5958 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 Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 791553BA23A for ; Fri, 13 Mar 2026 13:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408305; cv=none; b=m4Y24GHjzlqZZz0ulosQzdTgHk1C7LWRMpbq3y+7RkC393J1ia1aMtPbJH10EYUPoepFki4QQlfnIGvYt6Fpm6Jt4OP/1OHnftp86su6gKBfSCFqbkfALrB5GJCVSbyv0sIuef5izA7mC8CDvuzDVH7SmI+wxTjKQoIx7jxFI+k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408305; c=relaxed/simple; bh=s2yHvRQv2LFvQHSueM4len7CaE0U8GN19rseJ9pfjzU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YAnmzQnxGAf4jzY/bZBin8MKpgeYg7lr/WOYIOlHHBQoScYy/gm4VijVC4oIaTRb8iYLSD3z4zGcF59TdxoC7fy0X0PVhHZQe0Ndp6It95kRHp4khO9lNo2LL1uBV30s8x+9wTZGJPX6LrBTQaCjnjZDdPwpTC/jBI3adPX6kpA= 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=bBl83qtu; arc=none smtp.client-ip=209.85.167.177 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="bBl83qtu" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-467161c4ba7so1424441b6e.0 for ; Fri, 13 Mar 2026 06:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408303; x=1774013103; 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=bBl83qtuj1btvlG4XZSzWoDUm1MCrIOE4arDzC5WDCFoVLIuA7BAP9CZqC5Ye9tZyj xtgSg7H8DQHrg0IXKErnhuZiHov00OSo1Uyxu8JqThY6/NpJwahvG0c2bCe/NZjTJ6DV VHxXOjnY0O0z3zCCiIU0knSBqeqo+WEzFOqqYocUsnjnb27WEXD3Hgp4DL1WAb3DJ/cP GdwvrzVL8S9KVKl+rnyqDAxpUQos3Wdv5CWG8OoPDASxcoF9OxF3mqLoOR9kNRERzVQz Wp8swAX8urVCMmi2ZsDSWJBHi3EaQey+bXucLeD9qK2S9xMPWqA/We4kuG4xNCM82W7e +WRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408303; x=1774013103; 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=n/aYZHRz8GfxS/xuGdsfOTyvQoBxj9u76sk/PKjz0mfMFLuFLBdmMUvi9lYkLxQwK6 ZW6zXJ3Rn8CpUbMRiWMmOn++nzhCB0PQLiP7F8yW9Y3TyLYJt9dl3qJFgEhhz32H/XXT 9gMJkx1KZyZO0KfcyL0PWf9CiBD++tV1lfLuDsFufq78AF+dN52SWXHNbCQpLS37NaKw hW8CNehc3yBdDA8TFJyH/qbuHAg0kI1Hbfwa+FCSB0svSKDbKTrHacgO9kMhlO9pZicK KFqW6vAns59Qz6emflW5fBrzcljRDRnW+9NK2dRmTtUlix4Sl5Lc2asOUHNbIIR0g1fI uaBg== X-Forwarded-Encrypted: i=1; AJvYcCV3skKZ5NLnwi8lbyq2r130qmJOMy8LRGUpdTE8a7gxUEEkMscf4QXGXs1k0hm7ldJMJ/1IZGdaCWNC1jk=@vger.kernel.org X-Gm-Message-State: AOJu0YzdJLhgUdPO/yOALQ+juIANPl7ieS4aVqOosko+vCwWihjRkzdh 6j9kvIo4IJbftXUhP4vKcdEhBHFTysfIZ5jNYgGa3HgjDkCnt2EU1Mew X-Gm-Gg: ATEYQzzRTA1nfYUqAQWCvCKQs3rSYkUm45AZgzVbNnQmOGQiey4W9en5v0IAwyRaCqz UgNpVOOP7UmY0bMlekGLdaVEoReqKkv/yjW0EZR3UMfe4e6GJ4fJGc7GzMYOsyodJ0+fxZBDkXU BgbylDMUafgQPrYCatz05MI8eCZm0+gcjk2q1U10izYyYdx+o3KIxUa1Uzlxe25uzMpp1gimg9N piJXVNYhbrHEoivik30lVCKeYbbaY1WwTV4SjFX+2CHKa9oM8rFtjRS7Rz18WyOf5pgMdz1whsx jjRUWuZNLWl+Ka8B06x080lNkOd3UtJoi58gft8mzeSXFDgFyt4nxw+1tcRNecj7yY7aN4IWC9H HIoYiUmIHoc0gL0EOEte0KMM4YFtIsB4gLAeo8/m0ZsBY6+lWZfdchhtGElDeZd68w9gJBchoQ7 /cks/LmuiArPykNuhgU0xTUe/8HeNePa/L6eh+UFeCnnueWl24 X-Received: by 2002:a05:6808:190e:b0:467:2be4:9e33 with SMTP id 5614622812f47-4675552dd65mr1929280b6e.6.1773408303348; Fri, 13 Mar 2026 06:25:03 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:03 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, "Rob Herring (Arm)" , Tomeu Vizoso , Oded Gabbay , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 61/65] accel/ethosu: enable drm.debug control Date: Fri, 13 Mar 2026 07:20:26 -0600 Message-ID: <20260313132103.2529746-62-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Acked-by: Rob Herring (Arm) Reviewed-by: Louis Chauvet --- 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 Tue Apr 7 11:17:21 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 35EAB3BADB9 for ; Fri, 13 Mar 2026 13:25:06 +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=1773408307; cv=none; b=LikOqGLs8lNRuBUQGdC6ImJpA5h06YvIKCeurv1SWlEoNk+l1XAJ7U2EFZywTkQVDeiM/DeWtLBDlcee6i6RABWXrPss4xDmtFr31wH1CV5Re2PIcFvheLa2sjLrAXhLrJG3p2RP1scYDfqvEGh2IHXk9WQ3U0Vrtwat8U8NAEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408307; c=relaxed/simple; bh=vbo/1J7VXFa6zaUXR4UhQRabjHLi44yC/GOBDm2eBhM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GbvUwdLBDveZaGDj9FwZ9jJjuZ7x3mfD5DUIiKRDL3eAWhuJ7pug0qPW4nsGRCsrOIM/Wvc6ytLhqSvMJkN77Km/sTjzZXYHhT3nsE62doSCkddhvq0sfiCtq7qQ9ZeaKyA3U85rR8jM9ba3V6e6yTtZEl+cOhv5KAKKBrv1hVw= 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=ceFfAR1u; 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="ceFfAR1u" Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-46703fb602fso907336b6e.0 for ; Fri, 13 Mar 2026 06:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408305; x=1774013105; 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=ceFfAR1uYOS11E7/4SRQfP3ytmRaNiXycXi1q1o9Qgtm3Q1pKE3qNZjzNiQqLRqr63 1/beULU8/DFkJhqOyl+cLaoivuXvxslYO6QRkYECN1gngusYzIyQxkmpq0vD7IrFs/E6 wXZRM2ap5BxxiDC9XAJBPbFQi9NYO43AnpLdov1j7EbX/KgJrKGaiuSMqPpisVi9Ugtm 792bB0LhKfHElVgDoCnAKYC3LrZIevhFa6H5JWiOq+gcG6EJBaPRakeHeN4XPmxjSyGM UGhqzhtwVf24gycuRUxrQDbwz8iR5WtjGf9CSP1Zs8yuZnFwa5fMxAV+3uYThPliXpFJ qpIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408305; x=1774013105; 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=cDeyO7k3t8IkvEQYqatFltkX0ZLjMDBQKgBT9AvLMkJ2H9aU5U5NkxKCEruOgAXY5d 8BXD7FDMSKSz5pe1psWzt6KFHZpbITKJPXPthAt/4Dh9xNSyGSxnXNDKmStDCNC5ZkKP z0NlPm8p6thXeuG/Xd+WbNT1LGjSNJSz3c9xmdhuNMHHc0ciFO4rbBvUNIS2pg7K3hgc RgOZ5i59PZlBCxPsdCcExfetkZwMZKu8cOqXyaJ3jcGPsurmPjk3epTF5w68w5sSDmyZ SM/RIby5WW72YowJwQwAAe9YnnzHFyQk2d6NfD/vqDSw3qWcnhW5bYkB5pVv55KC2lha n4uQ== X-Forwarded-Encrypted: i=1; AJvYcCXmI450ej38ZpExDHGdUSSd4wn6D6bLaFrvSoq0UvcVv/5fnk818I5uPoqBCfMfM3k+5hIAt1YVp1kEZOE=@vger.kernel.org X-Gm-Message-State: AOJu0Yw8x4nIYrNwgoKQtrmEaQc3Bce6IwTRSCrZqN6pSLLxeRTegosr Bb/JBRtTV8rH2LMBvDQISrz3cdhJw0XBriRye21GUkjsFNw+C/Bbtb2y X-Gm-Gg: ATEYQzxu8sE65UFfKpQ8/Oq/8n7WPUQu6Be5sJA8v2LbUds0+EdwYURW+gEWlTZRN+f 5l37UWnJPRe39DpwlXHpajBFShAE9yUDVF2YMiWkzSDtdwbcBNzNMYMu3BXRL61aNqR91+aKzLX zKRS7xrCI/lGtA/tHrC+W/UK+QrCohiXUquequQCdfCvrcJ8efvuunB9iKhu2PDi835uT1ZH5xU e4fEtZg+8C0KoeQwcUj/bjtheW0K07aGRkA20wnqXiif/DjVmMoukyp+1BwcerCHPEiXC+pnpVE mxv28O/FxUpKKEDbCZk3LTVgKp8erSMsMArHmRjnLyN9p5uVzvCIohMwkleYsc3oPKK9ESGmvYw 633x5XjVh3VOXd1HWZoD65tx4Y9wjkkeB7lHydRnTWN2OkrwHsyPozDacTR6Hy7ftQY85QnRDiX 0yQgReli9ObwjV4A3zIVl+iHnZTNmpxNwG80+ZE1dbYKhPNjvS X-Received: by 2002:a05:6808:1187:b0:467:3f4:907d with SMTP id 5614622812f47-467575812d0mr1643061b6e.56.1773408305157; Fri, 13 Mar 2026 06:25: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:04 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Tomeu Vizoso , Oded Gabbay , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 62/65] accel/rocket: enable drm.debug control Date: Fri, 13 Mar 2026 07:20:27 -0600 Message-ID: <20260313132103.2529746-63-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 Reviewed-by: Louis Chauvet --- 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 From nobody Tue Apr 7 11:17:21 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 33FFB3BC676 for ; Fri, 13 Mar 2026 13:25:07 +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=1773408309; cv=none; b=OZOR68QQAlD7pMGedPj05IjfXsMHj74rNZ8C6HuZ+mmK5ya94nH5pbSUinzvctcgKMvysZ+090QiZaHXs2VZKed8GLY0vTOvdwoHlplPDEpna9ZYcMUX6Hj2xo9fITs56/L3P9SriHIsUxooyCKiILkHAGSY02Gg84dgI3wbWS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408309; c=relaxed/simple; bh=pkCgTSJJXbt5VxzxPj8oHFbgppFep4H/tIjoWSquLFA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oHJMfaqKT2yGo3lSRZ6kBz/euahjwrzD4/B58R53rz0EYdPwqsYa0P8sSrJz2HEMe9w5d92awCYeUb7EjiP7lZoPO+KGHZvGe1o8I+pN+MYsckRYM2Co1cFstIV9IVE2R/+QpYh+rP23eQebkk3d4Ii7K3wzYqVjAiRhWCeoxwg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=L+YIynbm; 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="L+YIynbm" Received: by mail-oi1-f174.google.com with SMTP id 5614622812f47-4672076355aso1531417b6e.2 for ; Fri, 13 Mar 2026 06:25:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408307; x=1774013107; 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=p9IAEzSkGuy9vSx6TA0Y4hBOc80UNfiz/9RCZw4zMCM=; b=L+YIynbmbz9BTuVVxQvLpkb2SZNeupxsAgpgw7kBfNK3krce3V7GJN0juAJTklZMpV Rcxd0mEoloHbuKhTvJws4Mb7AT6f6DLQRUkqNYdmYMbXGazY+l2XL39eNhiRCowe8Vve g6SGuwFlJI9Xmsp86AhA/nC4ScfxkHiUIKOH2medcAN+cpfEAmmpFe7/IT0hp1/34r8m LkK7+wBGcVzsIEbaqxY+L3uRvJJgAqXhuydUJOkpOYKh6xHbPfV8W9D49wrYh1a/rHhe MFD7SW7tP+Eec+2NlqJVPMhoRZrhx/Y2Zv1LQO5ZUtYiSBG8uJ/99L68nwCOuYuL6tJh GfUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408307; x=1774013107; 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=p9IAEzSkGuy9vSx6TA0Y4hBOc80UNfiz/9RCZw4zMCM=; b=qadOXhIH3/XaXJpW+D4K8ZULv3Lg1SVRbm9sRhLqEGzKAMq1L1r9Oej/DXuduv+IPU F3ojYEtYvrlwcgyOmG/78pJD0J8Zyrfi9eUlQ0k8QgV5SBLZc+RzWPt/4Z6trlUAs5jb /o8nO70xUzlVsVGD9MYGO6879Vfbz46J5S/dvy2kj5IsEhl6pmdLAuWFT3TB7rVQssRz LezPv5uWa5A3gYcv+XD3IENbmt+TyaqWDg2JHatynY7ZPyLrdhTVsBiQGQrhHyX0B6OR VtGKdkBs+VHdhIgggM5+fVZXPcmTBIhAAxXjlxvbB8Czm62rW02MhmMo06NRfgyl+0+g oTig== X-Forwarded-Encrypted: i=1; AJvYcCVo3ANOhXuzNwyA32ukHMl1XGB5QjvIdNy71VfY0lmKdioLTiOQGGHLfd/7bEmP8eSi06bg2yaeNbgeOSo=@vger.kernel.org X-Gm-Message-State: AOJu0YzAcM0YJVpl8HUwGsZ2M5LZ5feHNTVSaNIk7raqztLt7hQRO2uN yRZ5GrsIIdfolttfXUoPfV2bUOYbNGiDeu2v3yKU+g+Be1NGyLKvM9YD X-Gm-Gg: ATEYQzwGqCLIS68oZZhkMlptrnSgcNrlntdPIXvZ88u06zus819X3woeIhMrkHdQeCU qwPvb69zA6t1iLCHj/NgzX1muJGFtJ30N5SzAEl/DR5dsFJZs4lVVDEBsWfuGlJHic94rKHaCX4 UA6MLrZpDIQ3x62jadOKVsTmyzEONt9XCKxSI61K7IBswXbf+riz9NhXwGcikKgGmdZUJ+6Giw1 Qgd+PF7YpPdC927+Bua2O+b/IxY9hmV2jYPxdsq05xcxLZLf4yTb77NP5mYHF6fjffF7o3nWucV FQVPvqbndHTDOW+yW3KkHlBos9+Gp51kVw8p3s5IhZajjfdLe0Wf1ePU+rAhp+mkDfnWELzIQRy 2pGnybuHTq+rgqLkNvStMZ7prHxk20eqJ6S6wDszR6haI9uwm6mdUsuhmpwoUvlnNp1npYtOYcb zy2UtL1h3btUzQyuipWv070vWA1O/RKRnjBR/YohkQsON8CIYA X-Received: by 2002:a05:6808:1912:b0:467:4a4e:5a80 with SMTP id 5614622812f47-467575aef9cmr1688429b6e.45.1773408306845; Fri, 13 Mar 2026 06:25:06 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:06 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Matthew Auld , Arun Pravin , Christian Koenig , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 63/65] drm_buddy: fix 64-bit truncation in power-of-2 rounding Date: Fri, 13 Mar 2026 07:20:28 -0600 Message-ID: <20260313132103.2529746-64-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 the 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 standard macros with safe 64-bit power-of-two calculations using ilog2(). Signed-off-by: Jim Cromie --- [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 FA= ILED 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+0= x114/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+= 0x1c8/0x36c [23:19:41] drm_test_buddy_alloc_exceeds_max_order from kunit_try_run_c= ase+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 = 00000000 00000000 [23:19:41] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 = 00000000 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/dr= m/drm_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+0= x1b4/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+= 0x1c8/0x36c [23:19:41] drm_test_buddy_alloc_exceeds_max_order from kunit_try_run_c= ase+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 = 00000000 00000000 [23:19:41] 5fc0: 00000000 00000000 00000000 00000000 00000000 00000000 = 00000000 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= =3D0xacce106c [23:19:41] # module: drm_buddy_test [23:19:41] # drm_buddy: pass:8 fail:1 skip:0 total:9 --- drivers/gpu/buddy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/buddy.c b/drivers/gpu/buddy.c index 52686672e99f..ed4d33a30687 100644 --- a/drivers/gpu/buddy.c +++ b/drivers/gpu/buddy.c @@ -1091,7 +1091,7 @@ static int __alloc_contig_try_harder(struct gpu_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) @@ -1318,7 +1318,7 @@ int gpu_buddy_alloc_blocks(struct gpu_buddy *mm, =20 /* Roundup the size to power of 2 */ if (flags & GPU_BUDDY_CONTIGUOUS_ALLOCATION) { - size =3D roundup_pow_of_two(size); + size =3D 1ULL << (ilog2(size - 1) + 1); min_block_size =3D size; /* * Normalize the requested size to min_block_size for regular allocation= s. --=20 2.53.0 From nobody Tue Apr 7 11:17:21 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 D52AA3BC699 for ; Fri, 13 Mar 2026 13:25:09 +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=1773408311; cv=none; b=DMDJnLEWBqAmdlZ//Q3w7HYEzyBqk6UuvABik+jkFk6Dv4Le7+hyxJRd+NniJKIrvh1EHR1W+6s8n58IeIyspZ6nss+YSoKr5mYMhmnTgEDcA+vgh6Fnhn6Hlm3bE5Wgot6cicz+KxGPiklnnbVRcWAyVHP9HqupICepmj/9pTc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408311; c=relaxed/simple; bh=5SK2vrQTmGsYJ2XPIk7j97VipujdQktv5uWLjBlVfRg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rb799da1Zk884gdhaFFU+6XBG2/jsJd6i+qbWrY8wxE2TahslFdPfi7O8VSZfKr1wGS2diF7kbtRKuagZz9I6dkUIVgjvfc9ag4peFaxs5QNzFSFGYUg5Cqysj3v7fJZyYxmE+vFZccHtsJSp8TKXSax1HKZIUAca3JepQexjGQ= 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=bbKkbrQ9; 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="bbKkbrQ9" Received: by mail-oi1-f181.google.com with SMTP id 5614622812f47-466f1c3c627so1553989b6e.1 for ; Fri, 13 Mar 2026 06:25:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408309; x=1774013109; 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=Vn6BBWYTc8CIB4CSHYkkNij4NNRuRZw5Ruqls3nbhKU=; b=bbKkbrQ9dX+S5q0So6Ifr8504nlJjAftnjE0SSNwDZmHr27YvihXue4D3oFcNqYyyX evgVsCtqLSIjTmMLGKluTviR5Cof0WQn3eV/NFjT8g3sAbNfW2U7O1Ip2FtzEyjNTuDK zNg7BBA6Nl/2j2R1jjPYXBHG8YOA1JcalcZF+QdrCqsF5HtYgbMVOYuM7wcDRMgDiLpJ WMx3ZkvS5NckEyx+YfUhTSnvyLAi0iLMzlgCNRMs5o6J8KXuCjyozuC3RTT8ZE9hM5Hm tcgKO1yCvTkaRgS1Q/RfOvpvZSQKZBCJAjg3UM5S6uP8L6cBTIokPT+jdwAuymavCcv3 9Kjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408309; x=1774013109; 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=Vn6BBWYTc8CIB4CSHYkkNij4NNRuRZw5Ruqls3nbhKU=; b=iWF8cuzt5fp3BCQf7ETIhr+DCMExyyMCZZVQDqOGwtM8SYh4mD+ZyRC3n79eUmkRo0 xdkWzc0O+37lp5pmhm0l0fwP38iLmhhdULMJ3moHx5lNkLyicQ+wKzpPj4LAiyqD/5l9 hnFUUppoqH0NBWd9m0h1NRsOt1Vtvq6jri79i7ya3f2OjMt0g/gjpi2PXMJyqJr0mSRc GasWxfMq51Ba/8qYPooGKSBZDCrX06xqBJMtpxAIgCHLvR7t5eqfzUYO3v4FtICavijf 3mAzB7SuSZMst7w0xXEw3J6MvN1yKcJUnwgfbGd7N88kw93T94HbtQyWmOTElR62XRHF b8/A== X-Forwarded-Encrypted: i=1; AJvYcCV30qvYqaKIaYcyD/3ZGwiI8HdSULyWxhgHwznnL9q565VU3kvasCsA7ldotT/gHIEX001+i3TNKxL6/8I=@vger.kernel.org X-Gm-Message-State: AOJu0YzQJXxtYtjIsQCYzUigza9n+4WmdeuSgxyvVCDpNyh7SYCOoZ1p VwyXb7fcaojZ/3c7yBsyQgvXhYLLM89MX4JeRb1stwrfIlEFvba4tCTG X-Gm-Gg: ATEYQzyFwXQZ4wivq+GKxcOVOqiQbJL/Qi0oygrHlOSYptW0gHYP7c9Arz72TsHUHPm Ey3eQmOJHD1DXFOgsI9nA95zZQ4kdtiVLbqdVPJ4kaMH1gFjP6I/wzRQOpBcHXB+yJpKuW9PdN3 ipsocL4xctPr36dwxLz0zgx7UlGQK0xnL+2df1zeSX2UiRSqWyK9gDqtZ8KJLpYTDmEdjlzafhc Vc8wZ2V97ypwPHs6OVVIK5fb5AL76MS6k6R8k8v7F1XQm+IutkzpGHlJKnFwP4w7a5Mlko5URJE +rkJj93KCujr5khZMk/hKixUCoFy6dSU+1+QG/jBDl7I8eQ6kma0BjGOV8SdTFlH1H/iUpTc5GQ bAq/qqsHq7+t2MVEMK8ByJbpGI1JVrW6l+0nVQJquliA8y5o3szCOpCKOVtaNnxTfdc9w4qvDca Xx683i39sQ7WF1NRwhChck/IJT1aPa1bXEpfLTvn3FYOKY7KrG X-Received: by 2002:a05:6808:1302:b0:467:17f3:68bb with SMTP id 5614622812f47-467576d3042mr1687190b6e.59.1773408308527; Fri, 13 Mar 2026 06:25:08 -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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:08 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Luca Coelho , Jani Nikula , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 64/65] drm_print: fix drm_printer dynamic debug bypass Date: Fri, 13 Mar 2026 07:20:29 -0600 Message-ID: <20260313132103.2529746-65-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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([1]) is the canonical bit-test for drm.debug. Commit 6ce6fae84536 ("drm_print: optimize drm_debug_enabled for jump-label") did several things: A- renamed [1] to drm_debug_enabled_raw() B- introduced __drm_debug_enabled(), which evald to either 'true' or _raw([A]), depending upon [2] CONFIG_DRM_USE_DYNAMIC_DEBUG=3Dy/n. C- altered *dev_dbg() to call __drm_debug_enabled(). D- redefined [1] to drm_debug_enabled_instrumented(). This called _raw(), but added a pr_debug() too. This allowed us to see how where and often remaining callsites were called. When [2]=3Dy, [B] short-circuited the bit-test, since dyndbg's wrapper macro had already set the callsite reachable/unreachable. 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, [2]=3Dy was marked BROKEN. Because __drm_printfn_dbg() is a shared callback where the callpath is not directly guarded by dyndbg's static-key, checking the bypass macro caused it to evaluate to 'true' and always print, ignoring the drm.debug bit-mask entirely. 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 (see below the snip). To fix this, change __drm_printfn_dbg() to use the explicit drm_debug_enabled_instrumented() instead. This ensures the bit-test is performed at runtime for this unguarded helper, stopping the UART storm. [1] drm_debug_enabled [2] CONFIG_DRM_USE_DYNAMIC_DEBUG Fixes: 9fd6f61a297e ("drm/print: add drm_dbg_printer() for drm device speci= fic printer") Signed-off-by: Jim Cromie --- some of the many: i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vsync_start (expected= 0, found 1083) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vsync_end (expected 0= , found 1097) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vtotal (expected 0, f= ound 1116) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:57:pipe A]= fastset requirement not met in hw.adjusted_mode.crtc_vblank_end (expected = 0, found 1116) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 112800) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 141000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 141000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 61040) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 76300) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in hw.adjusted_mode.crtc_clock (expected 0, fo= und 76300) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 216000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 216000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 270000) i915 0000:00:02.0: [drm:intel_pipe_config_compare [i915]] [CRTC:82:pipe B]= fastset requirement not met in port_clock (expected 0, found 270000) --- drivers/gpu/drm/drm_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index ceede094ff13..b431881de2c1 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -214,7 +214,7 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va= _format *vaf) const struct drm_device *drm =3D p->arg; const struct device *dev =3D drm ? drm->dev : NULL; =20 - if (!__drm_debug_enabled(p->category)) + if (!drm_debug_enabled_instrumented(p->category)) return; =20 __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf); --=20 2.53.0 From nobody Tue Apr 7 11:17:21 2026 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 5BB073BD225 for ; Fri, 13 Mar 2026 13:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408312; cv=none; b=Wp+nLzqo0bLpCW1EFhn9opMmZxyv1SJViXz9r6+QOzXKNVrDVFyg4O0yLscexj4mHjRcSOGlAbDXbvQ9Qh28+x9cOvvx5OMsjsOMnAcXmtcRvf69JSDvNQUDVGzE7WmBXqYahvfQlLKO+5hMeo+YkJJL+8WHgEAW+eq1vmWPfUI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408312; c=relaxed/simple; bh=WZngrojUvz5q82ybHwgvtDZoge1DVAZUgBqmVpCiQOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JsjfvpaMR7QrKImMMCNN7yv/lXvR30lrUA6+pvHsesMLi7sWV2JbTl+YWZQw4s5kIUH6tsVG7SP09Mz1MYfPBBK4XIJewcB2x8sKuBWKcdI49TLNMr0pluWP/qI4gT1+fx8Crb4lSiGNxlur3PwSWYFgjnI96Jo09OoFPoFP7Lo= 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=TNSwXxiM; arc=none smtp.client-ip=209.85.167.177 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="TNSwXxiM" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-4672076355aso1531452b6e.2 for ; Fri, 13 Mar 2026 06:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408310; x=1774013110; 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=BxHe4+DOmq20FSC3herHJvg5metbXtBJFuJ219tBZ0M=; b=TNSwXxiMEDaa6OVypmewt/gAS6oxQtQSq/iG03kT1i5Ha5VcRahYFr60F7S8JoHB6t LX1BhI9OGlMvz0zRyrsCwfGYsuzdKWUaCgsrC4qzp9pglsQynTW9CmS/kgzfOm+/EvUx 6o+vcB2TxE/j19Rlft98sc1EJaEg/vi9dKVaPLQocgzsvkuYml7pY6uMN49yNaaG//ie +2Fg7P5dutlN0o0iImCvUoP7ajXnWERcDPA7n4/n73eGYbUmT6lBTCELyIZjIooPB92O pCrEH7AQtaqtc2R8L0NcERzfiteTx0Y3zeXRb010bU+GZ05h1pd2XNdHwsStlnXJkGks JFsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408310; x=1774013110; 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=BxHe4+DOmq20FSC3herHJvg5metbXtBJFuJ219tBZ0M=; b=N7JlQNdKw3hOo5hECDwxghG2oSyN00WqDLXpfsGtbU+4wm1LxRyhXyVG+Pil/r6rBz Qe+TMFAZ6RlLWSUPblQaV9q9tUIIeSyLtfMQ+FytBE9JXN8GsHm1xZWyo/lfOBwZ00tV XE4GaA/wCM7FS2pSuKy7oqhjxYHM70qblCxQYH93G3i71h+1hQdfDkuzgBo1Bfnfj98U ByfPEAHnPUdJUNQI+e/S3dajxOSwE8xBG5hKrwMqwCrW8gJVyCiTf7vqcwcIAkawf7O8 7KKMGi/Ke+bGaARSrbV/z1Jwcr1OV8c3JeHwMI2Kcs+MNfEMXPPJhGWKps35HhIPCKrG 55hQ== X-Forwarded-Encrypted: i=1; AJvYcCVs1Hi5X4MVrYafeJlb+gQ5sRbe9Ihp5Auxt5VD16fdVZUB/od+cSCI4w5mWIhnTMZcvG6i6Ihb4K5z6gY=@vger.kernel.org X-Gm-Message-State: AOJu0YxSr8K/u21imMFsI8JgxmE5hBR1kDqMXt63hHuWppSTXZct6aUi E6ZCOVmbaDXTv0kkvusy/51tIhfglcyjkunk2AP97DsCm9trpLEYPUVY X-Gm-Gg: ATEYQzzwOLX117XL79LhmLOTFOeREx2bCu6r343PYoOzpiO7WHc3CYo935FiYWyxE5V w5WRqqYx+9s4u/K/AMWRrE9rn71/sg2tQ542iWSzQOvJFgXO4IMcKLzHo1yVfQVbizZyHxACOhh a0tFYuUsCVPX0GMiqQi1fO1peXidXldneb7VL/VtMohB7T/Nkx3fr6i3etu6xuJ8KHhJwgB2c/B wOfHaE9dw8ulazD7fEdMnoR+9vIeUkajgGINsDB5RsIjbveltkH+YYrBzC7VwJyKdRyi55mt9EP iEjeNE/tOHuvmuzuaNTBoZ8ABdcXsiq42LvHHy2Rn8cNGSKUkpR3T9qTr4LrFgwx8Zcmju7xVkr 1m2jhiB9EPFj8MP1LlwF+2RKZ4vUHpg62184HmUQEH8Up3nsB+AeF5h8XBUQCtmG2O/exaVTbsl G4Nxe/Of6/Cc3fOGVkm7uxJLOwLsrycyay6hwUxf+8QalnL0Ux X-Received: by 2002:a05:6808:118e:b0:467:268d:31cc with SMTP id 5614622812f47-46757144050mr1803892b6e.26.1773408310188; Fri, 13 Mar 2026 06:25: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 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:09 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , 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, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 65/65] drm_vblank: use dyndbg's static-key to avoid flag-check Date: Fri, 13 Mar 2026 07:20:30 -0600 Message-ID: <20260313132103.2529746-66-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-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 the debug logging is disabled. When CONFIG_DRM_USE_DYNAMIC_DEBUG=3DY, the drm_debug_enabled() is redundant, because the following drm_dbg_vbl() already carries a static-key optimization. So move the ktime conversions into the drm_dbg_vbl() argument list, then they are guarded natively by the static key. This avoids the double-check entirely. TBD: if CONFIG_DRM_USE_DYNAMIC_DEBUG=3DN, this does the ktime conversions unconditionally, so this might not be prudent (yet). Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_vblank.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index f78bf37f1e0a..0dac7eec2066 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -803,15 +803,11 @@ 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)) - return true; - - 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