From: David Zafman Date: Fri, 6 Feb 2015 02:48:22 +0000 (-0800) Subject: osd: Dump header in FileJournal::dump() X-Git-Tag: v0.94.7~28^2~11^2~19 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b8f4ea17274f9094efa169a28440701319c14516;p=ceph.git osd: Dump header in FileJournal::dump() Signed-off-by: David Zafman (cherry picked from commit 3c97b32131e83c934b3d340eeb75284e898380c4) --- diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index d0b9563def06d..34082cdb5bdef 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -588,8 +588,22 @@ int FileJournal::dump(ostream& out) read_pos = header.start; JSONFormatter f(true); + f.open_object_section("journal"); + + f.open_object_section("header"); + f.dump_unsigned("flags", header.flags); + ostringstream os; + os << header.fsid; + f.dump_string("fsid", os.str()); + f.dump_unsigned("block_size", header.block_size); + f.dump_unsigned("alignment", header.alignment); + f.dump_int("max_size", header.max_size); + f.dump_int("start", header.start); + f.dump_unsigned("committed_up_to", header.committed_up_to); + f.dump_unsigned("start_seq", header.start_seq); + f.close_section(); - f.open_array_section("journal"); + f.open_array_section("entries"); uint64_t seq = 0; while (1) { bufferlist bl; @@ -618,6 +632,7 @@ int FileJournal::dump(ostream& out) f.close_section(); } + f.close_section(); f.close_section(); f.flush(out); dout(10) << "dump finish" << dendl;