[Lldb-commits] [PATCH] D124962: [trace][intelpt] Support system-wide tracing [5] - Disable/enable per-core tracing based on the process state

Jakob Johnson via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue May 10 09:33:52 PDT 2022


jj10306 added inline comments.


================
Comment at: lldb/source/Plugins/Process/Linux/IntelPTSingleBufferTrace.cpp:234
+IntelPTSingleBufferTrace::GetTraceBuffer(size_t offset, size_t size,
+                                         bool flush) {
   std::vector<uint8_t> data(size, 0);
----------------
What's the purpose of this new `flush` flag? When would you want to call this method with it set to false? I can only think of cases when you want to flush the buffer if you're trying to read its data


================
Comment at: lldb/source/Plugins/Process/Linux/Perf.h:216-222
+  llvm::Error DisableWithIoctl() const;
+
+  /// Use the ioctl API to enable the perf event.
+  ///
+  /// \return
+  ///   An Error if the perf event couldn't be enabled.
+  llvm::Error EnableWithIoctl() const;
----------------
Nice, happy to see we are extending the mini perf API (:
In the future we also can update this to control whether or not the event is enabled at perf_event_open time because that's the default but there may be cases where you don't want the event to be enabled until you explicitly enable it w ioctl


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D124962



More information about the lldb-commits mailing list