|
8 | 8 | #include <PresentMonAPIWrapperCommon/EnumMap.h> |
9 | 9 | #include <format> |
10 | 10 | #include <array> |
| 11 | +#include "RawFrameDataMetricList.h" |
11 | 12 |
|
12 | 13 | namespace p2c::pmon |
13 | 14 | { |
@@ -135,15 +136,7 @@ namespace p2c::pmon |
135 | 136 | class QueryElementContainer_ |
136 | 137 | { |
137 | 138 | public: |
138 | | - // types |
139 | | - struct ElementDefinition |
140 | | - { |
141 | | - PM_METRIC metricId; |
142 | | - uint32_t deviceId; |
143 | | - std::optional<uint32_t> index; |
144 | | - }; |
145 | | - // functions |
146 | | - QueryElementContainer_(std::span<const ElementDefinition> elements, |
| 139 | + QueryElementContainer_(std::span<const RawFrameQueryElementDefinition> elements, |
147 | 140 | pmapi::Session& session, const pmapi::intro::Root& introRoot) |
148 | 141 | { |
149 | 142 | for (auto& el : elements) { |
@@ -250,67 +243,7 @@ namespace p2c::pmon |
250 | 243 | pStatsTracker{ frameStatsPath ? std::make_unique<StatisticsTracker>() : nullptr }, |
251 | 244 | file{ path } |
252 | 245 | { |
253 | | - using Element = QueryElementContainer_::ElementDefinition; |
254 | | - |
255 | | - std::array queryElements{ |
256 | | - Element{.metricId = PM_METRIC_TIME, .deviceId = 0 }, |
257 | | - Element{.metricId = PM_METRIC_SWAP_CHAIN_ADDRESS, .deviceId = 0 }, |
258 | | - Element{.metricId = PM_METRIC_PRESENT_RUNTIME, .deviceId = 0 }, |
259 | | - Element{.metricId = PM_METRIC_SYNC_INTERVAL, .deviceId = 0 }, |
260 | | - Element{.metricId = PM_METRIC_PRESENT_FLAGS, .deviceId = 0 }, |
261 | | - Element{.metricId = PM_METRIC_ALLOWS_TEARING, .deviceId = 0 }, |
262 | | - Element{.metricId = PM_METRIC_PRESENT_MODE, .deviceId = 0 }, |
263 | | - Element{.metricId = PM_METRIC_CPU_FRAME_QPC, .deviceId = 0 }, |
264 | | - Element{.metricId = PM_METRIC_FRAME_TIME, .deviceId = 0 }, |
265 | | - Element{.metricId = PM_METRIC_CPU_BUSY, .deviceId = 0 }, |
266 | | - Element{.metricId = PM_METRIC_CPU_WAIT, .deviceId = 0 }, |
267 | | - Element{.metricId = PM_METRIC_GPU_LATENCY, .deviceId = 0 }, |
268 | | - Element{.metricId = PM_METRIC_GPU_TIME, .deviceId = 0 }, |
269 | | - Element{.metricId = PM_METRIC_GPU_BUSY, .deviceId = 0 }, |
270 | | - Element{.metricId = PM_METRIC_GPU_WAIT, .deviceId = 0 }, |
271 | | - Element{.metricId = PM_METRIC_DISPLAY_LATENCY, .deviceId = 0 }, |
272 | | - Element{.metricId = PM_METRIC_DISPLAYED_TIME, .deviceId = 0 }, |
273 | | - Element{.metricId = PM_METRIC_CLICK_TO_PHOTON_LATENCY, .deviceId = 0 }, |
274 | | - |
275 | | - Element{.metricId = PM_METRIC_GPU_POWER, .deviceId = activeDeviceId }, |
276 | | - Element{.metricId = PM_METRIC_GPU_VOLTAGE, .deviceId = activeDeviceId }, |
277 | | - Element{.metricId = PM_METRIC_GPU_FREQUENCY, .deviceId = activeDeviceId }, |
278 | | - Element{.metricId = PM_METRIC_GPU_TEMPERATURE, .deviceId = activeDeviceId }, |
279 | | - Element{.metricId = PM_METRIC_GPU_UTILIZATION, .deviceId = activeDeviceId }, |
280 | | - Element{.metricId = PM_METRIC_GPU_RENDER_COMPUTE_UTILIZATION, .deviceId = activeDeviceId }, |
281 | | - Element{.metricId = PM_METRIC_GPU_MEDIA_UTILIZATION, .deviceId = activeDeviceId }, |
282 | | - Element{.metricId = PM_METRIC_GPU_MEM_POWER, .deviceId = activeDeviceId }, |
283 | | - Element{.metricId = PM_METRIC_GPU_MEM_VOLTAGE, .deviceId = activeDeviceId }, |
284 | | - Element{.metricId = PM_METRIC_GPU_MEM_FREQUENCY, .deviceId = activeDeviceId }, |
285 | | - Element{.metricId = PM_METRIC_GPU_MEM_EFFECTIVE_FREQUENCY, .deviceId = activeDeviceId }, |
286 | | - Element{.metricId = PM_METRIC_GPU_MEM_TEMPERATURE, .deviceId = activeDeviceId }, |
287 | | - Element{.metricId = PM_METRIC_GPU_MEM_SIZE, .deviceId = activeDeviceId }, // special case filling static |
288 | | - Element{.metricId = PM_METRIC_GPU_MEM_USED, .deviceId = activeDeviceId }, |
289 | | - Element{.metricId = PM_METRIC_GPU_MEM_MAX_BANDWIDTH, .deviceId = activeDeviceId }, // special case filling static |
290 | | - Element{.metricId = PM_METRIC_GPU_MEM_READ_BANDWIDTH, .deviceId = activeDeviceId }, |
291 | | - Element{.metricId = PM_METRIC_GPU_MEM_WRITE_BANDWIDTH, .deviceId = activeDeviceId }, |
292 | | - Element{.metricId = PM_METRIC_GPU_FAN_SPEED, .deviceId = activeDeviceId, .index = 0 }, |
293 | | - Element{.metricId = PM_METRIC_GPU_FAN_SPEED, .deviceId = activeDeviceId, .index = 1 }, |
294 | | - Element{.metricId = PM_METRIC_GPU_FAN_SPEED, .deviceId = activeDeviceId, .index = 2 }, |
295 | | - Element{.metricId = PM_METRIC_GPU_FAN_SPEED, .deviceId = activeDeviceId, .index = 3 }, |
296 | | - Element{.metricId = PM_METRIC_GPU_POWER_LIMITED, .deviceId = activeDeviceId }, |
297 | | - Element{.metricId = PM_METRIC_GPU_TEMPERATURE_LIMITED, .deviceId = activeDeviceId }, |
298 | | - Element{.metricId = PM_METRIC_GPU_CURRENT_LIMITED, .deviceId = activeDeviceId }, |
299 | | - Element{.metricId = PM_METRIC_GPU_VOLTAGE_LIMITED, .deviceId = activeDeviceId }, |
300 | | - Element{.metricId = PM_METRIC_GPU_UTILIZATION_LIMITED, .deviceId = activeDeviceId }, |
301 | | - Element{.metricId = PM_METRIC_GPU_MEM_POWER_LIMITED, .deviceId = activeDeviceId }, |
302 | | - Element{.metricId = PM_METRIC_GPU_MEM_TEMPERATURE_LIMITED, .deviceId = activeDeviceId }, |
303 | | - Element{.metricId = PM_METRIC_GPU_MEM_CURRENT_LIMITED, .deviceId = activeDeviceId }, |
304 | | - Element{.metricId = PM_METRIC_GPU_MEM_VOLTAGE_LIMITED, .deviceId = activeDeviceId }, |
305 | | - Element{.metricId = PM_METRIC_GPU_MEM_UTILIZATION_LIMITED, .deviceId = activeDeviceId }, |
306 | | - |
307 | | - Element{.metricId = PM_METRIC_CPU_UTILIZATION }, |
308 | | - Element{.metricId = PM_METRIC_CPU_POWER }, |
309 | | - Element{.metricId = PM_METRIC_CPU_TEMPERATURE }, |
310 | | - Element{.metricId = PM_METRIC_CPU_FREQUENCY }, |
311 | | - }; |
312 | | - // we want the order in the output csv to match the order of the metric ids |
313 | | - rn::sort(queryElements, {}, &Element::metricId); |
| 246 | + auto queryElements = GetRawFrameDataMetricList(activeDeviceId); |
314 | 247 | pQueryElementContainer = std::make_unique<QueryElementContainer_>(queryElements, session, introRoot); |
315 | 248 | blobs = pQueryElementContainer->MakeBlobs(numberOfBlobs); |
316 | 249 |
|
|
0 commit comments