summaryrefslogtreecommitdiff
path: root/include/lldb/Target/Process.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/lldb/Target/Process.h')
-rw-r--r--include/lldb/Target/Process.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/include/lldb/Target/Process.h b/include/lldb/Target/Process.h
index 56bbbfd53fdd..9a749efa7ae1 100644
--- a/include/lldb/Target/Process.h
+++ b/include/lldb/Target/Process.h
@@ -36,6 +36,7 @@
#include "lldb/Core/PluginInterface.h"
#include "lldb/Core/StructuredData.h"
#include "lldb/Core/ThreadSafeValue.h"
+#include "lldb/Core/TraceOptions.h"
#include "lldb/Core/UserSettingsController.h"
#include "lldb/Host/HostThread.h"
#include "lldb/Host/ProcessRunLock.h"
@@ -2766,6 +2767,79 @@ public:
lldb::StructuredDataPluginSP
GetStructuredDataPlugin(const ConstString &type_name) const;
+ //------------------------------------------------------------------
+ /// Starts tracing with the configuration provided in options. To
+ /// enable tracing on the complete process the thread_id in the
+ /// options should be set to LLDB_INVALID_THREAD_ID. The API returns
+ /// a user_id which is needed by other API's that manipulate the
+ /// trace instance.
+ /// The handling of erroneous or unsupported configuration is left
+ /// to the trace technology implementations in the server, as they
+ /// could be returned as an error, or rounded to a valid
+ /// configuration to start tracing. In the later case the
+ /// GetTraceConfig should supply the actual used trace
+ /// configuration.
+ //------------------------------------------------------------------
+ virtual lldb::user_id_t StartTrace(lldb::TraceOptionsSP &options,
+ Error &error) {
+ error.SetErrorString("Not implemented");
+ return LLDB_INVALID_UID;
+ }
+
+ //------------------------------------------------------------------
+ /// Stops the tracing instance leading to deletion of the trace
+ /// data. The tracing instance is identified by the user_id which
+ /// is obtained when tracing was started from the StartTrace.
+ /// In case tracing of the complete process needs to be stopped
+ /// the thread_id should be set to LLDB_INVALID_THREAD_ID.
+ /// In the other case that tracing on an individual thread needs
+ /// to be stopped a thread_id can be supplied.
+ //------------------------------------------------------------------
+ virtual void StopTrace(lldb::user_id_t uid, lldb::tid_t thread_id,
+ Error &error) {
+ error.SetErrorString("Not implemented");
+ }
+
+ //------------------------------------------------------------------
+ /// Provides the trace data as raw bytes. A buffer needs to be
+ /// supplied to copy the trace data. The exact behavior of this API
+ /// may vary across trace technology, as some may support partial
+ /// reading of the trace data from a specified offset while some
+ /// may not. The thread_id should be used to select a particular
+ /// thread for trace extraction.
+ //------------------------------------------------------------------
+ virtual size_t GetData(lldb::user_id_t uid, lldb::tid_t thread_id,
+ Error &error, void *buf, size_t size,
+ size_t offset = 0) {
+ error.SetErrorString("Not implemented");
+ return 0;
+ }
+
+ //------------------------------------------------------------------
+ /// Similar API as above except for obtaining meta data
+ //------------------------------------------------------------------
+ virtual size_t GetMetaData(lldb::user_id_t uid, lldb::tid_t thread_id,
+ Error &error, void *buf, size_t size,
+ size_t offset = 0) {
+ error.SetErrorString("Not implemented");
+ return 0;
+ }
+
+ //------------------------------------------------------------------
+ /// API to obtain the trace configuration used by a trace instance.
+ /// Configurations that may be specific to some trace technology
+ /// should be stored in the custom parameters. The options are
+ /// transported to the server, which shall interpret accordingly.
+ /// The thread_id can be specified in the options to obtain the
+ /// configuration used by a specific thread. The thread_id specified
+ /// should also match the uid otherwise an error will be returned.
+ //------------------------------------------------------------------
+ virtual void GetTraceConfig(lldb::user_id_t uid, Error &error,
+ lldb::TraceOptionsSP &options) {
+ error.SetErrorString("Not implemented");
+ return;
+ }
+
protected:
void SetState(lldb::EventSP &event_sp);