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

Introduce "Non-reentrant time" radio button

Add to the statistics view an option for "Non-reentrant
time", which displays the count of and time spent in zone
events which were the only appearances (at that time) of
their zones on their threads' stacks.

Besides the GUI changes, this involves:

- Introducing a tri-state accumulation mode to replace the
boolean "self time":  now there's "Self time only",
"Child time", and "Non-reentrant time".

- Removing the separate "selfTotal" from SrcLocZonesSlim,
making "total" represent whichever of the now three options
is active, which in turn requires keeping track of the
accumulation mode in StatisticsCache and invalidating that
cache when the accumulation mode changes.
This commit is contained in:
Terence Rokop
2021-06-05 11:41:21 -07:00
parent 66053e37f7
commit 9366e58d12
2 changed files with 90 additions and 64 deletions
+10 -2
View File
@@ -56,13 +56,20 @@ class View
uint64_t count;
};
enum class AccumulationMode
{
SelfOnly,
AllChildren,
NonReentrantChildren
};
struct StatisticsCache
{
RangeSlim range;
AccumulationMode accumulationMode;
size_t sourceCount;
size_t count;
int64_t total;
int64_t selfTotal;
};
public:
@@ -187,6 +194,7 @@ private:
void DrawMessages();
void DrawMessageLine( const MessageData& msg, bool hasCallstack, int& idx );
void DrawFindZone();
void AccumulationModeRadioButtons();
void DrawStatistics();
void DrawMemory();
void DrawAllocList();
@@ -394,7 +402,7 @@ private:
bool m_showCpuDataWindow = false;
bool m_showAnnotationList = false;
bool m_statSelf = true;
AccumulationMode m_statAccumulationMode = AccumulationMode::SelfOnly;
bool m_statSampleTime = true;
int m_statMode = 0;
int m_statSampleLocation = 2;