From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AAF7CC3DA49 for ; Tue, 16 Jul 2024 22:25:45 +0000 (UTC) Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.97.1) (envelope-from ) id 1sTnb0-000000003uk-3MuL; Tue, 16 Jul 2024 15:12:18 -0400 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.97.1) (envelope-from ) id 1sTnOW-000000000nj-1DbR for kernelnewbies@kernelnewbies.org; Tue, 16 Jul 2024 14:59:24 -0400 Received: by mail-il1-x12d.google.com with SMTP id e9e14a558f8ab-383e7a29808so594705ab.3 for ; Tue, 16 Jul 2024 11:59:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721156344; x=1721761144; darn=kernelnewbies.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M7xcpbsTDFqLNkX6yLBfMI4Cmqq9UEc7Ib3kRvowNps=; b=d2RMWVL7bhf7D0SMQ27amOkYQ1UpwU0vqS4C5BDONo3gXLeYDzdkVKVqLvXtYrpKcM Y/YfjvtEXhv1zSn4StHnqSWx5fy73jRq3dsWkrMoyryRUzUTuaArRHdfWhfOEc6qrDQD G1YRv0IOmdQjFwk6MeyQtu0xoL8EttjU+mLDcuB4/gLsjdiAaFbL1zg2eyAD2VLeO3bz 3KsggmqAGJE0DW5FIIKBtI3yLVjZMMVaS0gCP2mg9S3qF7/R+GwhhctTl0b9vYXtA9a4 A1Ld/4l72C6JZ2xJHQXeWbv1ymKTffxZ/OssqVLaebqGlBPbtMM6mmo0IgufPnrTop+v XfMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721156344; x=1721761144; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M7xcpbsTDFqLNkX6yLBfMI4Cmqq9UEc7Ib3kRvowNps=; b=mDDJZSblKxZKGtC3LqXzb5/TWyN4cNaKQLUpalK8sgXJDU0AaWCFzGHlHNRbD+Zyij j1bj7WVRIIKdo8YJTE8pHwaYQDLuSPdKlVTXtiQ1PMuJLEZbMEckXmm91U5NeRs0karW 0tOlRLPmUIlXL/8nLF2Lma1zrxTHLIDqZq3oJZcPNfc24mvU2/GmoIqNefvfa4gjHmFj L7uUSRSTsmeLejvsn2qJiTcZM2N69d8XcqBXUrZ6KvKw8BrPeCM/SHw92cNIzK+XocWl M02Bygif1HtzxkRoq1cKc2Q6GIgbdVWEj+vYI7BXooR2fd9a3EoLo9PU7tTmwvr3fyp+ DLmA== X-Forwarded-Encrypted: i=1; AJvYcCVrie57yTVGiDUUOed2bh0bYVh2MWRF6+Q/YVQnSBbH6yQFvWcu8/NMfp2CONOZLedrsk62d66ICCplZTDqzgGUol3oZIZIljHEQUe0Tokh X-Gm-Message-State: AOJu0Yz1Wplw98GjDjf8pSK7Cz4JAzeqdg5jIGw3ABT9FcHY5Z1Sn1B8 3BpTbiNtHyT0e/Cwnmusa+mqkjsWaN71jb3BxvL6HAnaAYJOndBp X-Google-Smtp-Source: AGHT+IExllrK/dDXx9zHRPe0P0zQSNNZHGhy8f3RcoaQKjATZG0VIQe5Ln/GSLSi2fMerteHcMi6Pw== X-Received: by 2002:a92:c267:0:b0:375:ca62:a418 with SMTP id e9e14a558f8ab-3950e9d74d7mr3061045ab.22.1721156343924; Tue, 16 Jul 2024 11:59:03 -0700 (PDT) Received: from frodo.. (c-73-78-62-130.hsd1.co.comcast.net. [73.78.62.130]) by smtp.googlemail.com with ESMTPSA id 8926c6da1cb9f-4c210f23f1csm75301173.102.2024.07.16.11.59.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 11:59:03 -0700 (PDT) From: Jim Cromie To: linux-kernel@vger.kernel.org, jbaron@akamai.com, gregkh@linuxfoundation.org, daniel.vetter@ffwll.ch, tvrtko.ursulin@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com Subject: [PATCH v9-resend 30/54] drm-dyndbg: adapt drm core to use dyndbg classmaps-v2 Date: Tue, 16 Jul 2024 12:57:42 -0600 Message-ID: <20240716185806.1572048-31-jim.cromie@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240716185806.1572048-1-jim.cromie@gmail.com> References: <20240716185806.1572048-1-jim.cromie@gmail.com> MIME-Version: 1.0 Cc: groeck@google.com, linux-doc@vger.kernel.org, Jim Cromie , yanivt@google.com, intel-gfx@lists.freedesktop.org, kernelnewbies@kernelnewbies.org, linux@rasmusvillemoes.dk, robdclark@gmail.com, dri-devel@lists.freedesktop.org, mcgrof@kernel.org, seanpaul@chromium.org, amd-gfx@lists.freedesktop.org, joe@perches.com, bleung@google.com, intel-gvt-dev@lists.freedesktop.org, ukaszb@chromium.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org dyndbg's CLASSMAP-v1 api was broken; DECLARE_DYNDBG_CLASSMAP tried to do too much. Its replaced by DRM_CLASSMAP_DEFINE, which creates & EXPORTs the classmap when CONFIG_DRM_USE_DYNAMIC_DEBUG=y, for direct reference by drivers. The drivers still use DECLARE_DYNDBG_CLASSMAP for now, so they still redundantly re-declare the classmap, but we can convert the drivers later to DYNDBG_CLASSMAP_USE Signed-off-by: Jim Cromie --- drivers/gpu/drm/drm_print.c | 25 +++++++++++++------------ include/drm/drm_print.h | 8 ++++++++ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c index cf2efb44722c..41f167082042 100644 --- a/drivers/gpu/drm/drm_print.c +++ b/drivers/gpu/drm/drm_print.c @@ -55,18 +55,19 @@ MODULE_PARM_DESC(debug, "Enable debug output, where each bit enables a debug cat #if !defined(CONFIG_DRM_USE_DYNAMIC_DEBUG) module_param_named(debug, __drm_debug, ulong, 0600); #else -/* classnames must match vals of enum drm_debug_category */ -DECLARE_DYNDBG_CLASSMAP(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, 0, - "DRM_UT_CORE", - "DRM_UT_DRIVER", - "DRM_UT_KMS", - "DRM_UT_PRIME", - "DRM_UT_ATOMIC", - "DRM_UT_VBL", - "DRM_UT_STATE", - "DRM_UT_LEASE", - "DRM_UT_DP", - "DRM_UT_DRMRES"); +/* classnames must match value-symbols of enum drm_debug_category */ +DRM_CLASSMAP_DEFINE(drm_debug_classes, DD_CLASS_TYPE_DISJOINT_BITS, + DRM_UT_CORE, + "DRM_UT_CORE", + "DRM_UT_DRIVER", + "DRM_UT_KMS", + "DRM_UT_PRIME", + "DRM_UT_ATOMIC", + "DRM_UT_VBL", + "DRM_UT_STATE", + "DRM_UT_LEASE", + "DRM_UT_DP", + "DRM_UT_DRMRES"); static struct ddebug_class_param drm_debug_bitmap = { .bits = &__drm_debug, diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h index 089950ad8681..b467ee67a281 100644 --- a/include/drm/drm_print.h +++ b/include/drm/drm_print.h @@ -140,6 +140,14 @@ enum drm_debug_category { DRM_UT_DRMRES }; +#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG +#define DRM_CLASSMAP_DEFINE(...) DYNDBG_CLASSMAP_DEFINE(__VA_ARGS__) +#define DRM_CLASSMAP_USE(name) DYNDBG_CLASSMAP_USE(name) +#else +#define DRM_CLASSMAP_DEFINE(...) +#define DRM_CLASSMAP_USE(name) +#endif + static inline bool drm_debug_enabled_raw(enum drm_debug_category category) { return unlikely(__drm_debug & BIT(category)); -- 2.45.2 _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies