MCPcopy Create free account
hub / github.com/GameTechDev/PresentMon / EventCallback

Method EventCallback

ETLTrimmer/main.cpp:143–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141
142public:
143 EventCallback(bool infoOnly, std::shared_ptr<Filter> pFilter, bool trimState, bool byId, bool listProcesses)
144 :
145 mode_{ infoOnly ? Mode::Analysis : Mode::Trim },
146 pFilter_{ std::move(pFilter) },
147 trimState_{ trimState },
148 byId_{ byId },
149 listProcesses_{ listProcesses }
150 {
151 // when trimming by timestamp, we must take care not to remove the state data psuedo-events generated
152 // at the beginning of the trace (also true state events coming before the trim region)
153 // nt process
154 stateFilter_.ProviderEnabled(NT_Process::GUID, 0, 0, EnableAllLevels, EVENT_CONTROL_CODE_ENABLE_PROVIDER);
155 // dxgkrnl --> DCs
156 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::Context_DCStart::Id);
157 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::Device_DCStart::Id);
158 // --> Contexts
159 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::Context_Start::Id);
160 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::Context_Stop::Id);
161 // --> Devices
162 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::Device_Start::Id);
163 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::Device_Stop::Id);
164 // --> hwqueue starts
165 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::HwQueue_DCStart::Id);
166 stateFilter_.EventAdded(Microsoft_Windows_DxgKrnl::HwQueue_Start::Id);
167 // <-- finish
168 stateFilter_.ProviderEnabled(Microsoft_Windows_DxgKrnl::GUID, 0, 0, EnableAllLevels, EVENT_CONTROL_CODE_ENABLE_PROVIDER);
169 // kernel proc start/stop
170 stateFilter_.EventAdded(Microsoft_Windows_Kernel_Process::ProcessStart_Start::Id);
171 stateFilter_.EventAdded(Microsoft_Windows_Kernel_Process::ProcessStop_Stop::Id);
172 stateFilter_.ProviderEnabled(Microsoft_Windows_Kernel_Process::GUID, 0, 0, EnableAllLevels, EVENT_CONTROL_CODE_ENABLE_PROVIDER);
173 }
174 STDMETHODIMP QueryInterface(const IID& iid, void** pObj)
175 {
176 if (iid == IID_IUnknown) {

Callers

nothing calls this directly

Calls 2

ProviderEnabledMethod · 0.45
EventAddedMethod · 0.45

Tested by

no test coverage detected