Desperado17
Desperado17

Reputation: 1015

Recording perf files with symbols for analysis on a different system (cross architecture)

I'm recording perf traces on an embedded target which I want to evaluate on a desktop host using hotspot. However, as far as I can tell this means the the desktop has to set up a complete sysroot for the embedded target to read the symbols correctly.

Is there a way to create stand-alone perf.data files or hotspot files that I can just send to people for evaluation without having to set up a sysroot? Heaptrack can do this, I wonder what the problem for perf would be.

Upvotes: 5

Views: 1643

Answers (1)

Will Chen
Will Chen

Reputation: 603

Use perf archive.

[user@MachineA]$ perf record --debuginfod SomeCommand --some --arguments
# Creates `perf.data`, containing profiled data.

[user@MachineA]$ perf archive
# Creates `perf.data.tar.bz2`, containing object files and debug symbols.
[user@OtherMachine]$ mkdir ~/.debug

[user@OtherMachine]$ tar xvf perf.data.tar.bz2 -C ~/.debug

[user@OtherMachine]$ perf report
# Reads `perf.data`, using objects and symbols extracted from the archive.

If you pull in a lot of libraries, expect the archive to be proportionally large and possibly take a long time to create.


If perf archive isn't available for whatever reason, or if you'd like to modify the output format, you can try downloading and using the perf-archive.sh Bash script separately from the Linux source tree:

https://github.com/torvalds/linux/blob/master/tools/perf/perf-archive.sh

Upvotes: 4

Related Questions