summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/xray/xray_fdr_logging.cc3
-rw-r--r--lib/xray/xray_fdr_logging_impl.h4
2 files changed, 5 insertions, 2 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;
diff --git a/lib/xray/xray_fdr_logging_impl.h b/lib/xray/xray_fdr_logging_impl.h
index 20e89d6c1..bc795b3b6 100644
--- a/lib/xray/xray_fdr_logging_impl.h
+++ b/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;