Re: [PATCH] printk: inject caller information into the body of message

From: Dmitry Vyukov
Date: Wed Jun 20 2018 - 05:31:35 EST


On Wed, Jun 20, 2018 at 11:18 AM, Sergey Senozhatsky
<sergey.senozhatsky.work@xxxxxxxxx> wrote:
> On (06/20/18 18:06), Sergey Senozhatsky wrote:
>>
>> b) printk_safe output is quite uncommon. And we flush per-CPU buffer
>> from the same CPU which has caused printk_safe output [except for
>> panic() flush] therefore logging the info available to log_store()
>> seemed enough. IOW, once again, was a bit unsure if we want to add
>> some complex code to already complex code, with just one potential
>> user.
>
> BTW, pr_cont() handling is not so simple when we are in printk_safe()
> context. Unlike vprintk_emit() [normal printk], we don't use any
> dedicated pr_cont() buffer in printk_safe. So, at a glance, I suspect
> that injecting context info at every printk_safe_log_store() call for
> `for (...) pr_cont()' loop is going to produce something like this:
> I<10> 23 I<10> 43 I<10> 47 ....
>
> // Hmm, maybe the line will endup having two prefixes. Once
> // from printk_safe_log_store, the other from normal printk
> // log_store().
>
> While the same `for (...) pr_cont()' called from normal printk() context
> will produce
> I<10> 32 43 47 ....
>
> It could be that I'm wrong.
> Tetsuo, have you tested pr_cont() from printk_safe() context?


So this is another reason to get rid of pr_cont entirely, right?