25 "Enable statistics collection", nullptr,
26 eCommandProcessMustBePaused) {}
46 "Disable statistics collection", nullptr,
47 eCommandProcessMustBePaused) {}
54 result.
AppendError(
"need to enable statistics before disabling them");
63#define LLDB_OPTIONS_statistics_dump
64#include "CommandOptions.inc"
76 switch (short_option) {
87 if (llvm::Expected<bool> bool_or_error =
94 if (llvm::Expected<bool> bool_or_error =
101 if (llvm::Expected<bool> bool_or_error =
108 if (llvm::Expected<bool> bool_or_error =
115 llvm_unreachable(
"Unimplemented option");
126 return llvm::ArrayRef(g_statistics_dump_options);
138 interpreter,
"statistics dump",
"Dump metrics in JSON format",
139 "statistics dump [<options>]", eCommandRequiresTarget) {}
156 "transcript requested but none was saved. Enable with "
157 "'settings set interpreter.save-transcript true'");
171 "Print statistics about a debugging session",
172 "statistics <subcommand> [<subcommand-options>]") {
static llvm::raw_ostream & error(Stream &strm)
void DoExecute(Args &command, CommandReturnObject &result) override
~CommandObjectStatsDisable() override=default
CommandObjectStatsDisable(CommandInterpreter &interpreter)
void OptionParsingStarting(ExecutionContext *execution_context) override
const StatisticsOptions & GetStatisticsOptions()
Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override
Set the value of an option.
StatisticsOptions m_stats_options
llvm::ArrayRef< OptionDefinition > GetDefinitions() override
Options * GetOptions() override
~CommandObjectStatsDump() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
CommandObjectStatsDump(CommandInterpreter &interpreter)
CommandObjectStatsEnable(CommandInterpreter &interpreter)
~CommandObjectStatsEnable() override=default
void DoExecute(Args &command, CommandReturnObject &result) override
A command line argument class.
bool LoadSubCommand(llvm::StringRef cmd_name, const lldb::CommandObjectSP &command_obj) override
CommandObjectMultiword(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
friend class CommandInterpreter
CommandObjectParsed(CommandInterpreter &interpreter, const char *name, const char *help=nullptr, const char *syntax=nullptr, uint32_t flags=0)
~CommandObjectStats() override
CommandObjectStats(CommandInterpreter &interpreter)
ExecutionContext m_exe_ctx
CommandInterpreter & GetCommandInterpreter()
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void void AppendMessageWithFormatv(const char *format, Args &&...args)
void void AppendWarning(llvm::StringRef in_string)
static void SetCollectingStats(bool enable)
static bool GetCollectingStats()
static llvm::json::Value ReportStatistics(Debugger &debugger, Target *target, const lldb_private::StatisticsOptions &options)
Get metrics associated with one or all targets in a debugger in JSON format.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::CommandObject > CommandObjectSP
@ eReturnStatusSuccessFinishResult
static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr)
bool GetIncludeTranscript() const