From 7c68241271680fca94ff610ff1b43705b61a4b9b Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Sat, 7 Mar 2015 18:02:54 +0900 Subject: [PATCH] sys/vfs/hammer: Fix hammer_debug_btree print format - hunk1 - Print current thread variable address like hammer_btree_iterate() does. - hunk2,3 - Add 'R' since hammer_btree_iterate() and hammer_btree_iterate_reverse() had the exact same format. - hunk4 - Minor cleanup to align with other btree debug prints. - hunk5 - Need another space to align with other btree debug prints. --- sys/vfs/hammer/hammer_btree.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/vfs/hammer/hammer_btree.c b/sys/vfs/hammer/hammer_btree.c index bbdac9bb8d..cc7bca2bb3 100644 --- a/sys/vfs/hammer/hammer_btree.c +++ b/sys/vfs/hammer/hammer_btree.c @@ -502,18 +502,20 @@ hammer_btree_iterate_reverse(hammer_cursor_t cursor) KKASSERT(cursor->index != node->count); if (node->type == HAMMER_BTREE_TYPE_INTERNAL) { elm = &node->elms[cursor->index]; + r = hammer_btree_cmp(&cursor->key_end, &elm[0].base); s = hammer_btree_cmp(&cursor->key_beg, &elm[1].base); if (hammer_debug_btree) { kprintf("BRACKETL %016llx[%d] %016llx %02x " - "key=%016llx lo=%02x %d\n", + "key=%016llx lo=%02x %d (td=%p)\n", (long long)cursor->node->node_offset, cursor->index, (long long)elm[0].internal.base.obj_id, elm[0].internal.base.rec_type, (long long)elm[0].internal.base.key, elm[0].internal.base.localization, - r + r, + curthread ); kprintf("BRACKETR %016llx[%d] %016llx %02x " "key=%016llx lo=%02x %d\n", @@ -557,7 +559,7 @@ hammer_btree_iterate_reverse(hammer_cursor_t cursor) elm = &node->elms[cursor->index]; s = hammer_btree_cmp(&cursor->key_beg, &elm->base); if (hammer_debug_btree) { - kprintf("ELEMENT %016llx:%d %c %016llx %02x " + kprintf("ELEMENTR %016llx:%d %c %016llx %02x " "key=%016llx lo=%02x %d\n", (long long)cursor->node->node_offset, cursor->index, @@ -610,7 +612,7 @@ hammer_btree_iterate_reverse(hammer_cursor_t cursor) if (hammer_debug_btree) { int i = cursor->index; hammer_btree_elm_t elm = &cursor->node->ondisk->elms[i]; - kprintf("ITERATE %p:%d %016llx %02x " + kprintf("ITERATER %p:%d %016llx %02x " "key=%016llx lo=%02x\n", cursor->node, i, (long long)elm->internal.base.obj_id, @@ -1058,7 +1060,7 @@ btree_search(hammer_cursor_t cursor, int flags) ++hammer_stats_btree_searches; if (hammer_debug_btree) { - kprintf("SEARCH %016llx[%d] %016llx %02x key=%016llx cre=%016llx lo=%02x (td = %p)\n", + kprintf("SEARCH %016llx[%d] %016llx %02x key=%016llx cre=%016llx lo=%02x (td=%p)\n", (long long)cursor->node->node_offset, cursor->index, (long long)cursor->key_beg.obj_id, @@ -1069,7 +1071,7 @@ btree_search(hammer_cursor_t cursor, int flags) curthread ); if (cursor->parent) - kprintf("SEARCHP %016llx[%d] (%016llx/%016llx %016llx/%016llx) (%p/%p %p/%p)\n", + kprintf("SEARCHP %016llx[%d] (%016llx/%016llx %016llx/%016llx) (%p/%p %p/%p)\n", (long long)cursor->parent->node_offset, cursor->parent_index, (long long)cursor->left_bound->obj_id, -- 2.41.0