lkml.org 
[lkml]   [2017]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: printk: what is going on with additional newlines?
On Wed, 30 Aug 2017 10:03:48 +0900
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> wrote:

> Hello,
>
> On (08/29/17 19:50), Steven Rostedt wrote:
> [..]
> > > A private buffer has none of those issues.
> >
> > What about using the seq_buf*() then?
> >
> > struct seq_buf s;
> >
> > buf = kmalloc(mysize);
> > seq_buf_init(&s, buf, mysize);
> >
> > seq_printf(&s,"blah blah %d", bah_blah);
> > [...]
> > seq_printf(&s, "my last print\n");
> >
> > printk("%.*s", s.len, s.buffer);
> >
> > kfree(buf);
>
> could do. for a single continuation line printk("%.*s", s.len, s.buffer)
> this will work perfectly fine. for a more general case - backtraces, dumps,
> etc. - this requires some tweaks.

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.

-- Steve

\
 
 \ /
  Last update: 2017-08-30 03:11    [W:0.105 / U:1.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site