#dwarf #elf #stacktrace #tracing #gsym


blazesym is a library for address symbolization and related tasks

9 releases

0.2.0-alpha.8 Nov 2, 2023
0.2.0-alpha.7 Oct 4, 2023
0.2.0-alpha.6 Sep 14, 2023
0.2.0-alpha.5 Aug 10, 2023
0.1.0 Jul 12, 2022

#43 in Debugging

Download history 649/week @ 2023-08-10 320/week @ 2023-08-17 280/week @ 2023-08-24 156/week @ 2023-08-31 188/week @ 2023-09-07 197/week @ 2023-09-14 167/week @ 2023-09-21 253/week @ 2023-09-28 243/week @ 2023-10-05 321/week @ 2023-10-12 318/week @ 2023-10-19 273/week @ 2023-10-26 236/week @ 2023-11-02 363/week @ 2023-11-09 221/week @ 2023-11-16 179/week @ 2023-11-23

1,014 downloads per month
Used in 5 crates (3 directly)

Custom license

10K SLoC

pipeline coverage crates.io Docs rustc


blazesym is a library that can be used to symbolize addresses. Address symbolization is a common problem in tracing contexts, for example, where users want to reason about functions by name, but low level components report only the "raw" addresses (e.g., in the form of stacktraces).

In addition to symbolization, blazesym also provides APIs for the reverse operation: looking up addresses from symbol names. That can be useful, for example, for configuring breakpoints or tracepoints.

The library aims to provide a "batteries-included" experience. That is to say, it tries to do the expected thing by default. When offering such convenience comes at the cost of performance, we aim to provide advanced APIs that allow for runtime configuration of the corresponding features.

blazesym supports a variety of formats, such as DWARF, ELF, and Gsym (see below for an up-to-date list).

The library is written in Rust and provides a first class C API. This crate adheres to Cargo's semantic versioning rules. At a minimum, it builds with the most recent Rust stable release minus five minor versions ("N - 5"). E.g., assuming the most recent Rust stable is 1.68, the crate is guaranteed to build with 1.63 and higher.


blazesym is being actively worked on. Feel free to contribute with discussions, feature suggestions, or code contributions!

As alluded to above, the library provides support for a variety of formats. For symbolization specifically, the following table lays out what features each format supports and whether blazesym can currently use this feature:

Format Feature Supported by format? Supported by blazesym?
ELF symbol size ✔️ ✔️
source code location information ✖️ ✖️
inlined function information ✖️ ✖️
DWARF symbol size ✔️ ✔️
source code location information ✔️ ✔️
inlined function information ✔️ ✔️
Gsym symbol size ✔️ ✔️
source code location information ✔️ ✔️
inlined function information ✔️ ✔️
Ksym symbol size ✖️ ✖️
source code location information ✖️ ✖️
inlined function information ✖️ ✖️

Here is rough roadmap of currently planned features (in no particular order):

Build & Use

blazesym requires a standard Rust toolchain and can be built using the Cargo project manager (e.g., cargo build).


Consumption from a Rust project should happen via Cargo.toml:

blazesym = "=0.2.0-alpha.8"

For a quick set of examples please refer to the examples/ folder. Please refer to the documentation for a comprehensive explanation of individual types and functions.


For C interoperability, the aforementioned build will produce libblazesym.a as well as libblazesym.so in the respective target folder (e.g., <project-root>/target/debug/).

In your C programs include blazesym.h (provided as part of the library) from your source code and then link against the static or shared library, respectively. When linking statically, you may also need to link:

-lrt -ldl -lpthread -lm

An example of usage of the C API is in available in libbpf-bootstrap: https://github.com/libbpf/libbpf-bootstrap/blob/master/examples/c/profile.c

This example periodically samples the running process of every processor in a system and prints their stack traces.

A detailed documentation of the C API is available as part of the Rust documentation or can be generated locally from the current repository snapshot using cargo doc (grouped under the c_api module).


The library also comes with a command line interface for quick experimentation and debugging. You can run it directly from the repository, e.g.:

cargo run -p blazecli -- symbolize elf --path /lib64/libc.so.6 00000000000caee1

Please refer to its README as well as the help text for additional information and usage instructions.


~32K SLoC