libbpf/blazesym

Support symbol demangling

danielocfb opened this issue · 3 comments

We should evaluate whether to add support to demangling of symbols from languages such as C++ or Rust as part of the symbolization process. It's not entirely clear whether it makes sense to integrate that into the library, given that it basically could be done entirely as a close-to-trivial post processing step (with the likes of https://crates.io/crates/symbolic-demangle), but it may be beneficial to do so if we aim to be a completely batteries-included solution.

I am positive about this feature. (opt-in)

One related feature is to look up symbols demangled? I mean mapping from symbol names to addresses. And one function name may match more than one demangled symbol. Although this feature is kind of independent.

given that it basically could be done entirely as a close-to-trivial post processing step

I'd do this as integrated feature, because for C/C++ users of blazesym adding extra Rust library dependency might not be that convenient. This also seems like a very popular feature, so having an option to request this from blazesym directly seems like a good idea.

It may be a bit more work to get this done, at least to get it done properly. Will take care of it. The gist is that at least for DWARF, we probably don't want to just attempt the various demangling schemes but honor the LANG attribute, if available. In addition, last I checked we did not yet report fully qualified names there, so that will need to be fixed (e.g., only new was reported when symbolizing the address of blazesym::Symbolizer::new).