From 52e9e5ec339a4aa996731604bcc0ff95e6659d3b Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Fri, 10 Jun 2011 12:25:52 -0700 Subject: [PATCH] heap_profiler: if log_dir is empty, don't try and log to root dir! 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 --- src/perfglue/heap_profiler.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/perfglue/heap_profiler.cc b/src/perfglue/heap_profiler.cc index 48f4c5c2a636a..066315cd21820 100644 --- a/src/perfglue/heap_profiler.cc +++ b/src/perfglue/heap_profiler.cc @@ -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); -- 2.39.5