LLDB  mainline
CommandObjectThreadTraceExportCTF.h
Go to the documentation of this file.
1 //===-- CommandObjectThreadTraceExportCTF.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_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H
10 #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H
11 
12 #include "TraceExporterCTF.h"
15 
16 namespace lldb_private {
17 namespace ctf {
18 
20 public:
21  class CommandOptions : public Options {
22  public:
24 
25  Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
26  ExecutionContext *execution_context) override;
27 
28  void OptionParsingStarting(ExecutionContext *execution_context) override;
29 
30  llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
31 
32  llvm::Optional<size_t> m_thread_index;
34  };
35 
38  interpreter, "thread trace export ctf",
39  "Export a given thread's trace to Chrome Trace Format",
40  "thread trace export ctf [<ctf-options>]",
41  lldb::eCommandRequiresProcess | lldb::eCommandTryTargetAPILock |
42  lldb::eCommandProcessMustBeLaunched |
43  lldb::eCommandProcessMustBePaused |
44  lldb::eCommandProcessMustBeTraced),
45  m_options() {}
46 
47  Options *GetOptions() override { return &m_options; }
48 
49 protected:
50  bool DoExecute(Args &command, CommandReturnObject &result) override;
51 
53 };
54 
55 } // namespace ctf
56 } // namespace lldb_private
57 
58 #endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H
lldb_private::CommandObjectParsed
Definition: CommandObject.h:389
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb_private::ctf::CommandObjectThreadTraceExportCTF::m_options
CommandOptions m_options
Definition: CommandObjectThreadTraceExportCTF.h:52
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandOptions::m_thread_index
llvm::Optional< size_t > m_thread_index
Definition: CommandObjectThreadTraceExportCTF.h:32
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandObjectThreadTraceExportCTF
CommandObjectThreadTraceExportCTF(CommandInterpreter &interpreter)
Definition: CommandObjectThreadTraceExportCTF.h:36
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandOptions::m_file
std::string m_file
Definition: CommandObjectThreadTraceExportCTF.h:33
lldb_private::Args
Definition: Args.h:33
CommandReturnObject.h
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandOptions::CommandOptions
CommandOptions()
Definition: CommandObjectThreadTraceExportCTF.h:23
lldb_private::Options
Definition: Options.h:57
lldb_private::ctf::CommandObjectThreadTraceExportCTF::DoExecute
bool DoExecute(Args &command, CommandReturnObject &result) override
Definition: CommandObjectThreadTraceExportCTF.cpp:65
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandOptions::SetOptionValue
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
Definition: CommandObjectThreadTraceExportCTF.cpp:27
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandOptions::GetDefinitions
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Definition: CommandObjectThreadTraceExportCTF.cpp:61
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandOptions
Definition: CommandObjectThreadTraceExportCTF.h:21
lldb_private::Status
Definition: Status.h:44
TraceExporterCTF.h
lldb_private::CommandReturnObject
Definition: CommandReturnObject.h:26
uint32_t
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
CommandInterpreter.h
lldb
Definition: SBAddress.h:15
lldb_private::ctf::CommandObjectThreadTraceExportCTF::GetOptions
Options * GetOptions() override
Definition: CommandObjectThreadTraceExportCTF.h:47
lldb_private::ctf::CommandObjectThreadTraceExportCTF::CommandOptions::OptionParsingStarting
void OptionParsingStarting(ExecutionContext *execution_context) override
Definition: CommandObjectThreadTraceExportCTF.cpp:54
lldb_private::ctf::CommandObjectThreadTraceExportCTF
Definition: CommandObjectThreadTraceExportCTF.h:19