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

Function RunTestCaseV2

IntelPresentMon/PresentMonAPI2Tests/EtlTests.cpp:21–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19namespace EtlTests
20{
21 void RunTestCaseV2(std::unique_ptr<pmapi::Session>&& pSession,
22 const uint32_t& processId, const std::string& processName, CsvParser& goldCsvFile,
23 std::optional<std::ofstream>& debugCsvFile) {
24 using namespace std::chrono_literals;
25 pmapi::ProcessTracker processTracker;
26 static constexpr uint32_t numberOfBlobs = 10000u;
27 uint32_t totalFramesValidated = 0;
28
29 PM_QUERY_ELEMENT queryElements[]{
30 //{ PM_METRIC_APPLICATION, PM_STAT_NONE, 0, 0 },
31 { PM_METRIC_SWAP_CHAIN_ADDRESS, PM_STAT_NONE, 0, 0 },
32 { PM_METRIC_PRESENT_RUNTIME, PM_STAT_NONE, 0, 0 },
33 { PM_METRIC_SYNC_INTERVAL, PM_STAT_NONE, 0, 0 },
34 { PM_METRIC_PRESENT_FLAGS, PM_STAT_NONE, 0, 0 },
35 { PM_METRIC_ALLOWS_TEARING, PM_STAT_NONE, 0, 0 },
36 { PM_METRIC_PRESENT_MODE, PM_STAT_NONE, 0, 0 },
37 { PM_METRIC_FRAME_TYPE, PM_STAT_NONE, 0, 0 },
38 { PM_METRIC_PRESENT_START_QPC, PM_STAT_NONE, 0, 0 },
39 { PM_METRIC_BETWEEN_SIMULATION_START, PM_STAT_NONE, 0, 0},
40 { PM_METRIC_BETWEEN_PRESENTS, PM_STAT_NONE, 0, 0},
41 { PM_METRIC_BETWEEN_DISPLAY_CHANGE, PM_STAT_NONE, 0, 0},
42 { PM_METRIC_IN_PRESENT_API, PM_STAT_NONE, 0, 0},
43 { PM_METRIC_RENDER_PRESENT_LATENCY, PM_STAT_NONE, 0, 0},
44 { PM_METRIC_UNTIL_DISPLAYED, PM_STAT_NONE, 0, 0},
45 { PM_METRIC_PC_LATENCY, PM_STAT_NONE, 0, 0},
46 { PM_METRIC_CPU_START_QPC, PM_STAT_NONE, 0, 0 },
47 { PM_METRIC_BETWEEN_APP_START, PM_STAT_NONE, 0, 0 },
48 { PM_METRIC_CPU_BUSY, PM_STAT_NONE, 0, 0 },
49 { PM_METRIC_CPU_WAIT, PM_STAT_NONE, 0, 0 },
50 { PM_METRIC_GPU_LATENCY, PM_STAT_NONE, 0, 0 },
51 { PM_METRIC_GPU_TIME, PM_STAT_NONE, 0, 0},
52 { PM_METRIC_GPU_BUSY, PM_STAT_NONE, 0, 0},
53 { PM_METRIC_GPU_WAIT, PM_STAT_NONE, 0, 0},
54 { PM_METRIC_ANIMATION_ERROR, PM_STAT_NONE, 0, 0 },
55 { PM_METRIC_ANIMATION_TIME, PM_STAT_NONE, 0, 0 },
56 { PM_METRIC_FLIP_DELAY, PM_STAT_NONE, 0, 0 },
57 { PM_METRIC_ALL_INPUT_TO_PHOTON_LATENCY, PM_STAT_NONE, 0, 0},
58 { PM_METRIC_CLICK_TO_PHOTON_LATENCY, PM_STAT_NONE, 0, 0},
59 { PM_METRIC_INSTRUMENTED_LATENCY, PM_STAT_NONE, 0, 0 },
60 };
61
62 auto frameQuery = pSession->RegisterFrameQuery(queryElements);
63 auto blobs = frameQuery.MakeBlobContainer(numberOfBlobs);
64
65 processTracker = pSession->TrackProcess(processId, true, true);
66
67 using Clock = std::chrono::high_resolution_clock;
68 const auto start = Clock::now();
69
70 int emptyPollCount = 0;
71 while (1) {
72 frameQuery.Consume(processTracker, blobs);
73 if (blobs.GetNumBlobsPopulated() == 0) {
74 // if we poll 10 times in a row and get no new frames, consider this ETL finished
75 if (++emptyPollCount >= 10) {
76 if (totalFramesValidated > 0) {
77 // only finish if we have consumed at least one frame
78 break;

Callers 1

TEST_METHODFunction · 0.85

Calls 6

RegisterFrameQueryMethod · 0.80
GetNumBlobsPopulatedMethod · 0.80
VerifyBlobAgainstCsvMethod · 0.80
MakeBlobContainerMethod · 0.45
TrackProcessMethod · 0.45
ConsumeMethod · 0.45

Tested by

no test coverage detected