lkml.org 
[lkml]   [2020]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH] vsprintf: Add %pv extension replacement for print_vma_addr
On Fri, Aug 14, 2020 at 10:53:03AM -0700, Joe Perches wrote:
> There is a print_vma_addr function used several places
> that requires KERN_CONT use.
>
> Add a %pv mechanism to avoid the need for KERN_CONT.

I like the idea, but I would accent the selling point to make code
(in the user call sites) nicer.

> An example conversion is arch/x86/kernel/signal.c
>
> from:
> if (show_unhandled_signals && printk_ratelimit()) {
> printk("%s"
> "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx",
> task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG,
> me->comm, me->pid, where, frame,
> regs->ip, regs->sp, regs->orig_ax);
> print_vma_addr(KERN_CONT " in ", regs->ip);
> pr_cont("\n");
> to:
> printk("%s"
> "%s[%d] bad frame in %s frame:%p ip:%lx sp:%lx orax:%lx in %pv\n",
> task_pid_nr(current) > 1 ? KERN_INFO : KERN_EMERG,
> me->comm, me->pid, where, frame,
> regs->ip, regs->sp, regs->orig_ax, (void *)regs->ip);

...

> +#else
> + buf = string_nocheck(buf, end, "CONFIG_MMU=n", default_str_spec);
> +#endif

Can we avoid this spammy message? Really it's quite long and fills valuable
space in kernel buffer. I would rather print the hashed pointer as it's done
for the rest of %pXXX.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2020-08-17 13:45    [W:1.838 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site