@@ -1043,20 +1043,28 @@ DEFINE_EVENT(transaction_restart_iter, trans_restart_btree_node_split,
10431043 TP_ARGS (trans , caller_ip , path )
10441044);
10451045
1046+ struct get_locks_fail ;
1047+
10461048TRACE_EVENT (trans_restart_upgrade ,
10471049 TP_PROTO (struct btree_trans * trans ,
10481050 unsigned long caller_ip ,
10491051 struct btree_path * path ,
10501052 unsigned old_locks_want ,
1051- unsigned new_locks_want ),
1052- TP_ARGS (trans , caller_ip , path , old_locks_want , new_locks_want ),
1053+ unsigned new_locks_want ,
1054+ struct get_locks_fail * f ),
1055+ TP_ARGS (trans , caller_ip , path , old_locks_want , new_locks_want , f ),
10531056
10541057 TP_STRUCT__entry (
10551058 __array (char , trans_fn , 32 )
10561059 __field (unsigned long , caller_ip )
10571060 __field (u8 , btree_id )
10581061 __field (u8 , old_locks_want )
10591062 __field (u8 , new_locks_want )
1063+ __field (u8 , level )
1064+ __field (u32 , path_seq )
1065+ __field (u32 , node_seq )
1066+ __field (u32 , path_alloc_seq )
1067+ __field (u32 , downgrade_seq )
10601068 TRACE_BPOS_entries (pos )
10611069 ),
10621070
@@ -1066,18 +1074,28 @@ TRACE_EVENT(trans_restart_upgrade,
10661074 __entry -> btree_id = path -> btree_id ;
10671075 __entry -> old_locks_want = old_locks_want ;
10681076 __entry -> new_locks_want = new_locks_want ;
1077+ __entry -> level = f -> l ;
1078+ __entry -> path_seq = path -> l [f -> l ].lock_seq ;
1079+ __entry -> node_seq = IS_ERR_OR_NULL (f -> b ) ? 0 : f -> b -> c .lock .seq ;
1080+ __entry -> path_alloc_seq = path -> alloc_seq ;
1081+ __entry -> downgrade_seq = path -> downgrade_seq ;
10691082 TRACE_BPOS_assign (pos , path -> pos )
10701083 ),
10711084
1072- TP_printk ("%s %pS btree %s pos %llu:%llu:%u locks_want %u -> %u" ,
1085+ TP_printk ("%s %pS btree %s pos %llu:%llu:%u locks_want %u -> %u level %u path seq %u node seq %u alloc_seq %u downgrade_seq %u " ,
10731086 __entry -> trans_fn ,
10741087 (void * ) __entry -> caller_ip ,
10751088 bch2_btree_id_str (__entry -> btree_id ),
10761089 __entry -> pos_inode ,
10771090 __entry -> pos_offset ,
10781091 __entry -> pos_snapshot ,
10791092 __entry -> old_locks_want ,
1080- __entry -> new_locks_want )
1093+ __entry -> new_locks_want ,
1094+ __entry -> level ,
1095+ __entry -> path_seq ,
1096+ __entry -> node_seq ,
1097+ __entry -> path_alloc_seq ,
1098+ __entry -> downgrade_seq )
10811099);
10821100
10831101DEFINE_EVENT (transaction_restart_iter , trans_restart_relock ,
@@ -1238,6 +1256,27 @@ TRACE_EVENT(trans_restart_key_cache_key_realloced,
12381256 __entry -> new_u64s )
12391257);
12401258
1259+ TRACE_EVENT (path_downgrade ,
1260+ TP_PROTO (struct btree_trans * trans ,
1261+ unsigned long caller_ip ,
1262+ struct btree_path * path ),
1263+ TP_ARGS (trans , caller_ip , path ),
1264+
1265+ TP_STRUCT__entry (
1266+ __array (char , trans_fn , 32 )
1267+ __field (unsigned long , caller_ip )
1268+ ),
1269+
1270+ TP_fast_assign (
1271+ strscpy (__entry -> trans_fn , trans -> fn , sizeof (__entry -> trans_fn ));
1272+ __entry -> caller_ip = caller_ip ;
1273+ ),
1274+
1275+ TP_printk ("%s %pS" ,
1276+ __entry -> trans_fn ,
1277+ (void * ) __entry -> caller_ip )
1278+ );
1279+
12411280DEFINE_EVENT (transaction_event , trans_restart_write_buffer_flush ,
12421281 TP_PROTO (struct btree_trans * trans ,
12431282 unsigned long caller_ip ),
0 commit comments