]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/Cycles: Do not initialize Cycles globally. 8538/head
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 21 Mar 2016 14:24:35 +0000 (14:24 +0000)
committerVicente Cheng <freeze.bilsted@gmail.com>
Mon, 11 Apr 2016 15:39:08 +0000 (23:39 +0800)
Move initialization to the few tests that actually use it.

Fixes: http://tracker.ceph.com/issues/15225
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
(cherry picked from commit 1c2831a2c1277c69f9649200d74a75c04a4b0296)

  Conflicts:
src/test/msgr/perf_msgr_client.cc
src/test/msgr/perf_msgr_server.cc
src/test/perf_local.cc
            These three files were not introduced on hammer, just remove

src/common/Cycles.cc
src/test/objectstore/ObjectStoreTransactionBenchmark.cc

index b0b687e49d46b3d3ea1c4bfac449ecfd5950957d..656f08b40ceeab8a7a51225bee8e63ef833ce6f8 100644 (file)
 #include "Cycles.h"
 
 double Cycles::cycles_per_sec = 0;
-static Initialize _(Cycles::init);
 
 /**
  * Perform once-only overall initialization for the Cycles class, such
- * as calibrating the clock frequency.  This method is invoked automatically
- * during initialization, but it may be invoked explicitly by other modules
- * to ensure that initialization occurs before those modules initialize
- * themselves.
+ * as calibrating the clock frequency.  This method must be called
+ * before using the Cycles module.
+ *
+ * It is not initialized by default because the timing loops cause
+ * general process startup times to balloon
+ * (http://tracker.ceph.com/issues/15225).
  */
 void Cycles::init()
 {
index a82efb7e1ff95de5661fa61aa3e1b64d48f84860..55ffcf2b4c164c1d9255cbc3f5f8322ed81c6e02 100644 (file)
@@ -252,6 +252,7 @@ int main(int argc, char **argv)
   global_init(NULL, args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY, 0);
   common_init_finish(g_ceph_context);
   g_ceph_context->_conf->apply_changes(NULL);
+  Cycles::init();
 
   cerr << "args: " << args << std::endl;
   if (args.size() < 1) {