aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.h
diff options
context:
space:
mode:
authorScott Lystig Fritchie <[email protected]>2012-08-17 03:24:20 -0500
committerScott Lystig Fritchie <[email protected]>2012-08-17 04:39:36 -0500
commit75552bd3bb4e7f3cf4dab81a5c81cf73b1d3fb99 (patch)
tree58b9fbc507fbfe46aeee2311e7f308e8b70d7abf /erts/emulator/beam/erl_nif.h
parentf3c830eddc68d7269d4f48b13ddae40893929573 (diff)
downloadotp-75552bd3bb4e7f3cf4dab81a5c81cf73b1d3fb99.tar.gz
otp-75552bd3bb4e7f3cf4dab81a5c81cf73b1d3fb99.tar.bz2
otp-75552bd3bb4e7f3cf4dab81a5c81cf73b1d3fb99.zip
Relocate bodies of DTrace probes to the statically-linked VM.
Due to various operating systems (in both the DTrace and SystemTap worlds) not fully supporting DTrace probes (or SystemTap-compatibility mode probes) in shared libraries, we relocate those probes to the statically-linked virtual machine. This could be seen as pollution of the pristine VM by a (yet) experimental feature. However: 1. This code can be eliminated completely by the C preprocessor. 2. Leaving the probes in the dyntrace NIF shared library simply does not work correctly on too many platforms. *Many* thanks to Macneil Shonle at Basho for assisting when my RSI-injured fingers gave out. Tested on: * CentOS 5, SystemTap 1.3 * Solaris 10 (note) * Solaris 11 * OpenIndiana 151 * SmartOS 20120809T221258Z * FreeBSD 9.0-RELEASE (note) I had hoped to be able to test CentOS 6 + SystemTap 1.7, but the details of dealing with all dependencies for a 2.6.32-279.5.1.el6.x86_64 kernel are too time consuming right now. (note: Solaris 10 and FreeBSD 9.0-RELEASE can take a long time to compile)
Diffstat (limited to 'erts/emulator/beam/erl_nif.h')
-rw-r--r--erts/emulator/beam/erl_nif.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_nif.h b/erts/emulator/beam/erl_nif.h
index e5d99dc4f1..33e221b44c 100644
--- a/erts/emulator/beam/erl_nif.h
+++ b/erts/emulator/beam/erl_nif.h
@@ -226,6 +226,15 @@ ERL_NIF_INIT_DECL(NAME) \
} \
ERL_NIF_INIT_EPILOGUE
+#if defined(USE_DYNAMIC_TRACE) && (defined(USE_DTRACE) || defined(USE_SYSTEMTAP))
+#define HAVE_USE_DTRACE 1
+#endif
+
+#ifdef HAVE_USE_DTRACE
+ERL_NIF_TERM erl_nif_user_trace_s1(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM erl_nif_user_trace_i4s4(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+ERL_NIF_TERM erl_nif_user_trace_n(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+#endif
#endif /* __ERL_NIF_H__ */