about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--lib/Core/ExecutionState.h1
-rw-r--r--lib/Core/StatsTracker.cpp8
-rwxr-xr-xtools/klee-stats/klee-stats1
3 files changed, 8 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));
diff --git a/tools/klee-stats/klee-stats b/tools/klee-stats/klee-stats
index b08022f4..629095bc 100755
--- a/tools/klee-stats/klee-stats
+++ b/tools/klee-stats/klee-stats
@@ -45,6 +45,7 @@ Legend = [
     ('TQuery(s)', 'time spent in the constraint solver', "QueryTime"),
     ('TSolver(s)', 'time spent in the solver chain (incl. caches and constraint solver)', "SolverTime"),
     # - states
+    ('States', 'number of created states', "States"),
     ('ActiveStates', 'number of currently active states (0 after successful termination)', "NumStates"),
     ('MaxActiveStates', 'maximum number of active states', "MaxStates"),
     ('AvgActiveStates', 'average number of active states', "AvgStates"),