[PATCH] D54088: [XRay] Update TSC match to handle wraparound

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 4 21:17:18 PST 2018


dberris created this revision.
dberris added a reviewer: mboerger.

Prior to this change, we can run into situations where the TSC we're
getting when exiting a function is less than the TSC we got when
entering it. This would sometimes cause the counter for cumulative call
times overflow, which was erroneously also being stored as a signed
64-bit integer.

This change addresses both these issues while adding provisions for
tracking CPU migrations. We do this because moving from one CPU to
another doesn't guarantee that the timestamp counter for some
architectures aren't guaranteed to be synchronised. For the moment, we
leave the provisions there until we can update the data format to
include the counting of CPU migrations we can catch.

We update the necessary tests as well, ensuring that our expectations
for the cycle accounting to be met in case of counter wraparound.


https://reviews.llvm.org/D54088

Files:
  compiler-rt/lib/xray/tests/unit/function_call_trie_test.cc
  compiler-rt/lib/xray/tests/unit/profile_collector_test.cc
  compiler-rt/lib/xray/xray_function_call_trie.h
  compiler-rt/lib/xray/xray_profiling.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54088.172542.patch
Type: text/x-patch
Size: 15602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181105/734d7d13/attachment.bin>


More information about the llvm-commits mailing list