Perf2bolt fails with PERF-ERROR: return code 1

Running perf2bolt fails at

PERF2BOLT: waiting for perf events collection to finish...
PERF-ERROR: return code 1

What might have failed here? How can I see the output of the nested perf call?

Do you run perf and perf2bolt on the same machine?

Yes, it’s on the same machine.

This is trying to apply BOLT to the clang binary, using a perf recording of our build. The script doing this worked before. What I changed now is adding -DLLVM_ENABLE_LTO=Thin to the clang/LLVM build.

It’s probably the perf invocation itself that is failing in this case.

The command is likely the following:

perf script -F pid,ip,brstack -f -i <>

Let us know if the command works, but keeps failing as part of perf2bolt.

That seems to run fine indeed:

$ perf script -F pid,ip,brstack -f -i >/tmp/perf-script-out 
Processed 62040822 events and lost 4050 chunks!

Check IO/CPU overload!
$ echo $?