1 //===-- TraceExporter.h -----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_TARGET_TRACE_EXPORTER_H
10 #define LLDB_TARGET_TRACE_EXPORTER_H
11 
12 #include "lldb/Core/PluginInterface.h"
13 #include "lldb/lldb-forward.h"
14 #include "llvm/Support/Error.h"
15 
16 namespace lldb_private {
17 
18 /// \class TraceExporter TraceExporter.h "lldb/Target/TraceExporter.h"
19 /// A plug-in interface definition class for trace exporters.
20 ///
21 /// Trace exporter plug-ins operate on traces, converting the trace data
22 /// provided by an \a lldb_private::TraceCursor into a different format that can
23 /// be digested by other tools, e.g. Chrome Trace Event Profiler.
24 ///
25 /// Trace exporters are supposed to operate on an architecture-agnostic fashion,
26 /// as a TraceCursor, which feeds the data, hides the actual trace technology
27 /// being used.
28 class TraceExporter : public PluginInterface {
29 public:
30   /// Create an instance of a trace exporter plugin given its name.
31   ///
32   /// \param[in] plugin_Name
33   ///     Plug-in name to search.
34   ///
35   /// \return
36   ///     A \a TraceExporterUP instance, or an \a llvm::Error if the plug-in
37   ///     name doesn't match any registered plug-ins.
38   static llvm::Expected<lldb::TraceExporterUP>
39   FindPlugin(llvm::StringRef plugin_name);
40 };
41 
42 } // namespace lldb_private
43 
44 #endif // LLDB_TARGET_TRACE_EXPORTER_H
45