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 
14 namespace lldb_private {
15 
16 /// \class TraceExporter TraceExporter.h "lldb/Target/TraceExporter.h"
17 /// A plug-in interface definition class for trace exporters.
18 ///
19 /// Trace exporter plug-ins operate on traces, converting the trace data
20 /// provided by an \a lldb_private::TraceCursor into a different format that can
21 /// be digested by other tools, e.g. Chrome Trace Event Profiler.
22 ///
23 /// Trace exporters are supposed to operate on an architecture-agnostic fashion,
24 /// as a TraceCursor, which feeds the data, hides the actual trace technology
25 /// being used.
26 class TraceExporter : public PluginInterface {
27 public:
28   /// Create an instance of a trace exporter plugin given its name.
29   ///
30   /// \param[in] plugin_Name
31   ///     Plug-in name to search.
32   ///
33   /// \return
34   ///     A \a TraceExporterUP instance, or an \a llvm::Error if the plug-in
35   ///     name doesn't match any registered plug-ins.
36   static llvm::Expected<lldb::TraceExporterUP>
37   FindPlugin(llvm::StringRef plugin_name);
38 };
39 
40 } // namespace lldb_private
41 
42 #endif // LLDB_TARGET_TRACE_EXPORTER_H
43