This is an archive of the discontinued LLVM Phabricator instance.

[esan] Initialize runtime during early interceptors
ClosedPublic

Authored by bruening on Jun 3 2016, 11:33 AM.

Details

Summary

Adds initialization of esan's runtime library during any early interceptors
that are sometimes called prior to the official __esan_init() invocation
(we see this with apps using tcmalloc).

Adds handling of interceptors called during interceptor initialization.

Diff Detail

Repository
rL LLVM

Event Timeline

bruening updated this revision to Diff 59588.Jun 3 2016, 11:33 AM
bruening retitled this revision from to [esan] Initialize runtime during early interceptors.
bruening updated this object.
bruening added a reviewer: aizatsky.
bruening added subscribers: llvm-commits, eugenis, kcc and 2 others.
aizatsky added inline comments.Jun 3 2016, 11:57 AM
lib/esan/esan_interceptors.cpp
56 ↗(On Diff #59588)

If performance is a concern, I suggest trying to make this look like:

if (UNLIKELY(flag1)) {
  // 2 branches here
}

instead of two consequent ones. I am not sure how two UNLIKELY work though.

But this will have only one memory read on the fast path.

aizatsky requested changes to this revision.Jun 3 2016, 11:58 AM
aizatsky edited edge metadata.
This revision now requires changes to proceed.Jun 3 2016, 11:58 AM
bruening marked an inline comment as done.Jun 3 2016, 2:01 PM
bruening updated this revision to Diff 59618.Jun 3 2016, 2:01 PM
bruening edited edge metadata.

Eliminate one branch on the interceptor entry common path.

aizatsky accepted this revision.Jun 3 2016, 2:02 PM
aizatsky edited edge metadata.
This revision is now accepted and ready to land.Jun 3 2016, 2:02 PM
This revision was automatically updated to reflect the committed changes.