This is an archive of the discontinued LLVM Phabricator instance.

[XRay] Fix TSC and atomic custom/typed event accounting
ClosedPublic

Authored by dberris on Oct 31 2018, 8:23 PM.

Details

Summary

This is a follow-on change to D53858 which turns out to have had a TSC
accounting bug when writing out function exit records in FDR mode.

This change adds a number of tests to ensure that:

  • We are handling the delta between the exit TSC and the last TSC we've seen.
  • We are writing the custom event and typed event records as a single update to the buffer extents.
  • We are able to catch boundary conditions when loading FDR logs.

We introduce a TSC matcher to the test helpers, which we use in the
testing/verification of the TSC accounting change.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Oct 31 2018, 8:23 PM
dberris updated this revision to Diff 172081.Oct 31 2018, 8:29 PM

Write down correct delta.

mboerger added inline comments.Oct 31 2018, 8:46 PM
compiler-rt/lib/xray/tests/unit/fdr_controller_test.cc
126 ↗(On Diff #172081)

to see if...

compiler-rt/lib/xray/tests/unit/fdr_log_writer_test.cc
102 ↗(On Diff #172081)

s/THen/Then/
where is first?

112 ↗(On Diff #172081)

ASSERT_THAT(B.Data, IsNull());

compiler-rt/lib/xray/xray_fdr_log_writer.h
116 ↗(On Diff #172081)

s/first before/first, before/

dberris updated this revision to Diff 172095.Nov 1 2018, 1:07 AM
dberris marked 4 inline comments as done.

Address comments by @mboerger.

mboerger accepted this revision.Nov 1 2018, 4:45 AM

LGTM

This revision is now accepted and ready to land.Nov 1 2018, 4:45 AM
This revision was automatically updated to reflect the committed changes.