Score:0

non-sudo perf sched always fails with "broken or missing trace data"

au flag

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?

Chang Hyun Park avatar
es flag
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 avatar
es flag
To add, this behavior is happening for tracepoint related recording. (Not for SW events)
Federico avatar
au flag
"Did OP figure this out?" - No, I used sudo and eventually moved away from `perf sched`.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.