diff --git a/src/c++/perf_analyzer/command_line_parser.cc b/src/c++/perf_analyzer/command_line_parser.cc index b6e9407a2..6f858b184 100644 --- a/src/c++/perf_analyzer/command_line_parser.cc +++ b/src/c++/perf_analyzer/command_line_parser.cc @@ -797,6 +797,7 @@ CLParser::ParseCommandLine(int argc, char** argv) {"input-tensor-format", required_argument, 0, 55}, {"output-tensor-format", required_argument, 0, 56}, {"version", no_argument, 0, 57}, + {"profile-export-file", required_argument, 0, 58}, {0, 0, 0, 0}}; // Parse commandline... @@ -1296,6 +1297,14 @@ CLParser::ParseCommandLine(int argc, char** argv) PrintVersion(); break; } + case 58: { + std::string profile_export_file{optarg}; + if (IsFile(profile_export_file) || IsDirectory(profile_export_file)) { + Usage("--profile-export-file must not already exist"); + } + params_->profile_export_file = profile_export_file; + break; + } case 'v': params_->extra_verbose = params_->verbose; params_->verbose = true; diff --git a/src/c++/perf_analyzer/command_line_parser.h b/src/c++/perf_analyzer/command_line_parser.h index 1a71a0997..1f17b9a82 100644 --- a/src/c++/perf_analyzer/command_line_parser.h +++ b/src/c++/perf_analyzer/command_line_parser.h @@ -145,6 +145,9 @@ struct PerfAnalyzerParameters { // Triton inference response output tensor format. cb::TensorFormat output_tensor_format{cb::TensorFormat::BINARY}; + + // The profile export file path. + std::string profile_export_file{""}; }; using PAParamsPtr = std::shared_ptr;