Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp889580pxb; Fri, 13 Aug 2021 08:30:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9xvLbyvE9X3UYgn2qXhc5ZWPA+PizZ9zRtv9qALJn7QTTqetfDnXWGDfJyaoPVFELa7A8 X-Received: by 2002:aa7:c7d0:: with SMTP id o16mr3810634eds.75.1628868637871; Fri, 13 Aug 2021 08:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628868637; cv=none; d=google.com; s=arc-20160816; b=SUPUQG+wqVxo1oxIclzK+dgu+tzO5358muTrFzy8YZbNO4UZV7zqRMt0URvqxCMvmI q1VIsrugyoLlqIstlxenz4S8oe+pkknGjW9JOjHdrPMLXVD9L3rUQhlUNGYQj2Qg1UHy Omb6eIwviMMZ4iS4YRGhM6CDx6z9dUNjTeHgCxsq/rrGeHpX0WDxgD4Cq9d4jAu8AwDJ o9KiL/1/A+AwqXkeIynSM36Tq3oAE8mnTrKx0y8szSOctMnQWQO3hUHh24AmbSvERbHL hqUiscaNSxaLwTdnIiqNgt/MfPpnu3WoHT3r00h1bGhRPMIYaij8y6Q2HAS2IrW08qII CwVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Di0vKi6q1FQK7H2Iauu5LRuMFu/619Qh3TdTrNtKXuA=; b=JSGa64wXRtL+ZWsi2ISRYcvTH6gRcZa1YQFaGhwU64No/PHaUSS0zRzWNtNubtxKUF WNO4IRzuX7qfj4nqVtoump29/rHD9soVGKCN51QdJ5XPJ17dX0vrTAe3er2zSJ2s3O9E M4nDMMvKmNZ7vY1x0L/+LzK51fR1vEW7CvZgBLMvIFmNy9uz8GnM8UIyfwTmUDxDx+Yq h25Qj1JQZ9A4/AbseU2ClnQ6QutrV06C9oplzxbnXg77BVAZgPQkSPEZmy0ACeydDB0E zgL+fT7DVbYZFrY+CYZ+oVHMvSYB5BVyRyFz2/+Yk8/jkJFGMM5V0wBeIhqGDlgkTZlS /PWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PLbGXNu9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ka17si1944745ejc.609.2021.08.13.08.30.06; Fri, 13 Aug 2021 08:30:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PLbGXNu9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242786AbhHMP0W (ORCPT + 99 others); Fri, 13 Aug 2021 11:26:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243612AbhHMPYb (ORCPT ); Fri, 13 Aug 2021 11:24:31 -0400 Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38B56C0612E7 for ; Fri, 13 Aug 2021 08:20:12 -0700 (PDT) Received: by mail-il1-x12f.google.com with SMTP id k3so11207576ilu.2 for ; Fri, 13 Aug 2021 08:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Di0vKi6q1FQK7H2Iauu5LRuMFu/619Qh3TdTrNtKXuA=; b=PLbGXNu9yoFFMGvAAq7mWxn1nB2oBNSmzMpU++6lMiwMowccbTk69/TgNBK9WRgBI/ mrDIh2aU8WKSoBDTSm2Xxm7nkOt+8PzvzTkQHd/NzYgBZ1EY/zIZSamX/29Ngd3Rbeey ebplp9i5NFP3EVLieSjROCtLIr+3Ge1k/0jjfCS9QBhSA45Y35RYaAy26zOsg0DIKEql BC1U3EZ7B7SuQDlH+s85/RriXjUVwOdiOe8Zyjgj6c9/gxz4EQNl4nQYAKZddQgWMXik rPAIbHMdV72J4KXtWEl43oLdXcSxjk3lmrg3y93MNqiCSsWs9vY81UIf6rKbRN4xoi37 U2jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Di0vKi6q1FQK7H2Iauu5LRuMFu/619Qh3TdTrNtKXuA=; b=M7o/oncEvtSq1k63gG0qvP6ikjhiu3kZxhGx1lQ73wn7xGXGJhyQTqgqQPYbT89ejq 4w5bha1mP8eSRV6mqU49nWK7tQedl0uwLRTHLahXFGot95G4Mn/ZmnhzWUAaMt/0zyQw 1OeDvgUkZbf4U1eC6mZITHz1C96r4FgBvKcreS4x0PQGY/OEdyV1OaWuCHvD/bltnVTJ eUdkX3hyoBGBNVbMGsOrzqag6mmhgaFkDDJVqB5lAr0rr0HzKcyAI7tPaiojhjfMvcEG oQlAezEyXa1eCbzrtVqwnTch3YT/Y6WNdR+jgfYbsnXTpkmzbHB1ggIIDaO1WOAhlBj/ +bCg== X-Gm-Message-State: AOAM531WhJsUkd9zDlAqzWBudXIYh88vIeQRsZO7FxiAvgjepf9lpGd0 4pNI3eaxC+tmEorMUHkB4Zs= X-Received: by 2002:a92:7d0f:: with SMTP id y15mr2194691ilc.10.1628868011655; Fri, 13 Aug 2021 08:20:11 -0700 (PDT) Received: from frodo.. (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id d4sm921145ilo.29.2021.08.13.08.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 08:20:11 -0700 (PDT) From: Jim Cromie To: gregkh@linuxfoundation.org, seanpaul@chromium.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "Pan, Xinhui" , Harry Wentland , Leo Li , Zhenyu Wang , Zhi Wang , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Jason Baron , Hawking Zhang , Tao Zhou , Huang Rui , Kevin Wang , Chengming Gui , Likun Gao , Jim Cromie , John Clements , Ashley Thomas , Aurabindo Pillai , Qingqing Zhuo , Wyatt Wood , Johan Hovold , Jessica Yu , Joe Perches , Miguel Ojeda , Nick Desaulniers , Andrew Morton , Masahiro Yamada , Peter Zijlstra , Andy Shevchenko , "Paul E. McKenney" , Tetsuo Handa , Thomas Gleixner , Vitor Massaru Iha , Sedat Dilek , Changbin Du , Marco Elver , Brendan Higgins , Andrey Konovalov , Albert van der Linde , Zhen Lei , Arvind Sankar , Patricia Alfonso , Arnd Bergmann , Jiri Olsa , Johannes Berg , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, intel-gvt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Subject: [PATCH v5 6/9] amdgpu: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to control categorized pr_debugs Date: Fri, 13 Aug 2021 09:17:14 -0600 Message-Id: <20210813151734.1236324-7-jim.cromie@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210813151734.1236324-1-jim.cromie@gmail.com> References: <20210813151734.1236324-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org logger_types.h defines many DC_LOG_*() categorized debug wrappers. Most of these use DRM debug API, so are controllable using drm.debug, but others use bare pr_debug("$prefix: .."), each with a different class-prefix matching "^\[\w+\]:" Use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create a /sys debug_dc parameter, modinfos, and to specify a map from bits -> categorized pr_debugs to be controlled. Signed-off-by: Jim Cromie --- .../gpu/drm/amd/display/dc/core/dc_debug.c | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_debug.c b/drivers/gpu/drm/amd/display/dc/core/dc_debug.c index 21be2a684393..69e68d721512 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_debug.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_debug.c @@ -36,8 +36,50 @@ #include "resource.h" -#define DC_LOGGER_INIT(logger) +#ifdef DRM_USE_DYNAMIC_DEBUG +/* define a drm.debug style dyndbg pr-debug control point */ +#include + +unsigned long __debug_dc; +EXPORT_SYMBOL(__debug_dc); + +#define _help_(key) "\t " key "\t- help for " key "\n" + +/* Id like to do these inside DEFINE_DYNAMIC_DEBUG_CATEGORIES, if possible */ +#define DC_DYNDBG_BITMAP_DESC(name) \ + "Control pr_debugs via /sys/module/amdgpu/parameters/" #name \ + ", where each bit controls a debug category.\n" \ + _help_("[SURFACE]:") \ + _help_("[CURSOR]:") \ + _help_("[PFLIP]:") \ + _help_("[VBLANK]:") \ + _help_("[HW_LINK_TRAINING]:") \ + _help_("[HW_AUDIO]:") \ + _help_("[SCALER]:") \ + _help_("[BIOS]:") \ + _help_("[BANDWIDTH_CALCS]:") \ + _help_("[DML]:") \ + _help_("[IF_TRACE]:") \ + _help_("[GAMMA]:") \ + _help_("[SMU_MSG]:") + +DEFINE_DYNAMIC_DEBUG_CATEGORIES(debug_dc, __debug_dc, + DC_DYNDBG_BITMAP_DESC(debug_dc), + _DD_cat_("[CURSOR]:"), + _DD_cat_("[PFLIP]:"), + _DD_cat_("[VBLANK]:"), + _DD_cat_("[HW_LINK_TRAINING]:"), + _DD_cat_("[HW_AUDIO]:"), + _DD_cat_("[SCALER]:"), + _DD_cat_("[BIOS]:"), + _DD_cat_("[BANDWIDTH_CALCS]:"), + _DD_cat_("[DML]:"), + _DD_cat_("[IF_TRACE]:"), + _DD_cat_("[GAMMA]:"), + _DD_cat_("[SMU_MSG]:")); +#endif +#define DC_LOGGER_INIT(logger) #define SURFACE_TRACE(...) do {\ if (dc->debug.surface_trace) \ -- 2.31.1