mirror of
https://github.com/wolfpld/tracy
synced 2025-05-05 06:33:52 +00:00
Add allocations list window.
This commit is contained in:
parent
01e0bbb5f9
commit
6cfd53b274
@ -695,6 +695,7 @@ bool View::DrawImpl()
|
|||||||
if( m_findZone.show ) DrawFindZone();
|
if( m_findZone.show ) DrawFindZone();
|
||||||
if( m_showStatistics ) DrawStatistics();
|
if( m_showStatistics ) DrawStatistics();
|
||||||
if( m_memInfo.show ) DrawMemory();
|
if( m_memInfo.show ) DrawMemory();
|
||||||
|
if( m_memInfo.showAllocList ) DrawAllocList();
|
||||||
if( m_compare.show ) DrawCompare();
|
if( m_compare.show ) DrawCompare();
|
||||||
if( m_callstackInfoWindow != 0 ) DrawCallstackWindow();
|
if( m_callstackInfoWindow != 0 ) DrawCallstackWindow();
|
||||||
if( m_memoryAllocInfoWindow >= 0 ) DrawMemoryAllocWindow();
|
if( m_memoryAllocInfoWindow >= 0 ) DrawMemoryAllocWindow();
|
||||||
@ -7517,7 +7518,7 @@ void View::DrawMemory()
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled( "Press ctrl key to display allocation info tooltip." );
|
ImGui::TextDisabled( "Press ctrl key to display allocation info tooltip." );
|
||||||
ImGui::TextDisabled( "Right click on file name to open source file." );
|
ImGui::TextDisabled( "Right click on function name to display allocations list. Right click on file name to open source file." );
|
||||||
|
|
||||||
auto& mem = m_worker.GetMemData();
|
auto& mem = m_worker.GetMemData();
|
||||||
auto tree = GetCallstackFrameTree( mem );
|
auto tree = GetCallstackFrameTree( mem );
|
||||||
@ -7566,6 +7567,7 @@ void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx )
|
|||||||
{
|
{
|
||||||
auto& mem = m_worker.GetMemData().data;
|
auto& mem = m_worker.GetMemData().data;
|
||||||
const auto sz = mem.size();
|
const auto sz = mem.size();
|
||||||
|
m_memInfo.showAllocList = true;
|
||||||
m_memInfo.allocList.clear();
|
m_memInfo.allocList.clear();
|
||||||
for( size_t i=0; i<sz; i++ )
|
for( size_t i=0; i<sz; i++ )
|
||||||
{
|
{
|
||||||
@ -7666,6 +7668,16 @@ void View::DrawFrameTreeLevel( std::vector<CallstackFrameTree>& tree, int& idx )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::DrawAllocList()
|
||||||
|
{
|
||||||
|
ImGui::Begin( "Allocations list", &m_memInfo.showAllocList );
|
||||||
|
TextFocused( "Number of allocations:", RealToString( m_memInfo.allocList.size(), true ) );
|
||||||
|
ListMemData<decltype( m_memInfo.allocList.begin() )>( m_memInfo.allocList.begin(), m_memInfo.allocList.end(), [this]( auto& v ) {
|
||||||
|
ImGui::Text( "0x%" PRIx64, (*v)->ptr );
|
||||||
|
}, "##allocations" );
|
||||||
|
ImGui::End();
|
||||||
|
}
|
||||||
|
|
||||||
std::pair<int8_t*, size_t> View::GetMemoryPages() const
|
std::pair<int8_t*, size_t> View::GetMemoryPages() const
|
||||||
{
|
{
|
||||||
const auto& mem = m_worker.GetMemData();
|
const auto& mem = m_worker.GetMemData();
|
||||||
|
@ -93,6 +93,7 @@ private:
|
|||||||
void DrawFindZone();
|
void DrawFindZone();
|
||||||
void DrawStatistics();
|
void DrawStatistics();
|
||||||
void DrawMemory();
|
void DrawMemory();
|
||||||
|
void DrawAllocList();
|
||||||
void DrawCompare();
|
void DrawCompare();
|
||||||
void DrawCallstackWindow();
|
void DrawCallstackWindow();
|
||||||
void DrawMemoryAllocWindow();
|
void DrawMemoryAllocWindow();
|
||||||
@ -402,6 +403,7 @@ private:
|
|||||||
char pattern[1024] = {};
|
char pattern[1024] = {};
|
||||||
uint64_t ptrFind = 0;
|
uint64_t ptrFind = 0;
|
||||||
bool restrictTime = false;
|
bool restrictTime = false;
|
||||||
|
bool showAllocList = false;
|
||||||
std::vector<const MemEvent*> allocList;
|
std::vector<const MemEvent*> allocList;
|
||||||
} m_memInfo;
|
} m_memInfo;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user