From: Sage Weil Date: Fri, 16 Dec 2016 18:59:00 +0000 (-0500) Subject: common/TrackedOp: some cleanup X-Git-Tag: v12.0.0~45^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=719c66ef01957f52821f5abdc64904711530fdd4;p=ceph.git common/TrackedOp: some cleanup Signed-off-by: Sage Weil --- diff --git a/src/common/TrackedOp.h b/src/common/TrackedOp.h index 599cc18b309..db014a35063 100644 --- a/src/common/TrackedOp.h +++ b/src/common/TrackedOp.h @@ -172,12 +172,12 @@ protected: } }; - vector events; /// list of events and their times - mutable Mutex lock; /// to protect the events list - const char *current; /// the current state the event is in - uint64_t seq; /// a unique value set by the OpTracker + vector events; ///< list of events and their times + mutable Mutex lock = {"TrackedOp::lock"}; ///< to protect the events list + const char *current = 0; ///< the current state the event is in + uint64_t seq = 0; ///< a unique value set by the OpTracker - uint32_t warn_interval_multiplier; // limits output of a given op warning + uint32_t warn_interval_multiplier = 1; //< limits output of a given op warning enum { STATE_UNTRACKED = 0, @@ -191,10 +191,7 @@ protected: TrackedOp(OpTracker *_tracker, const utime_t& initiated) : tracker(_tracker), - initiated_at(initiated), - lock("TrackedOp::lock"), - seq(0), - warn_interval_multiplier(1) + initiated_at(initiated) { events.reserve(OPTRACKER_PREALLOC_EVENTS); } @@ -244,12 +241,14 @@ public: } return desc; } +private: void _gen_desc() const { ostringstream ss; _dump_op_descriptor_unlocked(ss); desc_str = ss.str(); desc = desc_str.c_str(); } +public: void reset_desc() { desc = nullptr; }