Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10598031imu; Thu, 6 Dec 2018 03:54:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xn7e6oGWgdFjYl0sluP5MlEukRolI7XM50cTQk1LEtwwCU9HGoXK1c44q+SmWPSm8e6sWr X-Received: by 2002:a17:902:2aaa:: with SMTP id j39mr28659341plb.335.1544097266752; Thu, 06 Dec 2018 03:54:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544097266; cv=none; d=google.com; s=arc-20160816; b=mfFKW0T+whpQyDCxtLUlFtI5NEcOrmoOQLlPWCCu3rfzclVvdWosduu2ejKdMRpT7w Aw86l8ezZV1OoMmKqooDtPCpfSz+irbSJuqcKk75Uobx+AXYmjyyn2X7OmfNSFsVO5xP aMMqCh1igrrMfJOUMpIK6vphgsaSWx9QxYX904ui573+6eQjhTR5unaqRhDl7Thn/WpJ OYXA3jQQdY8LK39syXJw510LLc4jLIZSpiEj6TFa/Bn+N2d2bNC2hcDsTowBoEI7M9Pe iIBAhaGDigy6YRn8ynFjXgjuEXj5WNK3BvnMbRl56+S78hCQnnjewLqt3b2n2b1PTzSF q/bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=uWa4oJJIPAeyHas7PWCeglNzN2cZoVgfj5RC/OvK+6E=; b=BzOb4rBmxkbGJsS3ffCxqD6qIrGhGeaiBab3J4KfnxVqvUw2yn3eIiFHqnZiqf8Z/w VITEL9InWa5n7iMtBcTGx34GMV4qdBINgxmUkL4CxK9DSc5mfOPf132XUwRXsvvuGNOj dDcYW8dznYq3pm0fQb57s2J5v0/Gp7vIq++ecpQqePblZHmzPxLA/qqabrpufVlJLqOh y0XukcwqCeZZ9tqgiSyNR5R1D+hQHdapbMhM5aAViffVuaKLnGoo0vngCWa2PNNCfks9 Xs8ouxpG/ON5MzxiRwOGDYLPz4PaD+jkn2RV/hsADKe7jcwLlvC9guYPI0PKV4rfl1Tl 3xXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f65si126369pfb.194.2018.12.06.03.54.10; Thu, 06 Dec 2018 03:54:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729490AbeLFLwn (ORCPT + 99 others); Thu, 6 Dec 2018 06:52:43 -0500 Received: from mail.netline.ch ([148.251.143.178]:58821 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727832AbeLFLwm (ORCPT ); Thu, 6 Dec 2018 06:52:42 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 5A2192A604D; Thu, 6 Dec 2018 12:52:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id flDF4AXnm3VD; Thu, 6 Dec 2018 12:52:34 +0100 (CET) Received: from thor (39.1.199.178.dynamic.wline.res.cust.swisscom.ch [178.199.1.39]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id 05D502A604B; Thu, 6 Dec 2018 12:52:33 +0100 (CET) Received: from localhost ([::1]) by thor with esmtp (Exim 4.91) (envelope-from ) id 1gUsCn-0005i3-NV; Thu, 06 Dec 2018 12:52:33 +0100 Subject: Re: [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is disabled To: Joe Perches , "Zhang, Jerry(Junwei)" , Christian Koenig , Huang Rui , Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Chris Wilson Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org References: <20181205165621.5805-1-michel@daenzer.net> <10fca21a-5d7c-fe9e-07f0-6200e9de538e@amd.com> <1586a49594d30b4bf4d88eba0d258e21efd26da2.camel@perches.com> <276fbf7f-d33f-83a5-cb88-bd4051dc03ba@daenzer.net> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Openpgp: preference=signencrypt Autocrypt: addr=michel@daenzer.net; prefer-encrypt=mutual; keydata= mQGiBDsehS8RBACbsIQEX31aYSIuEKxEnEX82ezMR8z3LG8ktv1KjyNErUX9Pt7AUC7W3W0b LUhu8Le8S2va6hi7GfSAifl0ih3k6Bv1Itzgnd+7ZmSrvCN8yGJaHNQfAevAuEboIb+MaVHo 9EMJj4ikOcRZCmQWw7evu/D9uQdtkCnRY9iJiAGxbwCguBHtpoGMxDOINCr5UU6qt+m4O+UD /355ohBBzzyh49lTj0kTFKr0Ozd20G2FbcqHgfFL1dc1MPyigej2gLga2osu2QY0ObvAGkOu WBi3LTY8Zs8uqFGDC4ZAwMPoFy3yzu3ne6T7d/68rJil0QcdQjzzHi6ekqHuhst4a+/+D23h Za8MJBEcdOhRhsaDVGAJSFEQB1qLBACOs0xN+XblejO35gsDSVVk8s+FUUw3TSWJBfZa3Imp V2U2tBO4qck+wqbHNfdnU/crrsHahjzBjvk8Up7VoY8oT+z03sal2vXEonS279xN2B92Tttr AgwosujguFO/7tvzymWC76rDEwue8TsADE11ErjwaBTs8ZXfnN/uAANgPLQjTWljaGVsIERh ZW56ZXIgPG1pY2hlbEBkYWVuemVyLm5ldD6IXgQTEQIAHgUCQFXxJgIbAwYLCQgHAwIDFQID AxYCAQIeAQIXgAAKCRBaga+OatuyAIrPAJ9ykonXI3oQcX83N2qzCEStLNW47gCeLWm/QiPY jqtGUnnSbyuTQfIySkK5AQ0EOx6FRRAEAJZkcvklPwJCgNiw37p0GShKmFGGqf/a3xZZEpjI qNxzshFRFneZze4f5LhzbX1/vIm5+ZXsEWympJfZzyCmYPw86QcFxyZflkAxHx9LeD+89Elx bw6wT0CcLvSv8ROfU1m8YhGbV6g2zWyLD0/naQGVb8e4FhVKGNY2EEbHgFBrAAMGA/0VktFO CxFBdzLQ17RCTwCJ3xpyP4qsLJH0yCoA26rH2zE2RzByhrTFTYZzbFEid3ddGiHOBEL+bO+2 GNtfiYKmbTkj1tMZJ8L6huKONaVrASFzLvZa2dlc2zja9ZSksKmge5BOTKWgbyepEc5qxSju YsYrX5xfLgTZC5abhhztpYhGBBgRAgAGBQI7HoVFAAoJEFqBr45q27IAlscAn2Ufk2d6/3p4 Cuyz/NX7KpL2dQ8WAJ9UD5JEakhfofed8PSqOM7jOO3LCA== Message-ID: Date: Thu, 6 Dec 2018 12:52:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-12-06 12:41 p.m., Joe Perches wrote: > On Thu, 2018-12-06 at 10:23 +0100, Michel Dänzer wrote: >> On 2018-12-06 3:51 a.m., Joe Perches wrote: >>> On Thu, 2018-12-06 at 10:40 +0800, Zhang, Jerry(Junwei) wrote: >>>> 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") >>> >>> I very much doubt this is a fix. >>> >>> Did you read the commit log for this commit? >>> >>> It says "make sure it will always produce output" >> >> I thought the commit log covered this, suggestions for improvement welcome. >> >> Chris' change addressed case 1a), but also took us from 2a) to 2b). But >> we want 2a) > >> I suspect Chris missed that pr_debug()'s output is visible by default if >> CONFIG_DYNAMIC_DEBUG and DEBUG are both defined. > > I believe you and Chris have different goals and that your > point of 2b is > misguided. > > I think the language used in the Chris' commit log is > plain ans obvious. 'always produce output'. That was probably meant as "make sure there always can be output", which isn't the case with 1a (no_printk suppresses the output at compile time, the strings might not even exist in the binaries). In contrast to the 2b case, the pr_debug output isn't visible by default with 1b, so the latter doesn't fit "always produce output" either. But Chris' initial follow-up in this thread seems to confirm my assumption that his change was about 1a/b. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer