Implementing a generic binary trace interface.

Frank Ch. Eigler fche@redhat.com
Fri Jan 27 02:58:00 GMT 2006


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



More information about the Systemtap mailing list