0

On my Ubuntu 22.04 (5.19.0-35-generic), it seems that perf sched is not able to parse its own perf.data output. Following the examples on Brendan Gregg's blog, recording works fine

# perf sched record -- sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 2.844 MB perf.data (11439 samples) ]

However, any my attempt at reading the profiling data fails:

# perf script --header
incompatible file format (rerun with -v to learn more)
# perf sched script
incompatible file format (rerun with -v to learn more)
# perf sched latency
incompatible file format (rerun with -v to learn more)
# perf sched map
incompatible file format (rerun with -v to learn more)

The verbose output just tells broken or missing trace data:

# perf script -v --header
build id event received for [kernel.kallsyms]: 77ab8542b6540fae3367bbb18a7aeede3c3b6f7b [20]
build id event received for [vdso]: f33b8f26bed889157b75129711599f9ca5ec9d0e [20]
broken or missing trace data
incompatible file format (rerun with -v to learn more)

Googling a bit, I only found old bug reports, but their workarounds don't apply to my case:

# perf script --header -i - < perf.data
incompatible file format (rerun with -v to learn more)

Furthermore, I found that running the same commands with sudo works fine:

# sudo perf sched record -- sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 3.875 MB perf.data (19424 samples) ]
# sudo perf script --header
<output>

Any clue what's the issue with the non-sudo commands?

Federico
  • 101
  • 2
  • I'm running a custom kernel 6.3.8, with custom built perf and getting the same behavior. Running via sudo works fine, but running as non-sudo causes the incompatible file format issue. Did OP figure this out? – Chang Hyun Park Jun 19 '23 at 15:20
  • To add, this behavior is happening for tracepoint related recording. (Not for SW events) – Chang Hyun Park Jun 19 '23 at 15:26
  • "Did OP figure this out?" - No, I used sudo and eventually moved away from `perf sched`. – Federico Jun 21 '23 at 12:01

0 Answers0