This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Implementing a generic binary trace interface.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]