From: Sage Weil Date: Fri, 15 Jun 2018 22:29:11 +0000 (-0500) Subject: common/ceph_context: add "assert" and "abort" asok commands X-Git-Tag: v14.0.1~1042^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14699d2997f8b1e6e65cc2c24b33e2fcaf9cee4d;p=ceph.git common/ceph_context: add "assert" and "abort" asok commands Require 'debug_asok_assert_abort = true' Signed-off-by: Sage Weil --- diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index faaca450b2d5..0a087d8cc241 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -391,6 +391,12 @@ void CephContext::do_command(std::string_view command, const cmdmap_t& cmdmap, } lgeneric_dout(this, 1) << "do_command '" << command << "' '" << ss.str() << dendl; + if (command == "assert" && _conf->debug_asok_assert_abort) { + assert(0 == "assert"); + } + if (command == "abort" && _conf->debug_asok_assert_abort) { + abort(); + } if (command == "perfcounters_dump" || command == "1" || command == "perf dump") { std::string logger; @@ -582,6 +588,8 @@ CephContext::CephContext(uint32_t module_type_, _plugin_registry = new PluginRegistry(this); _admin_hook = new CephContextHook(this); + _admin_socket->register_command("assert", "assert", _admin_hook, ""); + _admin_socket->register_command("abort", "abort", _admin_hook, ""); _admin_socket->register_command("perfcounters_dump", "perfcounters_dump", _admin_hook, ""); _admin_socket->register_command("1", "1", _admin_hook, ""); _admin_socket->register_command("perf dump", "perf dump name=logger,type=CephString,req=false name=counter,type=CephString,req=false", _admin_hook, "dump perfcounters value"); diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 1df4177884a9..b7c1559cdd0c 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1516,6 +1516,7 @@ OPTION(rgw_torrent_sha_unit, OPT_INT) // torrent field piece length 512K OPTION(event_tracing, OPT_BOOL) // true if LTTng-UST tracepoints should be enabled OPTION(debug_deliberately_leak_memory, OPT_BOOL) +OPTION(debug_asok_assert_abort, OPT_BOOL) OPTION(rgw_swift_custom_header, OPT_STR) // option to enable swift custom headers diff --git a/src/common/options.cc b/src/common/options.cc index a4c54a19b7f0..e682526a7c9a 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4880,6 +4880,10 @@ std::vector