From: Sage Weil Date: Fri, 16 Dec 2016 18:53:41 +0000 (-0500) Subject: common/TrackedOp: manage current in parent class X-Git-Tag: v12.0.0~45^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e7613bd7e2ceded9ca0d804c42f86d74e9d13edb;p=ceph.git common/TrackedOp: manage current in parent class No reason for child to muck with this! Signed-off-by: Sage Weil --- diff --git a/src/common/TrackedOp.cc b/src/common/TrackedOp.cc index bd04ca75447..bd32b4e3255 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 3bd865bdec7..599cc18b309 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 bd4c82b6e13..3a161b65170 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,