[PATCH] D133153: [support] Prepare TimeProfiler for cross-thread support

Mark Shields via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 1 13:52:05 PDT 2022


mbs-modular created this revision.
Herald added subscribers: hiraditya, mgorny.
Herald added a project: All.
mbs-modular requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This NFC sets up the TimeProfiler for support the construction
and completion of time profiling 'entries' across threads.
(See https://reviews.llvm.org/D133083).

- Add ClockType alias so we can change the clock in one place.
- (trivial) Use c++ usings instead of typedefs
- Rename Entry to TimeTraceProfilerEntry since this type will eventually become public.
- Move construction of entries from TimeTraceProfiler::begin to timeTraceProfilerBegin.
- Add an intro comment.
- Generalize from raw_pwrite_stream to raw_ostream to support unit tests (and raw_pwrite_stream::pwrite was unused anyway).
- Add some smoke unit tests.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133153

Files:
  llvm/include/llvm/Support/TimeProfiler.h
  llvm/lib/Support/TimeProfiler.cpp
  llvm/unittests/Support/CMakeLists.txt
  llvm/unittests/Support/TimeProfilerTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133153.457386.patch
Type: text/x-patch
Size: 13849 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220901/b654d09c/attachment.bin>


More information about the llvm-commits mailing list