From e7613bd7e2ceded9ca0d804c42f86d74e9d13edb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 16 Dec 2016 13:53:41 -0500 Subject: [PATCH] common/TrackedOp: manage current in parent class No reason for child to muck with this! Signed-off-by: Sage Weil --- src/common/TrackedOp.cc | 3 ++- src/common/TrackedOp.h | 2 +- src/osd/OpRequest.cc | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/TrackedOp.cc b/src/common/TrackedOp.cc index bd04ca754476..bd32b4e32551 100644 --- a/src/common/TrackedOp.cc +++ b/src/common/TrackedOp.cc @@ -275,7 +275,7 @@ bool OpTracker::check_ops_in_flight(std::vector &warning_vector, int *sl ss << "slow request " << age << " seconds old, received at " << i->get_initiated() << ": " << i->get_desc() << " currently " - << (i->current.size() ? i->current : i->state_string()); + << (i->current ? i->current : i->state_string()); warning_vector.push_back(ss.str()); // only those that have been shown will backoff @@ -327,6 +327,7 @@ void TrackedOp::mark_event_string(const string &event, utime_t stamp) { Mutex::Locker l(lock); events.push_back(Event(stamp, event)); + current = events.back().c_str(); } dout(5) << "seq: " << seq << ", time: " << stamp diff --git a/src/common/TrackedOp.h b/src/common/TrackedOp.h index 3bd865bdec77..599cc18b3098 100644 --- a/src/common/TrackedOp.h +++ b/src/common/TrackedOp.h @@ -174,7 +174,7 @@ protected: vector events; /// list of events and their times mutable Mutex lock; /// to protect the events list - string current; /// the current state the event is in + const char *current; /// the current state the event is in uint64_t seq; /// a unique value set by the OpTracker uint32_t warn_interval_multiplier; // limits output of a given op warning diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index bd4c82b6e132..3a161b65170f 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -143,7 +143,6 @@ void OpRequest::mark_flag_point(uint8_t flag, const char *s) { uint8_t old_flags = hit_flag_points; #endif mark_event(s); - current = s; hit_flag_points |= flag; latest_flag_point = flag; tracepoint(oprequest, mark_flag_point, reqid.name._type, -- 2.47.3