mix mob.trace_otp (mob_dev v0.3.37)

Copy Markdown View Source

Runs MobDev.OtpTrace.Harness under full call tracing and reports the runtime modules + MFAs actually exercised.

This is the empirical complement to mix mob.audit_otp (which uses static reachability). Combined, they give a high-confidence answer to "what does any Elixir runtime actually need."

Usage

mix mob.trace_otp                 # Run all phases, summary report
mix mob.trace_otp --phase otp     # Just one phase
mix mob.trace_otp --json out.json # Machine-readable dump

# Trace a real running app on a connected device for 30s.
# First run `mix mob.connect` in another terminal.
mix mob.trace_otp --remote pigeon_ios_defd4bdc@127.0.0.1 --duration 30000

Local mode (default) runs a synthetic Elixir/OTP characterization harness inside the host BEAM. Remote mode wraps :erlang.trace_pattern on a connected device node and captures the MFAs hit during a real user session — drive the app interactively while the trace runs.

Phases

language      pattern match, comprehensions, structs, protocols
collections   Enum, List, Map, MapSet, Stream, Range
strings       String, Binary, charlist, codepoints
processes     spawn, send/receive, monitor, link, Task
otp           GenServer, Supervisor, Application, Logger
data          ETS, persistent_term, Date/Time, System
errors        raise/rescue, throw/catch, exit, exception structs
all           every phase (default)

Output

Plain mode prints a summary + sorted module list. --json writes a JSON file with the full MFA set, suitable for cross-referencing against the static audit (mix mob.audit_otp) to find modules shipped-but-never-called.