@@ -91,15 +91,28 @@ static bool bkey_nocow_lock(struct bch_fs *c, struct moving_context *ctxt, struc
91
91
return true;
92
92
}
93
93
94
- static void trace_move_extent_finish2 (struct bch_fs * c , struct bkey_s_c k )
94
+ static noinline void trace_move_extent_finish2 (struct data_update * u ,
95
+ struct bkey_i * new ,
96
+ struct bkey_i * insert )
95
97
{
96
- if ( trace_move_extent_finish_enabled ()) {
97
- struct printbuf buf = PRINTBUF ;
98
+ struct bch_fs * c = u -> op . c ;
99
+ struct printbuf buf = PRINTBUF ;
98
100
99
- bch2_bkey_val_to_text (& buf , c , k );
100
- trace_move_extent_finish (c , buf .buf );
101
- printbuf_exit (& buf );
102
- }
101
+ prt_newline (& buf );
102
+
103
+ bch2_data_update_to_text (& buf , u );
104
+ prt_newline (& buf );
105
+
106
+ prt_str_indented (& buf , "new replicas:\t" );
107
+ bch2_bkey_val_to_text (& buf , c , bkey_i_to_s_c (new ));
108
+ prt_newline (& buf );
109
+
110
+ prt_str_indented (& buf , "insert:\t" );
111
+ bch2_bkey_val_to_text (& buf , c , bkey_i_to_s_c (insert ));
112
+ prt_newline (& buf );
113
+
114
+ trace_move_extent_finish (c , buf .buf );
115
+ printbuf_exit (& buf );
103
116
}
104
117
105
118
static void trace_move_extent_fail2 (struct data_update * m ,
@@ -372,7 +385,8 @@ static int __bch2_data_update_index_update(struct btree_trans *trans,
372
385
bch2_btree_iter_set_pos (& iter , next_pos );
373
386
374
387
this_cpu_add (c -> counters [BCH_COUNTER_move_extent_finish ], new -> k .size );
375
- trace_move_extent_finish2 (c , bkey_i_to_s_c (& new -> k_i ));
388
+ if (trace_move_extent_finish_enabled ())
389
+ trace_move_extent_finish2 (m , & new -> k_i , insert );
376
390
}
377
391
err :
378
392
if (bch2_err_matches (ret , BCH_ERR_transaction_restart ))
@@ -525,34 +539,38 @@ void bch2_data_update_opts_to_text(struct printbuf *out, struct bch_fs *c,
525
539
struct data_update_opts * data_opts )
526
540
{
527
541
printbuf_tabstop_push (out , 20 );
528
- prt_str (out , "rewrite ptrs:\t" );
542
+
543
+ prt_str_indented (out , "rewrite ptrs:\t" );
529
544
bch2_prt_u64_base2 (out , data_opts -> rewrite_ptrs );
530
545
prt_newline (out );
531
546
532
- prt_str (out , "kill ptrs:\t" );
547
+ prt_str_indented (out , "kill ptrs:\t" );
533
548
bch2_prt_u64_base2 (out , data_opts -> kill_ptrs );
534
549
prt_newline (out );
535
550
536
- prt_str (out , "target:\t" );
551
+ prt_str_indented (out , "target:\t" );
537
552
bch2_target_to_text (out , c , data_opts -> target );
538
553
prt_newline (out );
539
554
540
- prt_str (out , "compression:\t" );
555
+ prt_str_indented (out , "compression:\t" );
541
556
bch2_compression_opt_to_text (out , io_opts -> background_compression );
542
557
prt_newline (out );
543
558
544
- prt_str (out , "opts.replicas:\t" );
559
+ prt_str_indented (out , "opts.replicas:\t" );
545
560
prt_u64 (out , io_opts -> data_replicas );
561
+ prt_newline (out );
546
562
547
- prt_str (out , "extra replicas:\t" );
563
+ prt_str_indented (out , "extra replicas:\t" );
548
564
prt_u64 (out , data_opts -> extra_replicas );
549
565
}
550
566
551
567
void bch2_data_update_to_text (struct printbuf * out , struct data_update * m )
552
568
{
553
- bch2_bkey_val_to_text (out , m -> op .c , bkey_i_to_s_c (m -> k .k ));
554
- prt_newline (out );
555
569
bch2_data_update_opts_to_text (out , m -> op .c , & m -> op .opts , & m -> data_opts );
570
+ prt_newline (out );
571
+
572
+ prt_str_indented (out , "old key:\t" );
573
+ bch2_bkey_val_to_text (out , m -> op .c , bkey_i_to_s_c (m -> k .k ));
556
574
}
557
575
558
576
int bch2_extent_drop_ptrs (struct btree_trans * trans ,
0 commit comments