aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.c
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2016-05-11 11:16:16 +0200
committerRickard Green <[email protected]>2016-05-11 16:48:37 +0200
commit3471d44a6a5ed5ab038c4cdc76b350119fe745e2 (patch)
tree629de2dea305b83ee00d685cffe6b8e9533eb7d7 /erts/emulator/beam/erl_process.c
parent4aea719054a594a06aceb34afca0ea3df65ead77 (diff)
downloadotp-3471d44a6a5ed5ab038c4cdc76b350119fe745e2.tar.gz
otp-3471d44a6a5ed5ab038c4cdc76b350119fe745e2.tar.bz2
otp-3471d44a6a5ed5ab038c4cdc76b350119fe745e2.zip
erts: Only allow remove from trace_status callback
Make it so that it is only possible to remove a tracer via returning remove from an erl_tracer. This limition is put in place in order to avoid a lot of lock checking and taking in various places, especially in regards to trace events happening on dirty schedulers.
Diffstat (limited to 'erts/emulator/beam/erl_process.c')
-rw-r--r--erts/emulator/beam/erl_process.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/erts/emulator/beam/erl_process.c b/erts/emulator/beam/erl_process.c
index b50ca6d009..9d895f1867 100644
--- a/erts/emulator/beam/erl_process.c
+++ b/erts/emulator/beam/erl_process.c
@@ -10085,7 +10085,10 @@ Process *schedule(Process *p, int calls)
erts_smp_proc_unlock(p, ERTS_PROC_LOCK_STATUS);
- if (IS_TRACED(p)) {
+ /* Clear tracer if it has been removed */
+ if (IS_TRACED(p) && erts_is_tracer_proc_enabled(
+ p, ERTS_PROC_LOCK_MAIN, &p->common)) {
+
if (state & ERTS_PSFLG_EXITING) {
if (ARE_TRACE_FLAGS_ON(p, F_TRACE_SCHED_EXIT))
trace_sched(p, ERTS_PROC_LOCK_MAIN, am_in_exiting);
@@ -10100,12 +10103,6 @@ Process *schedule(Process *p, int calls)
}
}
-
-#ifdef ERTS_SMP
- /* Clears tracer if it has been removed */
- (void)ERTS_TRACER_PROC_IS_ENABLED(p);
-#endif
-
if (state & (ERTS_PSFLG_RUNNING_SYS
| ERTS_PSFLG_DIRTY_RUNNING_SYS)) {
/*