diff options
author | Frank Busse <bb0xfb@gmail.com> | 2022-01-07 18:58:13 +0000 |
---|---|---|
committer | Cristian Cadar <c.cadar@imperial.ac.uk> | 2023-03-23 17:41:08 +0000 |
commit | 4749068700db333a47b034f047eed154de4ad2c8 (patch) | |
tree | 7b9505cb382c47760c6bee8c00c0573b069cf473 /lib/Core/CoreStats.cpp | |
parent | ba58e4add3bb2e924b0078146fdcd9b4f6158178 (diff) | |
download | klee-4749068700db333a47b034f047eed154de4ad2c8.tar.gz |
stats: add branch type stats
Diffstat (limited to 'lib/Core/CoreStats.cpp')
-rw-r--r-- | lib/Core/CoreStats.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/Core/CoreStats.cpp b/lib/Core/CoreStats.cpp index 06b8b930..54a9a697 100644 --- a/lib/Core/CoreStats.cpp +++ b/lib/Core/CoreStats.cpp @@ -9,6 +9,9 @@ #include "CoreStats.h" +#include "klee/Support/ErrorHandling.h" + + using namespace klee; Statistic stats::allocations("Allocations", "Alloc"); @@ -28,3 +31,21 @@ Statistic stats::solverTime("SolverTime", "Stime"); Statistic stats::states("States", "States"); Statistic stats::trueBranches("TrueBranches", "Bt"); Statistic stats::uncoveredInstructions("UncoveredInstructions", "Iuncov"); + + +// branch stats and setter + +#undef BTYPE +#define BTYPE(Name,I) Statistic stats::branches ## Name("Branches"#Name, "Br"#Name); +BRANCH_TYPES + +void stats::incBranchStat(BranchType reason, std::uint32_t value) { +#undef BTYPE +#define BTYPE(N,I) case BranchType::N : stats::branches ## N += value; break; + switch (reason) { + BRANCH_TYPES + default: + klee_error("Illegal branch type in incBranchStat(): %hhu", + static_cast<std::uint8_t>(reason)); + } +} |