This is an archive of the discontinued LLVM Phabricator instance.

[xray] Honor xray-never function-instrument attribute
ClosedPublic

Authored by ianlevesque on Oct 14 2020, 7:24 PM.

Details

Summary

function-instrument=xray-never wasn't actually honored before. We were getting lucky that it worked because CodeGenFunction would omit the other xray attributes when a function as annotated with xray_never_instrument. This patch adds proper support.

Diff Detail

Event Timeline

ianlevesque created this revision.Oct 14 2020, 7:24 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 14 2020, 7:24 PM
ianlevesque requested review of this revision.Oct 14 2020, 7:24 PM

Do you think we should fix this by handling the xray-never attribute in XRayInstrumentation, or having CodeGenFunction remove the threshold if xray-never is set?

Good catch, thanks!

I think we should go with the former (handling the case in XRayInstrumentation) -- the rationale here is that when we apply the file-based always-instrument case, we ignore the "never" attribute (i.e. the "always" case overrides the "never" case). We should make sure that this case still works (if we don't have cases for that, then we should add those too).

Apply the fix in XRayInstrumentation, add test cases.

ianlevesque retitled this revision from RFC: Potential fixes to function-instrument=xray-never to [xray] Honor xray-never function-instrument attribute.Oct 15 2020, 7:07 PM
ianlevesque edited the summary of this revision. (Show Details)
dberris accepted this revision.Oct 20 2020, 5:02 AM

LGTM -- thanks!

This revision is now accepted and ready to land.Oct 20 2020, 5:02 AM
This revision was landed with ongoing or failed builds.Jan 19 2021, 3:47 PM
This revision was automatically updated to reflect the committed changes.