This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Implementing a generic binary trace interface.
- From: "Frank Ch. Eigler" <fche at redhat dot com>
- To: Martin Hunt <hunt at redhat dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Thu, 26 Jan 2006 21:57:58 -0500
- Subject: Re: Implementing a generic binary trace interface.
- References: <43D645BB.1060804@us.ibm.com> <1138266763.3940.30.camel@monkey2>
hunt wrote:
> [...]
> probe kernel.function("sys_open")
> {
> trace("%d%d%d%s%d", HOOKID_OPEN, $flags, $mode, $filename, $fd)
> }
> [...]
> The trace function would then just directly call _stp_trace(), which
> would be simple to implement.
> [...]
There are several differences between this scheme (basically a printf
with a different back-end function in the runtime) and the others.
The straightforward implementation would require copying of the
individual data values onto and off the stack, a function call,
format string parsing in the runtime, and possible problems with
composing a large trace record from several pieces (e.g. common
timestamps).
Think of my proposed trace() special function as something that is
compiled right down into a single assignment per field. The runtime
would not be called except at the beginning and the end of the probe,
only to reserve and to flush a trace structure.
- FChE