]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
blkin: add config variable osd_blkin_trace_all
authorCasey Bodley <cbodley@redhat.com>
Tue, 27 Oct 2015 16:18:33 +0000 (12:18 -0400)
committerSage Weil <sage@redhat.com>
Fri, 5 May 2017 18:05:24 +0000 (14:05 -0400)
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 <cbodley@redhat.com>
src/common/config_opts.h
src/msg/Message.cc

index 976f06418dc8a0df8b0211ecc37e8f2e4576c6b5..741beac76a925a89ff7ac49871f3b35f988a3ba3 100644 (file)
@@ -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)
index bcc4ad0425a49a50baa17fd2b3cc1c0a48f77925..4edbff051b85b7cf8be10994451cf23eb10e8703 100644 (file)
@@ -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");
   }