This is an archive of the discontinued LLVM Phabricator instance.

[XRay][compiler-rt] Profiling Mode: Flush logs on exit
ClosedPublic

Authored by dberris on Jul 4 2018, 9:00 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Jul 4 2018, 9:00 PM
kpw added a comment.Jul 11 2018, 4:26 PM

Just one concern about exit handler being too aggressive if normal operation finalized and flushed.

compiler-rt/lib/xray/xray_profiling.cc
296–300 ↗(On Diff #154163)

Isn't it an error to unconditionally finalize and flush without checking the state first?

342–343 ↗(On Diff #154163)

Yeah. This is much better.

dberris marked an inline comment as done.Jul 11 2018, 8:36 PM
dberris added inline comments.
compiler-rt/lib/xray/xray_profiling.cc
296–300 ↗(On Diff #154163)

Not in this situation. Consider that this code is running in the initialisation of the profiling mode -- this means that in the lifetime of a program this mode has been initialised once. Notice that we're calling the profiling-mode specific finalization and flushing implementations at program exit. The implementation of either of these functions are then performing the invariant checks independently.

kpw accepted this revision.Jul 12 2018, 8:54 AM
This revision is now accepted and ready to land.Jul 12 2018, 8:54 AM
This revision was automatically updated to reflect the committed changes.