summaryrefslogtreecommitdiff
path: root/src/buildtool/profile/profile.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-07 10:22:39 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2025-05-07 12:25:56 +0200
commit9ff01a766d98359c7dcf199aa6c4fba7fb427140 (patch)
treeeef791d08966568a36b1aa138eb2041c7a91a2f4 /src/buildtool/profile/profile.cpp
parent520bb21a4a0887478dffbcc83997a4015f7e67a4 (diff)
downloadjustbuild-9ff01a766d98359c7dcf199aa6c4fba7fb427140.tar.gz
profile: include remote-execution properties
Include in the profile also the effective remote-execution endpoint, properties, and dispatch list. Software projects are often tested in a variety of environments or hardware configurations; as, obviously, the performance might differ significantly (especially depending on the used hardware) a proper analysis therefore requires the possibility to distinguish the various backends. Adding the effective configuration adds this posibility.
Diffstat (limited to 'src/buildtool/profile/profile.cpp')
-rw-r--r--src/buildtool/profile/profile.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp
index f37629f1..1407ddbd 100644
--- a/src/buildtool/profile/profile.cpp
+++ b/src/buildtool/profile/profile.cpp
@@ -20,6 +20,7 @@
#include "gsl/gsl"
#include "src/buildtool/common/artifact_digest.hpp"
#include "src/buildtool/common/cli.hpp"
+#include "src/buildtool/common/remote/remote_common.hpp"
#include "src/utils/cpp/expected.hpp"
void Profile::Write(int exit_code) {
@@ -156,3 +157,20 @@ void Profile::NoteAnalysisError(std::string const& error_message) {
std::unique_lock lock{mutex_};
analysis_errors_.emplace_back(error_message);
}
+
+void Profile::SetRemoteExecutionConfig(RemoteExecutionConfig const& config) {
+ auto remote = nlohmann::json::object();
+ if (config.remote_address) {
+ remote["address"] = config.remote_address->ToJson();
+ }
+ remote["properties"] = config.platform_properties;
+ auto dispatch = nlohmann::json::array();
+ for (auto const& dispatch_entry : config.dispatch) {
+ auto entry = nlohmann::json::array();
+ entry.emplace_back(dispatch_entry.first);
+ entry.emplace_back(dispatch_entry.second.ToJson());
+ dispatch.emplace_back(entry);
+ }
+ remote["dispatch"] = dispatch;
+ profile_["remote"] = remote;
+}