diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-05-27 12:20:29 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-05-28 12:37:39 +0200 |
commit | ab0599fcbdf25508e0a068edaee7a29aac14af8f (patch) | |
tree | 48f926767ebdbdd7a022ecc72d21357bcc4c7063 /src/buildtool | |
parent | 9ea3dbd7a3f80a5813dceb11dea416dc7a01d039 (diff) | |
download | justbuild-ab0599fcbdf25508e0a068edaee7a29aac14af8f.tar.gz |
profile: include also the end time of the build
... which might be quite ahead of the end time of the invocation if
writing out of the action graph delays the end of the invocation.
Diffstat (limited to 'src/buildtool')
-rw-r--r-- | src/buildtool/main/main.cpp | 3 | ||||
-rw-r--r-- | src/buildtool/profile/profile.cpp | 4 | ||||
-rw-r--r-- | src/buildtool/profile/profile.hpp | 1 |
3 files changed, 8 insertions, 0 deletions
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 { |