mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 04:09:33 -05:00
instrumentation: Rename install and custom trace events
Follow the format of other trace events to produce a pretty name for install events (as the last component of the install script directory) and a slightly prettier name for custom events (still limited by the nature of custom targets).
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "cmsys/FStream.hxx"
|
||||
#include "cmsys/SystemInformation.hxx"
|
||||
|
||||
#include "cmCMakePath.h"
|
||||
#include "cmCryptoHash.h"
|
||||
#include "cmExperimental.h"
|
||||
#include "cmFileLock.h"
|
||||
@@ -946,16 +947,19 @@ void cmInstrumentation::AppendTraceEvent(Json::Value& trace,
|
||||
|
||||
// Provide a useful trace event name depending on what data is available
|
||||
// from the snippet.
|
||||
std::string name = snippetData["role"].asString();
|
||||
std::string name = cmStrCat(snippetData["role"].asString(), ": ");
|
||||
if (snippetData["role"] == "compile") {
|
||||
name = cmStrCat("compile: ", snippetData["source"].asString());
|
||||
name.append(snippetData["source"].asString());
|
||||
} else if (snippetData["role"] == "link") {
|
||||
name = cmStrCat("link: ", snippetData["target"].asString());
|
||||
} else if (snippetData["role"] == "custom" ||
|
||||
snippetData["role"] == "install") {
|
||||
name = snippetData["command"].asString();
|
||||
name.append(snippetData["target"].asString());
|
||||
} else if (snippetData["role"] == "install") {
|
||||
cmCMakePath workingDir(snippetData["workingDir"].asCString());
|
||||
std::string lastDirName = workingDir.GetFileName().String();
|
||||
name.append(lastDirName);
|
||||
} else if (snippetData["role"] == "custom") {
|
||||
name.append(snippetData["command"].asString());
|
||||
} else if (snippetData["role"] == "test") {
|
||||
name = cmStrCat("test: ", snippetData["testName"].asString());
|
||||
name.append(snippetData["testName"].asString());
|
||||
}
|
||||
snippetTraceEvent["name"] = name;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user