lkml.org 
[lkml]   [2009]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 0/5] simplify the print fmt in the event format files

On Tue, 9 Jun 2009, Ingo Molnar wrote:
>
> >
> > We go from this:
> >
> > print fmt: "irq=%d handler=%s", REC->irq, (char *)((void *)REC + REC->__data_loc_name)
> >
> > to this:
> >
> > format: irq=<int:irq> handler=<string:name>
> >
> > and this:
> >
> > print fmt: "softirq=%d action=%s", REC->vec, ({ static const struct trace_print_flags symbols[] = { { HI_SOFTIRQ, "HI" }, { TIMER_SOFTIRQ, "TIMER" }, { NET_TX_SOFTIRQ, "NET_TX" }, { NET_RX_SOFTIRQ, "NET_RX" }, { BLOCK_SOFTIRQ, "BLOCK" }, { TASKLET_SOFTIRQ, "TASKLET" }, { SCHED_SOFTIRQ, "SCHED" }, { HRTIMER_SOFTIRQ, "HRTIMER" }, { RCU_SOFTIRQ, "RCU" }, { -1, ((void *)0) }}; ftrace_print_symbols_seq (p, REC->vec, symbols); })
> >
> > To this:
> >
> > format: softirq=<int:vec> action=<sym:vec:0=HI,1=TIMER,2=NET_TX,3=NET_RX,4=BLOCK,5=TASKLET,6=SCHED,7=HRTIMER,8=RCU
>
> Introducing new, elaborate description languages is always risky.
> Would there be a way to reuse something existing - ideally some nice
> sub-set of C structure definitions?

I'm open for suggestions. Yeah, I was trying to avoid the new markup, but
C is more for code and not for printing. In fact C sucks for text markup
:-(

But I would also like to avoid a full xml parser in the kernel ;-)

>
> Also, would it be possible to put more newlines into the format, so
> that human inspection is more straightforward. It wont matter to the
> tools.

Actually, you can add newlines in the tags, and they will not affect the
mark up. Well, at least before the numbers. You can have:

<sym:vec:
0=HI,
1=TIMER,
2=NET_TX,
3=NET_RX,
4=BLOCK,
5=TASKLET,
6=SCHED,
7=HRTIMER,
8=RCU>

But actually, this would make it harder on the tools. Since currently my
tool just reads one entire line. But I guess I can fix that too.

-- Steve



\
 
 \ /
  Last update: 2009-06-09 14:59    [from the cache]
©2003-2014 Jasper Spaans. hosted at Digital Ocean