Skip to content

Commit 82549de

Browse files
committed
Emit timestamps on each line of output
This commit adds the --timestamp command line option to allow cprover tools to emit timestamps before each line of output. The timestamps are either pretty-formatted wall-clock times (which may decrease as time passes in the event of a leap-second or daylight savings time event), or raw numbers that are guaranteed to increase. In either case, the timestamps have microsecond precision if supported by the underlying platform.
1 parent 3f6965b commit 82549de

15 files changed

+204
-12
lines changed

src/cbmc/cbmc_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ void cbmc_parse_optionst::help()
10291029
" --json-ui use JSON-formatted output\n"
10301030
HELP_GOTO_TRACE
10311031
" --verbosity # verbosity level\n"
1032+
HELP_TIMESTAMP
10321033
"\n";
10331034
// clang-format on
10341035
}

src/cbmc/cbmc_parse_options.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414

1515
#include <util/ui_message.h>
1616
#include <util/parse_options.h>
17+
#include <util/timestamper.h>
1718

1819
#include <langapi/language.h>
1920

@@ -62,6 +63,7 @@ class optionst;
6263
"(version)" \
6364
"(cover):(symex-coverage-report):" \
6465
"(mm):" \
66+
OPT_TIMESTAMP \
6567
"(i386-linux)(i386-macos)(i386-win32)(win32)(winx64)(gcc)" \
6668
"(ppc-macos)(unsigned-char)" \
6769
"(arrays-uf-always)(arrays-uf-never)" \

src/goto-analyzer/goto_analyzer_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,5 +906,6 @@ void goto_analyzer_parse_optionst::help()
906906
"\n"
907907
"Other options:\n"
908908
" --version show version and exit\n"
909+
HELP_TIMESTAMP
909910
"\n";
910911
}

src/goto-analyzer/goto_analyzer_parse_options.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ Author: Daniel Kroening, [email protected]
103103

104104
#include <util/ui_message.h>
105105
#include <util/parse_options.h>
106+
#include <util/timestamper.h>
106107

107108
#include <langapi/language.h>
108109

@@ -135,6 +136,7 @@ class optionst;
135136
"(show-local-may-alias)" \
136137
"(json):(xml):" \
137138
"(text):(dot):" \
139+
OPT_TIMESTAMP \
138140
"(unreachable-instructions)(unreachable-functions)" \
139141
"(reachable-functions)" \
140142
"(intervals)(show-intervals)" \

src/goto-diff/goto_diff_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,5 +501,6 @@ void goto_diff_parse_optionst::help()
501501
"Other options:\n"
502502
" --version show version and exit\n"
503503
" --json-ui use JSON-formatted output\n"
504+
HELP_TIMESTAMP
504505
"\n";
505506
}

src/goto-diff/goto_diff_parse_options.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Peter Schrammel
1414

1515
#include <util/ui_message.h>
1616
#include <util/parse_options.h>
17+
#include <util/timestamper.h>
1718

1819
#include <goto-programs/goto_model.h>
1920
#include <goto-programs/show_goto_functions.h>
@@ -27,6 +28,7 @@ class optionst;
2728
"(json-ui)" \
2829
OPT_SHOW_GOTO_FUNCTIONS \
2930
"(verbosity):(version)" \
31+
OPT_TIMESTAMP \
3032
"u(unified)(change-impact)(forward-impact)(backward-impact)" \
3133
"(compact-output)"
3234

src/goto-instrument/goto_instrument_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,5 +1568,6 @@ void goto_instrument_parse_optionst::help()
15681568
" --version show version and exit\n"
15691569
" --xml-ui use XML-formatted output\n"
15701570
" --json-ui use JSON-formatted output\n"
1571+
HELP_TIMESTAMP
15711572
"\n";
15721573
}

src/goto-instrument/goto_instrument_parse_options.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414

1515
#include <util/ui_message.h>
1616
#include <util/parse_options.h>
17+
#include <util/timestamper.h>
1718

1819
#include <goto-programs/goto_functions.h>
1920
#include <goto-programs/show_goto_functions.h>
@@ -66,6 +67,7 @@ Author: Daniel Kroening, [email protected]
6667
"(show-claims)(show-properties)(property):" \
6768
"(show-symbol-table)(show-points-to)(show-rw-set)" \
6869
"(cav11)" \
70+
OPT_TIMESTAMP \
6971
"(show-natural-loops)(accelerate)(havoc-loops)" \
7072
"(error-label):(string-abstraction)" \
7173
"(verbosity):(version)(xml-ui)(json-ui)(show-loops)" \

src/jbmc/jbmc_parse_options.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -956,5 +956,6 @@ void jbmc_parse_optionst::help()
956956
" --json-ui use JSON-formatted output\n"
957957
HELP_GOTO_TRACE
958958
" --verbosity # verbosity level\n"
959+
HELP_TIMESTAMP
959960
"\n";
960961
}

src/jbmc/jbmc_parse_options.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Author: Daniel Kroening, [email protected]
1414

1515
#include <util/ui_message.h>
1616
#include <util/parse_options.h>
17+
#include <util/timestamper.h>
1718

1819
#include <langapi/language.h>
1920

@@ -60,6 +61,7 @@ class optionst;
6061
"(verbosity):" \
6162
"(version)" \
6263
"(cover):(symex-coverage-report):" \
64+
OPT_TIMESTAMP \
6365
"(i386-linux)(i386-macos)(i386-win32)(win32)(winx64)" \
6466
"(ppc-macos)" \
6567
"(arrays-uf-always)(arrays-uf-never)" \

0 commit comments

Comments
 (0)