diff options
author | Zhang Song <zhangsong02@qianxin.com> | 2024-08-09 08:49:09 +0200 |
---|---|---|
committer | Zhang Song <zhangsong02@qianxin.com> | 2024-08-23 08:58:09 +0200 |
commit | 0bd89aca3849404ee254610d778f98b7f2bcc208 (patch) | |
tree | 1d4c70ab4e073f4b66bb0c73db41f73ed83503d0 /src/crimson/os | |
parent | Merge pull request #59393 from anthonyeleven/caps-man-caps (diff) | |
download | ceph-0bd89aca3849404ee254610d778f98b7f2bcc208.tar.xz ceph-0bd89aca3849404ee254610d778f98b7f2bcc208.zip |
crimson/os/seastore/onode_manager: remove hex format of laddr_t
laddr_t will no longer be a plain uint64_t but a struct with a
customized formatter in the future, so these hexadecimal log outputs
should be removed at first.
Signed-off-by: Zhang Song <zhangsong02@qianxin.com>
Diffstat (limited to 'src/crimson/os')
7 files changed, 44 insertions, 44 deletions
diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc b/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc index ec566ac03cc..28064800a32 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node.cc @@ -435,7 +435,7 @@ eagain_ifuture<Ref<Node>> Node::load_root(context_t c, RootNodeTracker& root_tra assert(_super); auto root_addr = _super->get_root_laddr(); assert(root_addr != L_ADDR_NULL); - TRACET("loading root_addr={:x} ...", c.t, root_addr); + TRACET("loading root_addr={} ...", c.t, root_addr); return Node::load(c, root_addr, true ).si_then([c, _super = std::move(_super), &root_tracker, FNAME](auto root) mutable { @@ -693,22 +693,22 @@ eagain_ifuture<Ref<Node>> Node::load( eagain_iertr::pass_further{}, crimson::ct_error::input_output_error::assert_failure( [FNAME, c, addr, expect_is_level_tail] { - ERRORT("EIO -- addr={:x}, is_level_tail={}", + ERRORT("EIO -- addr={}, is_level_tail={}", c.t, addr, expect_is_level_tail); }), crimson::ct_error::invarg::assert_failure( [FNAME, c, addr, expect_is_level_tail] { - ERRORT("EINVAL -- addr={:x}, is_level_tail={}", + ERRORT("EINVAL -- addr={}, is_level_tail={}", c.t, addr, expect_is_level_tail); }), crimson::ct_error::enoent::assert_failure( [FNAME, c, addr, expect_is_level_tail] { - ERRORT("ENOENT -- addr={:x}, is_level_tail={}", + ERRORT("ENOENT -- addr={}, is_level_tail={}", c.t, addr, expect_is_level_tail); }), crimson::ct_error::erange::assert_failure( [FNAME, c, addr, expect_is_level_tail] { - ERRORT("ERANGE -- addr={:x}, is_level_tail={}", + ERRORT("ERANGE -- addr={}, is_level_tail={}", c.t, addr, expect_is_level_tail); }) ).si_then([FNAME, c, addr, expect_is_level_tail](auto extent) @@ -717,13 +717,13 @@ eagain_ifuture<Ref<Node>> Node::load( auto header = extent->get_header(); auto field_type = header.get_field_type(); if (!field_type) { - ERRORT("load addr={:x}, is_level_tail={} error, " + ERRORT("load addr={}, is_level_tail={} error, " "got invalid header -- {}", c.t, addr, expect_is_level_tail, fmt::ptr(extent)); ceph_abort("fatal error"); } if (header.get_is_level_tail() != expect_is_level_tail) { - ERRORT("load addr={:x}, is_level_tail={} error, " + ERRORT("load addr={}, is_level_tail={} error, " "is_level_tail mismatch -- {}", c.t, addr, expect_is_level_tail, fmt::ptr(extent)); ceph_abort("fatal error"); @@ -732,7 +732,7 @@ eagain_ifuture<Ref<Node>> Node::load( auto node_type = header.get_node_type(); if (node_type == node_type_t::LEAF) { if (extent->get_length() != c.vb.get_leaf_node_size()) { - ERRORT("load addr={:x}, is_level_tail={} error, " + ERRORT("load addr={}, is_level_tail={} error, " "leaf length mismatch -- {}", c.t, addr, expect_is_level_tail, fmt::ptr(extent)); ceph_abort("fatal error"); @@ -743,7 +743,7 @@ eagain_ifuture<Ref<Node>> Node::load( new LeafNode(derived_ptr, std::move(impl))); } else if (node_type == node_type_t::INTERNAL) { if (extent->get_length() != c.vb.get_internal_node_size()) { - ERRORT("load addr={:x}, is_level_tail={} error, " + ERRORT("load addr={}, is_level_tail={} error, " "internal length mismatch -- {}", c.t, addr, expect_is_level_tail, fmt::ptr(extent)); ceph_abort("fatal error"); @@ -1084,7 +1084,7 @@ eagain_ifuture<> InternalNode::apply_children_merge( auto left_addr = left_child->impl->laddr(); auto& right_pos = right_child->parent_info().position; auto right_addr = right_child->impl->laddr(); - DEBUGT("apply {}'s child {} (was {:#x}) at pos({}), " + DEBUGT("apply {}'s child {} (was {}) at pos({}), " "to merge with {} at pos({}), update_index={} ...", c.t, get_name(), left_child->get_name(), origin_left_addr, left_pos, right_child->get_name(), right_pos, update_index); @@ -1572,12 +1572,12 @@ eagain_ifuture<Ref<Node>> InternalNode::get_or_track_child( return [this, position, child_addr, c, FNAME] { auto found = tracked_child_nodes.find(position); if (found != tracked_child_nodes.end()) { - TRACET("loaded child tracked {} at pos({}) addr={:x}", + TRACET("loaded child tracked {} at pos({}) addr={}", c.t, found->second->get_name(), position, child_addr); return eagain_iertr::make_ready_future<Ref<Node>>(found->second); } // the child is not loaded yet - TRACET("loading child at pos({}) addr={:x} ...", + TRACET("loading child at pos({}) addr={} ...", c.t, position, child_addr); bool level_tail = position.is_end(); return Node::load(c, child_addr, level_tail diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_accessor.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_accessor.h index e4054e4fc0d..f178d998ca6 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_accessor.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_accessor.h @@ -173,7 +173,7 @@ class DeltaRecorderT final: public DeltaRecorder { auto p_addr = reinterpret_cast<laddr_packed_t*>( mut.get_write() + update_offset); SUBDEBUG(seastore_onode, - "apply {:#x} to offset {:#x} ...", + "apply {} to offset {:#x} ...", new_addr, update_offset); layout_t::update_child_addr(mut, new_addr, p_addr); break; @@ -526,12 +526,12 @@ class NodeExtentAccessorT { crimson::ct_error::input_output_error::assert_failure( [FNAME, c, alloc_size, l_to_discard = extent->get_laddr()] { SUBERRORT(seastore_onode, - "EIO during allocate -- node_size={}, to_discard={:x}", + "EIO during allocate -- node_size={}, to_discard={}", c.t, alloc_size, l_to_discard); }) ).si_then([this, c, FNAME] (auto fresh_extent) { SUBDEBUGT(seastore_onode, - "update addr from {:#x} to {:#x} ...", + "update addr from {} to {} ...", c.t, extent->get_laddr(), fresh_extent->get_laddr()); assert(fresh_extent); assert(fresh_extent->is_initial_pending()); @@ -555,14 +555,14 @@ class NodeExtentAccessorT { [FNAME, c, l_to_discard = to_discard->get_laddr(), l_fresh = fresh_extent->get_laddr()] { SUBERRORT(seastore_onode, - "EIO during retire -- to_disgard={:x}, fresh={:x}", + "EIO during retire -- to_disgard={}, fresh={}", c.t, l_to_discard, l_fresh); }), crimson::ct_error::enoent::assert_failure( [FNAME, c, l_to_discard = to_discard->get_laddr(), l_fresh = fresh_extent->get_laddr()] { SUBERRORT(seastore_onode, - "ENOENT during retire -- to_disgard={:x}, fresh={:x}", + "ENOENT during retire -- to_disgard={}, fresh={}", c.t, l_to_discard, l_fresh); }) ); @@ -582,11 +582,11 @@ class NodeExtentAccessorT { eagain_iertr::pass_further{}, crimson::ct_error::input_output_error::assert_failure( [FNAME, c, addr] { - SUBERRORT(seastore_onode, "EIO -- addr={:x}", c.t, addr); + SUBERRORT(seastore_onode, "EIO -- addr={}", c.t, addr); }), crimson::ct_error::enoent::assert_failure( [FNAME, c, addr] { - SUBERRORT(seastore_onode, "ENOENT -- addr={:x}", c.t, addr); + SUBERRORT(seastore_onode, "ENOENT -- addr={}", c.t, addr); }) #ifndef NDEBUG ).si_then([c] { diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h index 24df8b548e9..04ff5477127 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/dummy.h @@ -28,7 +28,7 @@ class DummySuper final: public Super { laddr_t get_root_laddr() const override { return *p_root_laddr; } void write_root_laddr(context_t c, laddr_t addr) override { LOG_PREFIX(OTree::Dummy); - SUBDEBUGT(seastore_onode, "update root {:#x} ...", c.t, addr); + SUBDEBUGT(seastore_onode, "update root {} ...", c.t, addr); *p_root_laddr = addr; } private: @@ -77,7 +77,7 @@ class DummyNodeExtentManager final: public NodeExtentManager { read_iertr::future<NodeExtentRef> read_extent( Transaction& t, laddr_t addr) override { - SUBTRACET(seastore_onode, "reading at {:#x} ...", t, addr); + SUBTRACET(seastore_onode, "reading at {} ...", t, addr); if constexpr (SYNC) { return read_extent_sync(t, addr); } else { @@ -90,7 +90,7 @@ class DummyNodeExtentManager final: public NodeExtentManager { alloc_iertr::future<NodeExtentRef> alloc_extent( Transaction& t, laddr_t hint, extent_len_t len) override { - SUBTRACET(seastore_onode, "allocating {}B with hint {:#x} ...", t, len, hint); + SUBTRACET(seastore_onode, "allocating {}B with hint {} ...", t, len, hint); if constexpr (SYNC) { return alloc_extent_sync(t, len); } else { @@ -104,7 +104,7 @@ class DummyNodeExtentManager final: public NodeExtentManager { retire_iertr::future<> retire_extent( Transaction& t, NodeExtentRef extent) override { SUBTRACET(seastore_onode, - "retiring {}B at {:#x} -- {} ...", + "retiring {}B at {} -- {} ...", t, extent->get_length(), extent->get_laddr(), *extent); if constexpr (SYNC) { return retire_extent_sync(t, extent); @@ -140,7 +140,7 @@ class DummyNodeExtentManager final: public NodeExtentManager { assert(iter != allocate_map.end()); auto extent = iter->second; SUBTRACET(seastore_onode, - "read {}B at {:#x} -- {}", + "read {}B at {} -- {}", t, extent->get_length(), extent->get_laddr(), *extent); assert(extent->get_laddr() == addr); return read_iertr::make_ready_future<NodeExtentRef>(extent); @@ -157,7 +157,7 @@ class DummyNodeExtentManager final: public NodeExtentManager { assert(allocate_map.find(extent->get_laddr()) == allocate_map.end()); allocate_map.insert({extent->get_laddr(), extent}); SUBDEBUGT(seastore_onode, - "allocated {}B at {:#x} -- {}", + "allocated {}B at {} -- {}", t, extent->get_length(), extent->get_laddr(), *extent); assert(extent->get_length() == len); return alloc_iertr::make_ready_future<NodeExtentRef>(extent); @@ -172,13 +172,13 @@ class DummyNodeExtentManager final: public NodeExtentManager { auto iter = allocate_map.find(addr); assert(iter != allocate_map.end()); allocate_map.erase(iter); - SUBDEBUGT(seastore_onode, "retired {}B at {:#x}", t, len, addr); + SUBDEBUGT(seastore_onode, "retired {}B at {}", t, len, addr); return retire_iertr::now(); } getsuper_iertr::future<Super::URef> get_super_sync( Transaction& t, RootNodeTracker& tracker) { - SUBTRACET(seastore_onode, "got root {:#x}", t, root_laddr); + SUBTRACET(seastore_onode, "got root {}", t, root_laddr); return getsuper_iertr::make_ready_future<Super::URef>( Super::URef(new DummySuper(t, tracker, &root_laddr))); } diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h index fb8fe54271d..9230051cc50 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_extent_manager/seastore.h @@ -30,7 +30,7 @@ class SeastoreSuper final: public Super { } void write_root_laddr(context_t c, laddr_t addr) override { LOG_PREFIX(OTree::Seastore); - SUBDEBUGT(seastore_onode, "update root {:#x} ...", c.t, addr); + SUBDEBUGT(seastore_onode, "update root {} ...", c.t, addr); root_addr = addr; tm.write_onode_root(c.t, addr); } @@ -102,10 +102,10 @@ class SeastoreNodeExtentManager final: public TransactionManagerHandle { read_iertr::future<NodeExtentRef> read_extent( Transaction& t, laddr_t addr) override { - SUBTRACET(seastore_onode, "reading at {:#x} ...", t, addr); + SUBTRACET(seastore_onode, "reading at {} ...", t, addr); if constexpr (INJECT_EAGAIN) { if (trigger_eagain()) { - SUBDEBUGT(seastore_onode, "reading at {:#x}: trigger eagain", t, addr); + SUBDEBUGT(seastore_onode, "reading at {}: trigger eagain", t, addr); t.test_set_conflict(); return read_iertr::make_ready_future<NodeExtentRef>(); } @@ -113,7 +113,7 @@ class SeastoreNodeExtentManager final: public TransactionManagerHandle { return tm.read_extent<SeastoreNodeExtent>(t, addr ).si_then([addr, &t](auto&& e) -> read_iertr::future<NodeExtentRef> { SUBTRACET(seastore_onode, - "read {}B at {:#x} -- {}", + "read {}B at {} -- {}", t, e->get_length(), e->get_laddr(), *e); assert(e->get_laddr() == addr); std::ignore = addr; @@ -123,7 +123,7 @@ class SeastoreNodeExtentManager final: public TransactionManagerHandle { alloc_iertr::future<NodeExtentRef> alloc_extent( Transaction& t, laddr_t hint, extent_len_t len) override { - SUBTRACET(seastore_onode, "allocating {}B with hint {:#x} ...", t, len, hint); + SUBTRACET(seastore_onode, "allocating {}B with hint {} ...", t, len, hint); if constexpr (INJECT_EAGAIN) { if (trigger_eagain()) { SUBDEBUGT(seastore_onode, "allocating {}B: trigger eagain", t, len); @@ -134,7 +134,7 @@ class SeastoreNodeExtentManager final: public TransactionManagerHandle { return tm.alloc_non_data_extent<SeastoreNodeExtent>(t, hint, len ).si_then([len, &t](auto extent) { SUBDEBUGT(seastore_onode, - "allocated {}B at {:#x} -- {}", + "allocated {}B at {} -- {}", t, extent->get_length(), extent->get_laddr(), *extent); if (!extent->is_initial_pending()) { SUBERRORT(seastore_onode, @@ -157,12 +157,12 @@ class SeastoreNodeExtentManager final: public TransactionManagerHandle { auto addr = extent->get_laddr(); auto len = extent->get_length(); SUBDEBUGT(seastore_onode, - "retiring {}B at {:#x} -- {} ...", + "retiring {}B at {} -- {} ...", t, len, addr, *extent); if constexpr (INJECT_EAGAIN) { if (trigger_eagain()) { SUBDEBUGT(seastore_onode, - "retiring {}B at {:#x} -- {} : trigger eagain", + "retiring {}B at {} -- {} : trigger eagain", t, len, addr, *extent); t.test_set_conflict(); return retire_iertr::now(); @@ -170,7 +170,7 @@ class SeastoreNodeExtentManager final: public TransactionManagerHandle { } return tm.remove(t, extent).si_then([addr, len, &t] (unsigned cnt) { assert(cnt == 0); - SUBTRACET(seastore_onode, "retired {}B at {:#x} ...", t, len, addr); + SUBTRACET(seastore_onode, "retired {}B at {} ...", t, len, addr); }); } @@ -185,7 +185,7 @@ class SeastoreNodeExtentManager final: public TransactionManagerHandle { } } return tm.read_onode_root(t).si_then([this, &t, &tracker](auto root_addr) { - SUBTRACET(seastore_onode, "got root {:#x}", t, root_addr); + SUBTRACET(seastore_onode, "got root {}", t, root_addr); return Super::URef(new SeastoreSuper(t, tracker, root_addr, tm)); }); } diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h index 70db76be75d..e6490f7632c 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_layout.h @@ -374,8 +374,8 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl { size += sizeof(laddr_t); auto value_ptr = node_stage.get_end_p_laddr(); int offset = reinterpret_cast<const char*>(value_ptr) - p_start; - os << "\n tail value: 0x" - << std::hex << value_ptr->value << std::dec + os << "\n tail value: " + << value_ptr->value << " " << size << "B" << " @" << offset << "B"; } @@ -845,7 +845,7 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl { const search_position_t& pos, laddr_t dst, laddr_t src) override { if constexpr (NODE_TYPE == node_type_t::INTERNAL) { LOG_PREFIX(OTree::Layout::replace_child_addr); - SUBDEBUG(seastore_onode, "update from {:#x} to {:#x} at pos({}) ...", src, dst, pos); + SUBDEBUG(seastore_onode, "update from {} to {} at pos({}) ...", src, dst, pos); const laddr_packed_t* p_value; if (pos.is_end()) { assert(is_level_tail()); @@ -924,8 +924,8 @@ class NodeLayoutT final : public InternalNodeImpl, public LeafNodeImpl { // XXX: maybe also include the extent state std::ostringstream sos; sos << "Node" << NODE_TYPE << FIELD_TYPE - << "@0x" << std::hex << extent.get_laddr() - << "+" << extent.get_length() << std::dec + << "@" << extent.get_laddr() + << "+" << std::hex << extent.get_length() << std::dec << "Lv" << (unsigned)level() << (is_level_tail() ? "$" : ""); name = sos.str(); diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h b/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h index 6acb1df0077..975fceedac8 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/node_types.h @@ -47,7 +47,7 @@ struct laddr_packed_t { laddr_t value; } __attribute__((packed)); inline std::ostream& operator<<(std::ostream& os, const laddr_packed_t& laddr) { - return os << "laddr_packed(0x" << std::hex << laddr.value << std::dec << ")"; + return os << "laddr_packed(" << laddr.value << ")"; } using match_stat_t = int8_t; diff --git a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h index cc4c39d5027..140ddba2ff5 100644 --- a/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h +++ b/src/crimson/os/seastore/onode_manager/staged-fltree/stages/stage.h @@ -1443,7 +1443,7 @@ struct staged { if constexpr (NODE_TYPE == node_type_t::LEAF) { os << *value_ptr; } else { - os << "0x" << std::hex << value_ptr->value << std::dec; + os << value_ptr->value; } os << " " << size << "B" << " @" << offset << "B"; |