This is an archive of the discontinued LLVM Phabricator instance.

[SampleFDO] Report error when reading a bad/incompatible profile instead of turning off profile use silently.
ClosedPublic

Authored by wmi on Jan 22 2021, 3:27 PM.

Details

Summary

Currently sample loader pass turns off SampleFDO optimization silently when it sees error in reading the profile. This behavior will defeat the tests which could have caught those bad/incompatible profile problems and let the problem slip to release or production. This patch change the behavior and report an error when reading a bad profile.

Diff Detail

Event Timeline

wmi created this revision.Jan 22 2021, 3:27 PM
wmi requested review of this revision.Jan 22 2021, 3:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 3:27 PM

Should it be warning or error?

wmi added a comment.Jan 22 2021, 4:09 PM

Should it be warning or error?

A build command has samplefdo flag in place, but it cannot perform the samplefdo optimization because the input profile cannot be read properly. That is an error case which can be fixed. So I think it should be an error. From my understanding, a warning should be used in the case that there is something concerning but likely there is nothing to be fixed, like profile mismatch in instrument FDO.

Just above the error reporting I added, there has already been another error handling dealing the case that a profile cannot be opened. I think these two cases are similar.

davidxl accepted this revision.Jan 22 2021, 4:39 PM

lgtm

This revision is now accepted and ready to land.Jan 22 2021, 4:39 PM
wenlei accepted this revision.Jan 22 2021, 6:08 PM

LGTM. Thanks for tightening this up. though I think warning does give others more flexibility in how/when to respond to this - in the end, this is not a build break, but a performance issue.

hoy accepted this revision.Jan 22 2021, 6:20 PM

LGTM, thanks.

This revision was landed with ongoing or failed builds.Jan 25 2021, 10:28 AM
This revision was automatically updated to reflect the committed changes.