This is an archive of the discontinued LLVM Phabricator instance.

[XRay][compiler-rt] Add an end-to-end test for FDR Logging
ClosedPublic

Authored by dberris on Mar 28 2017, 9:37 PM.

Details

Summary

This change exercises the end-to-end functionality defined in the FDR
logging implementation. We also prepare for being able to run traces
generated by the FDR logging implementation from being analysed with the
llvm-xray command that comes with the LLVM distribution.

This also unblocks D31385, D31384, and D31345.

Event Timeline

dberris created this revision.Mar 28 2017, 9:37 PM
kpw edited edge metadata.Mar 28 2017, 10:23 PM

Thanks for the quick fix and for figuring out the lit configuration.

lib/xray/xray_fdr_logging.cc
65

Cool. I didn't grok the proper use of the void * args in xray_log_interface.h or how to switch on fdr via flags and just use the top level interface.

lib/xray/xray_utils.cc
95–96

This comment dangles now. There may still be a fix, necessary somewhere for how to configure Report, but the FIXME shouldn't be here.

test/xray/TestCases/Linux/fdr-mode.cc
4

I suspect we'll lose the exit code due to unix pipes returning the final commands exit code.

If the command returns a TRACE prefix as expected, then crashes, we want a failure.
If the shell that runs these is guaranteed to be bash, then the pipefail builtin option could help.

26–28

This is never called AFAICT.

52

Might as well lose this. It's not CHECKED.

kpw accepted this revision.Mar 28 2017, 10:24 PM

LGTM with the spruce up specified.

This revision is now accepted and ready to land.Mar 28 2017, 10:24 PM
dberris updated this revision to Diff 93343.Mar 28 2017, 10:30 PM
dberris marked 4 inline comments as done.
  • fixup: address review comments
test/xray/TestCases/Linux/fdr-mode.cc
4

Yes, this is currently not doing anything (notice that it's a FIXME as opposed to a RUN) :)

As soon as we fix the writing of the buffer sizes in the log, we'll be ready to turn this on.

This revision was automatically updated to reflect the committed changes.