| 38 | using namespace pmon::util; |
| 39 | using namespace pmon::util::cli; |
| 40 | struct Options : public OptionsBase<Options> |
| 41 | { |
| 42 | private: Group gm_{ this, "Mode", "Choose sample mode" }; public: |
| 43 | Option<Mode> mode{ this, "--mode", Mode::Count, "Which demonstration mode to run", CLI::CheckedTransformer{ ref::GenerateEnumKeyMap<Mode>(), CLI::ignore_case } }; |
| 44 | Option<int> submode{ this, "--submode", 0, "Which submode option to run for the given mode" }; |
| 45 | private: Group gc_{ this, "Connection", "Control client connection" }; public: |
| 46 | Option<std::string> controlPipe{ this, "--control-pipe", "", "Name of the named pipe to use for the client-service control channel" }; |
| 47 | Option<std::string> middlewareDllPath{ this, "--middleware-dll-path", "", "Override middleware DLL path discovery with custom path" }; |
| 48 | private: Group gs_{ this, "Sampling", "Control sampling / targeting behavior" }; public: |
| 49 | Option<double> metricOffset{ this, "--metric-offset", 1064., "Offset from top for frame data. Used in --dynamic-query-sample" }; |
| 50 | Option<double> windowSize{ this, "--window-size", 1000., "Window size used for metrics calculation. Used in --dynamic-query-sample" }; |
| 51 | Option<unsigned int> processId{ this, "--process-id", 0, "Process Id to use for polling or frame data capture" }; |
| 52 | Option<std::string> processName{ this, "--process-name", "", "Name of process to use for polling or frame data capture" }; |
| 53 | Option<std::string> metric{ this, "--metric", "", "PM_METRIC, ex. PM_METRIC_PRESENTED_FPS" }; |
| 54 | Option<unsigned int> defaultAdapterId{ this, "--default-adapter-id", 0, "GPU device id to use for system-wide dynamic polling" }; |
| 55 | Option<unsigned int> telemetryPeriodMs{ this, "--telemetry-period-ms", {}, "Telemetry period in milliseconds" }; |
| 56 | Option<unsigned int> etwFlushPeriodMs{ this, "--etw-flush-period-ms", {}, "ETW manual flush period in milliseconds" }; |
| 57 | Option<double> runTime{ this, "--run-time", 10., "How long to capture for, in seconds" }; |
| 58 | Option<double> runStart{ this, "--run-start", 1., "How many seconds to delay before beginning run" }; |
| 59 | Option<double> pollPeriod{ this, "--poll-period", 0.1, "Period in seconds for polling the API query" }; |
| 60 | Option<std::string> outputPath{ this, "--output-path", {}, "Full path to output to" }; |
| 61 | Option<size_t> frameLimit{ this, "--frame-limit", 0, "Maximum number of frames to capture (0 for unlimited)" }; |
| 62 | private: Group gl_{ this, "Logging", "Control logging behavior" }; public: |
| 63 | Option<log::Level> logLevel{ this, "--log-level", log::Level::Error, "Severity to log at", CLI::CheckedTransformer{ log::GetLevelMapNarrow(), CLI::ignore_case } }; |
| 64 | Option<log::Level> logTraceLevel{ this, "--log-trace-level", log::Level::Error, "Severity to print stacktrace at", CLI::CheckedTransformer{ log::GetLevelMapNarrow(), CLI::ignore_case } }; |
| 65 | Flag logTraceExceptions{ this, "--log-trace-exceptions", "Add stack trace to all thrown exceptions (including SEH exceptions)" }; |
| 66 | Option<std::string> logDenyList{ this, "--log-deny-list", "", "Path to log deny list (with trace overrides)", CLI::ExistingFile }; |
| 67 | Option<std::string> logAllowList{ this, "--log-allow-list", "", "Path to log allow list (with trace overrides)", CLI::ExistingFile }; |
| 68 | Option<std::string> logFolder{ this, "--log-folder", "", "Folder to create log file(s) in" }; |
| 69 | Flag logNamePid{ this, "--log-name-pid", "Append PID to the log file name" }; |
| 70 | Option<std::vector<log::V>> logVerboseModules{ this, "--log-verbose-modules", {}, "Verbose logging modules to enable", CLI::CheckedTransformer{ log::GetVerboseModuleMapNarrow(), CLI::ignore_case } }; |
| 71 | private: Group gv_{ this, "Service", "Control service options" }; public: |
| 72 | Flag servicePacePlayback{ this, "--service-pace-playback", "Pace ETL playback on the service" }; |
| 73 | Option<std::string> serviceEtlPath{ this, "--service-etl-path", "", "Path of the ETL file to pass to the service for playback" }; |
| 74 | private: Group gt_{ this, "Testing", "Control testing support options" }; public: |
| 75 | Flag testExpectError{ this, "--test-expect-error", "Indicates to test modes that fail state is being tested" }; |
| 76 | Option<size_t> ipcSystemRingCapacity{ this, "--ipc-system-ring-capacity", 32, |
| 77 | "System telemetry ring capacity for the IPC component server" }; |
| 78 | Option<size_t> ipcSystemSamplesPerPush{ this, "--ipc-system-samples-per-push", 12, |
| 79 | "Samples per push batch for the IPC component server" }; |
| 80 | |
| 81 | static constexpr const char* description = "Minimal Sample Client for Intel PresentMon service"; |
| 82 | static constexpr const char* name = "SampleClient.exe"; |
| 83 | |
| 84 | private: |
| 85 | MutualExclusion logListExclusion_{ logDenyList, logAllowList }; |
| 86 | Mandatory mandatoryMode_{ mode }; |
| 87 | }; |
| 88 | } |
nothing calls this directly
no test coverage detected