mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +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 "common/tracy_lz4.cpp"
|
||||||
#include "client/TracyProfiler.cpp"
|
#include "client/TracyProfiler.cpp"
|
||||||
#include "client/TracyCallstack.cpp"
|
#include "client/TracyCallstack.cpp"
|
||||||
|
#include "client/TracySysPower.cpp"
|
||||||
#include "client/TracySysTime.cpp"
|
#include "client/TracySysTime.cpp"
|
||||||
#include "client/TracySysTrace.cpp"
|
#include "client/TracySysTrace.cpp"
|
||||||
#include "common/TracySocket.cpp"
|
#include "common/TracySocket.cpp"
|
||||||
|
@ -1711,6 +1711,9 @@ void Profiler::Worker()
|
|||||||
if( m_sock ) break;
|
if( m_sock ) break;
|
||||||
#ifndef TRACY_ON_DEMAND
|
#ifndef TRACY_ON_DEMAND
|
||||||
ProcessSysTime();
|
ProcessSysTime();
|
||||||
|
# ifdef TRACY_HAS_SYSPOWER
|
||||||
|
m_sysPower.Tick();
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( m_broadcast )
|
if( m_broadcast )
|
||||||
@ -1828,6 +1831,9 @@ void Profiler::Worker()
|
|||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
ProcessSysTime();
|
ProcessSysTime();
|
||||||
|
#ifdef TRACY_HAS_SYSPOWER
|
||||||
|
m_sysPower.Tick();
|
||||||
|
#endif
|
||||||
const auto status = Dequeue( token );
|
const auto status = Dequeue( token );
|
||||||
const auto serialStatus = DequeueSerial();
|
const auto serialStatus = DequeueSerial();
|
||||||
if( status == DequeueStatus::ConnectionLost || serialStatus == DequeueStatus::ConnectionLost )
|
if( status == DequeueStatus::ConnectionLost || serialStatus == DequeueStatus::ConnectionLost )
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "tracy_concurrentqueue.h"
|
#include "tracy_concurrentqueue.h"
|
||||||
#include "tracy_SPSCQueue.h"
|
#include "tracy_SPSCQueue.h"
|
||||||
#include "TracyCallstack.hpp"
|
#include "TracyCallstack.hpp"
|
||||||
|
#include "TracySysPower.hpp"
|
||||||
#include "TracySysTime.hpp"
|
#include "TracySysTime.hpp"
|
||||||
#include "TracyFastVector.hpp"
|
#include "TracyFastVector.hpp"
|
||||||
#include "../common/TracyQueue.hpp"
|
#include "../common/TracyQueue.hpp"
|
||||||
@ -941,6 +942,10 @@ private:
|
|||||||
void ProcessSysTime() {}
|
void ProcessSysTime() {}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TRACY_HAS_SYSPOWER
|
||||||
|
SysPower m_sysPower;
|
||||||
|
#endif
|
||||||
|
|
||||||
ParameterCallback m_paramCallback;
|
ParameterCallback m_paramCallback;
|
||||||
void* m_paramCallbackData;
|
void* m_paramCallbackData;
|
||||||
SourceContentsCallback m_sourceCallback;
|
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