Twine (twine v0.5.2)
Twine is a function call tracer that wraps recon_trace.
Summary
Functions
Clear all existing traces.
Placeholder for ergonomics so iex does not attempt to evaluate the call if one argument is passed. This has no use.
Print all calls that match the given function call either the given number of times (e.g. 10 will print 10 calls), or at a given rate (e.g. {10, 1000} will print 10 calls per second at most). The calls given can also have patterns and/or guards so you can match specific calls.
Identical to print_calls/2, but instead of printing the calls, it sends
them to the calling process. The message will be a TracedCall structure.
If track_outcome is specified as false, then outcome on the structure
will be nil.
Functions
Clear all existing traces.
Placeholder for ergonomics so iex does not attempt to evaluate the call if one argument is passed. This has no use.
Print all calls that match the given function call either the given number of times (e.g. 10 will print 10 calls), or at a given rate (e.g. {10, 1000} will print 10 calls per second at most). The calls given can also have patterns and/or guards so you can match specific calls.
Options:
pid: the pid to print calls for. If omitted, this will run for all pids on the system.arg_mapper: A function to map the arguments of the function before printing it. This can be useful if you are tracing a call on a function that has a very large argument (such as aGenServer's state), and want to reduce it down before printing it. This function must have the same arity as the captured function, and return a list or tuple of the mapped arguments.return_mapper: A function to map the return value of a function before printing it. This can be useful if you are tracing a call on a function that has a very large return value, and want to reduce it down before printing it. This function must have an arity of 1, and return the value directly. If this is supplied withtrack_outcome: false, it will not be called.track_outcome: If true, calls are printed with their outcome (crash, return, exception) once they complete. If false, calls are printed immediately, without waiting for their the outcome. Defaults to false.
Identical to print_calls/2, but instead of printing the calls, it sends
them to the calling process. The message will be a TracedCall structure.
If track_outcome is specified as false, then outcome on the structure
will be nil.