On 16.09.2022 10:32, Michal Orzel wrote:
> On 16/09/2022 10:08, Julien Grall wrote:
>> On 16/09/2022 08:19, Michal Orzel wrote:
>>> Using dprintk results in printing additionally file name and line
>>> number. This is something we do not want when printing regular
>>> information unconditionally as it looks like as if there was some issue.
>> I am OK if you want to switch to a printk() but I disagree with this
>> argument. dprintk() is not about error, it is about anything that
>> doesn't matter in release build.
> 
> In the vast majority of cases, dprintk is used conditionally. That is why
> in the debug build you cannot spot a single line of log starting with
> a file name + line number. That is why I assume this behaviorto be abnormal
> compared to all the other logs.
> 
> If someone adds a printk starting with e.g. "$$$" this is also not a bad
> usage of printk but would result in an inconsistent behavior.
> 
>>
>> I don't think we should just switch to printk() because dprintk() add
>> the line/file. There are message we don't necessarily want to have in
>> release build. So dprintk(XENLOG_INFO, ...) would be right for them.
> 
> I think this is a matter of being consistent.
> We do not have a helper to add printk only for a debug build but without 
> adding
> filename/line number. That is why almost all the dprintks are used 
> conditionally.

FWIW I agree with Julien and I don't view the "conditional" aspect as
relevant to decide whether to use printk() or dprintk().

Jan

Reply via email to