From: Brad Hubbard Date: Fri, 29 May 2026 03:59:41 +0000 (+1000) Subject: common: Log when we leak and disallow inlining X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d6f1bcc89018e02e08290fda58cfa0792bd0a76a;p=ceph.git common: Log when we leak and disallow inlining 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 --- diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index afd22f86543..6c329c82457 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -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") {