Coverage Report

Created: 2022-01-18 06:27

/Users/buildslave/jenkins/workspace/coverage/llvm-project/lldb/source/Plugins/TraceExporter/ctf/CommandObjectThreadTraceExportCTF.h
Line
Count
Source (jump to first uncovered line)
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"
13
#include "lldb/Interpreter/CommandInterpreter.h"
14
#include "lldb/Interpreter/CommandReturnObject.h"
15
16
namespace lldb_private {
17
namespace ctf {
18
19
class CommandObjectThreadTraceExportCTF : public CommandObjectParsed {
20
public:
21
  class CommandOptions : public Options {
22
  public:
23
0
    CommandOptions() : Options() { OptionParsingStarting(nullptr); }
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;
33
    std::string m_file;
34
  };
35
36
  CommandObjectThreadTraceExportCTF(CommandInterpreter &interpreter)
37
      : CommandObjectParsed(
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
0
        m_options() {}
46
47
0
  Options *GetOptions() override { return &m_options; }
48
49
protected:
50
  bool DoExecute(Args &command, CommandReturnObject &result) override;
51
52
  CommandOptions m_options;
53
};
54
55
} // namespace ctf
56
} // namespace lldb_private
57
58
#endif // LLDB_SOURCE_PLUGINS_TRACE_INTEL_PT_COMMANDOBJECTTHREADTRACEEXPORTCTF_H