From: Richard W.M. Jones Date: Mon, 21 Mar 2016 14:24:35 +0000 (+0000) Subject: common/Cycles: Do not initialize Cycles globally. X-Git-Tag: v0.94.8~48^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F8538%2Fhead;p=ceph.git common/Cycles: Do not initialize Cycles globally. Move initialization to the few tests that actually use it. Fixes: http://tracker.ceph.com/issues/15225 Signed-off-by: Richard W.M. Jones (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 --- diff --git a/src/common/Cycles.cc b/src/common/Cycles.cc index b0b687e49d46..656f08b40cee 100644 --- a/src/common/Cycles.cc +++ b/src/common/Cycles.cc @@ -38,14 +38,15 @@ #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() { diff --git a/src/test/objectstore/ObjectStoreTransactionBenchmark.cc b/src/test/objectstore/ObjectStoreTransactionBenchmark.cc index a82efb7e1ff9..55ffcf2b4c16 100644 --- a/src/test/objectstore/ObjectStoreTransactionBenchmark.cc +++ b/src/test/objectstore/ObjectStoreTransactionBenchmark.cc @@ -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) {