brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · e98e2c8 Raw
45 lines · cpp
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-exception6//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 protocol25//------------------------------------------------------------------26 27static CommandObjectSP28GetThreadTraceExportCommand(CommandInterpreter &interpreter) {29  return std::make_shared<CommandObjectThreadTraceExportCTF>(interpreter);30}31 32void TraceExporterCTF::Initialize() {33  PluginManager::RegisterPlugin(GetPluginNameStatic(),34                                "Chrome Trace Format Exporter", CreateInstance,35                                GetThreadTraceExportCommand);36}37 38void TraceExporterCTF::Terminate() {39  PluginManager::UnregisterPlugin(CreateInstance);40}41 42Expected<TraceExporterUP> TraceExporterCTF::CreateInstance() {43  return std::make_unique<TraceExporterCTF>();44}45