mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-25 23:44:35 +00:00
Add system power use tracking skeleton.
This commit is contained in:
parent
f428a5b52b
commit
5e2e5eeefb
@ -22,6 +22,7 @@
|
||||
#include "common/tracy_lz4.cpp"
|
||||
#include "client/TracyProfiler.cpp"
|
||||
#include "client/TracyCallstack.cpp"
|
||||
#include "client/TracySysPower.cpp"
|
||||
#include "client/TracySysTime.cpp"
|
||||
#include "client/TracySysTrace.cpp"
|
||||
#include "common/TracySocket.cpp"
|
||||
|
@ -1711,6 +1711,9 @@ void Profiler::Worker()
|
||||
if( m_sock ) break;
|
||||
#ifndef TRACY_ON_DEMAND
|
||||
ProcessSysTime();
|
||||
# ifdef TRACY_HAS_SYSPOWER
|
||||
m_sysPower.Tick();
|
||||
# endif
|
||||
#endif
|
||||
|
||||
if( m_broadcast )
|
||||
@ -1828,6 +1831,9 @@ void Profiler::Worker()
|
||||
for(;;)
|
||||
{
|
||||
ProcessSysTime();
|
||||
#ifdef TRACY_HAS_SYSPOWER
|
||||
m_sysPower.Tick();
|
||||
#endif
|
||||
const auto status = Dequeue( token );
|
||||
const auto serialStatus = DequeueSerial();
|
||||
if( status == DequeueStatus::ConnectionLost || serialStatus == DequeueStatus::ConnectionLost )
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "tracy_concurrentqueue.h"
|
||||
#include "tracy_SPSCQueue.h"
|
||||
#include "TracyCallstack.hpp"
|
||||
#include "TracySysPower.hpp"
|
||||
#include "TracySysTime.hpp"
|
||||
#include "TracyFastVector.hpp"
|
||||
#include "../common/TracyQueue.hpp"
|
||||
@ -941,6 +942,10 @@ private:
|
||||
void ProcessSysTime() {}
|
||||
#endif
|
||||
|
||||
#ifdef TRACY_HAS_SYSPOWER
|
||||
SysPower m_sysPower;
|
||||
#endif
|
||||
|
||||
ParameterCallback m_paramCallback;
|
||||
void* m_paramCallbackData;
|
||||
SourceContentsCallback m_sourceCallback;
|
||||
|
22
public/client/TracySysPower.cpp
Normal file
22
public/client/TracySysPower.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
#include "TracySysPower.hpp"
|
||||
|
||||
#ifdef TRACY_HAS_SYSPOWER
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
SysPower::SysPower()
|
||||
{
|
||||
}
|
||||
|
||||
SysPower::~SysPower()
|
||||
{
|
||||
}
|
||||
|
||||
void SysPower::Tick()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
25
public/client/TracySysPower.hpp
Normal file
25
public/client/TracySysPower.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
#ifndef __TRACYSYSPOWER_HPP__
|
||||
#define __TRACYSYSPOWER_HPP__
|
||||
|
||||
#if defined __linux__
|
||||
# define TRACY_HAS_SYSPOWER
|
||||
#endif
|
||||
|
||||
#ifdef TRACY_HAS_SYSPOWER
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
class SysPower
|
||||
{
|
||||
public:
|
||||
SysPower();
|
||||
~SysPower();
|
||||
|
||||
void Tick();
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user