aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_trace.c
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2014-03-20 13:11:35 +0100
committerBjörn Gustavsson <[email protected]>2014-03-20 13:11:35 +0100
commit4e982a63474d1ab92544662d34a75a8303733fbe (patch)
tree3299a192395c10831824dee2a1aa0ed186fc00f4 /erts/emulator/beam/erl_trace.c
parenta265552f764ee034ba71883bdb33a6c394224ce3 (diff)
parent9327904dcbf2708823c05baa7532783fb0214792 (diff)
downloadotp-4e982a63474d1ab92544662d34a75a8303733fbe.tar.gz
otp-4e982a63474d1ab92544662d34a75a8303733fbe.tar.bz2
otp-4e982a63474d1ab92544662d34a75a8303733fbe.zip
Merge branch 'bjorn/erts/fix-lingering-tracer'
* bjorn/erts/fix-lingering-tracer: Teach the call_time trace to notice when the trace dies (non-SMP system)
Diffstat (limited to 'erts/emulator/beam/erl_trace.c')
-rw-r--r--erts/emulator/beam/erl_trace.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_trace.c b/erts/emulator/beam/erl_trace.c
index 6978a5f11a..305058ceff 100644
--- a/erts/emulator/beam/erl_trace.c
+++ b/erts/emulator/beam/erl_trace.c
@@ -151,6 +151,11 @@ do { \
message dispatcher thread takes care of that). */
#define ERTS_GET_TRACER_REF(RES, TPID, TRACEE_FLGS) \
do { (RES) = (TPID); } while(0)
+int
+erts_is_tracer_proc_valid(Process* p)
+{
+ return 1;
+}
#else
#define ERTS_NULL_TRACER_REF NULL
#define ERTS_TRACER_REF_TYPE Process *
@@ -163,6 +168,20 @@ do { \
return; \
} \
} while (0)
+int
+erts_is_tracer_proc_valid(Process* p)
+{
+ Process* tracer;
+
+ tracer = erts_proc_lookup(ERTS_TRACER_PROC(p));
+ if (tracer && ERTS_TRACE_FLAGS(tracer) & F_TRACER) {
+ return 1;
+ } else {
+ ERTS_TRACER_PROC(p) = NIL;
+ ERTS_TRACE_FLAGS(p) = ~TRACEE_FLAGS;
+ return 0;
+ }
+}
#endif
static Uint active_sched;