diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 6b97c82cfba..ff674cfc19b 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -126,6 +126,7 @@ OPTION(ms_inject_delay_msg_type, OPT_STR, "") // the type of message to del OPTION(ms_inject_delay_max, OPT_DOUBLE, 1) // seconds OPTION(ms_inject_delay_probability, OPT_DOUBLE, 0) // range [0, 1] OPTION(ms_inject_internal_delays, OPT_DOUBLE, 0) // seconds +OPTION(ms_dump_on_send, OPT_BOOL, false) // hexdump msg to log on send OPTION(inject_early_sigterm, OPT_BOOL, false) diff --git a/src/msg/SimpleMessenger.cc b/src/msg/SimpleMessenger.cc index e11783dd0ab..2070fe59124 100644 --- a/src/msg/SimpleMessenger.cc +++ b/src/msg/SimpleMessenger.cc @@ -399,6 +399,19 @@ ConnectionRef SimpleMessenger::get_loopback_connection() void SimpleMessenger::submit_message(Message *m, Connection *con, const entity_addr_t& dest_addr, int dest_type, bool lazy) { + + if (cct->_conf->ms_dump_on_send) { + m->encode(-1, true); + ldout(cct, 0) << "submit_message " << *m << "\n"; + m->get_payload().hexdump(*_dout); + if (m->get_data().length() > 0) { + *_dout << " data:\n"; + m->get_data().hexdump(*_dout); + } + *_dout << dendl; + m->clear_payload(); + } + // existing connection? if (con) { Pipe *pipe = NULL;