aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
diff options
context:
space:
mode:
authorWalter Erquinigo <wallace@fb.com>2022-05-18 08:01:01 -0700
committerWalter Erquinigo <wallace@fb.com>2022-06-15 12:07:59 -0700
commita758205951d3a1eb60bdb65146ab23e8567f30a7 (patch)
tree7cd2fa8a9cfb6c16bceda98f2e28476ea747acb0 /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
parent5a92632dc477fcd42d912b2c781cc406e6d073f6 (diff)
downloadllvm-a758205951d3a1eb60bdb65146ab23e8567f30a7.zip
llvm-a758205951d3a1eb60bdb65146ab23e8567f30a7.tar.gz
llvm-a758205951d3a1eb60bdb65146ab23e8567f30a7.tar.bz2
[trace][intelpt] Support system-wide tracing [9] - Collect and return context switch traces
- Add collection of context switches per cpu grouped with the per-cpu intel pt traces. - Move the state handling from the interl pt trace class to the PerfEvent one. - Add support for stopping and enabling perf event groups. - Return context switch entries as part of the jLLDBTraceGetState response. - Move the triggers of whenever the process stopped or resumed. Now the will-resume notification is in a better location, which will ensure that we'll capture the instructions that will be executed. - Remove IntelPTSingleBufferTraceUP. The unique pointer was useless. - Add unit tests Differential Revision: https://reviews.llvm.org/D125897
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index a7869d2..429c68a 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -898,6 +898,8 @@ Status NativeProcessLinux::Resume(const ResumeActionList &resume_actions) {
Log *log = GetLog(POSIXLog::Process);
LLDB_LOG(log, "pid {0}", GetID());
+ NotifyTracersProcessWillResume();
+
bool software_single_step = !SupportHardwareSingleStepping();
if (software_single_step) {
@@ -1665,9 +1667,12 @@ void NativeProcessLinux::StopTrackingThread(NativeThreadLinux &thread) {
SignalIfAllThreadsStopped();
}
-void NativeProcessLinux::NotifyTracersProcessStateChanged(
- lldb::StateType state) {
- m_intel_pt_collector.OnProcessStateChanged(state);
+void NativeProcessLinux::NotifyTracersProcessDidStop() {
+ m_intel_pt_collector.ProcessDidStop();
+}
+
+void NativeProcessLinux::NotifyTracersProcessWillResume() {
+ m_intel_pt_collector.ProcessWillResume();
}
Status NativeProcessLinux::NotifyTracersOfNewThread(lldb::tid_t tid) {