]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: conditionally disable dlclose of erasure code plugins
authorLoic Dachary <loic@dachary.org>
Thu, 12 Dec 2013 13:03:26 +0000 (14:03 +0100)
committerLoic Dachary <loic@dachary.org>
Fri, 20 Dec 2013 10:28:47 +0000 (11:28 +0100)
When profiling, tools such as valgrind --tool=callgrind require that the
dynamically loaded libraries are not dlclosed so they can collect usage
information.

The public ErasureCodePluginRegistry::disable_dlclose boolean is introduced
for this purpose.

Signed-off-by: Loic Dachary <loic@dachary.org>
src/osd/ErasureCodePlugin.cc
src/osd/ErasureCodePlugin.h

index 5d0b6904e1ea2035bc31221ad20acf7fa5046be9..d31b197391e2680ae955cc08176ef2d4255740c5 100644 (file)
@@ -37,12 +37,16 @@ ErasureCodePluginRegistry ErasureCodePluginRegistry::singleton;
 
 ErasureCodePluginRegistry::ErasureCodePluginRegistry() :
   lock("ErasureCodePluginRegistry::lock"),
-  loading(false)
+  loading(false),
+  disable_dlclose(false)
 {
 }
 
 ErasureCodePluginRegistry::~ErasureCodePluginRegistry()
 {
+  if (disable_dlclose)
+    return;
+
   for (std::map<std::string,ErasureCodePlugin*>::iterator i = plugins.begin();
        i != plugins.end();
        ++i) {
index a2feb71695aba59b80327ab651de19f944a7c8c9..1f5e46c6d276b8c056c8de449d30aee5f8c7302f 100644 (file)
@@ -42,6 +42,7 @@ namespace ceph {
   public:
     Mutex lock;
     bool loading;
+    bool disable_dlclose;
     std::map<std::string,ErasureCodePlugin*> plugins;
 
     static ErasureCodePluginRegistry singleton;