Skip to content

Commit 8a23354

Browse files
Merge pull request #416 from GameTechDev/feature/igcl-percent-metrics
Feature/igcl percent metrics
2 parents 68256a8 + f545bb4 commit 8a23354

28 files changed

+962
-183
lines changed

IntelPresentMon/AppCef/CefNano.args.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@
8888
"Id": "fc633c46-6b09-43e6-9c02-3e4817ef382e",
8989
"Command": "--p2c-debug-wait-render"
9090
},
91+
{
92+
"Id": "f556bf27-cb7e-4a17-a7cb-3c0400aeb7d1",
93+
"Command": "--p2c-debug-wait-client"
94+
},
9195
{
9296
"Id": "92d25458-0b38-4e99-a582-49f0c90979c2",
9397
"Command": "--help"

IntelPresentMon/CommonUtilities/ref/StaticReflection.h

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <optional>
77
#include "WrapReflect.h"
88
#include "../Meta.h"
9+
#include <bitset>
910

1011

1112
namespace pmon::util::ref
@@ -36,7 +37,7 @@ namespace pmon::util::ref
3637
oss << "{unknown}";
3738
}
3839
else if constexpr (std::is_enum_v<S>) {
39-
oss << reflect::enum_name(s);
40+
oss << reflect::type_name<S>() << "::" << reflect::enum_name(s);
4041
}
4142
else if constexpr (std::is_class_v<S>) {
4243
oss << "struct " << reflect::type_name(s) << " { ";
@@ -64,4 +65,51 @@ namespace pmon::util::ref
6465
DumpStaticImpl_(s, oss);
6566
return oss.str();
6667
}
68+
69+
template<typename E, size_t N>
70+
std::string DumpEnumBitset(const std::bitset<N>& set)
71+
{
72+
std::ostringstream oss;
73+
oss << "| ";
74+
for (size_t n = 0; n < N; n++) {
75+
if (!set.test(n)) {
76+
continue;
77+
}
78+
const auto name = reflect::enum_name(E(n));
79+
if (!name.length()) {
80+
continue;
81+
}
82+
oss << name << ", ";
83+
}
84+
oss << "|";
85+
return oss.str();
86+
}
87+
88+
template<typename E>
89+
std::string DumpEnumFlagSet(uint64_t bits)
90+
{
91+
// simple hacky impl assumes 32-bit ints, logically unsigned for flags
92+
// unless underlying type is 8-bytes, then assume 64-bit
93+
size_t nBits;
94+
if constexpr (sizeof(std::underlying_type_t<E>) == 8) {
95+
nBits = 64;
96+
}
97+
else {
98+
nBits = 32;
99+
}
100+
std::ostringstream oss;
101+
oss << "| ";
102+
// loop over n-bits, shifting a 1-hot bit value to test all positions
103+
for (size_t n = 0, b = 1; n < nBits; n++, b<<1) {
104+
if (!(bits & b)) {
105+
continue;
106+
}
107+
const auto name = reflect::enum_name(E(b));
108+
if (!name.length()) {
109+
continue;
110+
}
111+
oss << name << ", ";
112+
}
113+
oss << "|";
114+
}
67115
}

IntelPresentMon/CommonUtilities/ref/gen/GeneratedReflection.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,6 +1364,43 @@ namespace pmon::util::ref::gen
13641364
<< " }";
13651365
return oss.str();
13661366
};
1367+
dumpers[typeid(_ctl_led_properties_t)] = [](const void* pStruct) {
1368+
const auto& s = *static_cast<const _ctl_led_properties_t*>(pStruct);
1369+
std::ostringstream oss;
1370+
oss << std::boolalpha << "struct _ctl_led_properties_t {"
1371+
<< " .Size = " << s.Size
1372+
<< " .Version = " << (int)s.Version
1373+
<< " .canControl = " << s.canControl
1374+
<< " .isI2C = " << s.isI2C
1375+
<< " .isPWM = " << s.isPWM
1376+
<< " .haveRGB = " << s.haveRGB
1377+
<< " }";
1378+
return oss.str();
1379+
};
1380+
dumpers[typeid(_ctl_led_color_t)] = [](const void* pStruct) {
1381+
const auto& s = *static_cast<const _ctl_led_color_t*>(pStruct);
1382+
std::ostringstream oss;
1383+
oss << std::boolalpha << "struct _ctl_led_color_t {"
1384+
<< " .Size = " << s.Size
1385+
<< " .Version = " << (int)s.Version
1386+
<< " .red = " << s.red
1387+
<< " .green = " << s.green
1388+
<< " .blue = " << s.blue
1389+
<< " }";
1390+
return oss.str();
1391+
};
1392+
dumpers[typeid(_ctl_led_state_t)] = [](const void* pStruct) {
1393+
const auto& s = *static_cast<const _ctl_led_state_t*>(pStruct);
1394+
std::ostringstream oss;
1395+
oss << std::boolalpha << "struct _ctl_led_state_t {"
1396+
<< " .Size = " << s.Size
1397+
<< " .Version = " << (int)s.Version
1398+
<< " .isOn = " << s.isOn
1399+
<< " .pwm = " << s.pwm
1400+
<< " .color = " << DumpGenerated(s.color)
1401+
<< " }";
1402+
return oss.str();
1403+
};
13671404
dumpers[typeid(_ctl_video_processing_super_resolution_info_t)] = [](const void* pStruct) {
13681405
const auto& s = *static_cast<const _ctl_video_processing_super_resolution_info_t*>(pStruct);
13691406
std::ostringstream oss;
@@ -1689,6 +1726,15 @@ namespace pmon::util::ref::gen
16891726
<< " .totalCardEnergyCounter = " << DumpGenerated(s.totalCardEnergyCounter)
16901727
<< " .psu = " << DumpArray_<ctl_psu_info_t, 5, false>(s.psu)
16911728
<< " .fanSpeed = " << DumpArray_<ctl_oc_telemetry_item_t, 5, false>(s.fanSpeed)
1729+
<< " .gpuVrTemp = " << DumpGenerated(s.gpuVrTemp)
1730+
<< " .vramVrTemp = " << DumpGenerated(s.vramVrTemp)
1731+
<< " .saVrTemp = " << DumpGenerated(s.saVrTemp)
1732+
<< " .gpuEffectiveClock = " << DumpGenerated(s.gpuEffectiveClock)
1733+
<< " .gpuOverVoltagePercent = " << DumpGenerated(s.gpuOverVoltagePercent)
1734+
<< " .gpuPowerPercent = " << DumpGenerated(s.gpuPowerPercent)
1735+
<< " .gpuTemperaturePercent = " << DumpGenerated(s.gpuTemperaturePercent)
1736+
<< " .vramReadBandwidth = " << DumpGenerated(s.vramReadBandwidth)
1737+
<< " .vramWriteBandwidth = " << DumpGenerated(s.vramWriteBandwidth)
16921738
<< " }";
16931739
return oss.str();
16941740
};
@@ -2041,6 +2087,7 @@ namespace pmon::util::ref::gen
20412087
case _ctl_units_t::CTL_UNITS_PERCENT: return "CTL_UNITS_PERCENT"s;
20422088
case _ctl_units_t::CTL_UNITS_MEM_SPEED_GBPS: return "CTL_UNITS_MEM_SPEED_GBPS"s;
20432089
case _ctl_units_t::CTL_UNITS_VOLTAGE_MILLIVOLTS: return "CTL_UNITS_VOLTAGE_MILLIVOLTS"s;
2090+
case _ctl_units_t::CTL_UNITS_BANDWIDTH_MBPS: return "CTL_UNITS_BANDWIDTH_MBPS"s;
20442091
case _ctl_units_t::CTL_UNITS_UNKNOWN: return "CTL_UNITS_UNKNOWN"s;
20452092
case _ctl_units_t::CTL_UNITS_MAX: return "CTL_UNITS_MAX"s;
20462093
default: return "{ unknown }"s;
@@ -2602,6 +2649,7 @@ namespace pmon::util::ref::gen
26022649
dumpers[typeid(_ctl_3d_feature_misc_flag_t)] = [](const void* pEnum) {
26032650
const auto& e = *static_cast<const _ctl_3d_feature_misc_flag_t*>(pEnum);
26042651
switch (e) {
2652+
case _ctl_3d_feature_misc_flag_t::CTL_3D_FEATURE_MISC_FLAG_DX9: return "CTL_3D_FEATURE_MISC_FLAG_DX9"s;
26052653
case _ctl_3d_feature_misc_flag_t::CTL_3D_FEATURE_MISC_FLAG_DX11: return "CTL_3D_FEATURE_MISC_FLAG_DX11"s;
26062654
case _ctl_3d_feature_misc_flag_t::CTL_3D_FEATURE_MISC_FLAG_DX12: return "CTL_3D_FEATURE_MISC_FLAG_DX12"s;
26072655
case _ctl_3d_feature_misc_flag_t::CTL_3D_FEATURE_MISC_FLAG_VULKAN: return "CTL_3D_FEATURE_MISC_FLAG_VULKAN"s;

0 commit comments

Comments
 (0)