From: Casey Bodley Date: Tue, 27 Oct 2015 16:18:33 +0000 (-0400) Subject: blkin: add config variable osd_blkin_trace_all X-Git-Tag: v12.0.3~73^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4516d8bf3c9a9fe27884657f6f7dccca8bc8f2da;p=ceph.git blkin: add config variable osd_blkin_trace_all when set, Message::decode_trace() will always create a trace for incoming messages, even if they didn't pass trace information Signed-off-by: Casey Bodley --- diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 976f06418dc8..741beac76a92 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -998,6 +998,8 @@ OPTION(osd_bench_large_size_max_throughput, OPT_U64, 100 << 20) // 100 MB/s OPTION(osd_bench_max_block_size, OPT_U64, 64 << 20) // cap the block size at 64MB OPTION(osd_bench_duration, OPT_U32, 30) // duration of 'osd bench', capped at 30s to avoid triggering timeouts +OPTION(osd_blkin_trace_all, OPT_BOOL, false) // create a blkin trace for all osd requests + OPTION(osd_discard_disconnected_ops, OPT_BOOL, true) OPTION(memstore_device_bytes, OPT_U64, 1024*1024*1024) diff --git a/src/msg/Message.cc b/src/msg/Message.cc index bcc4ad0425a4..4edbff051b85 100644 --- a/src/msg/Message.cc +++ b/src/msg/Message.cc @@ -858,7 +858,8 @@ void Message::decode_trace(bufferlist::iterator &p, bool create) if (!connection) return; - const auto endpoint = connection->get_messenger()->get_trace_endpoint(); + const auto msgr = connection->get_messenger(); + const auto endpoint = msgr->get_trace_endpoint(); blkin_trace_info info = {}; // only decode a trace if both sides of the connection agree @@ -868,7 +869,9 @@ void Message::decode_trace(bufferlist::iterator &p, bool create) if (info.trace_id) { trace.init(get_type_name(), endpoint, &info, true); trace.event("decoded trace"); - } else if (create) { // create a trace even if we didn't get one on the wire + } else if (create || (msgr->get_myname().is_osd() && + msgr->cct->_conf->osd_blkin_trace_all)) { + // create a trace even if we didn't get one on the wire trace.init(get_type_name(), endpoint); trace.event("created trace"); }