ObserverWeb.Tracer.Tool.CallSeq (Observer Web v0.2.5)

View Source

Builds an indented call-sequence tree per process: every traced call is an "enter" line and every matching return is an "exit" line, indented by nesting depth.

Ported and adapted from https://github.com/gabiz/tracer's Tracer.Tool.CallSeq:

  • Drops the start_match/started gating - upstream can trace a whole process but only start recording once a specific function is called. Observer Web already scopes which functions can be traced from the Profiling page's own function picker, so there's no separate "start match" concept to gate on - every entry/exit is recorded from the start.
  • Drops the show_args/show_return toggles - both are always shown here. Arguments need the call_seq match spec (ObserverWeb.Tracer.Tool.forced_match_spec_keys/1 forces it in), and return values come for free once return_trace() is set, so there's no extra cost to always including them.
  • max_depth is a fixed internal safety cap rather than an init option, to keep runaway recursion from growing a process's stack unbounded.

Summary

Functions

Finalizes into a flat, ordered list of %{node:, pid:, pid_label:, depth:, type:, mod:, fun:, arity:, detail:} maps - detail holds the call arguments on :enter and the return value on :exit, and pid_label is the process's registered name when it has one (see ObserverWeb.Tracer.Tool.process_label/1), the pid otherwise. Depth here is recomputed fresh per pid from the (already max-depth-capped) stack, so it's always a valid 0-based nesting level regardless of how deep the untruncated call actually went.

Types

t()

@type t() :: %ObserverWeb.Tracer.Tool.CallSeq{
  depth: %{optional(pid()) => integer()},
  stacks: %{optional(pid()) => list()}
}

Functions

handle_event(state, arg2)

@spec handle_event(
  t(),
  struct()
) :: t()

handle_stop(call_seq)

@spec handle_stop(t()) :: [map()]

Finalizes into a flat, ordered list of %{node:, pid:, pid_label:, depth:, type:, mod:, fun:, arity:, detail:} maps - detail holds the call arguments on :enter and the return value on :exit, and pid_label is the process's registered name when it has one (see ObserverWeb.Tracer.Tool.process_label/1), the pid otherwise. Depth here is recomputed fresh per pid from the (already max-depth-capped) stack, so it's always a valid 0-based nesting level regardless of how deep the untruncated call actually went.

new()

@spec new() :: t()