]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
blkin: set up tracing in PGs
authorCasey Bodley <cbodley@redhat.com>
Fri, 28 Aug 2015 20:22:06 +0000 (16:22 -0400)
committerSage Weil <sage@redhat.com>
Fri, 5 May 2017 18:04:51 +0000 (14:04 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/common/TrackedOp.h
src/osd/PG.cc
src/osd/PG.h
src/osd/PrimaryLogPG.cc

index 5de461e9c63edef01bfdb98db49ab53ce8e8c704..da573b1b9d035e5bd96d13731b34c525bd3bd9b1 100644 (file)
@@ -224,6 +224,7 @@ protected:
 
 public:
   ZTracer::Trace osd_trace;
+  ZTracer::Trace pg_trace;
 
   virtual ~TrackedOp() {}
 
index acc0884a8d04df2f3cce4f9c4ec486f20f81fad2..d6f039f96082ff85a1dfd77b1eaff12db702aa33 100644 (file)
@@ -289,7 +289,9 @@ PG::PG(OSDService *o, OSDMapRef curmap,
   #ifdef PG_DEBUG_REFS
   _ref_id_lock("PG::_ref_id_lock"), _ref_id(0),
   #endif
-  deleting(false), dirty_info(false), dirty_big_info(false),
+  deleting(false),
+  trace_endpoint("0.0.0.0", 0, "PG"),
+  dirty_info(false), dirty_big_info(false),
   info(p),
   info_struct_v(0),
   coll(p), pg_log(cct),
@@ -328,6 +330,11 @@ PG::PG(OSDService *o, OSDMapRef curmap,
 {
 #ifdef PG_DEBUG_REFS
   osd->add_pgid(p, this);
+#endif
+#ifdef WITH_BLKIN
+  std::stringstream ss;
+  ss << "PG " << info.pgid;
+  trace_endpoint.copy_name(ss.str());
 #endif
   osr->shard_hint = p;
 }
index 71a0b63052df7c8cb7fea0e3beac71de4f39b792..8397959f587e2ed7f9d009499497cd233d67bc11 100644 (file)
@@ -310,6 +310,7 @@ protected:
 public:
   bool deleting;  // true while in removing or OSD is shutting down
 
+  ZTracer::Endpoint trace_endpoint;
 
   void lock_suspend_timeout(ThreadPool::TPHandle &handle);
   void lock(bool no_lockdep = false) const;
index dae342369107b05a0ed8fccef75a672dde86445b..60922d1a8aae76e3b8576fbd0eb8a52667c9bb9b 100644 (file)
@@ -1596,6 +1596,10 @@ void PrimaryLogPG::do_request(
   OpRequestRef& op,
   ThreadPool::TPHandle &handle)
 {
+  if (op->osd_trace) {
+    op->pg_trace.init("pg op", &trace_endpoint, &op->osd_trace);
+    op->pg_trace.event("do request");
+  }
   // make sure we have a new enough map
   auto p = waiting_for_map.find(op->get_source());
   if (p != waiting_for_map.end()) {