]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
heap_profiler: if log_dir is empty, don't try and log to root dir!
authorGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 10 Jun 2011 19:25:52 +0000 (12:25 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 10 Jun 2011 19:26:16 +0000 (12:26 -0700)
If log_dir was empty then the prefix would be of the form /mon.a
That isn't good, so fill it in so it writes to the current dir.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/perfglue/heap_profiler.cc

index 48f4c5c2a636aeae8c9ddb9afe2380e53bf0275a..066315cd21820637a3bb6f318b2899af65e8e3f0 100644 (file)
@@ -51,7 +51,8 @@ void ceph_heap_profiler_start()
 {
   char profile_name[PATH_MAX];
   snprintf(profile_name, sizeof(profile_name),
-          "%s/%s", g_conf->log_dir.c_str(), g_conf->name.to_cstr());
+          "%s/%s", g_conf->log_dir.empty() ? "." : g_conf->log_dir.c_str(),
+                                           g_conf->name.to_cstr());
   generic_dout(0) << "turning on heap profiler with prefix "
                  << profile_name << dendl;
   HeapProfilerStart(profile_name);