Re: printk: what is going on with additional newlines?

From: Sergey Senozhatsky
Date: Tue Aug 29 2017 - 22:23:15 EST


On (08/29/17 18:52), Joe Perches wrote:
[..]
> > We could simply add a seq_buf_printk() that is implemented in the printk
> > proper, to parse the seq_buf buffer properly, and add the timestamps and
> > such.
>
> No need. printk would already add timestamps.

the idea is not to do printk() on that seq buffer at all, but to
log_store(), atomically, seq buffer messages

spin_lock(&logbuf_lock)
while (offset < seq_buffer->len) {
...
log_store(seq->buffer + offset);
...
}
spin_unlock(&logbuf_unlock)

-ss