@@ -260,6 +260,10 @@ impl GlobalStateInner {
260
260
kind : MemoryKind ,
261
261
machine : & MiriMachine < ' _ > ,
262
262
) -> AllocState {
263
+ let _span = enter_trace_span ! (
264
+ "new_allocation" ,
265
+ "id = {id:?}, size = {alloc_size:?}, kind = {kind:?}"
266
+ ) ;
263
267
match self . borrow_tracker_method {
264
268
BorrowTrackerMethod :: StackedBorrows =>
265
269
AllocState :: StackedBorrows ( Box :: new ( RefCell :: new ( Stacks :: new_allocation (
@@ -280,6 +284,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
280
284
kind : RetagKind ,
281
285
val : & ImmTy < ' tcx > ,
282
286
) -> InterpResult < ' tcx , ImmTy < ' tcx > > {
287
+ let _span =
288
+ enter_trace_span ! ( "retag_ptr_value" , "kind = {kind:?}, val.layout = {:?}" , val. layout) ;
283
289
let this = self . eval_context_mut ( ) ;
284
290
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
285
291
match method {
@@ -293,6 +299,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
293
299
kind : RetagKind ,
294
300
place : & PlaceTy < ' tcx > ,
295
301
) -> InterpResult < ' tcx > {
302
+ let _span = enter_trace_span ! ( "retag_place_contents" , "kind = {kind:?}, place = {place:?}" ) ;
296
303
let this = self . eval_context_mut ( ) ;
297
304
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
298
305
match method {
@@ -302,6 +309,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
302
309
}
303
310
304
311
fn protect_place ( & mut self , place : & MPlaceTy < ' tcx > ) -> InterpResult < ' tcx , MPlaceTy < ' tcx > > {
312
+ let _span = enter_trace_span ! ( "protect_place" , "place = {place:?}" ) ;
305
313
let this = self . eval_context_mut ( ) ;
306
314
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
307
315
match method {
@@ -311,6 +319,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
311
319
}
312
320
313
321
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 ) ;
314
323
let this = self . eval_context_ref ( ) ;
315
324
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
316
325
match method {
@@ -354,6 +363,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
354
363
& self ,
355
364
frame : & Frame < ' tcx , Provenance , FrameExtra < ' tcx > > ,
356
365
) -> InterpResult < ' tcx > {
366
+ let _span = enter_trace_span ! ( "on_stack_pop" ) ;
357
367
let this = self . eval_context_ref ( ) ;
358
368
let borrow_tracker = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) ;
359
369
// The body of this loop needs `borrow_tracker` immutably
@@ -431,6 +441,7 @@ impl AllocState {
431
441
range : AllocRange ,
432
442
machine : & MiriMachine < ' tcx > ,
433
443
) -> InterpResult < ' tcx > {
444
+ let _span = enter_trace_span ! ( "before_memory_read" ) ;
434
445
match self {
435
446
AllocState :: StackedBorrows ( sb) =>
436
447
sb. borrow_mut ( ) . before_memory_read ( alloc_id, prov_extra, range, machine) ,
@@ -452,6 +463,7 @@ impl AllocState {
452
463
range : AllocRange ,
453
464
machine : & MiriMachine < ' tcx > ,
454
465
) -> InterpResult < ' tcx > {
466
+ let _span = enter_trace_span ! ( "before_memory_write" ) ;
455
467
match self {
456
468
AllocState :: StackedBorrows ( sb) =>
457
469
sb. get_mut ( ) . before_memory_write ( alloc_id, prov_extra, range, machine) ,
@@ -473,6 +485,7 @@ impl AllocState {
473
485
size : Size ,
474
486
machine : & MiriMachine < ' tcx > ,
475
487
) -> InterpResult < ' tcx > {
488
+ let _span = enter_trace_span ! ( "before_memory_deallocation" ) ;
476
489
match self {
477
490
AllocState :: StackedBorrows ( sb) =>
478
491
sb. get_mut ( ) . before_memory_deallocation ( alloc_id, prov_extra, size, machine) ,
@@ -482,6 +495,7 @@ impl AllocState {
482
495
}
483
496
484
497
pub fn remove_unreachable_tags ( & self , tags : & FxHashSet < BorTag > ) {
498
+ let _span = enter_trace_span ! ( "remove_unreachable_tags" ) ;
485
499
match self {
486
500
AllocState :: StackedBorrows ( sb) => sb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
487
501
AllocState :: TreeBorrows ( tb) => tb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
@@ -496,6 +510,7 @@ impl AllocState {
496
510
tag : BorTag ,
497
511
alloc_id : AllocId , // diagnostics
498
512
) -> InterpResult < ' tcx > {
513
+ let _span = enter_trace_span ! ( "release_protector" ) ;
499
514
match self {
500
515
AllocState :: StackedBorrows ( _sb) => interp_ok ( ( ) ) ,
501
516
AllocState :: TreeBorrows ( tb) =>
@@ -506,6 +521,7 @@ impl AllocState {
506
521
507
522
impl VisitProvenance for AllocState {
508
523
fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
524
+ let _span = enter_trace_span ! ( "visit_provenance" ) ;
509
525
match self {
510
526
AllocState :: StackedBorrows ( sb) => sb. visit_provenance ( visit) ,
511
527
AllocState :: TreeBorrows ( tb) => tb. visit_provenance ( visit) ,
0 commit comments