Skip to content
Permalink
Browse files
patching up shorthand for return_trace
  • Loading branch information
ferd committed Aug 29, 2016
1 parent a039ed9 commit 2263a0c520ffe0716784769f495772d85d0ab86b
Showing 2 changed files with 8 additions and 5 deletions.
@@ -31,6 +31,8 @@ all stable changes of the first version of Recon.
- Allow the `return_to` option in `recon_trace`
- More efficient sorting function for procs and ports attributes
(thanks to @zhongwencool and @pichi)
- Allow the usage of `return_trace` in `recon_trace:calls/2-3` instead
of `fun(_) -> return_trace() end`.
- 2.3.1
- Updated `app_deps` script to run with rebar3 dependencies
- Minor docs update
@@ -201,7 +201,7 @@

-type mod() :: '_' | module().
-type fn() :: '_' | atom().
-type args() :: '_' | 0..255 | matchspec() | shellfun().
-type args() :: '_' | 0..255 | return_trace | matchspec() | shellfun().
-type tspec() :: {mod(), fn(), args()}.
-type max() :: max_traces() | max_rate().
-type num_matches() :: non_neg_integer().
@@ -281,7 +281,9 @@ calls(TSpecs = [_|_], Max) ->
%% or
%% ``recon_trace:calls({Mod,Fun,[{'_', [], [{return_trace}]}]}, Max, Opts)'',
%% the important bit being the `return_trace()' call or the
%% `{return_trace}' match spec value.</li>
%% `{return_trace}' match spec value.
%% A short-hand version for this pattern of 'match anything, trace everything'
%% for a function is `recon_trace:calls({Mod, Fun, return_trace})'. </li>
%% </ul>
%%
%% There's a few more combination possible, with multiple trace patterns per call, and more
@@ -471,9 +473,8 @@ validate_pid_specs(PidTerm) ->
validate_tspec(Mod, Fun, Args) when is_function(Args) ->
validate_tspec(Mod, Fun, fun_to_ms(Args));
%% helper to save typing for common actions
validate_tspec(Mod, Fun, trace) ->
validate_tspec(Mod, Fun,
fun_to_ms(fun(_) -> return_trace() end));
validate_tspec(Mod, Fun, return_trace) ->
validate_tspec(Mod, Fun, [{'_', [], [{return_trace}]}]);
validate_tspec(Mod, Fun, Args) ->
BannedMods = ['_', ?MODULE, io, lists],
%% The banned mod check can be bypassed by using

0 comments on commit 2263a0c

Please sign in to comment.