From 0c87d42b056e1a4095995dc5df8df2480aabdef1 Mon Sep 17 00:00:00 2001 From: "yite.gu" Date: Tue, 14 Mar 2023 09:58:56 -0400 Subject: [PATCH] osd/OpRequest: Add detail description for delayed op in osd log file Have no description delayed reason while the op mark is delayed in the log file. Add a detailed description while the op mark is delayed, it helps to quickly determine the problem and leave a trace. Signed-off-by: Yite Gu (cherry picked from commit a6c0e601b13dc2209cb6d546d249988d0472e1d4) --- src/osd/OpRequest.cc | 1 + src/osd/OpRequest.h | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/osd/OpRequest.cc b/src/osd/OpRequest.cc index cd62c922d6d45..6ab8aceb5ff5b 100644 --- a/src/osd/OpRequest.cc +++ b/src/osd/OpRequest.cc @@ -121,6 +121,7 @@ void OpRequest::mark_flag_point(uint8_t flag, const char *s) { uint8_t old_flags = hit_flag_points; #endif mark_event(s); + last_event_detail = s; hit_flag_points |= flag; latest_flag_point = flag; tracepoint(oprequest, mark_flag_point, reqid.name._type, diff --git a/src/osd/OpRequest.h b/src/osd/OpRequest.h index e0bc232a53b2d..33d1089dafefe 100644 --- a/src/osd/OpRequest.h +++ b/src/osd/OpRequest.h @@ -63,6 +63,7 @@ private: entity_inst_t req_src_inst; uint8_t hit_flag_points; uint8_t latest_flag_point; + const char* last_event_detail = nullptr; utime_t dequeued_time; static const uint8_t flag_queued_for_pg=1 << 0; static const uint8_t flag_reached_pg = 1 << 1; @@ -111,7 +112,7 @@ public: switch(latest_flag_point) { case flag_queued_for_pg: return "queued for pg"; case flag_reached_pg: return "reached pg"; - case flag_delayed: return "delayed"; + case flag_delayed: return last_event_detail; case flag_started: return "started"; case flag_sub_op_sent: return "waiting for sub ops"; case flag_commit_sent: return "commit sent; apply or cleanup"; @@ -152,8 +153,8 @@ public: void mark_reached_pg() { mark_flag_point(flag_reached_pg, "reached_pg"); } - void mark_delayed(const std::string& s) { - mark_flag_point_string(flag_delayed, s); + void mark_delayed(const char* s) { + mark_flag_point(flag_delayed, s); } void mark_started() { mark_flag_point(flag_started, "started"); -- 2.39.5