1//===-- TraceExporterCTF.cpp ----------------------------------------------===//
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#include "TraceExporterCTF.h"
10
11#include <memory>
12
13#include "CommandObjectThreadTraceExportCTF.h"
14#include "lldb/Core/PluginManager.h"
15
16using namespace lldb;
17using namespace lldb_private;
18using namespace lldb_private::ctf;
19using namespace llvm;
20
21LLDB_PLUGIN_DEFINE(TraceExporterCTF)
22
23//------------------------------------------------------------------
24// PluginInterface protocol
25//------------------------------------------------------------------
26
27static CommandObjectSP
28GetThreadTraceExportCommand(CommandInterpreter &interpreter) {
29 return std::make_shared<CommandObjectThreadTraceExportCTF>(args&: interpreter);
30}
31
32void TraceExporterCTF::Initialize() {
33 PluginManager::RegisterPlugin(name: GetPluginNameStatic(),
34 description: "Chrome Trace Format Exporter", create_callback: CreateInstance,
35 create_thread_trace_export_command: GetThreadTraceExportCommand);
36}
37
38void TraceExporterCTF::Terminate() {
39 PluginManager::UnregisterPlugin(create_callback: CreateInstance);
40}
41
42Expected<TraceExporterUP> TraceExporterCTF::CreateInstance() {
43 return std::make_unique<TraceExporterCTF>();
44}
45

source code of lldb/source/Plugins/TraceExporter/ctf/TraceExporterCTF.cpp