From: Liam R. Howlett Date: Mon, 1 Sep 2025 06:08:49 +0000 (-0400) Subject: testing output X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7312f0d993e1a9939dddbd0c9603bc8b89fd491d;p=users%2Fjedix%2Flinux-maple.git testing output Signed-off-by: Liam R. Howlett --- diff --git a/lib/maple_tree.c b/lib/maple_tree.c index 90c080bb318b..a296d8964ee4 100644 --- a/lib/maple_tree.c +++ b/lib/maple_tree.c @@ -2921,8 +2921,8 @@ unsigned long node_copy(struct ma_state *mas, struct maple_node *src, struct maple_enode *edst = mt_mk_node(dst, d_mt); printk("dst %p d_slots %p %p\n", dst, d_slots, *d_slots); - printk("d_start %u\n", d_start); for (int i = 0; i < size; i++) { + printk("d_start %u + i = %u\n", d_start, d_start + i); printk("set slot %u parent\n", i); printk("d_slots = %p\n", d_slots[i]); mas_set_parent(mas, d_slots[i], edst, d_start + i); @@ -2963,8 +2963,10 @@ unsigned long node_copy(struct ma_state *mas, struct maple_node *src, // printk("cp from %p -> %p %u\n", d_pivots, s_pivots, size); fflush(stdout); size--; - if (size) + if (size) { + printk("memcpy pivots of size %u\n", size); memcpy(d_pivots, s_pivots, size * sizeof(unsigned long)); + } return d_max; } @@ -2981,6 +2983,8 @@ void node_finalise(struct maple_node *node, enum maple_type mt, unsigned char en gaps = ma_gaps(node, mt); if (end < max_end - 1) { size = max_end - end; + + printk("Clear %u - %u\n", end, end + size - 1); memset(ma_slots(node, mt) + end, 0, size * sizeof(void*)); if (gaps) @@ -3114,6 +3118,7 @@ void spanning_split_dest_setup(struct maple_copy *cp, struct ma_state *mas, cp->split = (cp->data + 2) / 3; cp->d_count = 3; } + printk("split %u data %u d_count %u\n", cp->split, cp->data, cp->d_count); for (int i = 0; i < cp->d_count; i++) { cp->dst[i].mt = mt; @@ -3152,7 +3157,7 @@ void spanning_split_src_setup(struct maple_copy *cp, struct ma_state *mas, append_node_cp(cp, l_wr_mas->mas, 0, off); cp->src[cp->s_count - 1].max = cp->min - 1; - printk("Use pivot %p [%u]\n", l_wr_mas->node, off); + printk("->>src %u max is %lx\n", cp->s_count - 1,cp->min - 1); } printk("cp min is %lx\n", cp->min); @@ -3312,7 +3317,9 @@ void spanning_data_write(struct maple_copy *cp, struct ma_state *mas) data_offset--; dst_offset--; cp->dst[d].max = ma_pivots(dst, d_mt)[dst_offset - 1]; + printk("%d: RESET set dest max %lx\n", __LINE__, cp->dst[d].max); } + node_finalise(dst, d_mt, dst_offset); //mt_dump_node(mas->tree, mt_mk_node(dst, d_mt), 0, ULONG_MAX, 1, mt_dump_hex); if (d >= cp->d_count) { @@ -3631,15 +3638,10 @@ static void mas_wr_spanning_rebalance(struct ma_state *mas, printk("\nlmas %p rmas %p\n", l_wr_mas->node, r_wr_mas->node); cp.height++; - printk("%d: cp min %lx\n", __LINE__, cp.min); spanning_data_calc(&cp, mas, l_wr_mas, r_wr_mas, &sib); - printk("%d: cp min %lx\n", __LINE__, cp.min); spanning_split_dest_setup(&cp, mas, l_wr_mas->type); - printk("%d: cp min %lx\n", __LINE__, cp.min); spanning_split_src_setup(&cp, mas, l_wr_mas, r_wr_mas, &sib); - printk("%d: cp min %lx\n", __LINE__, cp.min); spanning_data_write(&cp, mas); - printk("%d: cp min %lx\n", __LINE__, cp.min); #if 0 if (debug < 2) { diff --git a/tools/testing/radix-tree/maple.c b/tools/testing/radix-tree/maple.c index 7118eea67fa5..99cdd94b2f12 100644 --- a/tools/testing/radix-tree/maple.c +++ b/tools/testing/radix-tree/maple.c @@ -34435,7 +34435,7 @@ static void *rcu_reader_fwd(void *ptr) goto quit; } fflush(stdout); - printk("start is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.index, mas.index, r_start, r_start); + printk("Error start is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.index, mas.index, r_start, r_start); } RCU_MT_BUG_ON(test, mas.index != r_start); @@ -34445,7 +34445,7 @@ static void *rcu_reader_fwd(void *ptr) goto quit; } fflush(stdout); - printk("last is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.last, mas.last, r_end, r_end); + printk("Error last is wrong: %lx (%lu) vs expected %lx (%lu)\n", mas.last, mas.last, r_end, r_end); } RCU_MT_BUG_ON(test, mas.last != r_end); @@ -34578,6 +34578,7 @@ static void *rcu_reader_rev(void *ptr) alt = xa_mk_value(index + i * 2 + 1 + RCU_RANGE_COUNT); mt_dump(test->mt, mt_dump_dec); + fflush(stdout); printk("Error: %p %lu-%lu %p != %lu-%lu %p %p line %d i %d\n", mas.node, mas.index, mas.last, entry, @@ -34801,6 +34802,11 @@ static void rcu_stress(struct maple_tree *mt, bool forward) seed = 1 + r + rand() % 10; } + mt_validate(mt); + + printk("TREE START BEFORE TEST\n"); + mt_dump(mt, mt_dump_hex); + i = count = ARRAY_SIZE(readers); while (i--) { unsigned long id;