From fe7289591703d5eb151a74a01a278f38497529d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Wed, 20 Apr 2016 20:34:34 +0200 Subject: runtime_tools: Add 'return_to' for call tracing --- lib/runtime_tools/c_src/dyntrace.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib') 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 @@ -454,6 +456,18 @@ static ERL_NIF_TERM trace_call(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv 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_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); -- cgit v1.2.3