1 //===-- CommandObjectThreadTraceExportCTF.h -------------------*- C++ //-*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H
10 #define LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H
12 #include "TraceExporterCTF.h"
13 #include "lldb/Interpreter/CommandInterpreter.h"
14 #include "lldb/Interpreter/CommandReturnObject.h"
17 namespace lldb_private
{
20 class CommandObjectThreadTraceExportCTF
: public CommandObjectParsed
{
22 class CommandOptions
: public Options
{
24 CommandOptions() : Options() { OptionParsingStarting(nullptr); }
26 Status
SetOptionValue(uint32_t option_idx
, llvm::StringRef option_arg
,
27 ExecutionContext
*execution_context
) override
;
29 void OptionParsingStarting(ExecutionContext
*execution_context
) override
;
31 llvm::ArrayRef
<OptionDefinition
> GetDefinitions() override
;
33 std::optional
<size_t> m_thread_index
;
37 CommandObjectThreadTraceExportCTF(CommandInterpreter
&interpreter
)
38 : CommandObjectParsed(
39 interpreter
, "thread trace export ctf",
40 "Export a given thread's trace to Chrome Trace Format",
41 "thread trace export ctf [<ctf-options>]",
42 lldb::eCommandRequiresProcess
| lldb::eCommandTryTargetAPILock
|
43 lldb::eCommandProcessMustBeLaunched
|
44 lldb::eCommandProcessMustBePaused
|
45 lldb::eCommandProcessMustBeTraced
),
48 Options
*GetOptions() override
{ return &m_options
; }
51 void DoExecute(Args
&args
, CommandReturnObject
&result
) override
;
53 CommandOptions m_options
;
57 } // namespace lldb_private
59 #endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H