Skip to content

Commit 040ba03

Browse files
committed
fix: exclude setup in simulation mode
1 parent 660b1f9 commit 040ba03

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

google_benchmark/include/benchmark/benchmark.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -948,8 +948,6 @@ class BENCHMARK_EXPORT BENCHMARK_INTERNAL_CACHELINE_ALIGNED State {
948948
const IterationCount max_iterations;
949949
#if defined(CODSPEED_SIMULATION) || defined(CODSPEED_WALLTIME)
950950
codspeed::CodSpeed* codspeed_;
951-
#endif
952-
#ifdef CODSPEED_WALLTIME
953951
uint64_t resume_timestamp_;
954952
#endif
955953

google_benchmark/src/benchmark.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,6 @@ State::State(std::string name, IterationCount max_iters,
198198
max_iterations(max_iters),
199199
#if defined(CODSPEED_SIMULATION) || defined(CODSPEED_WALLTIME)
200200
codspeed_(codspeed),
201-
#endif
202-
#ifdef CODSPEED_WALLTIME
203201
resume_timestamp_(0),
204202
#endif
205203
started_(false),
@@ -269,15 +267,15 @@ State::State(std::string name, IterationCount max_iters,
269267
}
270268

271269
void State::PauseTiming() {
272-
#ifdef CODSPEED_WALLTIME
270+
#if defined(CODSPEED_WALLTIME) || defined(CODSPEED_SIMULATION)
273271
uint64_t pause_timestamp = measurement_current_timestamp();
274272
#endif
275273

276274
// Add in time accumulated so far
277275
BM_CHECK(started_ && !finished_ && !skipped());
278276
timer_->StopTimer();
279277

280-
#ifdef CODSPEED_WALLTIME
278+
#if defined(CODSPEED_WALLTIME) || defined(CODSPEED_SIMULATION)
281279
if (!is_warmup_ && resume_timestamp_ != 0) {
282280
measurement_add_benchmark_timestamps(resume_timestamp_, pause_timestamp);
283281
resume_timestamp_ = 0;
@@ -306,7 +304,7 @@ void State::ResumeTiming() {
306304
perf_counters_measurement_->Start();
307305
}
308306

309-
#ifdef CODSPEED_WALLTIME
307+
#if defined(CODSPEED_WALLTIME) || defined(CODSPEED_SIMULATION)
310308
BM_CHECK(resume_timestamp_ == 0);
311309
resume_timestamp_ = measurement_current_timestamp();
312310
#endif

0 commit comments

Comments
 (0)