-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathMetricsTypes.cpp
More file actions
81 lines (66 loc) · 2.97 KB
/
MetricsTypes.cpp
File metadata and controls
81 lines (66 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Copyright (C) 2025 Intel Corporation
// SPDX-License-Identifier: MIT
#include "MetricsTypes.h"
#include "../PresentData/PresentMonTraceConsumer.hpp"
namespace pmon::util::metrics {
FrameData FrameData::CopyFrameData(const std::shared_ptr<PresentEvent>& p)
{
if (p) {
return CopyFrameData(*p);
}
pmlog_error("Tried to copy frame data from empty PresentEvent ptr");
return {};
}
FrameData FrameData::CopyFrameData(const PresentEvent& p)
{
FrameData frame{};
frame.runtime = p.Runtime;
frame.presentMode = p.PresentMode;
frame.presentStartTime = p.PresentStartTime;
frame.readyTime = p.ReadyTime;
frame.timeInPresent = p.TimeInPresent;
frame.gpuStartTime = p.GPUStartTime;
frame.gpuDuration = p.GPUDuration;
frame.gpuVideoDuration = p.GPUVideoDuration;
frame.appPropagatedPresentStartTime = p.AppPropagatedPresentStartTime;
frame.appPropagatedTimeInPresent = p.AppPropagatedTimeInPresent;
frame.appPropagatedGPUStartTime = p.AppPropagatedGPUStartTime;
frame.appPropagatedReadyTime = p.AppPropagatedReadyTime;
frame.appPropagatedGPUDuration = p.AppPropagatedGPUDuration;
frame.appPropagatedGPUVideoDuration = p.AppPropagatedGPUVideoDuration;
frame.appSleepStartTime = p.AppSleepStartTime;
frame.appSleepEndTime = p.AppSleepEndTime;
frame.appSimStartTime = p.AppSimStartTime;
frame.appSimEndTime = p.AppSimEndTime;
frame.appRenderSubmitStartTime = p.AppRenderSubmitStartTime;
frame.appRenderSubmitEndTime = p.AppRenderSubmitEndTime;
frame.appPresentStartTime = p.AppPresentStartTime;
frame.appPresentEndTime = p.AppPresentEndTime;
frame.appInputSample = p.AppInputSample;
frame.inputTime = p.InputTime;
frame.mouseClickTime = p.MouseClickTime;
frame.pclSimStartTime = p.PclSimStartTime;
frame.pclInputPingTime = p.PclInputPingTime;
frame.flipDelay = p.FlipDelay;
frame.flipToken = p.FlipToken;
frame.displayed.Assign(p.Displayed.begin(), p.Displayed.end());
frame.swapChainAddress = p.SwapChainAddress;
frame.syncInterval = p.SyncInterval;
frame.presentFlags = p.PresentFlags;
frame.finalState = p.FinalState;
frame.supportsTearing = p.SupportsTearing;
frame.frameId = p.FrameId;
frame.processId = p.ProcessId;
frame.threadId = p.ThreadId;
frame.appFrameId = p.AppFrameId;
frame.pclFrameId = p.PclFrameId;
// Extract VidPnSourceId and layer index from PresentIds if available for display identification
if (!p.ReportedPresentIds.empty()) {
auto presentIdEntry = p.ReportedPresentIds.begin();
// VidPnSourceId and Layer Index are encoded in the key
frame.vidPnLayerId = presentIdEntry->first;
frame.presentId = presentIdEntry->second;
}
return frame;
}
}