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

Function ParseCommandLine

PresentMon/CommandLine.cpp:375–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373}
374
375bool ParseCommandLine(int argc, wchar_t** argv)
376{
377 auto args = &gCommandLineArgs;
378
379 args->mTargetProcessNames.clear();
380 args->mExcludeProcessNames.clear();
381 args->mOutputCsvFileName = nullptr;
382 args->mEtlFileName = nullptr;
383 args->mSessionName = L"PresentMon";
384 args->mTargetPid = 0;
385 args->mDelay = 0;
386 args->mTimer = 0;
387 args->mHotkeyModifiers = MOD_NOREPEAT;
388 args->mHotkeyVirtualKeyCode = 0;
389 args->mPresentEventCircularBufferSize = 0;
390 args->mConsoleOutput = ConsoleOutput::Statistics;
391 args->mTrackDisplay = true;
392 args->mTrackInput = true;
393 args->mTrackGPU = true;
394 args->mTrackGPUVideo = false;
395 args->mTrackFrameType = false;
396 args->mTrackPMMeasurements = false;
397 args->mTrackAppTiming = false;
398 args->mTrackHybridPresent = false;
399 args->mScrollLockIndicator = false;
400 args->mExcludeDropped = false;
401 args->mTerminateExistingSession = false;
402 args->mTerminateOnProcExit = false;
403 args->mStartTimer = false;
404 args->mTerminateAfterTimer = false;
405 args->mHotkeySupport = false;
406 args->mTryToElevate = false;
407 args->mMultiCsv = false;
408 args->mUseV1Metrics = false;
409 args->mUseV2Metrics = false;
410 args->mStopExistingSession = false;
411 args->mWriteFrameId = false;
412 args->mWriteDisplayTime = false;
413 args->mDisableOfflineBackpressure = false;
414 args->mTrackEtwStatus = false;
415
416 bool sessionNameSet = false;
417 bool csvOutputStdout = false;
418 bool csvOutputNone = false;
419 bool qpcTime = false;
420 bool qpcmsTime = false;
421 bool dtTime = false;
422
423 #if PRESENTMON_ENABLE_DEBUG_TRACE
424 bool verboseTrace = false;
425 #endif
426
427 // Match command line arguments with known options. These must match
428 // options listed in the README.md for documentation and for PrintUsage()
429 // to work.
430 for (int i = 1; i < argc; ++i) {
431 // Capture target options:
432 if (ParseArg(argv[i], L"process_name")) { if (ParseValue(argv, argc, &i, &args->mTargetProcessNames)) continue; }

Callers 1

wmainFunction · 0.85

Calls 10

ParseArgFunction · 0.85
ParseValueFunction · 0.85
AssignHotkeyFunction · 0.85
PrintErrorFunction · 0.85
PrintUsageFunction · 0.85
PrintHotkeyErrorFunction · 0.85
PrintWarningFunction · 0.85
EnableVerboseTraceFunction · 0.85
StdOutIsConsoleFunction · 0.85
CanonicalizeProcessNameFunction · 0.85

Tested by

no test coverage detected