gdb supports SDT probes in the code. SDT stands for Statically Defined Tracing, and the probes are designed to have a tiny runtime code and data footprint, and no dynamic relocations.
Currently, the following types of probes are supported on ELF-compatible systems:
SystemTap(http://sourceware.org/systemtap/) SDT probes1.
SystemTapprobes are usable from assembly, C and C++ languages2.
DTrace(http://oss.oracle.com/projects/DTrace) USDT probes.
DTraceprobes are usable from C and C++ languages.
SystemTap probes have an associated semaphore variable;
for instance, this happens automatically if you defined your probe
using a DTrace-style .d file. If your probe has a semaphore,
gdb will automatically enable it when you specify a
breakpoint using the ‘-probe-stap’ notation. But, if you put a
breakpoint at a probe's location by some other method (e.g.,
break file:line), then gdb will not automatically set
DTrace probes do not support semaphores.
You can examine the available static static probes using
probes, with optional arguments:
info probes[type] [provider [name [objfile]]]
DTraceprobes. If omitted all probes are listed regardless of their types.
If given, provider is a regular expression used to match against provider names when selecting which probes to list. If omitted, probes by all probes from all providers are listed.
If given, name is a regular expression to match against probe names when selecting which probes to list. If omitted, probe names are not considered when deciding whether to display them.
If given, objfile is a regular expression used to select which
object files (executable or shared libraries) to examine. If not
given, all object files are considered.
info probes all
Some probe points can be enabled and/or disabled. The effect of
enabling or disabling a probe depends on the type of probe being
DTrace probes can be enabled or
SystemTap probes cannot be disabled.
You can enable (or disable) one or more probes using the following commands, with optional arguments:
enable probes[provider [name [objfile]]]
If given, name is a regular expression to match against probe names when selecting which probes to enable. If omitted, probe names are not considered when deciding whether to enable them.
If given, objfile is a regular expression used to select which object files (executable or shared libraries) to examine. If not given, all object files are considered.
disable probes[provider [name [objfile]]]
enable probescommand above for a description of the optional arguments accepted by this command.
A probe may specify up to twelve arguments. These are available at the
point at which the probe is defined—that is, when the current PC is
at the probe's location. The arguments are available using the
convenience variables (see Convenience Vars)
probes each probe argument is an integer of the appropriate size;
types are not preserved. In
DTrace probes types are preserved
provided that they are recognized as such by gdb; otherwise
the value of the probe argument will be a long integer. The
$_probe_argc holds the number of arguments
at the current probe point.
These variables are always available, but attempts to access them at any location other than a probe point will cause gdb to give an error message.
for more information on how to add
probes in your applications.
 See http://sourceware.org/systemtap/wiki/UserSpaceProbeImplementation for a good reference on how the SDT probes are implemented.