| 787 | } |
| 788 | |
| 789 | ULONG EnableProvidersListing( |
| 790 | TRACEHANDLE sessionHandle, |
| 791 | const GUID* pSessionGuid, |
| 792 | const PMTraceConsumer* pmConsumer, |
| 793 | bool filterEventIds, |
| 794 | bool isWin11OrGreater, |
| 795 | std::shared_ptr<IFilterBuildListener> pListener) |
| 796 | { |
| 797 | // Start backend providers first to reduce Presents being queued up before |
| 798 | // we can track them. |
| 799 | FilteredProvider provider(pSessionGuid, filterEventIds, isWin11OrGreater, std::move(pListener)); |
| 800 | |
| 801 | // Microsoft_Windows_Kernel_Process |
| 802 | // |
| 803 | provider.ClearFilter(); |
| 804 | provider.AddEvent<Microsoft_Windows_Kernel_Process::ProcessStart_Start>(); |
| 805 | provider.AddEvent<Microsoft_Windows_Kernel_Process::ProcessStop_Stop>(); |
| 806 | provider.AddEvent<Microsoft_Windows_Kernel_Process::ProcessRundown_Info>(); |
| 807 | auto status = provider.Enable(sessionHandle, Microsoft_Windows_Kernel_Process::GUID); |
| 808 | if (status != ERROR_SUCCESS && status != ERROR_ACCESS_DENIED) return status; |
| 809 | // additionally, request a rundown if we have kproc access and the pertinent consumer flag is set |
| 810 | if (pmConsumer->mTrackProcessState && status == ERROR_SUCCESS) { |
| 811 | status = provider.Enable(sessionHandle, Microsoft_Windows_Kernel_Process::GUID, |
| 812 | EVENT_CONTROL_CODE_CAPTURE_STATE); |
| 813 | if (status != ERROR_SUCCESS && status != ERROR_ACCESS_DENIED) return status; |
| 814 | } |
| 815 | |
| 816 | // Microsoft_Windows_DxgKrnl |
| 817 | // |
| 818 | // WARNING: When adding a DxgKrnl event, make sure to patch it's Performance keyword (see |
| 819 | // above). |
| 820 | provider.ClearFilter(); |
| 821 | provider.AddEvent<Microsoft_Windows_DxgKrnl::PresentHistory_Start>(); |
| 822 | if (pmConsumer->mTrackDisplay) { |
| 823 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Blit_Info>(); |
| 824 | provider.AddEvent<Microsoft_Windows_DxgKrnl::BlitCancel_Info>(); |
| 825 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Flip_Info>(); |
| 826 | provider.AddEvent<Microsoft_Windows_DxgKrnl::IndependentFlip_Info>(); |
| 827 | provider.AddEvent<Microsoft_Windows_DxgKrnl::FlipMultiPlaneOverlay_Info>(); |
| 828 | provider.AddEvent<Microsoft_Windows_DxgKrnl::HSyncDPCMultiPlane_Info>(); |
| 829 | provider.AddEvent<Microsoft_Windows_DxgKrnl::VSyncDPCMultiPlane_Info>(); |
| 830 | provider.AddEvent<Microsoft_Windows_DxgKrnl::MMIOFlip_Info>(); |
| 831 | provider.AddEvent<Microsoft_Windows_DxgKrnl::MMIOFlipMultiPlaneOverlay_Info>(); |
| 832 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Present_Info>(); |
| 833 | provider.AddEvent<Microsoft_Windows_DxgKrnl::PresentHistory_Info>(); |
| 834 | provider.AddEvent<Microsoft_Windows_DxgKrnl::PresentHistoryDetailed_Start>(); |
| 835 | provider.AddEvent<Microsoft_Windows_DxgKrnl::QueuePacket_Start>(); |
| 836 | provider.AddEvent<Microsoft_Windows_DxgKrnl::QueuePacket_Start_2>(); |
| 837 | provider.AddEvent<Microsoft_Windows_DxgKrnl::QueuePacket_Stop>(); |
| 838 | provider.AddEvent<Microsoft_Windows_DxgKrnl::VSyncDPC_Info>(); |
| 839 | } |
| 840 | if (pmConsumer->mTrackGPU) { |
| 841 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Context_DCStart>(); |
| 842 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Context_Start>(); |
| 843 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Context_Stop>(); |
| 844 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Device_DCStart>(); |
| 845 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Device_Start>(); |
| 846 | provider.AddEvent<Microsoft_Windows_DxgKrnl::Device_Stop>(); |
no test coverage detected