From 860c684582eaac0c94d6004dd9afeaccc43bc4ff Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 27 Feb 2025 12:55:31 +0100 Subject: just-mr: support --profile in invocation logging Support passing on an invocation-specific --profile option when launching just. This allows routine profiling of builds. --- src/other_tools/just_mr/launch.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/other_tools/just_mr/launch.cpp') diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index 1c08688e..76272213 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -318,6 +318,16 @@ auto CallJust(std::optional const& config_file, cmd.emplace_back("--dump-plain-graph"); cmd.emplace_back(*log_dir / *invocation_log.graph_file_plain); } + if (invocation_log.profile) { + if (not IsValidFileName(*invocation_log.profile)) { + Logger::Log(LogLevel::Error, + "Invalid file name for option --profile: {}", + nlohmann::json(*invocation_log.profile).dump()); + std::exit(kExitClargsError); + } + cmd.emplace_back("--profile"); + cmd.emplace_back(*log_dir / *invocation_log.profile); + } } // add (remaining) args given by user as clargs for (auto it = just_cmd_args.additional_just_args.begin() + -- cgit v1.2.3