#include "benchmark_runner.h"
#include "benchmark/benchmark.h"
#include "benchmark_api_internal.h"
#include "internal_macros.h"
#ifndef BENCHMARK_OS_WINDOWS
#if !defined(BENCHMARK_OS_FUCHSIA) && !defined(BENCHMARK_OS_QURT)
#include <sys/resource.h>
#endif
#include <sys/time.h>
#include <unistd.h>
#endif
#include <algorithm>
#include <atomic>
#include <climits>
#include <cmath>
#include <condition_variable>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <limits>
#include <memory>
#include <string>
#include <thread>
#include <utility>
#include "check.h"
#include "colorprint.h"
#include "commandlineflags.h"
#include "complexity.h"
#include "counter.h"
#include "internal_macros.h"
#include "log.h"
#include "mutex.h"
#include "perf_counters.h"
#include "re.h"
#include "statistics.h"
#include "string_util.h"
#include "thread_manager.h"
#include "thread_timer.h"
namespace benchmark {
namespace internal {
MemoryManager* memory_manager = …;
namespace {
static constexpr IterationCount kMaxIterations = …;
const double kDefaultMinTime = …;
BenchmarkReporter::Run CreateRunReport(
const benchmark::internal::BenchmarkInstance& b,
const internal::ThreadManager::Result& results,
IterationCount memory_iterations,
const MemoryManager::Result* memory_result, double seconds,
int64_t repetition_index, int64_t repeats) { … }
void RunInThread(const BenchmarkInstance* b, IterationCount iters,
int thread_id, ThreadManager* manager,
PerfCountersMeasurement* perf_counters_measurement) { … }
double ComputeMinTime(const benchmark::internal::BenchmarkInstance& b,
const BenchTimeType& iters_or_time) { … }
IterationCount ComputeIters(const benchmark::internal::BenchmarkInstance& b,
const BenchTimeType& iters_or_time) { … }
}
BenchTimeType ParseBenchMinTime(const std::string& value) { … }
BenchmarkRunner::BenchmarkRunner(
const benchmark::internal::BenchmarkInstance& b_,
PerfCountersMeasurement* pcm_,
BenchmarkReporter::PerFamilyRunReports* reports_for_family_)
: … { … }
BenchmarkRunner::IterationResults BenchmarkRunner::DoNIterations() { … }
IterationCount BenchmarkRunner::PredictNumItersNeeded(
const IterationResults& i) const { … }
bool BenchmarkRunner::ShouldReportIterationResults(
const IterationResults& i) const { … }
double BenchmarkRunner::GetMinTimeToApply() const { … }
void BenchmarkRunner::FinishWarmUp(const IterationCount& i) { … }
void BenchmarkRunner::RunWarmUp() { … }
void BenchmarkRunner::DoOneRepetition() { … }
RunResults&& BenchmarkRunner::GetResults() { … }
}
}