This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Customization of LKET
Li Guanglei ??:
Frank Ch. Eigler ??:
lket_trace_extra is actually a wrapper around printf
> [...]
> I am thinking of revert my changes of lket_trace_extra() to
> translator.
I though of another way of allowing the user add arbitrary extra trace
data using just printf. It has the same convenience as deprecated
lket_trace_extra(), no flag/%2n is needed, no changes to translator is
needed, and user can call printf() multiple times. I implemented it
and tested it for a while, and it worked fine for me.
And I think we can also add a function register_user_event() whose
signature is:
function register_user_event(grpid:long, hookid:long, fmt:string,
name:string)
Then event register provides a way to tell the post-processing app the
data/name of the extra trace data
The following shows an example of the above:
probe addevent.regevt
{
register_user_event(GROUP_NETDEV, HOOKID_NETDEV_RECEIVE,
"STRING:INT8:INT16", "sample string:sample id1:sample id2")
}
probe addevent.netdev.receive
{
printf("%0s%1b%2b", "sample str", 11, 112)
}
Basically, this new way of user customizable tracing is done by a
function named update_record() which will is called in a epilogue mode
alias so it will be the last one to be called and it will update the
total length of the trace data according to _stp_pbuf_len[cpu],
including those logged by _lket_trace() and printf(). Every trace
record has the format of:
total_len, sys_len(without user trace data), groupid, hookid, ...
it shows that the size of context will increase from 6608 to 51408 if
MAXSTRINGLEN is defined as 1024. Seems acceptable, right?
I want also delete backtrace() function now. If a user want to print
backtrace, he can just use printf and backtrace() function, e.g:
printf("%1b%0s", 11, backtrace())
Any comments?
- Guanglei