lkml.org 
[lkml]   [2013]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] lib/vsprintf: add %pT[C012] format specifier
From
Date
On Sat, 2013-12-28 at 12:08 -0800, Andrew Morton wrote:
> On Sat, 28 Dec 2013 11:53:25 -0800 Joe Perches <joe@perches.com> wrote:
>
> > > > #define PRINTK_PID "\002"
> > > > #define PRINTK_TASK_ID "\003" /* "comm:pid" */

> > > >
> > > > printk(PRINTK_TASK_ID ": hair on fire\n");
> > > >
> > > > It's certainly compact. I doubt if there's any existing code which
> > > > deliberately prints control chars?
> > >
> > > But the rest looks OK to me.
> >
> > Tell me again, what's wrong with using p or current?
> >
> > printk("%pt", current);
>
> Nothing much. It's just that all these callsites are generating the
> code to pass an argument which the callee already has access to.
> Optimizing that will reduce text size a bit.

There have been smaller reductions in code size
than that...

> There's also the matter of providing a standard and abstracted way of
> representing a task, instead of directly accessing its ->comm. But
> that's a separate thing from new printk tokens.

OK then perhaps use KERN_<ATTR> or CURRENT_<ATTR>
rather than PRINTK_<ATTR>





\
 
 \ /
  Last update: 2013-12-28 22:01    [W:0.073 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site