From: <za...@us...> - 2004-08-06 21:32:14
|
James Keniston writes: > > > > > > dpr...@ww... wrote on 08/06/2004 07:21:42 > AM: > > > ev...@te... writes: > > > Why is dprobes' output so cryptic? Wouldn't it be convenient if > > > printd("j = %d\n", j) caused > > > > > > "j = 2" to appear in /var/log/messages? > > > > That's what you should see if you use printd in conjunction with the > > tailprint utility included with dpcc, which tails /var/log/messages > > and renders the raw dprobes output human-readable. > > > > The reason things are done this way is that dprobes doesn't have a > > native print function, so as a debugging hack, I cobbled a simple one > > up in rpn code (thus the draconian restriction of only allowing one > > integer param) which uses the dprobes byte-logging instructions to > > simply print the raw bytes out and that lets the equally hackish > > tailprint worry about making sense of it later. > > > > Obviously these are debugging hacks and should just go away, if there > > was a way to do a real 'printk' from within the rpn interpreter... > > ... > > > > -- > > Regards, > > > > Tom Zanussi <za...@us...> > > IBM Linux Technology Center/RAS > > If you have event-logging support in your kernel (CONFIG_EVLOG), you can > log your data via evlog (dprobes --log-target EVL), and use evlview and/or > evlog templates to format your data however you want. (See > http://evlog.sourceforge.net.) > > Leaving fancy data formatting out of the probe program minimizes probe-time > processing, which is a very big concern for dprobes. But that means you > need a user app like tailprint or evlview to do the formatting for you. I agree that minimizing probe-time processing is very important for most dprobes, but for ad-hoc experimentation, being able to printk something and just have it directly appear in the the system log would be really useful IMHO. Whether it's worth the effort considering there are as you point out alternative means is another question, of course... Tom > > Jim Keniston > IBM Linux Technology Center/RAS<html><body> > <p><tt>dpr...@ww... wrote on 08/06/2004 07:21:42 AM:<br> > <br> > > ev...@te... writes:<br> > > > Why is dprobes' output so cryptic? Wouldn't it be convenient if <br> > > > printd("j = %d\n", j) caused <br> > > > <br> > > > "j = 2" to appear in /var/log/messages?<br> > > <br> > > That's what you should see if you use printd in conjunction with the<br> > > tailprint utility included with dpcc, which tails /var/log/messages<br> > > and renders the raw dprobes output human-readable.<br> > > <br> > > The reason things are done this way is that dprobes doesn't have a<br> > > native print function, so as a debugging hack, I cobbled a simple one<br> > > up in rpn code (thus the draconian restriction of only allowing one<br> > > integer param) which uses the dprobes byte-logging instructions to<br> > > simply print the raw bytes out and that lets the equally hackish<br> > > tailprint worry about making sense of it later.<br> > > <br> > > Obviously these are debugging hacks and should just go away, if there<br> > > was a way to do a real 'printk' from within the rpn interpreter...<br> > > ...<br> > > <br> > > -- <br> > > Regards,<br> > > <br> > > Tom Zanussi <za...@us...><br> > > IBM Linux Technology Center/RAS<br> > </tt><br> > <tt>If you have event-logging support in your kernel (CONFIG_EVLOG), you can log your data via evlog (dprobes --log-target EVL), and use evlview and/or evlog templates to format your data however you want. (See <a href="http://evlog.sourceforge.net">http://evlog.sourceforge.net</a>.)</tt><br> > <br> > <tt>Leaving fancy data formatting out of the probe program minimizes probe-time processing, which is a very big concern for dprobes. But that means you need a user app like tailprint or evlview to do the formatting for you.</tt><br> > <br> > <tt>Jim Keniston</tt><br> > <tt>IBM Linux Technology Center/RAS</tt></body></html> -- Regards, Tom Zanussi <za...@us...> IBM Linux Technology Center/RAS |