[PATCH 0 of 4] Add support for dtrace compatible sdt probes on GNU/Linux

Mark Wielaard mjw at redhat.com
Fri Jul 20 07:34:28 PDT 2012


This is a rebased version of the original patch set from last May against
current hsx/hotspot-main. This version contains an extra patch with a
simple testcase that makes sure that on GNU/Linux systems build with
ENABLE_DTRACE the SDT probes are actually there.

They don't have to be applied all at once. Just apply those in the serie
you feel are good to go. The later patches do depend on the earlier ones.
But I rather see only the first applied and get feedback on why the later
ones aren't good enough yet, than not get anything applied.

Please let me know if there is anything else I can do to get these applied.

The first patch is just a consistency cleanup patch. The JNI Set and
SetStatic Field methods used HS_DTRACE_PROBE_CDECL_N and HS_DTRACE_PROBE_N
directly instead of just using DTRACE_PROBE[N] like all other JNI methods.
This doesn't matter for the Solaris macros, but on GNU/Linux the macros
don't use direct function declarations (which is introduced in the second

The second patch introduces the DTRACE macros for use with the GNU/Linux
SystemTap provided sys/sdt.h. Like Solaris this uses USDT1, but using
macros instead of function declaractions. So it just adds a check for
is only needed there) and defines HS_DTRACE_PROBE[N] for the LINUX case.

The third patch enables the support in the build. I took the approach
used in the make/solaris/dtrace.make and vm.make file with a test to
see whether sys/sdt.h is available or not and printing a notice when
they are not found. In IcedTea there is a more elaborate configure
check to see if a small C++ program can be build with DTRACE probes
in it, but that looked like overkill here.

The last patch introduces a small jtreg based testcase that checks
whether this is a GNU/Linux build with ENABLE_DTRACE and in that case
makes sure the SDT probes are actually there in libjvm.so.

 src/share/vm/prims/jni.cpp                   |  11 +---
 src/share/vm/utilities/dtrace.hpp            |  50 ++++++++++++++++++++-
 make/linux/makefiles/dtrace.make             |  24 +++++++++
 make/linux/makefiles/vm.make                 |   2 +-
 test/serviceability/SDTProbesGNULinuxTest.sh |  68 ++++++++++++++++++++++++++++
 5 files changed, 145 insertions(+), 10 deletions(-)

Patches in separate emails.



More information about the hotspot-dev mailing list