You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The collected traces are stored in an ETS table (default name: `trace`).
133
-
They are stored as [`tr`](https://hexdocs.pm/erlang_doctor/0.2.6/tr.html#t:tr/0) records with the following fields:
133
+
They are stored as [`tr`](https://hexdocs.pm/erlang_doctor/0.2.7/tr.html#t:tr/0) records with the following fields:
134
134
135
135
-`index`: trace identifier, auto-incremented for each received trace.
136
136
-`pid`: process identifier associated with the trace.
@@ -186,7 +186,7 @@ Use `tr:select/0` to select all collected traces.
186
186
```
187
187
188
188
The `tr:select/1` function accepts a fun that is passed to `ets:fun2ms/1`.
189
-
This way you can limit the selection to specific items and select only some fields from the [`tr`](https://hexdocs.pm/erlang_doctor/0.2.6/tr.html#t:tr/0) record:
189
+
This way you can limit the selection to specific items and select only some fields from the [`tr`](https://hexdocs.pm/erlang_doctor/0.2.7/tr.html#t:tr/0) record:
@@ -323,15 +323,15 @@ The third possibility is `output => longest` which does the opposite of pruning,
323
323
ts=1705475521743239,info=no_info}]]
324
324
```
325
325
326
-
Possible [options](https://hexdocs.pm/erlang_doctor/0.2.6/tr.html#t:tb_options/0) for `tr:tracebacks/2` include:
326
+
Possible [options](https://hexdocs.pm/erlang_doctor/0.2.7/tr.html#t:tb_options/0) for `tr:tracebacks/2` include:
327
327
328
328
-`tab` is the table or list which is like the second argument of `tr:filter/2`,
329
329
-`output` - `shortest` (default), `all`, `longest` - see above.
330
330
-`format` - `list` (default), `tree` - returns a call tree instead of a list of tracebacks. Trees don't distinguish between `all` and `longest` output formats.
331
331
-`order` - `top_down` (default), `bottom_up` - call order in each tracaback; only for the `list` format.
332
332
-`limit` - positive integer or `infinity` (default) - limits the number of matched traces. The actual number of tracebacks returned can be smaller unless `output => all`
333
333
334
-
There are also functions `tr:traceback/1` and `tr:traceback/2`. They set `limit` to one and return only one trace if it exists. The options for `tr:traceback/2` are the same as for `tr:traceback/2` except `limit` and `format`. Additionally, it is possible to pass a [`tr`](https://hexdocs.pm/erlang_doctor/0.2.6/tr.html#t:tr/0) record (or an index) directly to `tr:traceback/1` to obtain the traceback for the provided trace event.
334
+
There are also functions `tr:traceback/1` and `tr:traceback/2`. They set `limit` to one and return only one trace if it exists. The options for `tr:traceback/2` are the same as for `tr:traceback/2` except `limit` and `format`. Additionally, it is possible to pass a [`tr`](https://hexdocs.pm/erlang_doctor/0.2.7/tr.html#t:tr/0) record (or an index) directly to `tr:traceback/1` to obtain the traceback for the provided trace event.
335
335
336
336
### Trace ranges for filtered traces: `ranges`
337
337
@@ -355,13 +355,13 @@ To get a list of traces between each matching call and the corresponding return,
355
355
data=1,ts=1705475521750453,info=no_info}]]
356
356
```
357
357
358
-
There is also `tr:ranges/2` - it accepts a [map of options](https://hexdocs.pm/erlang_doctor/0.2.6/tr.html#t:range_options/0), including:
358
+
There is also `tr:ranges/2` - it accepts a [map of options](https://hexdocs.pm/erlang_doctor/0.2.7/tr.html#t:range_options/0), including:
359
359
360
360
-`tab` is the table or list which is like the second argument of `tr:filter/2`,
361
361
-`max_depth` is the maximum depth of nested calls. A message event also adds 1 to the depth.
362
362
You can use `#{max_depth => 1}` to see only the top-level call and the corresponding return.
363
363
364
-
There are two additional function: `tr:range/1` and `tr:range/2`, which return only one range if it exists. It is possible to pass a [`tr`](https://hexdocs.pm/erlang_doctor/0.2.6/tr.html#t:tr/0) record or an index to `tr:range/1` as well.
364
+
There are two additional function: `tr:range/1` and `tr:range/2`, which return only one range if it exists. It is possible to pass a [`tr`](https://hexdocs.pm/erlang_doctor/0.2.7/tr.html#t:tr/0) record or an index to `tr:range/1` as well.
365
365
366
366
### Calling function from a trace: `do`
367
367
@@ -494,7 +494,7 @@ and `Count` is the number of times the tree repeated. The list is sorted by `Tim
494
494
In the example above `fib(2)` was called twice and `fib(1)` was called 3 times,
495
495
what already shows that the recursive implementation is suboptimal.
496
496
497
-
There is also `tr:top_call_trees/1`, which takes a [map of options](https://hexdocs.pm/erlang_doctor/0.2.6/tr.html#t:top_call_trees_options/0), including:
497
+
There is also `tr:top_call_trees/1`, which takes a [map of options](https://hexdocs.pm/erlang_doctor/0.2.7/tr.html#t:top_call_trees_options/0), including:
498
498
-`output` is `reduced` by default, but it can be set to `complete` where subtrees of already listed trees are also listed.
499
499
-`min_count` is the minimum number of times a tree has to occur to be listed, the default is 2.
500
500
-`min_time` is the minimum accumulated time for a tree, by default there is no minimum.
0 commit comments