From 0e0509e3da5c3735778fe0a5af8254c281ef4aed Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 16 Jul 2021 01:58:50 +0300 Subject: [PATCH] Dump op states in slow operation log --- src/osd.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/osd.cpp b/src/osd.cpp index 7998c88c..71cf6aec 100644 --- a/src/osd.cpp +++ b/src/osd.cpp @@ -7,6 +7,8 @@ #include #include +#include "blockstore_impl.h" +#include "osd_primary.h" #include "osd.h" #include "http_client.h" @@ -426,6 +428,24 @@ void osd_t::print_slow() { bufprintf(" inode=%lx offset=%lx len=%x", op->req.rw.inode, op->req.rw.offset, op->req.rw.len); } + if (op->req.hdr.opcode == OSD_OP_SEC_READ || op->req.hdr.opcode == OSD_OP_SEC_WRITE || + op->req.hdr.opcode == OSD_OP_SEC_WRITE_STABLE || op->req.hdr.opcode == OSD_OP_SEC_DELETE || + op->req.hdr.opcode == OSD_OP_SEC_SYNC || op->req.hdr.opcode == OSD_OP_SEC_LIST || + op->req.hdr.opcode == OSD_OP_SEC_STABILIZE || op->req.hdr.opcode == OSD_OP_SEC_ROLLBACK || + op->req.hdr.opcode == OSD_OP_SEC_READ_BMP) + { + bufprintf(" state=%d", PRIV(op->bs_op)->op_state); + int wait_for = PRIV(op->bs_op)->wait_for; + if (wait_for) + { + bufprintf(" wait=%d (detail=%lu)", wait_for, PRIV(op->bs_op)->wait_detail); + } + } + else if (op->req.hdr.opcode == OSD_OP_READ || op->req.hdr.opcode == OSD_OP_WRITE || + op->req.hdr.opcode == OSD_OP_SYNC || op->req.hdr.opcode == OSD_OP_DELETE) + { + bufprintf(" state=%d", !op->op_data ? -1 : op->op_data->st); + } #undef bufprintf printf("%s\n", alloc); }