24 "Enable statistics collection", nullptr,
25 eCommandProcessMustBePaused) {}
45 "Disable statistics collection", nullptr,
46 eCommandProcessMustBePaused) {}
53 result.
AppendError(
"need to enable statistics before disabling them");
62#define LLDB_OPTIONS_statistics_dump
63#include "CommandOptions.inc"
75 switch (short_option) {
86 if (llvm::Expected<bool> bool_or_error =
90 error = bool_or_error.takeError();
93 if (llvm::Expected<bool> bool_or_error =
97 error = bool_or_error.takeError();
100 if (llvm::Expected<bool> bool_or_error =
104 error = bool_or_error.takeError();
107 llvm_unreachable(
"Unimplemented option");
118 return llvm::ArrayRef(g_statistics_dump_options);
130 interpreter,
"statistics dump",
"Dump metrics in JSON format",
131 "statistics dump [<options>]", eCommandRequiresTarget) {}
154 "Print statistics about a debugging session",
155 "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
~CommandObjectStats() override
CommandObjectStats(CommandInterpreter &interpreter)
ExecutionContext m_exe_ctx
void void AppendError(llvm::StringRef in_string)
void SetStatus(lldb::ReturnStatus status)
void void AppendMessageWithFormatv(const char *format, Args &&... args)
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.
Target * GetTargetPtr() const
Returns a pointer to the target object.
A command line option parsing protocol class.
std::vector< Option > m_getopt_table
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)
void SetIncludeTranscript(bool value)
void SetSummaryOnly(bool value)
void SetIncludeModules(bool value)
void SetLoadAllDebugInfo(bool value)
void SetIncludeTargets(bool value)