From: Sage Weil Date: Thu, 13 Jun 2013 23:01:31 +0000 (-0700) Subject: osdc/Objecter: dump command ops X-Git-Tag: v0.65~78^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2bda9db1c24530cbaaa161b7ff0a80efa913aa78;p=ceph.git osdc/Objecter: dump command ops Dump command_ops along with everything else. Signed-off-by: Sage Weil --- diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index 3674d361f141..e6b07a248ed4 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -2189,6 +2189,7 @@ void Objecter::dump_requests(Formatter& fmt) const dump_pool_ops(fmt); dump_pool_stat_ops(fmt); dump_statfs_ops(fmt); + dump_command_ops(fmt); fmt.close_section(); // requests object } @@ -2245,6 +2246,29 @@ void Objecter::dump_linger_ops(Formatter& fmt) const fmt.close_section(); // linger_ops array } +void Objecter::dump_command_ops(Formatter& fmt) const +{ + fmt.open_array_section("command_ops"); + for (map::const_iterator p = command_ops.begin(); + p != command_ops.end(); + ++p) { + CommandOp *op = p->second; + fmt.open_object_section("command_op"); + fmt.dump_unsigned("command_id", op->tid); + fmt.dump_int("osd", op->session ? op->session->osd : -1); + fmt.open_array_section("command"); + for (vector::const_iterator q = op->cmd.begin(); q != op->cmd.end(); ++q) + fmt.dump_string("word", *q); + fmt.close_section(); + if (op->target_osd >= 0) + fmt.dump_int("target_osd", op->target_osd); + else + fmt.dump_stream("target_pg") << op->target_pg; + fmt.close_section(); // command_op object + } + fmt.close_section(); // command_ops array +} + void Objecter::dump_pool_ops(Formatter& fmt) const { fmt.open_array_section("pool_ops"); diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index b64c8f77ed07..5f28d6d7eac8 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1226,6 +1226,7 @@ private: void dump_requests(Formatter& fmt) const; void dump_ops(Formatter& fmt) const; void dump_linger_ops(Formatter& fmt) const; + void dump_command_ops(Formatter& fmt) const; void dump_pool_ops(Formatter& fmt) const; void dump_pool_stat_ops(Formatter& fmt) const; void dump_statfs_ops(Formatter& fmt) const;