From: Sage Weil Date: Wed, 29 Jan 2020 00:15:52 +0000 (-0600) Subject: common/ceph_context: add an asok command to deliberately leak memory X-Git-Tag: v15.1.1~531^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=e807669b77270b14829e8eb5787407d21dab6806;p=ceph-ci.git common/ceph_context: add an asok command to deliberately leak memory Signed-off-by: Sage Weil --- diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 64d58603d61..5dcdb98d68b 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -484,7 +484,11 @@ int CephContext::_do_command( return -EPERM; } } - if (command == "perfcounters_dump" || command == "1" || + if (command == "leak_some_memory") { + char *foo = new char[1234]; + (void)foo; + } + else if (command == "perfcounters_dump" || command == "1" || command == "perf dump") { std::string logger; std::string counter; @@ -685,6 +689,7 @@ CephContext::CephContext(uint32_t module_type_, _admin_hook = new CephContextHook(this); _admin_socket->register_command("assert", _admin_hook, ""); _admin_socket->register_command("abort", _admin_hook, ""); + _admin_socket->register_command("leak_some_memory", _admin_hook, ""); _admin_socket->register_command("perfcounters_dump", _admin_hook, ""); _admin_socket->register_command("1", _admin_hook, ""); _admin_socket->register_command("perf dump name=logger,type=CephString,req=false name=counter,type=CephString,req=false", _admin_hook, "dump perfcounters value");