This is an archive of the discontinued LLVM Phabricator instance.

[llvm-profgen] Support to load debug info from a second binary
ClosedPublic

Authored by wlei on Dec 17 2021, 9:33 AM.

Details

Summary

For reducing binary size purpose, the binary's debug info and executable segment can be separated(like using objcopy --only-keep-debug). Here add support in llvm-profgen to use two binaries as input. The original one is executable binary and added for debug info only binary. Adding a flag --debug-binary=file-path, with this, the binary will load debug info from debug binary.

Diff Detail

Event Timeline

wlei created this revision.Dec 17 2021, 9:33 AM
wlei requested review of this revision.Dec 17 2021, 9:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 17 2021, 9:33 AM
wlei edited the summary of this revision. (Show Details)Dec 17 2021, 9:44 AM
wlei added reviewers: hoy, wenlei.
wlei retitled this revision from [llvm-profgen] Support debug info only binary to [llvm-profgen] Support to load debug info from a second binary.Dec 17 2021, 9:56 AM
wenlei added inline comments.Dec 17 2021, 9:58 AM
llvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test
10–13 ↗(On Diff #395153)

Let's use a dedicated/targeted test case for this scenario, instead of making existing test more complicated.

hoy added inline comments.Dec 17 2021, 3:56 PM
llvm/test/tools/llvm-profgen/inline-noprobe2.test
112 ↗(On Diff #395153)

We should be able to use llvm-objcopy in the test, so the existing test binary can be reused and with an extra test step running llvm-objcopy.

wlei updated this revision to Diff 395263.Dec 17 2021, 10:38 PM

change symbolizer patch to point to debug info path.
addressing reviewers' feedback.

wlei added inline comments.Dec 17 2021, 10:38 PM
llvm/test/tools/llvm-profgen/inline-cs-pseudoprobe.test
10–13 ↗(On Diff #395153)

Separated this part into a new test.

llvm/test/tools/llvm-profgen/inline-noprobe2.test
112 ↗(On Diff #395153)

Good point! Changed.

wlei updated this revision to Diff 395264.Dec 17 2021, 10:40 PM

Updating D115948: [llvm-profgen] Support to load debug info from a second binary

hoy accepted this revision.Dec 20 2021, 11:23 AM

lgtm, thanks.

This revision is now accepted and ready to land.Dec 20 2021, 11:23 AM
wenlei accepted this revision.Jan 24 2022, 3:48 PM

lgtm.

This revision was landed with ongoing or failed builds.Jan 24 2022, 5:14 PM
This revision was automatically updated to reflect the committed changes.