[lkml]   [2019]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [RFC PATCH v1 10/25] printk: redirect emit/store to new ringbuffer
On Wed 2019-02-20 22:25:00, John Ogness wrote:
> On 2019-02-20, Petr Mladek <> wrote:
> >> vprintk_emit and vprintk_store are the main functions that all printk
> >> variants eventually go through. Change these to store the message in
> >> the new printk ring buffer that the printk kthread is reading.
> >
> > Please, are there any candidates or plans to reuse the new ring
> > buffer implementation?
> As you pointed out below, this patch already uses the ring buffer
> implementation for a totally different purpose: NMI safe dynamic memory
> allocation.

I have found an alternative solution. We could calculate the length
of the formatted string without any buffer:

va_list args_copy;

va_copy(args_copy, args);
len = vscprintf(NULL, fmt, args_copy);

This vsprintf() mode was implemented for exactly this purpose.

Best Regards,

 \ /
  Last update: 2019-02-25 13:11    [W:0.246 / U:0.792 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site