Page MenuHomePhabricator

tsan: don't instrument __attribute__((naked)) functions
ClosedPublic

Authored by AntonBikineev on Apr 4 2020, 1:57 PM.

Details

Summary

Naked functions must not have compiler generated prologues/epilogues, hence no instrumentation is needed for them.

I was not sure whether to disable instrumentation for an entire function or only for prologues/epilogues (tsan_func_entry/tsan_func_exit), but I assumed that the latter would probably be incorrect. Please let me if you think this is wrong.

FWIW, from the C/C++ frontend point of view, naked functions can only contain inline assembly.

Diff Detail

Event Timeline

AntonBikineev created this revision.Apr 4 2020, 1:57 PM
kcc added a comment.Apr 8 2020, 9:46 AM

The code is ok, but I'd like to see an ACK from Dmitry.

dvyukov accepted this revision.Apr 9 2020, 2:35 AM
This revision is now accepted and ready to land.Apr 9 2020, 2:35 AM
This revision was automatically updated to reflect the committed changes.

Thanks for taking a look!