perf
.debug_frame
section)
.eh_frame
based unwinding (this is how normal C++ exception handling unwinds the stack)
without requiring .eh_frame_hdr
(which, depending on the compiler, may not be emitted).ARM.exidx
+ .ARM.extab
based unwinding (which is ARM specific and is used instead of .eh_frame
)perf
?If perf
already works for you - great! Keep on using it.
This project was born out of a few limitations of the original perf
which make it non-ideal for CPU profiling in embedded-ish environments.
Some of those are as follows:
perf record
on ARM then you also need to run perf report
either on ARM or under QEMU,
and running the analysis under QEMU (depending on how you've compiled your binaries
and with what flags you've launched perf
) can take hours;Install at least Rust 1.31
Build it:
$ cd cli
$ cargo build --release
Grab the binary from target/release/
.
~/.cargo/config
, e.g.:[target.mips64-unknown-linux-gnuabi64]
linker = "/path/to/your/sdk/mips64-octeon2-linux-gnu-gcc"
rustflags = [
"-C", "link-arg=--sysroot=/path/to/your/sdk/sys-root/mips64-octeon2-linux-gnu"
]
[target.armv7-unknown-linux-gnueabihf]
linker = "/path/to/your/sdk/arm-cortexa15-linux-gnueabihf-gcc"
rustflags = [
"-C", "link-arg=--sysroot=/path/to/your/sdk/sys-root/arm-cortexa15-linux-gnueabihf"
]
Compile, either for ARM or for MIPS64:
$ cargo build --release --target=mips64-unknown-linux-gnuabi64
$ cargo build --release --target=armv7-unknown-linux-gnueabihf
Grab the binary from target/mips64-unknown-linux-gnuabi64/
or target/armv7-unknown-linux-gnueabihf/
.
Profiling an already running process by its PID:
$ cargo run record -p $PID_OF_YOUR_PROCESS -o datafile
Profiling a process by its name and waiting if it isn't running yet:
$ cargo run record -P cpu-hungry-program -w -o datafile
Generating a CPU flame graph from the gathered data:
$ cargo run flamegraph datafile > flame.svg
Replace cargo run
with the path to the executable if you're running the profiler
outside of its build directory.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.