summaryrefslogtreecommitdiffstats
path: root/vespamalloc
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2017-01-11 14:44:23 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2017-01-11 14:44:23 +0100
commit2b5b5302a638e055208577cf5ef7210d32a4c19b (patch)
treed4d70cc285efd464bf5d310ab91f54f09a600744 /vespamalloc
parent3fcbbacc7114e139111c81ae349c26eae731b475 (diff)
Count and show empty/invalid callstacks.
Diffstat (limited to 'vespamalloc')
-rw-r--r--vespamalloc/src/vespamalloc/malloc/datasegment.hpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/vespamalloc/src/vespamalloc/malloc/datasegment.hpp b/vespamalloc/src/vespamalloc/malloc/datasegment.hpp
index dd2db0d42b2..fe9d00decd0 100644
--- a/vespamalloc/src/vespamalloc/malloc/datasegment.hpp
+++ b/vespamalloc/src/vespamalloc/malloc/datasegment.hpp
@@ -169,6 +169,8 @@ size_t DataSegment<MemBlockPtrT>::infoThread(FILE * os, int level, int thread, S
size_t checkedCount(0);
size_t allocatedCount(0);
size_t notAccounted(0);
+ size_t invalidCallStacks(0);
+ size_t emptyCallStacks(0);
std::unique_ptr<CallGraphLT> callGraph(new CallGraphLT);
for(size_t i=0; i < NELEMS(_blockList); ) {
const BlockT & b = _blockList[i];
@@ -196,6 +198,12 @@ size_t DataSegment<MemBlockPtrT>::infoThread(FILE * os, int level, int thread, S
if ( ! callGraph->addStack(mem.callStack(), csl)) {
notAccounted++;
}
+ } else {
+ if (mem.callStackLen() == 0) {
+ emptyCallStacks++;
+ } else {
+ invalidCallStacks++;
+ }
}
}
}
@@ -205,9 +213,9 @@ size_t DataSegment<MemBlockPtrT>::infoThread(FILE * os, int level, int thread, S
i++;
}
}
- fprintf(os, "\nCallTree(Checked=%ld, GlobalAlloc=%ld(%ld%%)," "ByMeAlloc=%ld(%2.2f%%) NotAccountedDue2FullGraph=%ld:\n",
+ fprintf(os, "\nCallTree(Checked=%ld, GlobalAlloc=%ld(%ld%%)," "ByMeAlloc=%ld(%2.2f%%) NotAccountedDue2FullGraph=%ld EmptyCallStacks=%ld InvalidCallStacks=%ld:\n",
checkedCount, allocatedCount, checkedCount ? allocatedCount*100/checkedCount : 0,
- usedCount, checkedCount ? static_cast<double>(usedCount*100)/checkedCount : 0.0, notAccounted);
+ usedCount, checkedCount ? static_cast<double>(usedCount*100)/checkedCount : 0.0, notAccounted, emptyCallStacks, invalidCallStacks);
if ( ! callGraph->empty()) {
Aggregator agg;
DumpGraph<typename CallGraphLT::Node> dump(&agg, "{ ", " }");