1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Collect callstacks for each entry in call stack tree.

This commit is contained in:
Bartosz Taudul 2018-09-27 22:56:44 +02:00
parent 44fae53583
commit 9301986bae
2 changed files with 3 additions and 0 deletions

View File

@ -177,6 +177,7 @@ struct CallstackFrameTree
uint64_t allocExclusive, allocInclusive;
uint32_t countExclusive, countInclusive;
std::vector<CallstackFrameTree> children;
flat_hash_set<uint32_t, nohash<uint32_t>> callstacks;
};
enum { CallstackFrameTreeSize = sizeof( CallstackFrameTree ) };

View File

@ -7211,12 +7211,14 @@ std::vector<CallstackFrameTree> 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;