@@ -9,13 +9,14 @@ use rustc_middle::ty::{self, Instance, Ty};
9
9
use rustc_middle:: { bug, mir, span_bug} ;
10
10
use rustc_span:: source_map:: Spanned ;
11
11
use rustc_target:: callconv:: FnAbi ;
12
+ use tracing:: field:: Empty ;
12
13
use tracing:: { info, instrument, trace} ;
13
14
14
15
use super :: {
15
16
FnArg , FnVal , ImmTy , Immediate , InterpCx , InterpResult , Machine , MemPlaceMeta , PlaceTy ,
16
17
Projectable , Scalar , interp_ok, throw_ub, throw_unsup_format,
17
18
} ;
18
- use crate :: util;
19
+ use crate :: { enter_trace_span , util} ;
19
20
20
21
struct EvaluatedCalleeAndArgs < ' tcx , M : Machine < ' tcx > > {
21
22
callee : FnVal < ' tcx , M :: ExtraFnVal > ,
@@ -74,7 +75,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
74
75
///
75
76
/// This does NOT move the statement counter forward, the caller has to do that!
76
77
pub fn eval_statement ( & mut self , stmt : & mir:: Statement < ' tcx > ) -> InterpResult < ' tcx > {
77
- info ! ( "{:?}" , stmt) ;
78
+ let _span = enter_trace_span ! ( M , step:: eval_statement, stmt = ?stmt, tracing_separate_thread = Empty ) ;
79
+ info ! ( ?stmt) ;
78
80
79
81
use rustc_middle:: mir:: StatementKind :: * ;
80
82
@@ -159,6 +161,12 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
159
161
rvalue : & mir:: Rvalue < ' tcx > ,
160
162
place : mir:: Place < ' tcx > ,
161
163
) -> InterpResult < ' tcx > {
164
+ let _span = enter_trace_span ! (
165
+ M ,
166
+ step:: eval_rvalue_into_place,
167
+ ?rvalue,
168
+ tracing_separate_thread = Empty
169
+ ) ;
162
170
let dest = self . eval_place ( place) ?;
163
171
// FIXME: ensure some kind of non-aliasing between LHS and RHS?
164
172
// Also see https://github.com/rust-lang/rust/issues/68364.
@@ -383,6 +391,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
383
391
& self ,
384
392
op : & mir:: Operand < ' tcx > ,
385
393
) -> InterpResult < ' tcx , FnArg < ' tcx , M :: Provenance > > {
394
+ let _span =
395
+ enter_trace_span ! ( M , step:: eval_fn_call_argument, ?op, tracing_separate_thread = Empty ) ;
386
396
interp_ok ( match op {
387
397
mir:: Operand :: Copy ( _) | mir:: Operand :: Constant ( _) => {
388
398
// Make a regular copy.
@@ -421,6 +431,13 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
421
431
func : & mir:: Operand < ' tcx > ,
422
432
args : & [ Spanned < mir:: Operand < ' tcx > > ] ,
423
433
) -> InterpResult < ' tcx , EvaluatedCalleeAndArgs < ' tcx , M > > {
434
+ let _span = enter_trace_span ! (
435
+ M ,
436
+ step:: eval_callee_and_args,
437
+ ?func,
438
+ ?args,
439
+ tracing_separate_thread = Empty
440
+ ) ;
424
441
let func = self . eval_operand ( func, None ) ?;
425
442
let args = args
426
443
. iter ( )
@@ -456,6 +473,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
456
473
}
457
474
458
475
fn eval_terminator ( & mut self , terminator : & mir:: Terminator < ' tcx > ) -> InterpResult < ' tcx > {
476
+ let _span = enter_trace_span ! ( M , step:: eval_terminator, terminator = ?terminator. kind, tracing_separate_thread = Empty ) ;
459
477
info ! ( "{:?}" , terminator. kind) ;
460
478
461
479
use rustc_middle:: mir:: TerminatorKind :: * ;
0 commit comments