]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Log when we leak and disallow inlining 69278/head
authorBrad Hubbard <bhubbard@redhat.com>
Fri, 29 May 2026 03:59:41 +0000 (13:59 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Mon, 8 Jun 2026 22:04:08 +0000 (08:04 +1000)
eaa2013 added a generic suppression that exposed the fact that the newer
compiler was inlining CephContext::do_command(). In order to avoid such
scenario in the future, and to keeo the behaviour constant between
daemons we'll disallow inlining.

Fixes: https://tracker.ceph.com/issues/76473
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
src/common/ceph_context.cc

index afd22f865437e8226448f6c1f347ae50e5b9cea5..6c329c82457f6426c4754e0fa25c38a1ba90521f 100644 (file)
@@ -499,7 +499,7 @@ bool CephContext::check_experimental_feature_enabled(const std::string& feat,
   return enabled;
 }
 
-int CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
+[[gnu::noinline]] int CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
                            Formatter *f,
                            std::ostream& ss,
                            bufferlist *out)
@@ -514,7 +514,8 @@ int CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap,
 
 #pragma GCC push_options
 #pragma GCC optimize ("O0")
-static void leak_some_memory() {
+static void leak_some_memory(CephContext* cc) {
+  lgeneric_derr(cc) << "Leaking some memory" << dendl;
   volatile char *foo = new char[1234];
   (void)foo;
 }
@@ -538,7 +539,7 @@ int CephContext::_do_command(
     }
   }
   if (command == "leak_some_memory") {
-    leak_some_memory();
+    leak_some_memory(this);
   }
   else if (command == "perfcounters_dump" || command == "1" ||
       command == "perf dump") {