[PATCH] D78027: [TimeProfiler] Emit real process ID and thread names

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 14 12:24:45 PDT 2020


MaskRay requested changes to this revision.
MaskRay added inline comments.
This revision now requires changes to proceed.


================
Comment at: llvm/lib/Support/TimeProfiler.cpp:77
 
+static std::string getThreadName() {
+  SmallString<64> Name;
----------------
You can define ThreadName as `SmallString<0>` to avoid this function.


================
Comment at: llvm/lib/Support/TimeProfiler.cpp:246
+    writeMetadataEvent("process_name", Tid, ProcName);
+
+    writeMetadataEvent("thread_name", Tid, ThreadName);
----------------
The new line is not necessary


================
Comment at: llvm/lib/Support/TimeProfiler.cpp:249
+
+    for (const auto &TTP : ThreadTimeTraceProfilerInstances) {
+      writeMetadataEvent("thread_name", TTP->Tid, TTP->ThreadName);
----------------
Delete `{}` for simple statements. In LLVM code, such `{}` is not common.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78027/new/

https://reviews.llvm.org/D78027





More information about the cfe-commits mailing list