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: v13.2.6~86^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=044632b3362f188ed7da0d718a3606cb4f4ee0ee;p=ceph.git common/ceph_context: add "assert" and "abort" asok commands Require 'debug_asok_assert_abort = true' Signed-off-by: Sage Weil (cherry picked from commit 14699d2997f8b1e6e65cc2c24b33e2fcaf9cee4d) --- diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index 5fee784edae9..014741b276fe 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 f375e210ce90..c05e7d10a95c 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1513,6 +1513,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 9e567b6f438a..22adf6a7a368 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4864,6 +4864,10 @@ std::vector