summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorFrank Winklmeier <frank.winklmeier@cern.ch>2020-01-20 09:42:50 (GMT)
committerBrad King <brad.king@kitware.com>2020-01-22 14:58:52 (GMT)
commitc829f0cfcaa4753743fde1900091e1233c41350b (patch)
tree319fee9604ee4f5f4c6a006855b5d055f5b81a68 /Source/cmMakefile.cxx
parent5e38b8f608fee599494aadd0d4b5ed9366843bda (diff)
downloadCMake-c829f0cfcaa4753743fde1900091e1233c41350b.zip
CMake-c829f0cfcaa4753743fde1900091e1233c41350b.tar.gz
CMake-c829f0cfcaa4753743fde1900091e1233c41350b.tar.bz2
trace: Add time and stack level to JSON output format
Add the timestamp and stack depth of the function call to the JSON trace output format. This information can be useful for cmake profiling and call stack inspection (see e.g. https://github.com/volo-zyko/cmake-profile-stats). Improve unit test to allow for varying set of keys to check in trace lines.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index dc741d3..1d1e895 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -340,6 +340,9 @@ void cmMakefile::PrintCommandTrace(const cmListFileFunction& lff) const
for (std::string const& arg : args) {
val["args"].append(arg);
}
+ val["time"] = cmSystemTools::GetTime();
+ val["frame"] =
+ static_cast<std::uint64_t>(this->ExecutionStatusStack.size());
msg << Json::writeString(builder, val);
#endif
break;