aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_bp.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-11-08 09:51:03 +0100
committerRickard Green <[email protected]>2017-01-12 15:22:26 +0100
commit04e119e22a68d686b9e8df17c0a4836c4a5b91ea (patch)
tree59c7519927a8d72a31ae2ff609bd2db5acd29d4a /erts/emulator/beam/beam_bp.c
parent95ec5d385cfba23c770d946871c0197bf374ff3c (diff)
downloadotp-04e119e22a68d686b9e8df17c0a4836c4a5b91ea.tar.gz
otp-04e119e22a68d686b9e8df17c0a4836c4a5b91ea.tar.bz2
otp-04e119e22a68d686b9e8df17c0a4836c4a5b91ea.zip
Return and exception trace for nif-export scheduled BIFs
The support is somewhat primitive, since it is determined at call time if trace on return or exception should be sent.
Diffstat (limited to 'erts/emulator/beam/beam_bp.c')
-rw-r--r--erts/emulator/beam/beam_bp.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/erts/emulator/beam/beam_bp.c b/erts/emulator/beam/beam_bp.c
index 455362f5ae..27329a339e 100644
--- a/erts/emulator/beam/beam_bp.c
+++ b/erts/emulator/beam/beam_bp.c
@@ -32,6 +32,7 @@
#include "erl_binary.h"
#include "beam_bp.h"
#include "erl_term.h"
+#include "erl_nfunc_sched.h"
/* *************************************************************************
** Macros
@@ -805,6 +806,30 @@ erts_bif_trace(int bif_index, Process* p, Eterm* args, BeamInstr* I)
result = func(p, args, I);
+ if (erts_nif_export_check_save_trace(p, result,
+ applying, ep,
+ cp, flags,
+ flags_meta, I,
+ meta_tracer)) {
+ /*
+ * erts_bif_trace_epilogue() will be called
+ * later when appropriate via the NIF export
+ * scheduling functionality...
+ */
+ return result;
+ }
+
+ return erts_bif_trace_epilogue(p, result, applying, ep, cp,
+ flags, flags_meta, I,
+ meta_tracer);
+}
+
+Eterm
+erts_bif_trace_epilogue(Process *p, Eterm result, int applying,
+ Export* ep, BeamInstr *cp, Uint32 flags,
+ Uint32 flags_meta, BeamInstr* I,
+ ErtsTracer meta_tracer)
+{
if (applying && (flags & MATCH_SET_RETURN_TO_TRACE)) {
BeamInstr i_return_trace = beam_return_trace[0];
BeamInstr i_return_to_trace = beam_return_to_trace[0];