aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
diff options
context:
space:
mode:
authorWalter Erquinigo <wallace@fb.com>2022-05-04 13:24:49 -0700
committerWalter Erquinigo <wallace@fb.com>2022-05-17 12:46:54 -0700
commit1637545f689b8c4ef888ca385de75982a6a932e3 (patch)
tree23e765153bda735ff862cde8a24bcd7eb45954ad /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
parent1f49714d3e19502753fcea7ad8378a194222328f (diff)
downloadllvm-1637545f689b8c4ef888ca385de75982a6a932e3.zip
llvm-1637545f689b8c4ef888ca385de75982a6a932e3.tar.gz
llvm-1637545f689b8c4ef888ca385de75982a6a932e3.tar.bz2
[trace][intelpt] Support system-wide tracing [5] - Disable/enable per-core tracing based on the process state
When tracing on per-core mode, we are tracing all processes, which means that after hitting a breakpoint, our process will stop running (thus producing no more tracing data) but other processes will continue writing to our trace buffers. This causes a big data loss for our trace. As a way to remediate this, I'm adding some logic to pause and unpause tracing based on the target's state. The earlier we do it the better, however, I'm not adding the trigger at the earliest possible point for simplicity of this diff. Later we can improve that part. Differential Revision: https://reviews.llvm.org/D124962
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 37da1f1..a7869d2 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -1665,6 +1665,11 @@ void NativeProcessLinux::StopTrackingThread(NativeThreadLinux &thread) {
SignalIfAllThreadsStopped();
}
+void NativeProcessLinux::NotifyTracersProcessStateChanged(
+ lldb::StateType state) {
+ m_intel_pt_collector.OnProcessStateChanged(state);
+}
+
Status NativeProcessLinux::NotifyTracersOfNewThread(lldb::tid_t tid) {
Log *log = GetLog(POSIXLog::Thread);
Status error(m_intel_pt_collector.OnThreadCreated(tid));