aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornick.j.sanders <nick.j.sanders@gmail.com>2014-02-11 06:43:37 +0000
committernick.j.sanders <nick.j.sanders@gmail.com>2014-02-11 06:43:37 +0000
commitf99ecfc322bb6ccd63c4050a9a46cc7fb08200d2 (patch)
tree0bb4e77a4b41f7d46c67f4d538d67c35a0c18531
parent3c1c63e2c8620aeb552aba19374c7af134bb63fd (diff)
downloadstressapptest-f99ecfc322bb6ccd63c4050a9a46cc7fb08200d2.tar.gz
Add --printsec argument
* Allows printing 'Seconds remaining' less frequently.
-rw-r--r--src/sat.cc11
-rw-r--r--src/sat.h3
2 files changed, 10 insertions, 4 deletions
diff --git a/src/sat.cc b/src/sat.cc
index 56c6b66..7b72ec2 100644
--- a/src/sat.cc
+++ b/src/sat.cc
@@ -676,6 +676,7 @@ Sat::Sat() {
user_break_ = false;
verbosity_ = 8;
Logger::GlobalLogger()->SetVerbosity(verbosity_);
+ print_delay_ = 10;
strict_ = 1;
warm_ = 0;
run_on_anything_ = 0;
@@ -850,6 +851,9 @@ bool Sat::ParseArgs(int argc, char **argv) {
// Verbosity level.
ARG_IVALUE("-v", verbosity_);
+ // Chatty printout level.
+ ARG_IVALUE("--printsec", print_delay_);
+
// Turn off timestamps logging.
ARG_KVALUE("--no_timestamps", log_timestamps_, false);
@@ -1105,6 +1109,7 @@ void Sat::PrintHelp() {
" --no_timestamps do not prefix timestamps to log messages\n"
" --max_errors n exit early after finding 'n' errors\n"
" -v level verbosity (0-20), default is 8\n"
+ " --printsec secs How often to print 'seconds remaining'\n"
" -W Use more CPU-stressful memory copy\n"
" -A run in degraded mode on incompatible systems\n"
" -p pagesize size in bytes of memory chunks\n"
@@ -1885,12 +1890,12 @@ bool Sat::Run() {
// All of these are in seconds. You probably want them to be >=
// kSleepFrequency and multiples of kSleepFrequency, but neither is necessary.
static const time_t kInjectionFrequency = 10;
- static const time_t kPrintFrequency = 10;
+ // print_delay_ determines "seconds remaining" chatty update.
const time_t start = time(NULL);
const time_t end = start + runtime_seconds_;
time_t now = start;
- time_t next_print = start + kPrintFrequency;
+ time_t next_print = start + print_delay_;
time_t next_pause = start + pause_delay_;
time_t next_resume = 0;
time_t next_injection;
@@ -1926,7 +1931,7 @@ bool Sat::Run() {
if (now >= next_print) {
// Print a count down message.
logprintf(5, "Log: Seconds remaining: %d\n", seconds_remaining);
- next_print = NextOccurance(kPrintFrequency, start, now);
+ next_print = NextOccurance(print_delay_, start, now);
}
if (next_injection && now >= next_injection) {
diff --git a/src/sat.h b/src/sat.h
index 92396d8..5cc3bec 100644
--- a/src/sat.h
+++ b/src/sat.h
@@ -163,8 +163,9 @@ class Sat {
volatile sig_atomic_t user_break_; // User has signalled early exit. Used as
// a boolean.
int verbosity_; // How much to print.
+ int print_delay_; // Chatty update frequency.
int strict_; // Check results per transaction.
- int warm_; // FPU warms CPU while coying.
+ int warm_; // FPU warms CPU while copying.
int address_mode_; // 32 or 64 bit binary.
bool stop_on_error_; // Exit immendiately on any error.
bool findfiles_; // Autodetect tempfile locations.