dtrace: function boundary tracing (FBT)
This patch implements Function Boundary Tracing (FBT) for x86 and
sparc. It covers generic, x86 and sparc specific changes.
Generic:
A new exported function (which will be provided by each supported
architecture) dtrace_fbt_init() is added to be called from module
code to initiate the discovery of FBT probes. Any eligible probe
(based on arch-dependent logic) is passed to the provided callback
function pointer for processing.
A new option is added to the DTrace kernel config to enable FBT.
The logic for determing the size of the pdata memory block (which
is arch-dependent) has changed at the architecture level, and the
code for setting up the kernel pseudo-module has been modified to
account for that change.
The post-processing script dtrace_sdt.sh is now determining how
many functions exist in the kernel as an upper bound for the amount
of functions that can be traced with FBT. The logic ensures that
aliases are not counted.
x86:
On x86_64, entry FBT probes are implemented similarly to SDT probes on
that same architecture. A trap is triggered from the probe location,
which causes a call into the DTrace core. The entry probe is placed on
the 'mov %rsp,%rbp' instruction that immediately followed a 'push %rbp'
as part of the function prologue. If this instruction sequence is not
found, no entry probe will be created for the function.
sparc:
On sparc64, entry FBT probes are also implemented similar to SDT
probes on that same architecture. A call is made into a trampoline
(allocated within the limited addressing range for a single assembler
instruction) which in turn calls into the DTrace core. The entry probe
is placed on the location where typically a call is made to _mcount for
profiling purposes. Under normal operation, that instruction will be
a NOP.
Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
Acked-by: David Mc Lean <david.mclean@oracle.com>
Reviewed-by: Dhaval Giani <dhaval.giani@oracle.com>
Reviewed-by: Allen Pais <allen.pais@oracle.com>
Orabug:
21220305
Orabug:
24829326