From nobody Tue Dec 2 02:42:12 2025 Received: from mail-io1-f44.google.com (mail-io1-f44.google.com [209.85.166.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D93102FB0B7 for ; Tue, 18 Nov 2025 20:19:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763497147; cv=none; b=MODnut+7zIj2EOOSVt+GlrwhKXgz69xMkS+vUOZDjZKoCbbQ226y+PWwgD34CIZB8qT+mIoPuro3hmRoXaIbr+j+0PGp1MBykn5BZwQfCsMT2vkkI5Eyg8jJXgGTum3UgCof++Zl+43Gyikn4sscEMCWj6EHiv2y45lbBMBveB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763497147; c=relaxed/simple; bh=WJsL5+b64qEVbgIRF4xWFN8U/So/eEztAdwAUgt7q84=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PqGQggoCY0alHJf6mhttmMe7vlMx/VoM3/thlUtYzpJAfE5PdoRz7JHu9uBC3w9g+C6rwkvemEuJ5Gf/NbCCSHo0mqe1zIZznk789kQLiIv56dlDNX7HxFDnoG9keOzQ5OKHOIOdB7C0SyX3BNqHUb+WiPeGL/Gq7hnVOH7e/BE= 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=F1+ahNZY; arc=none smtp.client-ip=209.85.166.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F1+ahNZY" Received: by mail-io1-f44.google.com with SMTP id ca18e2360f4ac-9486adc1aa9so235642739f.1 for ; Tue, 18 Nov 2025 12:19:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763497143; x=1764101943; 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=gTxYU8h026vco97neRjwIFFgL6q6uUevMqp7p18zgTA=; b=F1+ahNZYNpR0PIPKskn5ZJHHP4RQpHI29wF/wXfP3Y5uAqDYwkP8z9pmouKPptOFZV TxMBl2K1JRm2HGNMJis32IZjF+5yBZ1nDS2tfZjIxL1emDXagdneHBJTmd9Mmx4xHJoz qi4iezbmZuBAvZjt9Y/EZqBBBEQ9NiTzRwuNqvfB7uO9pGzLkycYl96b13RMC1u89BoN 43pY5GD+kqGv+W9dn9reySY4x6reBF0a+ISDY6fMpV/FJ4AfXFwqNxdsrJmC87kvnRQl vGxjaBsm3k1ohEJUV7coMOGjGzgZ1qCv12s4gtph09WR35tNao7ytTSFF7oT4ThpjAJV ONKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763497143; x=1764101943; 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=gTxYU8h026vco97neRjwIFFgL6q6uUevMqp7p18zgTA=; b=Vlxkw9qu88H7NRySrNq15e47aNOU1RVLUDT3utK3WOQ+sZJbSsiGbGqmKY/o3G9O6p WxO1LT7YJAlNir7Ph3Vj2APijSwxNkqNwkSN+MKH/21vc2roRG/tYn6CW3dbBAP4gbPf sahCC6MKAT6zx8qcaZwHgRgGKZll/U02X477ShR3SGkj5S9PporKG1l1PrH/bKi+iu6G jh3GQck9iWkXeFX4i/d+F0SfcwGOa7fxtUScbwtqjehNU5Q9A09FZ43dLroQ8uWyVcXx 7ohnWND9Ov2ZTxML9phrgjRAtP6ccGYwyLGEfBNU4xs5u2wmT/CCb1jac3YaR52rDMuN jZbg== X-Gm-Message-State: AOJu0YzFu1t/XTK4oUTozXIC2TncfHuzcs4aXEmHebXDHe3irlanmY59 hkIO1fcOHOerBecQEvUXPnd2rNCNF1juGphjfMPtHFZXD3t9y1okdiAS0g0sEjJo X-Gm-Gg: ASbGnct8JqX0guRqJqUcI9t/lrhQhHGK3dAun0TWUGjLnIHG0UCSvszXueZJI5fsITP mCuOuQKkl/lV2Me/CBgYv8esFJ/lu0d855vHdglJCE/SGEmxmT13LVKZf8+1gPOh3JKB1NhyjvE Es49kwYwCWGdom+bmkhfunrEavZsdnqMXf2vx6Ydlw44LNsXjaILVbznHCDRbwzQ5aUxi7eeMSl uiCP45MlXs0Czw7MseoG6lWFLIPM/1/cDhtQvmco6IVq8BRyBg+JnQXSuFR2X1PfiiJmRpHToUM +b2Z9Bd79vXLy61UZOQ2Q72lq3ElT8FChJCo4MsmcHE4swY/W67+pDNjPBf4flnVqhoJ0oy+SzH oLkpztDg4x/Ajb7zq9TgV/sT4G0ql/7cROwRNzXD4zlryxm10nB9R8NfiggLuj6fUn1dqil297D XviM9x7fCJgPKRCOWUiBi1HcBrPY8hQ/HMXMiW7gkPcrtxivLuLV5so6sWZNuwrFJ6L8oHlDuTl PxTPQ== X-Google-Smtp-Source: AGHT+IFcrc3OLX2ZNqj1CE9FhAt/HqPB6Gasnh7zL31ocPGJeEjq5Y3rUTCiF6HLBv1+x43fWEAwEQ== X-Received: by 2002:a05:6602:1547:b0:949:f8f:eb1d with SMTP id ca18e2360f4ac-9490f900d7cmr916184239f.7.1763497142850; Tue, 18 Nov 2025 12:19:02 -0800 (PST) Received: from godzilla.raven-morpho.ts.net (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id ca18e2360f4ac-948fd4c273bsm419823939f.18.2025.11.18.12.19.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Nov 2025 12:19:02 -0800 (PST) From: Jim Cromie To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, gregkh@linuxfoundation.org, jbaron@akamai.com Cc: ukaszb@chromium.org, louis.chauvet@bootlin.com, Jim Cromie Subject: [PATCH v6 02/31] dyndbg: add stub macro for DECLARE_DYNDBG_CLASSMAP Date: Tue, 18 Nov 2025 13:18:12 -0700 Message-ID: <20251118201842.1447666-3-jim.cromie@gmail.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251118201842.1447666-1-jim.cromie@gmail.com> References: <20251118201842.1447666-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add the stub macro for !DYNAMIC_DEBUG builds, after moving the original macro-defn down under the big ifdef. Do it now so future changes have a cleaner starting point. Signed-off-by: Jim Cromie --- include/linux/dynamic_debug.h | 43 ++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h index ff44ec346162..98a36e2f94b6 100644 --- a/include/linux/dynamic_debug.h +++ b/include/linux/dynamic_debug.h @@ -92,27 +92,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; @@ -137,6 +116,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 @@ -303,6 +303,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.51.1