Argus.Extractors.Supervision (Panoptes v0.13.0)

Copy Markdown View Source

Supervision tree extractor.

Analyzes modules that implement the Supervisor or Application behaviour to extract child specifications, restart strategies, and supervision structure.

Approach

Reads the module's attributes to detect @behaviour Supervisor or use Application. For supervisors, inspects init/1; for application modules, inspects start/2. Both paths scan the function's literal table for child spec data. Since child specs are often built at compile time and stored in the literal table, we can extract them without full dataflow analysis.

Emitted facts

  • supervisor(mod, strategy, site) — module is a supervisor with given strategy; site is the instruction ID of the call (or literal) that defines the tree — the strategy line — or "dynamic" when no such instruction was found
  • child_spec_restart(mod, restart) — the restart the module's own child_spec/1 declares
  • post_start_call(func, site, callee) — a call made after a Supervisor.start_link in the same function
  • supervisor_child(sup, position, child_mod, restart, type) — child spec
  • named_process(mod, name) — named process registration detected