From c8ef08267fd5e67f40defac1ae692e8ec906fa3f Mon Sep 17 00:00:00 2001 From: Cristian Cadar Date: Tue, 22 Dec 2020 19:52:12 +0000 Subject: Added -max-static-pct-check-delay to replace the hardcoded delay after which the MaxStatic*Pct checks are performed. --- lib/Core/Executor.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/Core/Executor.cpp') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index cea7f173..cc3ac50f 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -365,6 +365,12 @@ cl::opt MaxStaticCPSolvePct( "instructions (default=1.0 (always))"), cl::cat(TerminationCat)); +cl::opt MaxStaticPctCheckDelay( + "max-static-pct-check-delay", + cl::desc("Time after which the --max-static-*-pct checks are enforced (default=60s)"), + cl::init("60s"), + cl::cat(TerminationCat)); + cl::opt TimerInterval( "timer-interval", cl::desc("Minimum interval to check timers. " @@ -485,6 +491,8 @@ Executor::Executor(LLVMContext &ctx, const InterpreterOptions &opts, this->solver = new TimingSolver(solver, EqualitySubstitution); memory = new MemoryManager(&arrayCache); + maxStaticPctCheckDelay = time::Span{MaxStaticPctCheckDelay}; + initializeSearchOptions(); if (OnlyOutputStatesCoveringNew && !StatsTracker::useIStats()) @@ -971,7 +979,9 @@ ref Executor::maxStaticPctChecks(ExecutionState ¤t, MaxStaticCPForkPct == 1. && MaxStaticCPSolvePct == 1.) return condition; - if (statsTracker->elapsed() <= time::seconds(60)) + // these checks are performed only after MaxStaticPctCheckDelay time has + // passed since execution started + if (statsTracker->elapsed() <= maxStaticPctCheckDelay) return condition; StatisticManager &sm = *theStatisticManager; -- cgit 1.4.1