From 9301986baeb9c75ef50f3b8fe9745f7ac3b303d7 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 27 Sep 2018 22:56:44 +0200 Subject: [PATCH] Collect callstacks for each entry in call stack tree. --- server/TracyEvent.hpp | 1 + server/TracyView.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/server/TracyEvent.hpp b/server/TracyEvent.hpp index d2ba95c0..bacccdac 100644 --- a/server/TracyEvent.hpp +++ b/server/TracyEvent.hpp @@ -177,6 +177,7 @@ struct CallstackFrameTree uint64_t allocExclusive, allocInclusive; uint32_t countExclusive, countInclusive; std::vector children; + flat_hash_set> callstacks; }; enum { CallstackFrameTreeSize = sizeof( CallstackFrameTree ) }; diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 6ac360aa..17cca346 100644 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -7211,12 +7211,14 @@ std::vector View::GetCallstackFrameTree( const MemData& mem auto treePtr = GetFrameTreeItem( root, base ); treePtr->countInclusive += path.second.cnt; treePtr->allocInclusive += path.second.mem; + treePtr->callstacks.emplace( path.first ); for( int i = int( cs.size() ) - 2; i >= 0; i-- ) { treePtr = GetFrameTreeItem( treePtr->children, cs[i] ); treePtr->countInclusive += path.second.cnt; treePtr->allocInclusive += path.second.mem; + treePtr->callstacks.emplace( path.first ); } treePtr->countExclusive += path.second.cnt;