File tree 3 files changed +19
-2
lines changed
crates/divan_compat/divan_fork/src
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -657,6 +657,7 @@ impl<'a> BenchContext<'a> {
657
657
658
658
let bench_overheads = timer. bench_overheads ( ) ;
659
659
660
+ let _guard = codspeed:: fifo:: BenchGuard :: new_with_runner_fifo ( ) ;
660
661
while {
661
662
// Conditions for when sampling is over:
662
663
if elapsed_picos >= max_picos {
@@ -810,6 +811,7 @@ impl<'a> BenchContext<'a> {
810
811
elapsed_picos = elapsed_picos. saturating_add ( progress_picos) ;
811
812
}
812
813
}
814
+ core:: mem:: drop ( _guard) ;
813
815
814
816
// Reset flag for ignoring allocations.
815
817
crate :: alloc:: IGNORE_ALLOC . set ( false ) ;
Original file line number Diff line number Diff line change @@ -428,6 +428,13 @@ mod codspeed {
428
428
bench_context. samples . time_samples . iter ( ) . map ( |s| s. duration . picos / 1_000 ) . collect ( ) ;
429
429
let max_time_ns = bench_context. options . max_time . map ( |t| t. as_nanos ( ) ) ;
430
430
431
+ if let Err ( error) = :: codspeed:: fifo:: send_cmd ( codspeed:: fifo:: Command :: CurrentBenchmark {
432
+ pid : std:: process:: id ( ) ,
433
+ uri : uri. clone ( ) ,
434
+ } ) {
435
+ eprintln ! ( "Failed to send benchmark URI to runner: {}" , error) ;
436
+ }
437
+
431
438
:: codspeed:: walltime:: collect_raw_walltime_results (
432
439
"divan" ,
433
440
bench_name,
Original file line number Diff line number Diff line change @@ -201,9 +201,17 @@ impl<F> TaskShared<F> {
201
201
where
202
202
F : Fn ( usize ) ,
203
203
{
204
- let task_fn = & ( * task. cast :: < TaskShared < F > > ( ) ) . task_fn ;
204
+ #[ inline( never) ]
205
+ unsafe fn __codspeed_root_frame__ < F > ( task : * const TaskShared < ( ) > , thread : usize )
206
+ where
207
+ F : Fn ( usize ) ,
208
+ {
209
+ let task_fn = & ( * task. cast :: < TaskShared < F > > ( ) ) . task_fn ;
210
+
211
+ task_fn ( thread) ;
212
+ }
205
213
206
- task_fn ( thread) ;
214
+ __codspeed_root_frame__ :: < F > ( task , thread) ;
207
215
}
208
216
209
217
Self {
You can’t perform that action at this time.
0 commit comments