Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support symbol demangling #50

Closed
danielocfb opened this issue Feb 2, 2023 · 3 comments
Closed

Support symbol demangling #50

danielocfb opened this issue Feb 2, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@danielocfb
Copy link
Collaborator

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.

@danielocfb danielocfb changed the title automatic demangling symbol demangling Feb 2, 2023
@ThinkerYzu1
Copy link
Collaborator

ThinkerYzu1 commented Feb 2, 2023

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.

@anakryiko
Copy link
Member

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.

@danielocfb danielocfb added help wanted Extra attention is needed good first issue Good for newcomers labels May 31, 2023
@danielocfb danielocfb changed the title symbol demangling Support symbol demangling Jun 5, 2023
@danielocfb danielocfb added the enhancement New feature or request label Jun 7, 2023
@d-e-s-o d-e-s-o self-assigned this Jun 9, 2023
@d-e-s-o d-e-s-o removed the good first issue Good for newcomers label Jun 9, 2023
@danielocfb danielocfb removed the help wanted Extra attention is needed label Jun 15, 2023
@danielocfb
Copy link
Collaborator Author

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).

d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 24, 2023
TODO: Need more tests for different languages.

This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 24, 2023
TODO: Need more tests for different languages.

This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 24, 2023
TODO: Need more tests for different languages.

This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 24, 2023
TODO: Need more tests for different languages.

This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 24, 2023
TODO: Need more tests for different languages.

This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 24, 2023
TODO: Need more tests for different languages.

This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue Jul 25, 2023
TODO: Need more tests for different languages.

This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.
Note that this change only provides *de*mangling support. That is, it
hooks into the APIs mapping addresses to human readable symbols. The
inverse, mapping human readable and potentially *un*mangled symbols to
their mangled counterparts and then to addresses is not currently being
done (that would be a useful addition to the inspect module, but is out
of the scope of this change).

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
danielocfb pushed a commit to danielocfb/blazesym that referenced this issue Jul 26, 2023
This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.
Note that this change only provides *de*mangling support. That is, it
hooks into the APIs mapping addresses to human readable symbols. The
inverse, mapping human readable and potentially *un*mangled symbols to
their mangled counterparts and then to addresses is not currently being
done (that would be a useful addition to the inspect module, but is out
of the scope of this change).

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 26, 2023
This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.
Note that this change only provides *de*mangling support. That is, it
hooks into the APIs mapping addresses to human readable symbols. The
inverse, mapping human readable and potentially *un*mangled symbols to
their mangled counterparts and then to addresses is not currently being
done (that would be a useful addition to the inspect module, but is out
of the scope of this change).

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
d-e-s-o added a commit to d-e-s-o/blazesym that referenced this issue Jul 26, 2023
This change adds support for transparent demangling of symbols.
Demangling is generally runtime configurable (via the previously added
Builder flag), but because it involves additional dependencies there is
also the option to disable it at compile time. If disabled at compile
time, the runtime option becomes a no-op.
Demangling currently happens in a single location inside the
Symbolizer type. This has the advantage of concentrating the feature's
implementation. However, it means that we need to bubble up the inferred
language from all resolvers -- something that the recently added IntSym
type helps us with.
Note that this change only provides *de*mangling support. That is, it
hooks into the APIs mapping addresses to human readable symbols. The
inverse, mapping human readable and potentially *un*mangled symbols to
their mangled counterparts and then to addresses is not currently being
done (that would be a useful addition to the inspect module, but is out
of the scope of this change).

Closes: libbpf#50

Signed-off-by: Daniel Müller <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants