2023-03-09 21:31:31 +00:00
|
|
|
#ifndef __TRACYSYSPOWER_HPP__
|
|
|
|
#define __TRACYSYSPOWER_HPP__
|
|
|
|
|
|
|
|
#if defined __linux__
|
|
|
|
# define TRACY_HAS_SYSPOWER
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TRACY_HAS_SYSPOWER
|
|
|
|
|
2023-03-09 23:05:18 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "TracyFastVector.hpp"
|
|
|
|
|
2023-03-09 21:31:31 +00:00
|
|
|
namespace tracy
|
|
|
|
{
|
|
|
|
|
|
|
|
class SysPower
|
|
|
|
{
|
2023-03-09 23:05:18 +00:00
|
|
|
struct Domain
|
|
|
|
{
|
|
|
|
uint64_t value;
|
|
|
|
uint64_t overflow;
|
|
|
|
FILE* handle;
|
|
|
|
const char* name;
|
|
|
|
};
|
|
|
|
|
2023-03-09 21:31:31 +00:00
|
|
|
public:
|
|
|
|
SysPower();
|
|
|
|
~SysPower();
|
|
|
|
|
|
|
|
void Tick();
|
2023-03-09 23:05:18 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void ScanDirectory( const char* path, int parent );
|
|
|
|
|
|
|
|
FastVector<Domain> m_domains;
|
2023-03-09 23:23:09 +00:00
|
|
|
uint64_t m_lastTime;
|
2023-03-09 21:31:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|