99#include "btree_update.h"
1010#include "btree_update_interior.h"
1111#include "btree_write_buffer.h"
12+ #include "compress.h"
1213#include "disk_groups.h"
1314#include "ec.h"
1415#include "errcode.h"
@@ -34,12 +35,46 @@ const char * const bch2_data_ops_strs[] = {
3435 NULL
3536};
3637
37- static void trace_move_extent2 (struct bch_fs * c , struct bkey_s_c k )
38+ static void bch2_data_update_opts_to_text (struct printbuf * out , struct bch_fs * c ,
39+ struct bch_io_opts * io_opts ,
40+ struct data_update_opts * data_opts )
41+ {
42+ printbuf_tabstop_push (out , 20 );
43+ prt_str (out , "rewrite ptrs:" );
44+ prt_tab (out );
45+ bch2_prt_u64_base2 (out , data_opts -> rewrite_ptrs );
46+ prt_newline (out );
47+
48+ prt_str (out , "kill ptrs: " );
49+ prt_tab (out );
50+ bch2_prt_u64_base2 (out , data_opts -> kill_ptrs );
51+ prt_newline (out );
52+
53+ prt_str (out , "target: " );
54+ prt_tab (out );
55+ bch2_target_to_text (out , c , data_opts -> target );
56+ prt_newline (out );
57+
58+ prt_str (out , "compression: " );
59+ prt_tab (out );
60+ bch2_compression_opt_to_text (out , io_opts -> background_compression ?: io_opts -> compression );
61+ prt_newline (out );
62+
63+ prt_str (out , "extra replicas: " );
64+ prt_tab (out );
65+ prt_u64 (out , data_opts -> extra_replicas );
66+ }
67+
68+ static void trace_move_extent2 (struct bch_fs * c , struct bkey_s_c k ,
69+ struct bch_io_opts * io_opts ,
70+ struct data_update_opts * data_opts )
3871{
3972 if (trace_move_extent_enabled ()) {
4073 struct printbuf buf = PRINTBUF ;
4174
4275 bch2_bkey_val_to_text (& buf , c , k );
76+ prt_newline (& buf );
77+ bch2_data_update_opts_to_text (& buf , c , io_opts , data_opts );
4378 trace_move_extent (c , buf .buf );
4479 printbuf_exit (& buf );
4580 }
@@ -250,9 +285,10 @@ int bch2_move_extent(struct moving_context *ctxt,
250285 unsigned sectors = k .k -> size , pages ;
251286 int ret = - ENOMEM ;
252287
288+ trace_move_extent2 (c , k , & io_opts , & data_opts );
289+
253290 if (ctxt -> stats )
254291 ctxt -> stats -> pos = BBPOS (iter -> btree_id , iter -> pos );
255- trace_move_extent2 (c , k );
256292
257293 bch2_data_update_opts_normalize (k , & data_opts );
258294
0 commit comments