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

Method Finish

IntelPresentMon/PresentMonAPIWrapper/EtlLogger.cpp:28–46  ·  view source on GitHub ↗

finish the logging session and receive the .etl file

Source from the content-addressed store, hash-verified

26 }
27 // finish the logging session and receive the .etl file
28 void EtlLogger::Finish(const std::filesystem::path& outputEtlFullPath)
29 {
30 char buffer[PM_MAX_PATH + 1];
31 if (auto sta = pmFinishEtlLogging(hSession_, hLogger_, buffer, (uint32_t)std::size(buffer));
32 sta != PM_STATUS_SUCCESS) {
33 Clear_();
34 throw ApiErrorException{ sta, "Failed to finish etl logging" };
35 }
36 try {
37 std::filesystem::rename(buffer, outputEtlFullPath);
38 Clear_();
39 }
40 catch (...) {
41 // attempt to remove if still there
42 std::error_code ec;
43 std::filesystem::remove(buffer, ec);
44 throw ApiErrorException{ PM_STATUS_FAILURE, "Failed to move output .etl file" };
45 }
46 }
47 // get the id of process being tracked
48 PM_ETL_HANDLE EtlLogger::GetHandle() const
49 {

Callers 1

EtlLoggerTestFunction · 0.45

Calls 2

pmFinishEtlLoggingFunction · 0.85
sizeFunction · 0.50

Tested by

no test coverage detected