From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Subject: Re: [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled Date: Thu, 6 Dec 2018 10:21:40 +0100 Message-ID: References: <20181205165621.5805-1-michel@daenzer.net> <10fca21a-5d7c-fe9e-07f0-6200e9de538e@amd.com> <154408757908.3572.9138595858555797029@skylake-alporthouse-com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: In-Reply-To: <154408757908.3572.9138595858555797029@skylake-alporthouse-com> Content-Language: en-CA Sender: linux-kernel-owner@vger.kernel.org To: Chris Wilson , "Zhang, Jerry(Junwei)" , Christian Koenig , David Airlie , Huang Rui , Maarten Lankhorst , Maxime Ripard , Sean Paul Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 2018-12-06 10:12 a.m., Chris Wilson wrote: > Quoting Zhang, Jerry(Junwei) (2018-12-06 02:40:42) >> On 12/6/18 12:56 AM, Michel Dänzer wrote: >>> From: Michel Dänzer >>> >>> The following cases are possible for pr_debug(): >>> >>> 1. CONFIG_DYNAMIC_DEBUG disabled >>> a) DEBUG not defined: pr_debug() translates to no_printk(...), i.e. >>> it never generates any output. >>> b) DEBUG defined: pr_debug() translates to printk(KERN_DEBUG ...), >>> i.e. it generates output which doesn't appear in dmesg by default, >>> can be enabled dynamically. >>> >>> 2. CONFIG_DYNAMIC_DEBUG enabled: pr_debug() translates to >>> dynamic_pr_debug() >>> a) DEBUG not defined: dynamic_pr_debug() generates no output by >>> default, can be enabled dynamically. >>> b) DEBUG defined: dynamic_pr_debug() generates output by default, >>> can be disabled dynamically. >>> >>> The intention for drm_debug_printer() is to generate output which >>> doesn't appear in dmesg by default, but can be enabled dynamically, i.e. >>> cases 1b) and 2a). However, defining DEBUG unconditionally gave us 2b) >>> instead of 2a) with CONFIG_DYNAMIC_DEBUG enabled. >>> >>> Fixes: 79a5ad2fdb3c ("drm: Enable pr_debug() for drm_printer") >>> Signed-off-by: Michel Dänzer >> Reviewed-by: Junwei Zhang > > At the cost of 1a? Nah. We still #define DEBUG if CONFIG_DYNAMIC_DEBUG isn't defined, so it's still 1b), not 1a). -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer