Skip to content

Lack of PGO probes in instrumented builds of libcoreclr #124141

Description

@hoyosjs

When building coreclr with --pgoinstrument, libcoreclr.so ends up with essentially no PGO instrumentation probes. The add_pgo(coreclr) call in src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt uses target_compile_options(PRIVATE), which only applies -flto -fprofile-instr-generate to the source files compiled directly into the coreclr shared library target - just mscoree.cpp and exports.cpp. The resulting library has very few probes (20-100 over ~30 functions). The vast majority of the runtime code lives in static libraries (cee_wks, utilcode, coreclrpal, etc.) that are linked in already compiled, without instrumentation flags. This doesn't affect clrjit because the JIT compiles all its source files directly into the shared library target. Windows doesn't have this issue since this is a link time option.

Metadata

Metadata

Assignees

Labels

Priority:1Work that is critical for the release, but we could probably ship withoutarea-Infrastructure

Type

No type

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions