@@ -11,14 +11,16 @@ use rustc_middle::ty::{self, AdtDef, Instance, Ty, VariantDef};
11
11
use rustc_middle:: { bug, mir, span_bug} ;
12
12
use rustc_span:: sym;
13
13
use rustc_target:: callconv:: { ArgAbi , FnAbi , PassMode } ;
14
+ use tracing:: field:: Empty ;
14
15
use tracing:: { info, instrument, trace} ;
15
16
16
17
use super :: {
17
18
CtfeProvenance , FnVal , ImmTy , InterpCx , InterpResult , MPlaceTy , Machine , OpTy , PlaceTy ,
18
19
Projectable , Provenance , ReturnAction , ReturnContinuation , Scalar , StackPopInfo , interp_ok,
19
20
throw_ub, throw_ub_custom, throw_unsup_format,
20
21
} ;
21
- use crate :: fluent_generated as fluent;
22
+ use crate :: interpret:: EnteredTraceSpan ;
23
+ use crate :: { enter_trace_span, fluent_generated as fluent} ;
22
24
23
25
/// An argument passed to a function.
24
26
#[ derive( Clone , Debug ) ]
@@ -344,6 +346,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
344
346
destination : & PlaceTy < ' tcx , M :: Provenance > ,
345
347
mut cont : ReturnContinuation ,
346
348
) -> InterpResult < ' tcx > {
349
+ let _span = enter_trace_span ! ( M , step:: init_stack_frame, %instance, tracing_separate_thread = Empty ) ;
350
+
347
351
// Compute callee information.
348
352
// FIXME: for variadic support, do we have to somehow determine callee's extra_args?
349
353
let callee_fn_abi = self . fn_abi_of_instance ( instance, ty:: List :: empty ( ) ) ?;
@@ -523,7 +527,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
523
527
target : Option < mir:: BasicBlock > ,
524
528
unwind : mir:: UnwindAction ,
525
529
) -> InterpResult < ' tcx > {
526
- trace ! ( "init_fn_call: {:#?}" , fn_val) ;
530
+ let _span =
531
+ enter_trace_span ! ( M , step:: init_fn_call, tracing_separate_thread = Empty , ?fn_val)
532
+ . or_if_tracing_disabled ( || trace ! ( "init_fn_call: {:#?}" , fn_val) ) ;
527
533
528
534
let instance = match fn_val {
529
535
FnVal :: Instance ( instance) => instance,
0 commit comments