diff options
author | Douglas Yung <douglas.yung@sony.com> | 2017-04-12 01:24:48 +0000 |
---|---|---|
committer | Douglas Yung <douglas.yung@sony.com> | 2017-04-12 01:24:48 +0000 |
commit | 379a34bac1483eb835f96072829253390ef42df9 (patch) | |
tree | 8d436c5bdb6abb7f4677ec1d5f595c80c2122b38 /lib/xray/xray_fdr_logging.cc | |
parent | b6240efd1f34bf5e72bd5350166957d829a10d7d (diff) |
[XRay][compiler-rt] Add another work-around to XRay FDR tests when TSC emulation is needed
This patch applies a work-around to the XRay FDR tests when TSC emulation is
needed because the processor frequency cannot be determined.
This fixes PR32620 using the suggestion given by Dean in comment 1.
Reviewers: dberris
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D31967
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300017 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_fdr_logging.cc')
-rw-r--r-- | lib/xray/xray_fdr_logging.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc index f2ff4076e..5c6bbd41c 100644 --- a/lib/xray/xray_fdr_logging.cc +++ b/lib/xray/xray_fdr_logging.cc @@ -120,7 +120,8 @@ XRayLogFlushStatus fdrLoggingFlush() XRAY_NEVER_INSTRUMENT { XRayFileHeader Header; Header.Version = 1; Header.Type = FileTypes::FDR_LOG; - Header.CycleFrequency = getTSCFrequency(); + Header.CycleFrequency = probeRequiredCPUFeatures() + ? getTSCFrequency() : __xray::NanosecondsPerSecond; // FIXME: Actually check whether we have 'constant_tsc' and 'nonstop_tsc' // before setting the values in the header. Header.ConstantTSC = 1; |