Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp888583pxb; Fri, 13 Aug 2021 08:29:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+Bt91nX1tLpqzkrVHvP8jsPvg7xB/UqlMkIozAt4DwtazPVccTVQePZOfMPc46DHprODy X-Received: by 2002:a50:fd87:: with SMTP id o7mr3900957edt.289.1628868561272; Fri, 13 Aug 2021 08:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628868561; cv=none; d=google.com; s=arc-20160816; b=JMu3dtTCP9ewrIhZJA+gMg32p3XPs988+MnQEwynt2M04bqqNOIa8zmRaXjLFt+geK YZeebg4zhfizbHy8gHf81RLmNyozPqNzGu3i9V7D5gii1rDpMJ5RG/mnLUCkIDRJ+/YH FSmS2I6uGw02Rcp1Rejh6ys3WN1/xVwFm5nG1p9Gob2FcY9n/O7MWxJ7Z1Xqze4MW5Ky n0D4wHP6PfXI9aad0WBqop7XhWHpEy6YwRY/WsuJ6vvMjjQwyfSM40rTJ0nSqKGcfU42 as9grhoJctTENUttCdYaxLDXpapeUlOMkoETkBVY9c5uVCbNYZE7hCJTnFoTrphTENCc Yv6w== 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=j0nfnl+luadMfBENeONGcQqctQXuoRc2drfaC6JFN/A=; b=cqvndSYWLkw+NHAMU+hMfSPScRjY18xrAgcKUppjxn1LWQxUXbEvgcByA8tqJEdVNZ Nk/Rxve+bzCu/32Ul7cFpwBaFEayUvEwaO4GJEiUq5tqmXA6QJ8oOhictMGps8s1ADkX qgmyZRsguuw07BiAT2dfaN5KMp11e5nhgKMf6xkNI+hJOACk6pLW7TKbgutefej+jyJU G/WZOXANk9eT5Col7NjScfrS0283+V3l8JnJJeK1xP7OJRzw16gQTql3yhUAZ/FvQiqT Y/UjFWsqHQUfwhpxmNkG9Uh2gPweBP3TUe0jFahxcOHTaOjj+U2Jxg7+fqQJtv4/Fl95 PBpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GBZRjmAO; 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 ch14si1714127ejb.650.2021.08.13.08.28.52; Fri, 13 Aug 2021 08:29:21 -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=GBZRjmAO; 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 S242740AbhHMP0T (ORCPT + 99 others); Fri, 13 Aug 2021 11:26:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243602AbhHMPYb (ORCPT ); Fri, 13 Aug 2021 11:24:31 -0400 Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77778C06114B for ; Fri, 13 Aug 2021 08:19:50 -0700 (PDT) Received: by mail-il1-x132.google.com with SMTP id v16so434424ilo.10 for ; Fri, 13 Aug 2021 08:19:50 -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=j0nfnl+luadMfBENeONGcQqctQXuoRc2drfaC6JFN/A=; b=GBZRjmAOPBa5yXLrsf6O+pIflq+4DOa/sjc9rs5KZWMeggk/Ngr5aWNqZAgIoXMGn8 GebO/bbELPJUlaI7iC/OhwxEXhIyJu/9Hy1e/qK7f/1fh01ay9eQpyGdTPzxm8uAi8I3 19J/zTBka6VYFLN/2kRRN863UF8MrVWdP4wheNKM6C+cGh6hFECEU3FafnSa//s0+JlX qiOZ02YqbRg4Omru4M6PiggCD4cMKh11QeNeMxo/LmBRZetzAkxlowAdkhVqaDCY4njg HaukA6BeRCpAIuB0U4Efh/yuaFHs95tAsg4VoxtblGZkWgtjWMOaeYSEbS1I3Y/784C5 FBCQ== 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=j0nfnl+luadMfBENeONGcQqctQXuoRc2drfaC6JFN/A=; b=eYYQHXhmB6PqAMA74Y3AkHQtoHpHWH0Z/NurxkgjGTEfztoLgeU84ER0zI/d019Uqg VChAw5daa15CQtriM+l8HB6P5fpI5Os7nlrCXBTJ/1W7KYDAXNYYypScYYYYC3D7o91d H4QwpkbOHPazAzOs88Ut6qlDoO+36EPjAd2gn37bBfGGUwVp1D0174D4C+9H3tQOleqY T+D+AN7NCmfeL5Uq6ODsFwx2mS19VARA1OEjN6EX2rOtzXoXaLXiaMGjCi2WcwclmPlQ 0Xaf2s2UICJwnHpH28ZQDD6XXtqfUtBnM8c/mA1vVmHbytcYnH4ejVp5TfSVtCG9MiId izlA== X-Gm-Message-State: AOAM531IJ+jBAmeoWAUhZwOLRzehpLYrneF+udTEZNL8earuLhqX8ebe Q/ffyl1Uy67S41TS8IPOCIM= X-Received: by 2002:a92:c841:: with SMTP id b1mr2181218ilq.300.1628867989820; Fri, 13 Aug 2021 08:19:49 -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.19.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Aug 2021 08:19:49 -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 , Le Ma , Chengming Gui , Likun Gao , Dennis Li , Jim Cromie , John Clements , Kevin Wang , Ashley Thomas , Aurabindo Pillai , Qingqing Zhuo , Wyatt Wood , Johan Hovold , Jessica Yu , Miguel Ojeda , Joe Perches , 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 , Andrey Konovalov , Alexander Potapenko , Brendan Higgins , Oliver Glitta , James Bottomley , Arnd Bergmann , Patricia Alfonso , Arvind Sankar , Jiri Olsa , Palmer Dabbelt , 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 5/9] i915/gvt: use DEFINE_DYNAMIC_DEBUG_CATEGORIES to create "gvt:core:" etc categories Date: Fri, 13 Aug 2021 09:17:13 -0600 Message-Id: <20210813151734.1236324-6-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 The gvt component of this driver has ~120 pr_debugs, in 9 categories quite similar to those in DRM. Following the interface model of drm.debug, add a parameter to map bits to these categorizations. DEFINE_DYNAMIC_DEBUG_CATEGORIES(debug_gvt, __gvt_debug, "dyndbg bitmap desc", { "gvt:cmd: ", "command processing" }, { "gvt:core: ", "core help" }, { "gvt:dpy: ", "display help" }, { "gvt:el: ", "help" }, { "gvt:irq: ", "help" }, { "gvt:mm: ", "help" }, { "gvt:mmio: ", "help" }, { "gvt:render: ", "help" }, { "gvt:sched: " "help" }); The actual patch has a few details different, cmd_help() macro emits the initialization construct. if CONFIG_DRM_USE_DYNAMIC_DEBUG, then -DDYNAMIC_DEBUG_MODULE is added cflags, by gvt/Makefile. --- v4+: . static decl of vector of bit->class descriptors - Emil.V . relocate gvt-makefile chunk from elsewhere Signed-off-by: Jim Cromie --- drivers/gpu/drm/i915/gvt/Makefile | 4 ++++ drivers/gpu/drm/i915/i915_params.c | 35 ++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/drivers/gpu/drm/i915/gvt/Makefile b/drivers/gpu/drm/i915/gvt/Makefile index ea8324abc784..846ba73b8de6 100644 --- a/drivers/gpu/drm/i915/gvt/Makefile +++ b/drivers/gpu/drm/i915/gvt/Makefile @@ -7,3 +7,7 @@ GVT_SOURCE := gvt.o aperture_gm.o handlers.o vgpu.o trace_points.o firmware.o \ ccflags-y += -I $(srctree)/$(src) -I $(srctree)/$(src)/$(GVT_DIR)/ i915-y += $(addprefix $(GVT_DIR)/, $(GVT_SOURCE)) + +#ifdef CONFIG_DRM_USE_DYNAMIC_DEBUG +ccflags-y += -DDYNAMIC_DEBUG_MODULE +#endif diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c index e07f4cfea63a..683e942a074e 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -265,3 +265,38 @@ void i915_params_free(struct i915_params *params) I915_PARAMS_FOR_EACH(FREE); #undef FREE } + +#ifdef DRM_USE_DYNAMIC_DEBUG +/* todo: needs DYNAMIC_DEBUG_MODULE in some cases */ + +unsigned long __gvt_debug; +EXPORT_SYMBOL(__gvt_debug); + +#define _help(key) "\t \"" key "\"\t: help for " key "\n" + +#define I915_GVT_CATEGORIES(name) \ + " Enable debug output via /sys/module/i915/parameters/" #name \ + ", where each bit enables a debug category.\n" \ + _help("gvt:cmd:") \ + _help("gvt:core:") \ + _help("gvt:dpy:") \ + _help("gvt:el:") \ + _help("gvt:irq:") \ + _help("gvt:mm:") \ + _help("gvt:mmio:") \ + _help("gvt:render:") \ + _help("gvt:sched:") + +DEFINE_DYNAMIC_DEBUG_CATEGORIES(debug_gvt, __gvt_debug, + I915_GVT_CATEGORIES(debug_gvt), + _DD_cat_("gvt:cmd:"), + _DD_cat_("gvt:core:"), + _DD_cat_("gvt:dpy:"), + _DD_cat_("gvt:el:"), + _DD_cat_("gvt:irq:"), + _DD_cat_("gvt:mm:"), + _DD_cat_("gvt:mmio:"), + _DD_cat_("gvt:render:"), + _DD_cat_("gvt:sched:")); + +#endif -- 2.31.1