From: Adam Kupczyk Date: Mon, 16 Jan 2023 09:28:47 +0000 (+0000) Subject: os/bluestore: Add operator<< for BufferSpace X-Git-Tag: v19.0.0~486^2~31 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=546e40091cc82d8d8b153b7678a2e62d7494e880;p=ceph.git os/bluestore: Add operator<< for BufferSpace Signed-off-by: Adam Kupczyk --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 0ab8a77c1ed0..c7cfbf9029c0 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -1943,6 +1943,23 @@ void BlueStore::BufferSpace::split(BufferCacheShard* cache, size_t pos, BlueStor cache->_trim(); } +// lists content of BufferSpace +// BufferSpace must be under exclusive access +std::ostream& operator<<(std::ostream& out, const BlueStore::BufferSpace& bc) +{ + for (auto& [i, j] : bc.buffer_map) { + out << " [0x" << std::hex << i << "]=" << *j << std::dec; + } + if (!bc.writing.empty()) { + out << " writing:"; + for (auto i = bc.writing.begin(); i != bc.writing.end(); ++i) { + out << " " << *i; + } + } + return out; +} + + // OnodeSpace #undef dout_prefix diff --git a/src/os/bluestore/BlueStore.h b/src/os/bluestore/BlueStore.h index ef8e380dbb36..e2ed810c0b35 100644 --- a/src/os/bluestore/BlueStore.h +++ b/src/os/bluestore/BlueStore.h @@ -477,6 +477,7 @@ public: } f->close_section(); } + friend std::ostream& operator<<(std::ostream& out, const BufferSpace& bc); }; struct SharedBlobSet;