lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d2a1f009-b2c7-240d-7e1c-e48a08d8ac7d@daenzer.net>
Date:   Thu, 6 Dec 2018 12:52:31 +0100
From:   Michel Dänzer <michel@...nzer.net>
To:     Joe Perches <joe@...ches.com>,
        "Zhang, Jerry(Junwei)" <Jerry.Zhang@....com>,
        Christian Koenig <christian.koenig@....com>,
        Huang Rui <ray.huang@....com>,
        Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <maxime.ripard@...tlin.com>,
        Sean Paul <sean@...rly.run>, David Airlie <airlied@...ux.ie>,
        Chris Wilson <chris@...is-wilson.co.uk>
Cc:     linux-kernel@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: Re: [PATCH 1/2] drm: Only #define DEBUG if CONFIG_DYNAMIC_DEBUG is
 disabled

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 <michel.daenzer@....com>
>>>>>
>>>>> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ