[Openmp-commits] [PATCH] D140248: [OpenMP] Enable profiling on multiple threads

Mark Dewing via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Dec 21 21:49:17 PST 2022


markdewing added inline comments.


================
Comment at: openmp/libomptarget/src/rtl.cpp:47
+// List of TimeTraceProfiler instances on other threads
+std::vector<llvm::TimeTraceProfiler *> *profileInstancesOtherThreads = nullptr;
+std::mutex profLock;
----------------
jdoerfert wrote:
> Why is this a pointer? And why a std::vector not llvm::SmallVector 
If it is not a pointer, the following error happens
```
a.out: /home/mdewing/nvme/software/llvm/git/llvm-project/llvm/lib/Support/TimeProfiler.cpp:154: void llvm::TimeTraceProfiler::write(llvm::raw_pwrite_stream&): Assertion `llvm::all_of(Instances.List, [](const auto &TTP) { return TTP->Stack.empty(); }) && "All profiler sections should be ended when calling write"' failed.
```
This seems to be happening because the first entry in the vector is missing.  I did not track down the root cause, but my guess is something to do with constructor ordering.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140248



More information about the Openmp-commits mailing list