Commit 60816d9b authored by Kent Overstreet's avatar Kent Overstreet Committed by Kent Overstreet

bcachefs: Improve bch2_dump_trans_paths_updates()

Also print the key beyng overwritten for each update.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
parent edeb986b
...@@ -1695,7 +1695,7 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans) ...@@ -1695,7 +1695,7 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans)
struct btree_path *path; struct btree_path *path;
struct btree_insert_entry *i; struct btree_insert_entry *i;
unsigned idx; unsigned idx;
char buf[300]; char buf1[300], buf2[300];
btree_trans_sort_paths(trans); btree_trans_sort_paths(trans);
...@@ -1704,7 +1704,7 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans) ...@@ -1704,7 +1704,7 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans)
path->idx, path->ref, path->intent_ref, path->idx, path->ref, path->intent_ref,
path->preserve ? " preserve" : "", path->preserve ? " preserve" : "",
bch2_btree_ids[path->btree_id], bch2_btree_ids[path->btree_id],
(bch2_bpos_to_text(&PBUF(buf), path->pos), buf), (bch2_bpos_to_text(&PBUF(buf1), path->pos), buf1),
#ifdef CONFIG_BCACHEFS_DEBUG #ifdef CONFIG_BCACHEFS_DEBUG
(void *) path->ip_allocated (void *) path->ip_allocated
#else #else
...@@ -1712,11 +1712,16 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans) ...@@ -1712,11 +1712,16 @@ void bch2_dump_trans_paths_updates(struct btree_trans *trans)
#endif #endif
); );
trans_for_each_update(trans, i) trans_for_each_update(trans, i) {
printk(KERN_ERR "update: btree %s %s %pS\n", struct bkey u;
struct bkey_s_c old = bch2_btree_path_peek_slot(i->path, &u);
printk(KERN_ERR "update: btree %s %pS\n old %s\n new %s",
bch2_btree_ids[i->btree_id], bch2_btree_ids[i->btree_id],
(bch2_bkey_val_to_text(&PBUF(buf), trans->c, bkey_i_to_s_c(i->k)), buf), (void *) i->ip_allocated,
(void *) i->ip_allocated); (bch2_bkey_val_to_text(&PBUF(buf1), trans->c, old), buf1),
(bch2_bkey_val_to_text(&PBUF(buf2), trans->c, bkey_i_to_s_c(i->k)), buf2));
}
} }
static struct btree_path *btree_path_alloc(struct btree_trans *trans, static struct btree_path *btree_path_alloc(struct btree_trans *trans,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment