summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDouglas Yung <douglas.yung@sony.com>2017-04-12 01:24:48 +0000
committerDouglas Yung <douglas.yung@sony.com>2017-04-12 01:24:48 +0000
commitbcfc9d9b382d4c80f084fbc2f43cfeb9b0555284 (patch)
treed81f3fca599e7ea4048eb00091c8a9d98c3d684a
parent821637aa52a31dc3ad8aed15eb2760adb5e49774 (diff)
downloadbcm5719-llvm-bcfc9d9b382d4c80f084fbc2f43cfeb9b0555284.tar.gz
bcm5719-llvm-bcfc9d9b382d4c80f084fbc2f43cfeb9b0555284.zip
[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 llvm-svn: 300017
-rw-r--r--compiler-rt/lib/xray/xray_fdr_logging.cc3
-rw-r--r--compiler-rt/lib/xray/xray_fdr_logging_impl.h4
2 files changed, 5 insertions, 2 deletions
diff --git a/compiler-rt/lib/xray/xray_fdr_logging.cc b/compiler-rt/lib/xray/xray_fdr_logging.cc
index f2ff4076e3c..5c6bbd41cfc 100644
--- a/compiler-rt/lib/xray/xray_fdr_logging.cc
+++ b/compiler-rt/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;
diff --git a/compiler-rt/lib/xray/xray_fdr_logging_impl.h b/compiler-rt/lib/xray/xray_fdr_logging_impl.h
index 20e89d6c12b..bc795b3b647 100644
--- a/compiler-rt/lib/xray/xray_fdr_logging_impl.h
+++ b/compiler-rt/lib/xray/xray_fdr_logging_impl.h
@@ -423,7 +423,9 @@ static inline void processFunctionHook(
return;
}
- uint64_t CycleFrequency = getTSCFrequency();
+ uint64_t CycleFrequency = probeRequiredCPUFeatures()
+ ? getTSCFrequency()
+ : __xray::NanosecondsPerSecond;
NumberOfTicksThreshold = CycleFrequency *
flags()->xray_fdr_log_func_duration_threshold_us /
1000000;
OpenPOWER on IntegriCloud