llvm / llvm/llvm-project

can not generate prof.fdata for libc.so

Open
#162,795 4 comments 0 reactions 0 assignees View on GitHub
BOLT
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

1.i have a process which use both example.so and libc.so.6(using in arm64 platform and corss-compile in x86)
but i found that for example.so,it can generate prof.fdata successfully after i use instrumentation-file-append-pid or instrumentation-sleep-time

however for libc.so.6
if i use **--instrumentation-sleep-time**

- ./llvm-bolt libc.so.6 --instrumentation-sleep-time=30 -o libc.so.6.30s
- BOLT-INFO: shared object or position-independent executable detected
- BOLT-INFO: Target architecture: aarch64
- BOLT-INFO: BOLT version: 6abb6264ea5577071dc5ac9e289dd1660553ad39
- BOLT-INFO: first alloc address is 0x0
- BOLT-INFO: creating new program header table at address 0x200000, offset 0x200000
- BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.
- BOLT-INFO: enabling relocation mode
- BOLT-INFO: number of removed linker-inserted veneers: 0
- BOLT-INFO: 0 out of 3238 functions in the binary (0.0%) have non-empty execution profile
- BOLT-INFO: removed 402 empty blocks
- BOLT-INFO: UCE removed 2 blocks and 8 bytes of code
- BOLT-INFO: Starting stub-insertion pass
- BOLT-INFO: Inserted 0 stubs in the hot area and 0 stubs in the cold area. Shared 0 times, iterated 1 times.
- BOLT-INFO: patched build-id (flipped last bit)

it can not generata prof.fdata in /tmp/ which is writable

if i use **--instrumentation-file-append-pid**

- `llvm-bolt libc.so.all.6 --instrumentation-file-append-pid -o libc.
- so.6.appendpid
- BOLT-INFO: shared object or position-independent executable detected
- BOLT-INFO: Target architecture: aarch64
- BOLT-INFO: BOLT version: 6abb6264ea5577071dc5ac9e289dd1660553ad39
- BOLT-INFO: first alloc address is 0x0
- BOLT-INFO: creating new program header table at address 0x200000, offset 0x200000
- BOLT-WARNING: debug info will be stripped from the binary. Use -update-debug-sections to keep it.
- BOLT-INFO: enabling relocation mode
- BOLT-INFO: number of removed linker-inserted veneers: 0
- BOLT-INFO: 0 out of 3238 functions in the binary (0.0%) have non-empty execution profile
- BOLT-INFO: removed 402 empty blocks
- BOLT-INFO: UCE removed 2 blocks and 8 bytes of code
- BOLT-INFO: Starting stub-insertion pass
- BOLT-INFO: Inserted 0 stubs in the hot area and 0 stubs in the cold area. Shared 0 times, iterated 1 times.
- BOLT-INFO: patched build-id (flipped last bit)`

it can generata prof.fdata but the size is 0 which means nothing collects

please tell me how can i debug? THANKS!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two llvm-bolt commands for libc.so.6 on the reported aarch64 and cross-compiled setup, comparing them with the working example.so case. Inspect where prof.fdata is written and whether it remains empty with --instrumentation-file-append-pid; done means identifying a reproducible cause and documenting a fix or clear diagnostic path.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
22/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.