]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/TrackedOp: manage current in parent class
authorSage Weil <sage@redhat.com>
Fri, 16 Dec 2016 18:53:41 +0000 (13:53 -0500)
committerSage Weil <sage@redhat.com>
Fri, 27 Jan 2017 15:30:44 +0000 (10:30 -0500)
No reason for child to muck with this!

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/TrackedOp.cc
src/common/TrackedOp.h
src/osd/OpRequest.cc

index bd04ca754476a3e91b9f8c0c1e82ea27a4c6622b..bd32b4e32551f3a5b03d52c76ee33e9de33c64dd 100644 (file)
@@ -275,7 +275,7 @@ bool OpTracker::check_ops_in_flight(std::vector<string> &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
index 3bd865bdec77918dc6c77ebbba1bf8453f1fbf28..599cc18b30986f3d1b84cfaad96185172c78b609 100644 (file)
@@ -174,7 +174,7 @@ protected:
 
   vector<Event> 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
index bd4c82b6e1329216ce341420b9dfbdb40f99da2d..3a161b65170f2f01f05096e351cf6ca81268764f 100644 (file)
@@ -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,