Running perf report for perf record captured remotely

Viewed 209

I have an embedded Linux or armv7, with perf installed. The root filesystem is fairly limited, so debug information cannot be installed in there. The cross-compilation toolchain however creates a directory with the image content plus the debug information.

So I run perf trace -e cpu-clock -g <app>, copy the perf.data over to the desktop and try to run perf report via qemu as cat perf.data | qemu-arm-static -L root root/usr/bin/perf report, but I just get

bad event header size

What do I need to give to perf to be able to run it on a different machine, given copy of the root filesystem with debug information installed (the kernel should be available somewhere too).


Update 1: The problem seems to occur when I am trying to write the perf data into a pipe only. If I write the data to a file normally, they are read after copying them over to the build node. But because the space on the device is limited, I'd prefer to stream them directly.

So I do a mkfifo /tmp/perf.data, set it as output, and stream it out. Either with simple ssh device cat /tmp/perf.data > perf.data (I've tried cat /dev/null > /tmp/perf.data on the target and no extra characters seem to be written) or more complicated ssh -R /tmp/perf.sock:/tmp/perf.sock socat pipe:/tmp/perf.data,rdonly!!stdout unix-connect:/tmp/perf.sock and similar on the build node (a side-channel should always be transparent).

0 Answers
Related