aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
diff options
context:
space:
mode:
authorWalter Erquinigo <wallace@fb.com>2022-05-02 19:10:39 -0700
committerWalter Erquinigo <wallace@fb.com>2022-05-17 12:46:54 -0700
commit1f49714d3e19502753fcea7ad8378a194222328f (patch)
treeabca0d85cac83114ba63a0b0d1a2f0a9a53f26cc /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
parent8d53f2fc0d9f7cf428905524fe85c459f755741c (diff)
downloadllvm-1f49714d3e19502753fcea7ad8378a194222328f.zip
llvm-1f49714d3e19502753fcea7ad8378a194222328f.tar.gz
llvm-1f49714d3e19502753fcea7ad8378a194222328f.tar.bz2
[trace][intelpt] Support system-wide tracing [4] - Support per core tracing on lldb-server
This diffs implements per-core tracing on lldb-server. It also includes tests that ensure that tracing can be initiated from the client and that the jLLDBGetState ppacket returns the list of trace buffers per core. This doesn't include any decoder changes. Finally, this makes some little changes here and there improving the existing code. A specific piece of code that can't reliably be tested is when tracing per core fails due to permissions. In this case we add a troubleshooting message and this is the manual test: ``` /proc/sys/kernel/perf_event_paranoid set to 1 (lldb) process trace start --per-core-tracing error: perf event syscall failed: Permission denied You might need that /proc/sys/kernel/perf_event_paranoid has a value of 0 or -1. `` Differential Revision: https://reviews.llvm.org/D124858
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 78d1b3a..37da1f1 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -312,7 +312,7 @@ NativeProcessLinux::NativeProcessLinux(::pid_t pid, int terminal_fd,
const ArchSpec &arch, MainLoop &mainloop,
llvm::ArrayRef<::pid_t> tids)
: NativeProcessELF(pid, terminal_fd, delegate), m_arch(arch),
- m_main_loop(mainloop) {
+ m_main_loop(mainloop), m_intel_pt_collector(*this) {
if (m_terminal_fd != -1) {
Status status = EnsureFDFlags(m_terminal_fd, O_NONBLOCK);
assert(status.Success());
@@ -1967,10 +1967,7 @@ Error NativeProcessLinux::TraceStart(StringRef json_request, StringRef type) {
if (Expected<TraceIntelPTStartRequest> request =
json::parse<TraceIntelPTStartRequest>(json_request,
"TraceIntelPTStartRequest")) {
- std::vector<lldb::tid_t> process_threads;
- for (auto &thread : m_threads)
- process_threads.push_back(thread->GetID());
- return m_intel_pt_collector.TraceStart(*request, process_threads);
+ return m_intel_pt_collector.TraceStart(*request);
} else
return request.takeError();
}