From: Casey Bodley Date: Fri, 28 Aug 2015 20:22:06 +0000 (-0400) Subject: blkin: set up tracing in PGs X-Git-Tag: v12.0.3~73^2~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf8772ff8e5c55359a8c8a26591cc345312c560b;p=ceph.git blkin: set up tracing in PGs Signed-off-by: Casey Bodley --- diff --git a/src/common/TrackedOp.h b/src/common/TrackedOp.h index 5de461e9c63e..da573b1b9d03 100644 --- a/src/common/TrackedOp.h +++ b/src/common/TrackedOp.h @@ -224,6 +224,7 @@ protected: public: ZTracer::Trace osd_trace; + ZTracer::Trace pg_trace; virtual ~TrackedOp() {} diff --git a/src/osd/PG.cc b/src/osd/PG.cc index acc0884a8d04..d6f039f96082 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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; } diff --git a/src/osd/PG.h b/src/osd/PG.h index 71a0b63052df..8397959f587e 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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; diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index dae342369107..60922d1a8aae 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -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()) {