about summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorFrank Busse <bb0xfb@gmail.com>2022-01-07 16:12:12 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-03-23 17:41:08 +0000
commita88a768c3ea9343db746344f2cc6e41d4c598a8c (patch)
tree4a8845026b73aac0b19dd546799dc45f7b130bc4
parent855d33173cae9fd43899a6a96a58f79563560cce (diff)
downloadklee-a88a768c3ea9343db746344f2cc6e41d4c598a8c.tar.gz
stats: add Allocations
-rw-r--r--lib/Core/StatsTracker.cpp8
-rwxr-xr-xtools/klee-stats/klee-stats1
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/Core/StatsTracker.cpp b/lib/Core/StatsTracker.cpp
index 37a52fff..bc40afd9 100644
--- a/lib/Core/StatsTracker.cpp
+++ b/lib/Core/StatsTracker.cpp
@@ -456,6 +456,7 @@ void StatsTracker::writeStatsHeader() {
              << "QueryCexCacheHits INTEGER,"
              << "InhibitedForks INTEGER,"
              << "ExternalCalls INTEGER,"
+             << "Allocations INTEGER,"
              << "ArrayHashTime INTEGER"
          << ')';
   char *zErrMsg = nullptr;
@@ -494,6 +495,7 @@ void StatsTracker::writeStatsHeader() {
              << "QueryCexCacheHits,"
              << "InhibitedForks,"
              << "ExternalCalls,"
+             << "Allocations,"
              << "ArrayHashTime"
          << ") VALUES ("
              << "?,"
@@ -520,6 +522,7 @@ void StatsTracker::writeStatsHeader() {
              << "?,"
              << "?,"
              << "?,"
+             << "?,"
              << "? "
          << ')';
 
@@ -557,10 +560,11 @@ void StatsTracker::writeStatsLine() {
   sqlite3_bind_int64(insertStmt, 22, stats::queryCexCacheHits);
   sqlite3_bind_int64(insertStmt, 23, stats::inhibitedForks);
   sqlite3_bind_int64(insertStmt, 24, stats::externalCalls);
+  sqlite3_bind_int64(insertStmt, 25, stats::allocations);
 #ifdef KLEE_ARRAY_DEBUG
-  sqlite3_bind_int64(insertStmt, 25, stats::arrayHashTime);
+  sqlite3_bind_int64(insertStmt, 26, stats::arrayHashTime);
 #else
-  sqlite3_bind_int64(insertStmt, 25, -1LL);
+  sqlite3_bind_int64(insertStmt, 26, -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 5e49587b..b08022f4 100755
--- a/tools/klee-stats/klee-stats
+++ b/tools/klee-stats/klee-stats
@@ -59,6 +59,7 @@ Legend = [
     ('QCexCacheMisses', 'Counterexample cache misses', "QueryCexCacheMisses"),
     ('QCexCacheHits', 'Counterexample cache hits', "QueryCexCacheHits"),
     # - memory
+    ('Allocations', 'number of allocated heap objects of the program under test', "Allocations"),
     ('Mem(MiB)', 'mebibytes of memory currently used', "MallocUsage"),
     ('MaxMem(MiB)', 'maximum memory usage', "MaxMem"),
     ('AvgMem(MiB)', 'average memory usage', "AvgMem"),