@@ -260,6 +260,10 @@ impl GlobalStateInner {
260260 kind : MemoryKind ,
261261 machine : & MiriMachine < ' _ > ,
262262 ) -> AllocState {
263+ let _span = enter_trace_span ! (
264+ "new_allocation" ,
265+ "id = {id:?}, size = {alloc_size:?}, kind = {kind:?}"
266+ ) ;
263267 match self . borrow_tracker_method {
264268 BorrowTrackerMethod :: StackedBorrows =>
265269 AllocState :: StackedBorrows ( Box :: new ( RefCell :: new ( Stacks :: new_allocation (
@@ -280,6 +284,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
280284 kind : RetagKind ,
281285 val : & ImmTy < ' tcx > ,
282286 ) -> InterpResult < ' tcx , ImmTy < ' tcx > > {
287+ let _span =
288+ enter_trace_span ! ( "retag_ptr_value" , "kind = {kind:?}, val.layout = {:?}" , val. layout) ;
283289 let this = self . eval_context_mut ( ) ;
284290 let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
285291 match method {
@@ -293,6 +299,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
293299 kind : RetagKind ,
294300 place : & PlaceTy < ' tcx > ,
295301 ) -> InterpResult < ' tcx > {
302+ let _span = enter_trace_span ! ( "retag_place_contents" , "kind = {kind:?}, place = {place:?}" ) ;
296303 let this = self . eval_context_mut ( ) ;
297304 let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
298305 match method {
@@ -302,6 +309,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
302309 }
303310
304311 fn protect_place ( & mut self , place : & MPlaceTy < ' tcx > ) -> InterpResult < ' tcx , MPlaceTy < ' tcx > > {
312+ let _span = enter_trace_span ! ( "protect_place" , "place = {place:?}" ) ;
305313 let this = self . eval_context_mut ( ) ;
306314 let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
307315 match method {
@@ -311,6 +319,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
311319 }
312320
313321 fn expose_tag ( & self , alloc_id : AllocId , tag : BorTag ) -> InterpResult < ' tcx > {
322+ let _span = enter_trace_span ! ( "expose_tag" , "alloc_id = {}, tag = {}" , alloc_id. 0 , tag. 0 ) ;
314323 let this = self . eval_context_ref ( ) ;
315324 let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
316325 match method {
@@ -354,6 +363,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
354363 & self ,
355364 frame : & Frame < ' tcx , Provenance , FrameExtra < ' tcx > > ,
356365 ) -> InterpResult < ' tcx > {
366+ let _span = enter_trace_span ! ( "on_stack_pop" ) ;
357367 let this = self . eval_context_ref ( ) ;
358368 let borrow_tracker = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) ;
359369 // The body of this loop needs `borrow_tracker` immutably
@@ -431,6 +441,7 @@ impl AllocState {
431441 range : AllocRange ,
432442 machine : & MiriMachine < ' tcx > ,
433443 ) -> InterpResult < ' tcx > {
444+ let _span = enter_trace_span ! ( "before_memory_read" ) ;
434445 match self {
435446 AllocState :: StackedBorrows ( sb) =>
436447 sb. borrow_mut ( ) . before_memory_read ( alloc_id, prov_extra, range, machine) ,
@@ -452,6 +463,7 @@ impl AllocState {
452463 range : AllocRange ,
453464 machine : & MiriMachine < ' tcx > ,
454465 ) -> InterpResult < ' tcx > {
466+ let _span = enter_trace_span ! ( "before_memory_write" ) ;
455467 match self {
456468 AllocState :: StackedBorrows ( sb) =>
457469 sb. get_mut ( ) . before_memory_write ( alloc_id, prov_extra, range, machine) ,
@@ -473,6 +485,7 @@ impl AllocState {
473485 size : Size ,
474486 machine : & MiriMachine < ' tcx > ,
475487 ) -> InterpResult < ' tcx > {
488+ let _span = enter_trace_span ! ( "before_memory_deallocation" ) ;
476489 match self {
477490 AllocState :: StackedBorrows ( sb) =>
478491 sb. get_mut ( ) . before_memory_deallocation ( alloc_id, prov_extra, size, machine) ,
@@ -482,6 +495,7 @@ impl AllocState {
482495 }
483496
484497 pub fn remove_unreachable_tags ( & self , tags : & FxHashSet < BorTag > ) {
498+ let _span = enter_trace_span ! ( "remove_unreachable_tags" ) ;
485499 match self {
486500 AllocState :: StackedBorrows ( sb) => sb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
487501 AllocState :: TreeBorrows ( tb) => tb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
@@ -496,6 +510,7 @@ impl AllocState {
496510 tag : BorTag ,
497511 alloc_id : AllocId , // diagnostics
498512 ) -> InterpResult < ' tcx > {
513+ let _span = enter_trace_span ! ( "release_protector" ) ;
499514 match self {
500515 AllocState :: StackedBorrows ( _sb) => interp_ok ( ( ) ) ,
501516 AllocState :: TreeBorrows ( tb) =>
@@ -506,6 +521,7 @@ impl AllocState {
506521
507522impl VisitProvenance for AllocState {
508523 fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
524+ let _span = enter_trace_span ! ( "visit_provenance" ) ;
509525 match self {
510526 AllocState :: StackedBorrows ( sb) => sb. visit_provenance ( visit) ,
511527 AllocState :: TreeBorrows ( tb) => tb. visit_provenance ( visit) ,
0 commit comments