summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/profile/profile.cpp5
-rw-r--r--src/buildtool/profile/profile.hpp1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp
index 6d1cc34d..225542e6 100644
--- a/src/buildtool/profile/profile.cpp
+++ b/src/buildtool/profile/profile.cpp
@@ -33,6 +33,9 @@ void Profile::Write(int exit_code) {
if (not v.cached) {
entry["duration"] = v.duration;
}
+ if (v.exit_code != 0) {
+ entry["exit code"] = v.exit_code;
+ }
entry["artifacts"] = v.artifacts;
if (v.out) {
entry["stdout"] = *v.out;
@@ -81,6 +84,7 @@ void Profile::NoteActionCompleted(std::string const& id,
actions_[id] = ActionData{
.cached = response->IsCached(),
.duration = response->ExecutionDuration(),
+ .exit_code = response->ExitCode(),
.out = out,
.err = err,
.artifacts = std::unordered_map<std::string, std::string>()};
@@ -89,6 +93,7 @@ void Profile::NoteActionCompleted(std::string const& id,
actions_[id] = ActionData{
.cached = response->IsCached(),
.duration = response->ExecutionDuration(),
+ .exit_code = response->ExitCode(),
.out = out,
.err = err,
.artifacts = std::unordered_map<std::string, std::string>(
diff --git a/src/buildtool/profile/profile.hpp b/src/buildtool/profile/profile.hpp
index 71511245..d90ad2a5 100644
--- a/src/buildtool/profile/profile.hpp
+++ b/src/buildtool/profile/profile.hpp
@@ -42,6 +42,7 @@ class Profile {
struct ActionData {
bool cached;
double duration;
+ int exit_code;
std::optional<std::string> out;
std::optional<std::string> err;
std::unordered_map<std::string, std::string> artifacts;