Skip to content

Conversation

@bobrik
Copy link
Contributor

@bobrik bobrik commented Dec 25, 2025

Testing with:

symbolizer, err := blazesym.NewSymbolizer()
if err != nil {
    panic(err)
}

syms, err := symbolizer.Symbolize(3061398, []uint64{0x5639d417c164})
if err != nil {
    panic(err)
}

for _, sym := range syms {
    fmt.Printf("%#v\n", sym)
}

Here's the output:

blazesym.Symbol{Name:"outie", File:"derp.c", Dir:"/home/ivan/.", Line:16, Column:10, Offset:13}
blazesym.Symbol{Name:"middle", File:"derp.c", Dir:"/home/ivan/.", Line:12, Column:10, Offset:0}

It matches blazecli:

$ sudo ../target/debug/blazecli symbolize process --pid 3061398 0x5639d417c164
0x005639d417c164: outie @ 0x1157+0xd /home/ivan/./derp.c:16:10
                  middle @ /home/ivan/./derp.c:12:10 [inlined]
  • Added tests, if you've added code that should be tested
  • Updated the documentation, if you've changed APIs
  • Ensured the test suite passes
  • Made sure your code lints
  • Completed the Contributor License Agreement ("CLA")

Testing with:

```go
symbolizer, err := blazesym.NewSymbolizer()
if err != nil {
    panic(err)
}

syms, err := symbolizer.Symbolize(3061398, []uint64{0x5639d417c164})
if err != nil {
    panic(err)
}

for _, sym := range syms {
    fmt.Printf("%#v\n", sym)
}
```

Here's the output:

```
blazesym.Symbol{Name:"outie", File:"derp.c", Dir:"/home/ivan/.", Line:16, Column:10, Offset:13}
blazesym.Symbol{Name:"middle", File:"derp.c", Dir:"/home/ivan/.", Line:12, Column:10, Offset:0}
```

It matches blazecli:

```
$ sudo ../target/debug/blazecli symbolize process --pid 3061398 0x5639d417c164
0x005639d417c164: outie @ 0x1157+0xd /home/ivan/./derp.c:16:10
                  middle @ /home/ivan/./derp.c:12:10 [inlined]
```
@meta-cla meta-cla bot added the cla signed label Dec 25, 2025
@bobrik
Copy link
Contributor Author

bobrik commented Dec 25, 2025

I find myself needing ELF based symbolication and I think this needs to be a standalone Go library. I can make one, but perhaps facebook people should own it instead, given that they own blazesym itself?

@d-e-s-o, let me know what you think.

@d-e-s-o
Copy link
Contributor

d-e-s-o commented Dec 29, 2025

@bobrik I don't think we are going to maintain a second symbolization library just for the sake of having a pure Go implementation, assuming that is what you are asking. Can you help me better understand what the problem you are facing is?

@bobrik
Copy link
Contributor Author

bobrik commented Dec 29, 2025

I'm not suggesting a pure Go library. My suggestion is a Go wrapper around C bindings, same as we have here, but in a separate project just for blazesym (as opposed to a part of facebook/dns).

The problem I'm facing is that I would like to use blazesym from Go. The only Go library is a part of facebook/dns here:

It is weird to import facebook/dns for symbolication and it's quite limited in what it actually provides at the moment.

@meta-codesync
Copy link

meta-codesync bot commented Dec 29, 2025

@virtyaluk has imported this pull request. If you are a Meta employee, you can view this in D89894658.

@d-e-s-o
Copy link
Contributor

d-e-s-o commented Dec 29, 2025

I see; different "standalone" then. Yeah, that would make sense. I think we can provide "official" bindings that reside in the blazesym repository itself (where we do have test binaries, testing infra, and it's easiest to keep everything in-sync), but we don't really have Go expertise on the team. So I think it would be best if at least the initial version would be contributed by the community. Given that it sounds as if you considered writing such a library, perhaps that's something you'd be interested in upstreaming?

I think the main hurdle/questionmark from my perspective would be how to make the Rust usage transparent to users, so I suspect that will need a bit more discussion. I am being told that perhaps pre-built binaries may be the most idiomatic way to go, but I don't have the necessary Go-overview here.

@bobrik
Copy link
Contributor Author

bobrik commented Dec 30, 2025

I made libbpf/blazesym#1402. Lets move the discussion there.

@meta-codesync
Copy link

meta-codesync bot commented Jan 5, 2026

@virtyaluk merged this pull request in e43fa1f.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants