From f400cb19a3ac9fe839f41b9d96d69e013698474d Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Tue, 9 Jul 2024 13:27:54 +0000 Subject: [PATCH] os/bluestore: Fix debug after rebase BufferSpace moved from Blob to Onode. Moved relevant code from Blob::operator<< to Onode::operator<<. Signed-off-by: Adam Kupczyk --- src/os/bluestore/BlueStore_debug.cc | 50 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/os/bluestore/BlueStore_debug.cc b/src/os/bluestore/BlueStore_debug.cc index 3fcf331052973..2d4e3a423fc87 100644 --- a/src/os/bluestore/BlueStore_debug.cc +++ b/src/os/bluestore/BlueStore_debug.cc @@ -209,31 +209,6 @@ std::ostream& operator<<(std::ostream& out, const BlueStore::Blob::printer &p) out << " " << *p.blob.shared_blob; } out << ")"; - // here printing Buffers - if (p.mode & (P::BUF | P::SBUF)) { - std::lock_guard l(p.blob.collection->cache->lock); - if (p.mode & P::SBUF) { - // summary buf mode, only print what is mapped what options are, one liner - out << " bufs("; - bool space = false; - for (auto& i : p.blob.get_bc().buffer_map) { - if (space) out << " "; - out << "0x" << std::hex << i.first << "~" << i.second.length << std::dec - << BlueStore::Buffer::get_state_name_short(i.second.state); - if (i.second.flags) { - out << "," << BlueStore::Buffer::get_flag_name(i.second.flags); - } - space = true; - } - out << ")"; - } else { - for (auto& i : p.blob.get_bc().buffer_map) { - out << std::endl << " 0x" << std::hex << i.first - << "~" << i.second.length << std::dec - << " " << i.second; - } - } - } return out; } @@ -275,6 +250,31 @@ std::ostream& operator<<(std::ostream& out, const BlueStore::Onode::printer &p) for (const auto& i : visited) { out << std::endl << i->print(mode); } + // here printing Buffers + if (p.mode & (P::BUF | P::SBUF)) { + std::lock_guard l(o.c->cache->lock); + if (p.mode & P::SBUF) { + // summary buf mode, only print what is mapped what options are, one liner + out << " bufs("; + bool space = false; + for (auto& i : o.bc.buffer_map) { + if (space) out << " "; + out << "0x" << std::hex << i.offset << "~" << i.length << std::dec + << BlueStore::Buffer::get_state_name_short(i.state); + if (i.flags) { + out << "," << BlueStore::Buffer::get_flag_name(i.flags); + } + space = true; + } + out << ")"; + } else { + for (auto& i : o.bc.buffer_map) { + out << std::endl << " 0x" << std::hex << i.offset + << "~" << i.length << std::dec + << " " << i; + } + } + } if (mode & P::ATTRS) { for (const auto& p : o.onode.attrs) { out << std::endl << "attr " << p.first << " len " << p.second.length(); -- 2.39.5