System information
80 System Analysis and Tuning Guide
tid()
ID of the current thread.
pid()
Process ID of the current thread.
uid()
ID of the current user.
cpu()
Current CPU number.
execname()
Name of the current process.
gettimeofday_s()
Number of seconds since UNIX epoch (January 1, 1970).
ctime()
Convert time into a string.
pp()
String describing the probe point currently being handled.
thread_indent()
Useful function for organizing print results. It (internally) stores an indentation
counter for each thread (tid()). The function takes one argument, an inden-
tation delta, indicating how many spaces to add or remove from the thread's in-
dentation counter. It returns a string with some generic trace data along with an
appropriate number of indentation spaces. The generic data returned includes a
time stamp (number of microseconds since the initial indentation for the thread),
a process name, and the thread ID itself. This allows you to identify what func-
tions were called, who called them, and how long they took.
Call entries and exits often do not immediately precede each other (otherwise
it would be easy to match them). In between a first call entry and its exit, usu-
ally a number of other call entries and exits are made. The indentation counter
helps you match an entry with its corresponding exit as it indents the next func-
tion call in case it is not the exit of the previous one. For an example System-
Tap script using thread_indent() and the respective output, refer to the
SystemTap Tutorial: http://sourceware.org/systemtap/tutori
al/Tracing.html#fig:socket-trace.