Skip to content

Compiling code for maximum compatibility with magic trace

Clark Gaebel edited this page May 5, 2022 · 4 revisions

Magic-trace relies on debug symbols to select a snapshot symbol and display file/line numbers on functions in traces.

For compatible debug symbols:

  • Enable debug info (e.g. gcc -g, go build -gcflags=-dwarflocationlists=true)
  • Do not enable compressed debug info (e.g. gcc -gz=zlib, go build -ldflags=-compressdwarf=true). Go enables compressed debug info by default, so you should set compressdwarf=false if you want to use magic-trace.
  • Do not enable split debug info (e.g. gcc -gsplit-dwarf)
  • Install debug symbols of system libraries you want to trace
  • In JITed languages, turn on perf maps (e.g. for Java, COMPlus_PerfMapEnabled=1 for C#)
Clone this wiki locally