@@ -8,7 +8,6 @@ use std::num::NonZeroU64;
8
8
use std:: time:: Instant ;
9
9
10
10
use log:: trace;
11
- use measureme:: { DetachedTiming , EventId , Profiler , StringId } ;
12
11
use rand:: rngs:: StdRng ;
13
12
use rand:: SeedableRng ;
14
13
@@ -47,7 +46,16 @@ pub struct FrameData<'tcx> {
47
46
/// If `measureme` profiling is enabled, holds timing information
48
47
/// for the start of this frame. When we finish executing this frame,
49
48
/// we use this to register a completed event with `measureme`.
50
- pub timing : Option < DetachedTiming > ,
49
+ pub timing : Option < measureme:: DetachedTiming > ,
50
+ }
51
+
52
+ impl < ' tcx > std:: fmt:: Debug for FrameData < ' tcx > {
53
+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
54
+ f. debug_struct ( "FrameData" )
55
+ . field ( "call_id" , & self . call_id )
56
+ . field ( "catch_unwind" , & self . catch_unwind )
57
+ . finish ( )
58
+ }
51
59
}
52
60
53
61
/// Extra memory kinds
@@ -278,20 +286,19 @@ pub struct Evaluator<'mir, 'tcx> {
278
286
279
287
/// The `measureme` profiler used to record timing information about
280
288
/// the emulated program.
281
- profiler : Option < Profiler > ,
289
+ profiler : Option < measureme :: Profiler > ,
282
290
/// Used with `profiler` to cache the `StringId`s for event names
283
291
/// uesd with `measureme`.
284
- string_cache : FxHashMap < String , StringId > ,
292
+ string_cache : FxHashMap < String , measureme :: StringId > ,
285
293
}
286
294
287
295
impl < ' mir , ' tcx > Evaluator < ' mir , ' tcx > {
288
296
pub ( crate ) fn new ( config : & MiriConfig , layout_cx : LayoutCx < ' tcx , TyCtxt < ' tcx > > ) -> Self {
289
297
let layouts =
290
298
PrimitiveLayouts :: new ( layout_cx) . expect ( "Couldn't get layouts of primitive types" ) ;
291
- let profiler = config
292
- . measureme_out
293
- . as_ref ( )
294
- . map ( |out| Profiler :: new ( out) . expect ( "Couldn't create `measureme` profiler" ) ) ;
299
+ let profiler = config. measureme_out . as_ref ( ) . map ( |out| {
300
+ measureme:: Profiler :: new ( out) . expect ( "Couldn't create `measureme` profiler" )
301
+ } ) ;
295
302
Evaluator {
296
303
// `env_vars` could be initialized properly here if `Memory` were available before
297
304
// calling this method.
@@ -619,7 +626,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
619
626
620
627
Some ( profiler. start_recording_interval_event_detached (
621
628
* name,
622
- EventId :: from_label ( * name) ,
629
+ measureme :: EventId :: from_label ( * name) ,
623
630
ecx. get_active_thread ( ) . to_u32 ( ) ,
624
631
) )
625
632
} else {
0 commit comments