about summary refs log tree commit diff homepage
path: root/lib
diff options
context:
space:
mode:
authorFrank Busse <bb0xfb@gmail.com>2022-01-07 16:28:17 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-03-23 17:41:08 +0000
commitba58e4add3bb2e924b0078146fdcd9b4f6158178 (patch)
tree28ac5295a5b3d4e611c110fe29669554ce512b26 /lib
parenta88a768c3ea9343db746344f2cc6e41d4c598a8c (diff)
downloadklee-ba58e4add3bb2e924b0078146fdcd9b4f6158178.tar.gz
stats: rename States -> ActiveStates, add States
Diffstat (limited to 'lib')
-rw-r--r--lib/Core/ExecutionState.h1
-rw-r--r--lib/Core/StatsTracker.cpp8
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/Core/ExecutionState.h b/lib/Core/ExecutionState.h
index 6d6336dd..dbe02fd9 100644
--- a/lib/Core/ExecutionState.h
+++ b/lib/Core/ExecutionState.h
@@ -281,6 +281,7 @@ public:
 
   std::uint32_t getID() const { return id; };
   void setID() { id = nextID++; };
+  static std::uint32_t getLastID() { return nextID - 1; };
 };
 
 struct ExecutionStateIDCompare {
diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp
index bc40afd9..51a0b73c 100644
--- a/lib/Core/StatsTracker.cpp
+++ b/lib/Core/StatsTracker.cpp
@@ -457,6 +457,7 @@ void StatsTracker::writeStatsHeader() {
              << "InhibitedForks INTEGER,"
              << "ExternalCalls INTEGER,"
              << "Allocations INTEGER,"
+             << "States INTEGER,"
              << "ArrayHashTime INTEGER"
          << ')';
   char *zErrMsg = nullptr;
@@ -496,6 +497,7 @@ void StatsTracker::writeStatsHeader() {
              << "InhibitedForks,"
              << "ExternalCalls,"
              << "Allocations,"
+             << "States,"
              << "ArrayHashTime"
          << ") VALUES ("
              << "?,"
@@ -523,6 +525,7 @@ void StatsTracker::writeStatsHeader() {
              << "?,"
              << "?,"
              << "?,"
+             << "?,"
              << "? "
          << ')';
 
@@ -561,10 +564,11 @@ void StatsTracker::writeStatsLine() {
   sqlite3_bind_int64(insertStmt, 23, stats::inhibitedForks);
   sqlite3_bind_int64(insertStmt, 24, stats::externalCalls);
   sqlite3_bind_int64(insertStmt, 25, stats::allocations);
+  sqlite3_bind_int64(insertStmt, 26, ExecutionState::getLastID());
 #ifdef KLEE_ARRAY_DEBUG
-  sqlite3_bind_int64(insertStmt, 26, stats::arrayHashTime);
+  sqlite3_bind_int64(insertStmt, 27, stats::arrayHashTime);
 #else
-  sqlite3_bind_int64(insertStmt, 26, -1LL);
+  sqlite3_bind_int64(insertStmt, 27, -1LL);
 #endif
   int errCode = sqlite3_step(insertStmt);
   if(errCode != SQLITE_DONE) klee_error("Error writing stats data: %s", sqlite3_errmsg(statsFile));