Skip to content

Demangling symbols from bcc/bpf does not work #34

@jonhoo

Description

@jonhoo

The ustack function from bpftrace/bcc produces symbols that for some reason cannot be parsed by rustc-demangle, such as:

_ZN100_$LT$tokio_tower..multiplex..server..Server$LT$T$C$S$GT$$u20$as$u20$core..future..future..Future$GT$4poll17hedb49c127bbef1efE+89

To test this yourself, run a Rust program and then bpftrace with something like:

sudo env BPFTRACE_NO_CPP_DEMANGLE=1 bpftrace -e 'profile:hz:1 /pid == '$(pgrep target/debug)'/ { printf("%ld %d %s\n", elapsed, tid, ustack) }'

And look at the resulting symbols. I suspect this is related to the .. characters, but as far as I can tell bcc just reads symbol names from /proc/kallsyms.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions