Return Probes - Red Hat ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE Reference Manual

Systemtap language reference
Hide thumbs Also See for ENTERPRISE LINUX 5.4 - SYSTEMTAP LANGUAGE:
Table of Contents

Advertisement

Chapter 4. Probe points
timer.jiffies(N)
timer.jiffies(N).randomize(M)
The probe handler runs every N jiffies. If the randomize
component is given, a linearly distributed random value in the range [-M ... +M] is added to N every
time the handler executes. N is restricted to a reasonable range (1 to approximately 1,000,000), and M
is restricted to be less than N. There are no target variables provided in either context. Probes can be
run concurrently on multiple processors.
Intervals may be specified in units of time. There are two probe point variants similar to the jiffies timer:
timer.ms(N)
timer.ms(N).randomize(M)
Here, N and M are specified in milliseconds, but the full options for units are seconds (s or sec),
milliseconds (ms or msec), microseconds (us or usec), nanoseconds (ns or nsec), and hertz (hz).
Randomization is not supported for hertz timers.
The resolution of the timers depends on the target kernel. For kernels prior to 2.6.17, timers are
limited to jiffies resolution, so intervals are rounded up to the nearest jiffies interval. After 2.6.17, the
implementation uses hrtimers for tighter precision, though the resulting resolution will be dependent
upon architecture. In either case, if the randomize component is given, then the random value will be
added to the interval before any rounding occurs.
Profiling timers are available to provide probes that execute on all CPUs at each system tick. This
probe takes no parameters, as follows.
timer.profile
Full context information of the interrupted process is available, making this probe suitable for
implementing a time-based sampling profiler.
The following is an example of timer usage.
# Refers to a periodic interrupt, every 1000 jiffies:
timer.jiffies(1000)
# Fires every 5 seconds:
timer.sec(5)
# Refers to a periodic interrupt, every 1000 +/- 200 jiffies:
timer.jiffies(1000).randomize(200)

4.6. Return probes

The .return variant places a probe at the moment of return from the named function, so that the
return value is available as the $return context variable. The entry parameters are also accessible in
20

Advertisement

Table of Contents
loading

Table of Contents