diff options
author | Lukas Larsson <[email protected]> | 2016-05-11 11:16:16 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2016-05-11 16:48:37 +0200 |
commit | 3471d44a6a5ed5ab038c4cdc76b350119fe745e2 (patch) | |
tree | 629de2dea305b83ee00d685cffe6b8e9533eb7d7 /erts/emulator/test/tracer_SUITE_data | |
parent | 4aea719054a594a06aceb34afca0ea3df65ead77 (diff) | |
download | otp-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/test/tracer_SUITE_data')
-rw-r--r-- | erts/emulator/test/tracer_SUITE_data/tracer_test.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/erts/emulator/test/tracer_SUITE_data/tracer_test.c b/erts/emulator/test/tracer_SUITE_data/tracer_test.c index 8b4be1345d..908f35da9c 100644 --- a/erts/emulator/test/tracer_SUITE_data/tracer_test.c +++ b/erts/emulator/test/tracer_SUITE_data/tracer_test.c @@ -104,16 +104,10 @@ static ERL_NIF_TERM trace(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]) enif_get_tuple(env, argv[1], &state_arity, &state_tuple); - tuple = enif_alloc(sizeof(ERL_NIF_TERM)*(argc+1)); - memcpy(tuple+1,argv,sizeof(ERL_NIF_TERM)*argc); + tuple = enif_alloc(sizeof(ERL_NIF_TERM)*(argc)); + memcpy(tuple,argv,sizeof(ERL_NIF_TERM)*argc); - if (enif_self(env, &self)) { - tuple[0] = enif_make_pid(env, &self); - } else { - tuple[0] = enif_make_atom(env, "undefined"); - } - - msg = enif_make_tuple_from_array(env, tuple, argc + 1); + msg = enif_make_tuple_from_array(env, tuple, argc); enif_get_local_pid(env, state_tuple[1], &to); enif_send(env, &to, NULL, msg); enif_free(tuple); |