summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/man/just-profile.5.md3
-rw-r--r--src/buildtool/main/main.cpp3
-rw-r--r--src/buildtool/profile/profile.cpp4
-rw-r--r--src/buildtool/profile/profile.hpp1
4 files changed, 11 insertions, 0 deletions
diff --git a/share/man/just-profile.5.md b/share/man/just-profile.5.md
index d3167b89..27dded3e 100644
--- a/share/man/just-profile.5.md
+++ b/share/man/just-profile.5.md
@@ -94,6 +94,9 @@ The profile file contains the following information.
- For the key *`"build start time"`* the start time of the build phase (if
any) in seconds since the epoch.
+- For the key *`"build stop time"`* the stop time of the build phase (if
+ any) in seconds since the epoch.
+
- For the key *`"stop time"`* the stop time of the invocation in seconds
since the epoch.
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 3da6de93..c1b8bcdf 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -1255,6 +1255,9 @@ auto main(int argc, char* argv[]) -> int {
std::move(trees),
std::move(tree_overlays),
std::move(cache_artifacts));
+ if (profile != nullptr) {
+ profile->StopBuild();
+ }
dump_and_cleanup_thread.join();
if (build_result) {
WriteTargetCacheEntries(
diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp
index 1d8a7b46..455aaf04 100644
--- a/src/buildtool/profile/profile.cpp
+++ b/src/buildtool/profile/profile.cpp
@@ -182,3 +182,7 @@ void Profile::SetRemoteExecutionConfig(RemoteExecutionConfig const& config) {
void Profile::StartBuild() {
profile_["build start time"] = std::time(nullptr);
}
+
+void Profile::StopBuild() {
+ profile_["build stop time"] = std::time(nullptr);
+}
diff --git a/src/buildtool/profile/profile.hpp b/src/buildtool/profile/profile.hpp
index 099ce2cc..bb5163ac 100644
--- a/src/buildtool/profile/profile.hpp
+++ b/src/buildtool/profile/profile.hpp
@@ -47,6 +47,7 @@ class Profile {
std::string const& cwd);
void NoteAnalysisError(std::string const& error_message);
void StartBuild();
+ void StopBuild();
private:
struct ActionData {