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

Read and report power usage.

This commit is contained in:
Bartosz Taudul
2023-03-10 00:23:09 +01:00
parent c3e7157cd5
commit 2971db21e3
4 changed files with 45 additions and 1 deletions
+10
View File
@@ -90,6 +90,7 @@ enum class QueueType : uint8_t
GpuNewContext,
CallstackFrame,
SysTimeReport,
SysPowerReport,
TidToPid,
HwSampleCpuCycle,
HwSampleInstructionRetired,
@@ -563,6 +564,13 @@ struct QueueSysTime
float sysTime;
};
struct QueueSysPower
{
int64_t time;
uint64_t delta;
uint64_t name; // ptr
};
struct QueueContextSwitch
{
int64_t time;
@@ -729,6 +737,7 @@ struct QueueItem
QueueCrashReport crashReport;
QueueCrashReportThread crashReportThread;
QueueSysTime sysTime;
QueueSysPower sysPower;
QueueContextSwitch contextSwitch;
QueueThreadWakeup threadWakeup;
QueueTidToPid tidToPid;
@@ -832,6 +841,7 @@ static constexpr size_t QueueDataSize[] = {
sizeof( QueueHeader ) + sizeof( QueueGpuNewContext ),
sizeof( QueueHeader ) + sizeof( QueueCallstackFrame ),
sizeof( QueueHeader ) + sizeof( QueueSysTime ),
sizeof( QueueHeader ) + sizeof( QueueSysPower ),
sizeof( QueueHeader ) + sizeof( QueueTidToPid ),
sizeof( QueueHeader ) + sizeof( QueueHwSample ), // cpu cycle
sizeof( QueueHeader ) + sizeof( QueueHwSample ), // instruction retired