summaryrefslogtreecommitdiff
path: root/source/Plugins/Process/Linux/NativeProcessLinux.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Plugins/Process/Linux/NativeProcessLinux.h')
-rw-r--r--source/Plugins/Process/Linux/NativeProcessLinux.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/source/Plugins/Process/Linux/NativeProcessLinux.h b/source/Plugins/Process/Linux/NativeProcessLinux.h
index aa6fe4412068..6bf093f6a39a 100644
--- a/source/Plugins/Process/Linux/NativeProcessLinux.h
+++ b/source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -23,6 +23,7 @@
#include "lldb/lldb-types.h"
#include "NativeThreadLinux.h"
+#include "ProcessorTrace.h"
#include "lldb/Host/common/NativeProcessProtocol.h"
namespace lldb_private {
@@ -105,6 +106,22 @@ public:
return getProcFile(GetID(), "auxv");
}
+ lldb::user_id_t StartTrace(const TraceOptions &config,
+ Status &error) override;
+
+ Status StopTrace(lldb::user_id_t traceid,
+ lldb::tid_t thread) override;
+
+ Status GetData(lldb::user_id_t traceid, lldb::tid_t thread,
+ llvm::MutableArrayRef<uint8_t> &buffer,
+ size_t offset = 0) override;
+
+ Status GetMetaData(lldb::user_id_t traceid, lldb::tid_t thread,
+ llvm::MutableArrayRef<uint8_t> &buffer,
+ size_t offset = 0) override;
+
+ Status GetTraceConfig(lldb::user_id_t traceid, TraceOptions &config) override;
+
// ---------------------------------------------------------------------
// Interface used by NativeRegisterContext-derived classes.
// ---------------------------------------------------------------------
@@ -228,6 +245,43 @@ private:
void SigchldHandler();
Status PopulateMemoryRegionCache();
+
+ lldb::user_id_t StartTraceGroup(const TraceOptions &config,
+ Status &error);
+
+ // This function is intended to be used to stop tracing
+ // on a thread that exited.
+ Status StopTracingForThread(lldb::tid_t thread);
+
+ // The below function as the name suggests, looks up a ProcessorTrace
+ // instance from the m_processor_trace_monitor map. In the case of
+ // process tracing where the traceid passed would map to the complete
+ // process, it is mandatory to provide a threadid to obtain a trace
+ // instance (since ProcessorTrace is tied to a thread). In the other
+ // scenario that an individual thread is being traced, just the traceid
+ // is sufficient to obtain the actual ProcessorTrace instance.
+ llvm::Expected<ProcessorTraceMonitor &>
+ LookupProcessorTraceInstance(lldb::user_id_t traceid, lldb::tid_t thread);
+
+ // Stops tracing on individual threads being traced. Not intended
+ // to be used to stop tracing on complete process.
+ Status StopProcessorTracingOnThread(lldb::user_id_t traceid,
+ lldb::tid_t thread);
+
+ // Intended to stop tracing on complete process.
+ // Should not be used for stopping trace on
+ // individual threads.
+ void StopProcessorTracingOnProcess();
+
+ llvm::DenseMap<lldb::tid_t, ProcessorTraceMonitorUP>
+ m_processor_trace_monitor;
+
+ // Set for tracking threads being traced under
+ // same process user id.
+ llvm::DenseSet<lldb::tid_t> m_pt_traced_thread_group;
+
+ lldb::user_id_t m_pt_proces_trace_id;
+ TraceOptions m_pt_process_trace_config;
};
} // namespace process_linux