diff options
author | Sverker Eriksson <[email protected]> | 2012-02-02 11:47:18 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2012-02-21 12:23:06 +0100 |
commit | e148e9fc3e11eb6e08e2dc94a468dc433864b11b (patch) | |
tree | 285b32baaf5cef8c75b2c5331c05d745246740ce /erts/emulator/beam/beam_bif_load.c | |
parent | 9dbd1dbf260c41878704728adc533ace1a27c1ff (diff) | |
download | otp-e148e9fc3e11eb6e08e2dc94a468dc433864b11b.tar.gz otp-e148e9fc3e11eb6e08e2dc94a468dc433864b11b.tar.bz2 otp-e148e9fc3e11eb6e08e2dc94a468dc433864b11b.zip |
erts: Fix tracing bug for new non-blocking load
Made on_load-tracing always set after commit on active
code_ix when system is still blocked.
Bug caused cprof_SUITE:on_load to fail.
Diffstat (limited to 'erts/emulator/beam/beam_bif_load.c')
-rw-r--r-- | erts/emulator/beam/beam_bif_load.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/erts/emulator/beam/beam_bif_load.c b/erts/emulator/beam/beam_bif_load.c index 8d41c7499d..d241bec441 100644 --- a/erts/emulator/beam/beam_bif_load.c +++ b/erts/emulator/beam/beam_bif_load.c @@ -35,7 +35,7 @@ #include "erl_nif.h" #include "erl_thr_progress.h" -static void set_default_trace_pattern(Eterm module, ErtsCodeIndex); +static void set_default_trace_pattern(Eterm module); static Eterm check_process_code(Process* rp, Module* modp); static void delete_code(Module* modp); static int purge_module(Process*, int module); @@ -114,8 +114,10 @@ load_module_2(BIF_ALIST_2) } res = TUPLE2(hp, am_error, reason); } else { - set_default_trace_pattern(BIF_ARG_1, erts_staging_code_ix()); erts_commit_staging_code_ix(); + if (is_blocking) { + set_default_trace_pattern(BIF_ARG_1); + } res = TUPLE2(hp, am_module, BIF_ARG_1); } @@ -485,7 +487,7 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2) } } modp->curr.code[MI_ON_LOAD_FUNCTION_PTR] = 0; - set_default_trace_pattern(BIF_ARG_1, erts_active_code_ix ()); + set_default_trace_pattern(BIF_ARG_1); } else if (BIF_ARG_2 == am_false) { BeamInstr* code; BeamInstr* end; @@ -513,7 +515,7 @@ BIF_RETTYPE finish_after_on_load_2(BIF_ALIST_2) } static void -set_default_trace_pattern(Eterm module, ErtsCodeIndex code_ix) +set_default_trace_pattern(Eterm module) { int trace_pattern_is_on; Binary *match_spec; @@ -533,8 +535,7 @@ set_default_trace_pattern(Eterm module, ErtsCodeIndex code_ix) match_spec, meta_match_spec, 1, trace_pattern_flags, - meta_tracer_pid, - code_ix); + meta_tracer_pid); } } |