This is an archive of the discontinued LLVM Phabricator instance.

[XRay][compiler-rt] Use llvm-xray in FDR mode tests
ClosedPublic

Authored by dberris on Mar 29 2017, 12:59 AM.

Details

Summary

This change allows us to do an end-to-end test of the FDR mode
implementation that uses the llvm-xray tooling to verify that what we
are both writing and reading the data in a consistent manner.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Mar 29 2017, 12:59 AM
kpw edited edge metadata.Mar 29 2017, 10:46 AM

LGTM

  1. Do these run as part of the "check-xray" target?
  2. We should update these to set the function time threshold flag to zero when we merge the unwriting patch in.

I volunteer to write a few supplemental test cases when that lands.

  • Sets the threshold very high and checks that no functions appear in the log.
  • Sets the threshold high, but have some functions that sleep. Check that invocations are erased when it makes sense and remain when eligible.
kpw accepted this revision.Mar 29 2017, 10:46 AM
This revision is now accepted and ready to land.Mar 29 2017, 10:46 AM
In D31454#713302, @kpw wrote:

LGTM

  1. Do these run as part of the "check-xray" target?

Yes. :)

  1. We should update these to set the function time threshold flag to zero when we merge the unwriting patch in.

Agreed.

I volunteer to write a few supplemental test cases when that lands.

  • Sets the threshold very high and checks that no functions appear in the log.
  • Sets the threshold high, but have some functions that sleep. Check that invocations are erased when it makes sense and remain when eligible.

Those sound like perfect individual tests to run indeed. :)

This revision was automatically updated to reflect the committed changes.
eugenis added inline comments.
compiler-rt/trunk/test/xray/TestCases/Linux/fdr-thread-order.cc
3

ls fdr-thread-order.* | head -1

How is that supposed to work?

This test never cleans old logs, so they just accumulate in the current directory, and then this line picks one basically at random.

dberris added inline comments.Apr 18 2017, 3:33 PM
compiler-rt/trunk/test/xray/TestCases/Linux/fdr-thread-order.cc
3

The line after should take care of that, except for when the tests start failing. I've not found a way with lit to determine a cleanup mechanism that isn't order-dependent -- is there a feature that's useful there? Or is there a better way of spelling this so that the cleanup happens reliably?

Oh. For some reason when I run it with manually with llvm-lit the temporary files keeping piling up in $PWD.

If that line fails, then yes it will start piling up and never get cleaned up. :(

Somehow I don't see the problem any longer.
Anyway, if the cleanup is moved to the beginning of the test, stale logs would not affect future test runs.