It turns out that some important native debugging/profiling tools (e.g.
perf) rely solely on symbol tables for function name resolution (as
opposed to using DWARF DIEs). However, previously GHC would emit
temporary symbols (e.g.
.La42b) to identify module-internal
entities. Such symbols are dropped during linking and therefore not
visible to runtime tools (in addition to having rather un-helpful unique
names). As a result,
perf report would often end up attributing all
cost to the libc
frame_dummy symbol since Haskell code was no covered
by any proper symbol (see #17605 (closed)).
We now rather follow the model of C compilers and emit
descriptively-named local symbols for module internal things. Since this
will increase object file size this behavior can be disabled with the
perf record can finally be used against Haskell executables.
Even more, with
perf annotate provides inline source code.
Measure object size overhead
Determine whether the special case in
Outputable Nameis worthwhile; maybe we should just always emit the long-form label
Perhaps this should be enabled by