ceph/0003-Skip-initialization-if-rtdsc-is-not-implemented.patch

34 lines
924 B
Diff
Raw Normal View History

From fdd728c0872b34d1b6f96ee5601b619748afc9e8 Mon Sep 17 00:00:00 2001
From: Boris Ranto <branto@redhat.com>
Date: Mon, 18 May 2015 20:27:56 +0200
Subject: [PATCH] Skip initialization if rtdsc is not implemented
Patch by James Page. See
https://bugs.launchpad.net/ubuntu/+source/ceph/+bug/1432786
for more details.
---
src/common/Cycles.cc | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/common/Cycles.cc b/src/common/Cycles.cc
index a2efcf3..a5367f7 100644
--- a/src/common/Cycles.cc
+++ b/src/common/Cycles.cc
@@ -52,6 +52,11 @@ void Cycles::init()
if (cycles_per_sec != 0)
return;
+
+ // Skip initialization if rtdsc is not implemented
+ if (rdtsc() == 0)
+ return;
+
// Compute the frequency of the fine-grained CPU timer: to do this,
// take parallel time readings using both rdtsc and gettimeofday.
// After 10ms have elapsed, take the ratio between these readings.
--
2.1.0