@@ -261,8 +261,11 @@ impl GlobalStateInner {
261
261
machine : & MiriMachine < ' _ > ,
262
262
) -> AllocState {
263
263
let _span = enter_trace_span ! (
264
- "borrow_tracker::new_allocation" ,
265
- "id = {id:?}, size = {alloc_size:?}, kind = {kind:?}"
264
+ "borrow_tracker" ,
265
+ borrow_tracker_fun = %"new_allocation" ,
266
+ ?id,
267
+ ?alloc_size,
268
+ ?kind,
266
269
) ;
267
270
match self . borrow_tracker_method {
268
271
BorrowTrackerMethod :: StackedBorrows =>
@@ -285,9 +288,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
285
288
val : & ImmTy < ' tcx > ,
286
289
) -> InterpResult < ' tcx , ImmTy < ' tcx > > {
287
290
let _span = enter_trace_span ! (
288
- "borrow_tracker::retag_ptr_value" ,
289
- "kind = {kind:?}, val.layout = {:?}" ,
290
- val. layout
291
+ "borrow_tracker" ,
292
+ borrow_tracker_fun = %"retag_ptr_value" ,
293
+ ?kind,
294
+ ?val. layout,
291
295
) ;
292
296
let this = self . eval_context_mut ( ) ;
293
297
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
@@ -303,8 +307,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
303
307
place : & PlaceTy < ' tcx > ,
304
308
) -> InterpResult < ' tcx > {
305
309
let _span = enter_trace_span ! (
306
- "borrow_tracker::retag_place_contents" ,
307
- "kind = {kind:?}, place = {place:?}"
310
+ "borrow_tracker" ,
311
+ borrow_tracker_fun = %"retag_place_contents" ,
312
+ ?kind,
313
+ ?place,
308
314
) ;
309
315
let this = self . eval_context_mut ( ) ;
310
316
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
@@ -315,7 +321,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
315
321
}
316
322
317
323
fn protect_place ( & mut self , place : & MPlaceTy < ' tcx > ) -> InterpResult < ' tcx , MPlaceTy < ' tcx > > {
318
- let _span = enter_trace_span ! ( "borrow_tracker::protect_place" , "place = {place:?}" ) ;
324
+ let _span =
325
+ enter_trace_span ! ( "borrow_tracker" , borrow_tracker_fun = %"protect_place" , ?place) ;
319
326
let this = self . eval_context_mut ( ) ;
320
327
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
321
328
match method {
@@ -326,10 +333,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
326
333
327
334
fn expose_tag ( & self , alloc_id : AllocId , tag : BorTag ) -> InterpResult < ' tcx > {
328
335
let _span = enter_trace_span ! (
329
- "borrow_tracker::expose_tag " ,
330
- "alloc_id = {}, tag = {} ",
331
- alloc_id. 0 ,
332
- tag. 0
336
+ "borrow_tracker" ,
337
+ borrow_tracker_fun = % "expose_tag ",
338
+ alloc_id = alloc_id . 0 ,
339
+ tag = tag . 0 ,
333
340
) ;
334
341
let this = self . eval_context_ref ( ) ;
335
342
let method = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) . borrow ( ) . borrow_tracker_method ;
@@ -374,7 +381,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
374
381
& self ,
375
382
frame : & Frame < ' tcx , Provenance , FrameExtra < ' tcx > > ,
376
383
) -> InterpResult < ' tcx > {
377
- let _span = enter_trace_span ! ( "borrow_tracker:: on_stack_pop" ) ;
384
+ let _span = enter_trace_span ! ( "borrow_tracker" , borrow_tracker_fun = % " on_stack_pop") ;
378
385
let this = self . eval_context_ref ( ) ;
379
386
let borrow_tracker = this. machine . borrow_tracker . as_ref ( ) . unwrap ( ) ;
380
387
// The body of this loop needs `borrow_tracker` immutably
@@ -452,7 +459,11 @@ impl AllocState {
452
459
range : AllocRange ,
453
460
machine : & MiriMachine < ' tcx > ,
454
461
) -> InterpResult < ' tcx > {
455
- let _span = enter_trace_span ! ( "borrow_tracker::before_memory_read" ) ;
462
+ let _span = enter_trace_span ! (
463
+ "borrow_tracker" ,
464
+ borrow_tracker_fun = %"before_memory_read" ,
465
+ alloc_id = alloc_id. 0
466
+ ) ;
456
467
match self {
457
468
AllocState :: StackedBorrows ( sb) =>
458
469
sb. borrow_mut ( ) . before_memory_read ( alloc_id, prov_extra, range, machine) ,
@@ -474,7 +485,11 @@ impl AllocState {
474
485
range : AllocRange ,
475
486
machine : & MiriMachine < ' tcx > ,
476
487
) -> InterpResult < ' tcx > {
477
- let _span = enter_trace_span ! ( "borrow_tracker::before_memory_write" ) ;
488
+ let _span = enter_trace_span ! (
489
+ "borrow_tracker" ,
490
+ borrow_tracker_fun = %"before_memory_write" ,
491
+ alloc_id = alloc_id. 0
492
+ ) ;
478
493
match self {
479
494
AllocState :: StackedBorrows ( sb) =>
480
495
sb. get_mut ( ) . before_memory_write ( alloc_id, prov_extra, range, machine) ,
@@ -496,7 +511,11 @@ impl AllocState {
496
511
size : Size ,
497
512
machine : & MiriMachine < ' tcx > ,
498
513
) -> InterpResult < ' tcx > {
499
- let _span = enter_trace_span ! ( "borrow_tracker::before_memory_deallocation" ) ;
514
+ let _span = enter_trace_span ! (
515
+ "borrow_tracker" ,
516
+ borrow_tracker_fun = %"before_memory_deallocation" ,
517
+ alloc_id = alloc_id. 0
518
+ ) ;
500
519
match self {
501
520
AllocState :: StackedBorrows ( sb) =>
502
521
sb. get_mut ( ) . before_memory_deallocation ( alloc_id, prov_extra, size, machine) ,
@@ -506,7 +525,8 @@ impl AllocState {
506
525
}
507
526
508
527
pub fn remove_unreachable_tags ( & self , tags : & FxHashSet < BorTag > ) {
509
- let _span = enter_trace_span ! ( "borrow_tracker::remove_unreachable_tags" ) ;
528
+ let _span =
529
+ enter_trace_span ! ( "borrow_tracker" , borrow_tracker_fun = %"remove_unreachable_tags" ) ;
510
530
match self {
511
531
AllocState :: StackedBorrows ( sb) => sb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
512
532
AllocState :: TreeBorrows ( tb) => tb. borrow_mut ( ) . remove_unreachable_tags ( tags) ,
@@ -521,7 +541,12 @@ impl AllocState {
521
541
tag : BorTag ,
522
542
alloc_id : AllocId , // diagnostics
523
543
) -> InterpResult < ' tcx > {
524
- let _span = enter_trace_span ! ( "borrow_tracker::release_protector" ) ;
544
+ let _span = enter_trace_span ! (
545
+ "borrow_tracker" ,
546
+ borrow_tracker_fun = %"release_protector" ,
547
+ alloc_id = alloc_id. 0 ,
548
+ tag = tag. 0
549
+ ) ;
525
550
match self {
526
551
AllocState :: StackedBorrows ( _sb) => interp_ok ( ( ) ) ,
527
552
AllocState :: TreeBorrows ( tb) =>
@@ -532,7 +557,7 @@ impl AllocState {
532
557
533
558
impl VisitProvenance for AllocState {
534
559
fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
535
- let _span = enter_trace_span ! ( "borrow_tracker:: visit_provenance" ) ;
560
+ let _span = enter_trace_span ! ( "borrow_tracker" , borrow_tracker_fun = % " visit_provenance") ;
536
561
match self {
537
562
AllocState :: StackedBorrows ( sb) => sb. visit_provenance ( visit) ,
538
563
AllocState :: TreeBorrows ( tb) => tb. visit_provenance ( visit) ,
0 commit comments