Revert "[libc] Breakup freelist_malloc into separate files" (#119749)
[llvm-project.git] / lldb / source / Plugins / TraceExporter / ctf / CommandObjectThreadTraceExportCTF.h
blob06834edf14ea16696f23b8317fe1de49bd19bcd2
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 //===----------------------------------------------------------------------===//
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"
15 #include <optional>
17 namespace lldb_private {
18 namespace ctf {
20 class CommandObjectThreadTraceExportCTF : public CommandObjectParsed {
21 public:
22 class CommandOptions : public Options {
23 public:
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;
34 std::string m_file;
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),
46 m_options() {}
48 Options *GetOptions() override { return &m_options; }
50 protected:
51 void DoExecute(Args &args, CommandReturnObject &result) override;
53 CommandOptions m_options;
56 } // namespace ctf
57 } // namespace lldb_private
59 #endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H