From 02c143010c24eee1aabd32f525a82b1f913038ba Mon Sep 17 00:00:00 2001 From: Derek Bruening Date: Tue, 10 Sep 2024 12:54:33 -0400 Subject: [PATCH] i#6971 sched time: Reduce gettimeofday calls (#6972) Only call gettimeofday once per next_record for instruction quanta, rather than every get_output_time() call. Future work will try to revisit using a counter to eliminate the non-determinism of wall-clock time and make analyzers behavior more like simulators, easing testing. Issue: #6971 --- clients/drcachesim/scheduler/scheduler.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/clients/drcachesim/scheduler/scheduler.cpp b/clients/drcachesim/scheduler/scheduler.cpp index 1094a2ae297..e60c98fed6b 100644 --- a/clients/drcachesim/scheduler/scheduler.cpp +++ b/clients/drcachesim/scheduler/scheduler.cpp @@ -2337,11 +2337,7 @@ template uint64_t scheduler_tmpl_t::get_output_time(output_ordinal_t output) { - // If the user is giving us times take the most recent of those. - if (outputs_[output].cur_time > 0) - return outputs_[output].cur_time; - // Otherwise, use wall-clock time. - return get_time_micros(); + return outputs_[output].cur_time; } template