]> www.infradead.org Git - users/jedix/linux-maple.git/commit
dtrace: is-enabled probes for SDT
authorKris Van Hees <kris.van.hees@oracle.com>
Wed, 23 Nov 2016 18:24:10 +0000 (18:24 +0000)
committerKris Van Hees <kris.van.hees@oracle.com>
Sat, 24 Dec 2016 06:26:56 +0000 (01:26 -0500)
commitf2a3f85e8cf599f4ae23b9d3bfd4fb272d9b98d2
tree8bb1514c43734fd7fba17fa07ed3753d1dc63b6b
parent5dcf6b3a2dd968431d17ce4bb9496ea27bda35c2
dtrace: is-enabled probes for SDT

This is the module side of the is-enabled probe implementation.  SDT
distinguishes is-enabled probes from normal probes by the leading ? in
their sdpd_name; at probe-firing time, the arch-dependent code arranges
to return 1 appropriately.

On x86, also arrange to jump past the probe's NOP region.  There was no
need to do this before now, because a trap followed by a bunch of NOPs
is a perfectly valid instruction stream: but is-enabled probes have a
three-byte sequence implementing "xor %rax, %rax", and overwriting only
the first byte of that leaves us with a couple of bytes that must be
skipped.  On SPARC, we drop the necessary return-value-changing
instruction into the delay slot of the call that used to be there
before we overwrote it with NOPs;: the instruction already there
is setting up the function argument-and-return-value, which is 0
when the probe is disabled, so we can overwrite it safely.

(We make minor adjustments to allow sdt_provide_probe_arch() to
safely modify the sdp_patchpoint.)

Finally, add a test use of an is-enabled probe to dt_test, used by the
DTrace testsuite.

[nca: sparc implementation, ip address adjustment, commit msg]
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Kris Van Hees <kris.van.hees@oracle.com>
Orabug: 25143173
dtrace/dt_test_dev.c
dtrace/include/dtrace/dtrace_impl_defines.h
dtrace/sdt_dev.c
dtrace/sdt_impl.h
dtrace/sdt_sparc64.c
dtrace/sdt_x86_64.c