]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cached_extent: add print_detail for logical extents
authorSamuel Just <sjust@redhat.com>
Thu, 6 Aug 2020 00:00:07 +0000 (17:00 -0700)
committerSamuel Just <sjust@redhat.com>
Thu, 13 Aug 2020 18:32:28 +0000 (11:32 -0700)
This way we can always see laddr in debug output.

Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/cached_extent.cc
src/crimson/os/seastore/cached_extent.h

index cbe730871e602cb148a8ba29c7c894dea88d2f9e..7019b9fb802a4fbc0ff791964b99a087a4f8ae7f 100644 (file)
@@ -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()
index 6de468ffb948b5626adbd327b8163fce7e1352b0..6ae87f83cbbe2ef61aaa7e490a26e5c64b0beb3d 100644 (file)
@@ -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;