llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.21k stars 11.15k forks source link

perf2bolt -p processor_trace.data -o perf.fdata lib5gl2lo_scttarget.so FAILED #96204

Open skychen-cn opened 1 month ago

skychen-cn commented 1 month ago

BOLT-INFO: shared object or position-independent executable detected PERF2BOLT: Starting data aggregation job for processor_trace.data PERF2BOLT: spawning perf job to read branch events PERF2BOLT: spawning perf job to read mem events PERF2BOLT: spawning perf job to read process events PERF2BOLT: spawning perf job to read task events BOLT-INFO: Target architecture: aarch64 BOLT-INFO: BOLT version: 470d59d6565f564701e1a1c194aeea4903d6baa1 BOLT-INFO: first alloc address is 0x0 BOLT-INFO: creating new program header table at address 0x400000, offset 0x400000 BOLT-INFO: enabling relocation mode BOLT-INFO: disabling -align-macro-fusion on non-x86 platform BOLT-INFO: enabling strict relocation mode for aggregation purposes BOLT-INFO: pre-processing profile using perf data aggregator BOLT-INFO: binary build-id is: 1b899d514e3d910fbe14813245f0eb88999484a4 PERF2BOLT: spawning perf job to read buildid list PERF2BOLT: matched build-id and file name PERF2BOLT: waiting for perf mmap events collection to finish... PERF-ERROR: return code 255 0x340 [0x868]: failed to process type: 70 [Operation not permitted]

llvmbot commented 1 month ago

@llvm/issue-subscribers-bolt

Author: None (skychen-cn)

BOLT-INFO: shared object or position-independent executable detected PERF2BOLT: Starting data aggregation job for processor_trace.data PERF2BOLT: spawning perf job to read branch events PERF2BOLT: spawning perf job to read mem events PERF2BOLT: spawning perf job to read process events PERF2BOLT: spawning perf job to read task events BOLT-INFO: Target architecture: aarch64 BOLT-INFO: BOLT version: 470d59d6565f564701e1a1c194aeea4903d6baa1 BOLT-INFO: first alloc address is 0x0 BOLT-INFO: creating new program header table at address 0x400000, offset 0x400000 BOLT-INFO: enabling relocation mode BOLT-INFO: disabling -align-macro-fusion on non-x86 platform BOLT-INFO: enabling strict relocation mode for aggregation purposes BOLT-INFO: pre-processing profile using perf data aggregator BOLT-INFO: binary build-id is: 1b899d514e3d910fbe14813245f0eb88999484a4 PERF2BOLT: spawning perf job to read buildid list PERF2BOLT: matched build-id and file name PERF2BOLT: waiting for perf mmap events collection to finish... PERF-ERROR: return code 255 0x340 [0x868]: failed to process type: 70 [Operation not permitted]
yota9 commented 1 month ago

Based on the error "Operation not permitted" maybe your user doesn't have read access of processor_trace.data file?

skychen-cn commented 1 month ago

Based on the error "Operation not permitted" maybe your user doesn't have read access of processor_trace.data file? ===I do not know but this file is the same as another perf0.data and it works but for perf.data, it failed.

-rwxrwxrwx 1 skychen dev_group 12864136 Jun 20 11:14 perf0.data -rwxrwxrwx 1 skychen dev_group 4266508 Jun 19 21:43 perf.data

**perf2bolt -p perf.data -o perf.fdata -ignore-build-id   -nl lib5gl2lo_scttarget.so**
BOLT-INFO: shared object or position-independent executable detected
PERF2BOLT: Starting data aggregation job for perf.data
PERF2BOLT: spawning perf job to read events without LBR
PERF2BOLT: spawning perf job to read mem events
PERF2BOLT: spawning perf job to read process events
PERF2BOLT: spawning perf job to read task events
BOLT-INFO: Target architecture: aarch64
BOLT-INFO: BOLT version: 2ae6889d3f6c6bbe8390d6b1686c6583492b44a2
BOLT-INFO: first alloc address is 0x0
BOLT-INFO: creating new program header table at address 0x400000, offset 0x400000
BOLT-INFO: enabling relocation mode
BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
BOLT-INFO: enabling strict relocation mode for aggregation purposes
BOLT-INFO: pre-processing profile using perf data aggregator
BOLT-INFO: binary build-id is:     c7761cb1881f2fb6a12b499982aa171e59109af2
PERF2BOLT: spawning perf job to read buildid list
PERF2BOLT: matched build-id and file name
PERF2BOLT: waiting for perf mmap events collection to finish...
PERF-ERROR: return code 255
0x340 [0x868]: failed to process type: 70 **[Operation not permitted]**
**perf2bolt -p perf0.data -o perf.fdata -ignore-build-id   -nl lib5gl2lo_scttarget.so**
BOLT-INFO: shared object or position-independent executable detected
PERF2BOLT: Starting data aggregation job for perf0.data
PERF2BOLT: spawning perf job to read events without LBR
PERF2BOLT: spawning perf job to read mem events
PERF2BOLT: spawning perf job to read process events
PERF2BOLT: spawning perf job to read task events
BOLT-INFO: Target architecture: aarch64
BOLT-INFO: BOLT version: 2ae6889d3f6c6bbe8390d6b1686c6583492b44a2
BOLT-INFO: first alloc address is 0x0
BOLT-INFO: creating new program header table at address 0x400000, offset 0x400000
BOLT-INFO: enabling relocation mode
BOLT-INFO: disabling -align-macro-fusion on non-x86 platform
BOLT-INFO: enabling strict relocation mode for aggregation purposes
BOLT-INFO: pre-processing profile using perf data aggregator
BOLT-INFO: binary build-id is:     c7761cb1881f2fb6a12b499982aa171e59109af2
PERF2BOLT: spawning perf job to read buildid list
PERF2BOLT-ERROR: failed to match build-id from perf output. This indicates the input binary supplied for data aggregation is not the same recorded by perf when collecting profiling data, or there were no samples recorded for the binary. Use -ignore-build-id option to override.
PERF2BOLT: waiting for perf mmap events collection to finish...
PERF2BOLT: parsing perf-script mmap events output
PERF2BOLT: waiting for perf task events collection to finish...
PERF2BOLT: parsing perf-script task events output
PERF2BOLT: input binary is associated with 2 PID(s)
PERF2BOLT: waiting for perf events collection to finish...
PERF2BOLT: parsing basic events (without LBR)...
PERF2BOLT: waiting for perf mem events collection to finish...
PERF2BOLT: processing basic events (without LBR)...
PERF2BOLT: read 320112 samples
PERF2BOLT: out of range samples recorded in unknown regions: 308165 (96.3%)

 !! WARNING !! This high mismatch ratio indicates the input binary is probably not the same binary used during profiling collection. The generated data may be ineffective for improving performance.

PERF2BOLT: wrote 2079 objects and 0 memory objects to perf.fdata
BOLT-INFO: 111 out of 4101 functions in the binary (2.7%) have non-empty execution profile
yota9 commented 1 month ago

Maybe there is some weird CAP issue with reading, non sure, I think @aaupov might help you. Do you work in virtualisation env like docker? Did you get your perf records on the same machine that tries to process perf2bolt?

skychen-cn commented 1 month ago

@yota9 I got my perf records on one machine and decode the perf.data on another docker

aaupov commented 1 month ago

Please rerun perf2bolt with -debug-only=aggregator. This will print perf commands that were invoked. Running them directly should produce a more descriptive error message.