aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_bif_trace.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-10-04 10:24:56 +0200
committerLukas Larsson <[email protected]>2016-10-04 11:01:33 +0200
commitb001b56e061454f3175d9d9a99e2efb945a696b9 (patch)
tree2cd036b6c45efe1fc67cf64b33a818f330840ca0 /erts/emulator/beam/erl_bif_trace.c
parent3f3f25b23379b1afb15cc97462cf5d385690f5a0 (diff)
downloadotp-b001b56e061454f3175d9d9a99e2efb945a696b9.tar.gz
otp-b001b56e061454f3175d9d9a99e2efb945a696b9.tar.bz2
otp-b001b56e061454f3175d9d9a99e2efb945a696b9.zip
erts: Do tracer liveness check on current tracer
This fixes a fault introduced in 19.0 where an invalid tracer would block setting of a new tracer on a process.
Diffstat (limited to 'erts/emulator/beam/erl_bif_trace.c')
-rw-r--r--erts/emulator/beam/erl_bif_trace.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/beam/erl_bif_trace.c b/erts/emulator/beam/erl_bif_trace.c
index 66e5146da0..96275eb228 100644
--- a/erts/emulator/beam/erl_bif_trace.c
+++ b/erts/emulator/beam/erl_bif_trace.c
@@ -512,7 +512,7 @@ start_trace(Process *c_p, ErtsTracer tracer,
&& !ERTS_TRACER_COMPARE(ERTS_TRACER(port), tracer)) {
/* This tracee is already being traced, and not by the
* tracer to be */
- if (erts_is_tracer_enabled(tracer, common)) {
+ if (erts_is_tracer_enabled(ERTS_TRACER(port), common)) {
/* The tracer is still in use */
return 1;
}
@@ -715,8 +715,8 @@ Eterm erts_internal_trace_3(BIF_ALIST_3)
Process* tracee_p = erts_pix2proc(i);
if (! tracee_p)
continue;
- start_trace(p, tracer, &tracee_p->common, on, mask);
- matches++;
+ if (!start_trace(p, tracer, &tracee_p->common, on, mask))
+ matches++;
}
}
if (ports || mods) {
@@ -730,8 +730,8 @@ Eterm erts_internal_trace_3(BIF_ALIST_3)
state = erts_atomic32_read_nob(&tracee_port->state);
if (state & ERTS_PORT_SFLGS_DEAD)
continue;
- start_trace(p, tracer, &tracee_port->common, on, mask);
- matches++;
+ if (!start_trace(p, tracer, &tracee_port->common, on, mask))
+ matches++;
}
}
}