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#include <optional>
16
17namespace lldb_private {
18namespace ctf {
19
21public:
22 class CommandOptions : public Options {
23 public:
25
26 Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
27 ExecutionContext *execution_context) override;
28
29 void OptionParsingStarting(ExecutionContext *execution_context) override;
30
31 llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
32
33 std::optional<size_t> m_thread_index;
34 std::string m_file;
35 };
36
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),
46 m_options() {}
47
48 Options *GetOptions() override { return &m_options; }
49
50protected:
51 void DoExecute(Args &command, CommandReturnObject &result) override;
52
54};
55
56} // namespace ctf
57} // namespace lldb_private
58
59#endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H
A command line argument class.
Definition: Args.h:33
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A command line option parsing protocol class.
Definition: Options.h:58
An error handling class.
Definition: Status.h:44
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
void DoExecute(Args &command, CommandReturnObject &result) override
A class that represents a running process on the host machine.
Definition: SBAddress.h:15