diff options
author | Björn-Egil Dahlberg <[email protected]> | 2016-04-20 20:34:34 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2016-04-29 18:31:38 +0200 |
commit | fe7289591703d5eb151a74a01a278f38497529d6 (patch) | |
tree | e888371a16d1e9d30665b1671f8fd16d70b300f5 /lib/runtime_tools | |
parent | a1f50deb9c87cbb7117baf22928c6cd7075ac2e3 (diff) | |
download | otp-fe7289591703d5eb151a74a01a278f38497529d6.tar.gz otp-fe7289591703d5eb151a74a01a278f38497529d6.tar.bz2 otp-fe7289591703d5eb151a74a01a278f38497529d6.zip |
runtime_tools: Add 'return_to' for call tracing
Diffstat (limited to 'lib/runtime_tools')
-rw-r--r-- | lib/runtime_tools/c_src/dyntrace.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/runtime_tools/c_src/dyntrace.c b/lib/runtime_tools/c_src/dyntrace.c index 773a5f67ec..3d940ecd54 100644 --- a/lib/runtime_tools/c_src/dyntrace.c +++ b/lib/runtime_tools/c_src/dyntrace.c @@ -177,6 +177,7 @@ static ERL_NIF_TERM atom_closed; static ERL_NIF_TERM atom_call; static ERL_NIF_TERM atom_return_from; +static ERL_NIF_TERM atom_return_to; static ERL_NIF_TERM atom_exception_from; #endif @@ -239,6 +240,7 @@ static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info) atom_call = enif_make_atom(env,"call"); atom_return_from = enif_make_atom(env,"return_from"); + atom_return_to = enif_make_atom(env,"return_to"); atom_exception_from = enif_make_atom(env,"exception_from"); #endif @@ -461,6 +463,18 @@ static ERL_NIF_TERM trace_call(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv } else { LTTNG3(function_return, pid, undef, 0); } + } else if (argv[0] == atom_return_to) { + const ERL_NIF_TERM* tuple; + int arity; + lttng_decl_mfabuf(mfa); + + if (enif_get_tuple(env, argv[3], &arity, &tuple)) { + enif_get_uint(env, tuple[2], &len); + lttng_mfa_to_str(tuple[0], tuple[1], len, mfa); + LTTNG3(function_return, pid, mfa, 0); + } else { + LTTNG3(function_return, pid, undef, 0); + } } else if (argv[0] == atom_exception_from) { const ERL_NIF_TERM* tuple; int arity; |