Page MenuHomePhabricator

[XRay] [compiler-rt] make sure single threaded programs get traced too

Authored by pelikan on Oct 3 2017, 12:02 AM.



When the XRay user calls the API to finish writing the log, the thread
which is calling the API still hasn't finished and therefore won't get
its trace written. Add a test for only the main thread to check this.

Diff Detail


Event Timeline

pelikan created this revision.Oct 3 2017, 12:02 AM
dberris added inline comments.Oct 3 2017, 4:52 AM
119–127 ↗(On Diff #117478)

Shouldn't this happen before we write out the data instead, so we don't need to do a special write here?

2 ↗(On Diff #117478)

Consider breaking these up with slashes:

// RUN: ... \
// RUN:     ... \
// RUN:     ...
pelikan updated this revision to Diff 117608.Oct 3 2017, 5:28 PM
pelikan marked 2 inline comments as done.

break up RUN: lines in the test

119–127 ↗(On Diff #117478)

That write will only be triggered if the second member of the tuple is true, which may or may not be the case. Hence the explicit write in an "if this thread needs it".

(Your question makes sense and I had it like that at first. It didn't work, though.)

2 ↗(On Diff #117478)

I've also removed the "TRACE" thing when there's a perfectly sensible default.

dberris accepted this revision.Oct 3 2017, 8:14 PM


This revision is now accepted and ready to land.Oct 3 2017, 8:14 PM
This revision was automatically updated to reflect the committed changes.