9#ifndef LLDB_TARGET_STATISTICS_H
10#define LLDB_TARGET_STATISTICS_H
16#include "llvm/ADT/StringMap.h"
17#include "llvm/Support/JSON.h"
32 using Duration = std::chrono::duration<double>;
40 value.fetch_add(std::chrono::duration_cast<InternalDuration>(dur).count(),
41 std::memory_order_relaxed);
93 llvm::json::Value
ToJSON()
const;
101 llvm::json::Value
ToJSON()
const;
130 llvm::json::Value
ToJSON()
const;
230 static llvm::json::Value
static double elapsed(const StatsTimepoint &start, const StatsTimepoint &end)
static MemoryStats GetMemoryStats()
static void SetCollectingStats(bool enable)
static bool GetCollectingStats()
static bool g_collecting_stats
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.
A class to manage flag bits.
A class that measures elapsed time in an exception safe way.
StatsDuration & m_elapsed_time
Elapsed time in seconds to increment when this object goes out of scope.
ElapsedTime(StatsDuration &opt_time)
StatsTimepoint m_start_time
Set to the start time when the object is created.
std::atomic< uint64_t > value
std::chrono::duration< double > Duration
StatsDuration & operator+=(Duration dur)
std::chrono::duration< uint64_t, std::micro > InternalDuration
A class that represents statistics for a since lldb_private::Target.
void IncreaseSourceMapDeduceCount()
StatsSuccessFail m_frame_var
std::optional< StatsTimepoint > m_launch_or_attach_time
uint32_t m_source_map_deduce_count
void CollectStats(Target &target)
StatsSuccessFail & GetFrameVariableStats()
llvm::json::Value ToJSON(Target &target, const lldb_private::StatisticsOptions &options)
StatsDuration m_create_time
std::optional< StatsTimepoint > m_first_public_stop_time
void IncreaseSourceRealpathAttemptCount(uint32_t count)
StatsDuration & GetCreateTime()
uint32_t m_source_realpath_compatible_count
void SetFirstPrivateStopTime()
StatsSuccessFail & GetExpressionStats()
StatsSuccessFail m_expr_eval
std::vector< intptr_t > m_module_identifiers
void SetFirstPublicStopTime()
uint32_t m_source_realpath_attempt_count
void SetLaunchOrAttachTime()
void IncreaseSourceRealpathCompatibleCount(uint32_t count)
std::optional< StatsTimepoint > m_first_private_stop_time
A class that represents a running process on the host machine.
std::chrono::time_point< StatsClock > StatsTimepoint
std::chrono::high_resolution_clock StatsClock
ConstString::MemoryStats stats
llvm::json::Value ToJSON() const
A class that represents statistics for a since lldb_private::Module.
bool debug_info_index_saved_to_cache
bool debug_info_had_variable_errors
llvm::json::Value ToJSON() const
llvm::StringMap< llvm::json::Value > type_system_stats
bool debug_info_had_incomplete_types
bool symtab_saved_to_cache
std::vector< intptr_t > symfile_modules
bool symtab_loaded_from_cache
bool debug_info_index_loaded_from_cache
bool GetIncludeTranscript() const
bool GetIncludeModules() const
std::optional< bool > m_load_all_debug_info
void SetIncludeTranscript(bool value)
void SetSummaryOnly(bool value)
bool GetSummaryOnly() const
std::optional< bool > m_include_modules
std::optional< bool > m_include_transcript
void SetIncludeModules(bool value)
bool GetIncludeTargets() const
bool GetLoadAllDebugInfo() const
std::optional< bool > m_summary_only
std::optional< bool > m_include_targets
void SetLoadAllDebugInfo(bool value)
void SetIncludeTargets(bool value)
A class to count success/fail statistics.
StatsSuccessFail(llvm::StringRef n)
llvm::json::Value ToJSON() const