From: Samuel Just Date: Thu, 6 Aug 2020 00:00:07 +0000 (-0700) Subject: crimson/os/seastore/cached_extent: add print_detail for logical extents X-Git-Tag: v16.1.0~1438^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4943d1464404d8b16ea41530cea6a8f23b14f499;p=ceph.git crimson/os/seastore/cached_extent: add print_detail for logical extents This way we can always see laddr in debug output. Signed-off-by: Samuel Just --- diff --git a/src/crimson/os/seastore/cached_extent.cc b/src/crimson/os/seastore/cached_extent.cc index cbe730871e60..7019b9fb802a 100644 --- a/src/crimson/os/seastore/cached_extent.cc +++ b/src/crimson/os/seastore/cached_extent.cc @@ -65,6 +65,17 @@ CachedExtent::~CachedExtent() } } +std::ostream &LogicalCachedExtent::print_detail(std::ostream &out) const +{ + out << ", laddr=" << laddr; + if (pin) { + out << ", pin=" << *pin; + } else { + out << ", pin=empty"; + } + return print_detail_l(out); +} + std::ostream &operator<<(std::ostream &out, const LBAPin &rhs) { return out << "LBAPin(" << rhs.get_laddr() << "~" << rhs.get_length() diff --git a/src/crimson/os/seastore/cached_extent.h b/src/crimson/os/seastore/cached_extent.h index 6de468ffb948..6ae87f83cbbe 100644 --- a/src/crimson/os/seastore/cached_extent.h +++ b/src/crimson/os/seastore/cached_extent.h @@ -566,8 +566,13 @@ public: bool is_logical() const final { return true; } + + std::ostream &print_detail(std::ostream &out) const final; protected: virtual void apply_delta(const ceph::bufferlist &bl) = 0; + virtual std::ostream &print_detail_l(std::ostream &out) const { + return out; + } private: laddr_t laddr = L_ADDR_NULL;