LLDB mainline
Statistics.cpp
Go to the documentation of this file.
1//===-- Statistics.cpp ----------------------------------------------------===//
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
10
11#include "lldb/Core/Debugger.h"
12#include "lldb/Core/Module.h"
17#include "lldb/Target/Process.h"
18#include "lldb/Target/Target.h"
22
23using namespace lldb;
24using namespace lldb_private;
25using namespace llvm;
26
27static void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key,
28 const std::string &str) {
29 if (str.empty())
30 return;
31 if (LLVM_LIKELY(llvm::json::isUTF8(str)))
32 obj.try_emplace(key, str);
33 else
34 obj.try_emplace(key, llvm::json::fixUTF8(str));
35}
36
37json::Value StatsSuccessFail::ToJSON() const {
38 return json::Object{{"successes", successes}, {"failures", failures}};
39}
40
41static double elapsed(const StatsTimepoint &start, const StatsTimepoint &end) {
43 end.time_since_epoch() - start.time_since_epoch();
44 return elapsed.count();
45}
46
49 for (ModuleSP module_sp : target.GetImages().Modules())
50 m_module_identifiers.emplace_back((intptr_t)module_sp.get());
51}
52
53json::Value ModuleStats::ToJSON() const {
54 json::Object module;
55 EmplaceSafeString(module, "path", path);
56 EmplaceSafeString(module, "uuid", uuid);
57 EmplaceSafeString(module, "triple", triple);
58 module.try_emplace("identifier", identifier);
59 module.try_emplace("symbolTableParseTime", symtab_parse_time);
60 module.try_emplace("symbolTableIndexTime", symtab_index_time);
61 module.try_emplace("symbolTableLoadedFromCache", symtab_loaded_from_cache);
62 module.try_emplace("symbolTableSavedToCache", symtab_saved_to_cache);
63 module.try_emplace("debugInfoParseTime", debug_parse_time);
64 module.try_emplace("debugInfoIndexTime", debug_index_time);
65 module.try_emplace("debugInfoByteSize", (int64_t)debug_info_size);
66 module.try_emplace("debugInfoIndexLoadedFromCache",
67 debug_info_index_loaded_from_cache);
68 module.try_emplace("debugInfoIndexSavedToCache",
69 debug_info_index_saved_to_cache);
70 module.try_emplace("debugInfoEnabled", debug_info_enabled);
71 module.try_emplace("debugInfoHadVariableErrors",
72 debug_info_had_variable_errors);
73 module.try_emplace("debugInfoHadIncompleteTypes",
74 debug_info_had_incomplete_types);
75 module.try_emplace("symbolTableStripped", symtab_stripped);
76 module.try_emplace("symbolTableSymbolCount", symtab_symbol_count);
77 module.try_emplace("dwoFileCount", dwo_stats.dwo_file_count);
78 module.try_emplace("loadedDwoFileCount", dwo_stats.loaded_dwo_file_count);
79 module.try_emplace("dwoErrorCount", dwo_stats.dwo_error_count);
80
81 if (!symbol_locator_time.map.empty()) {
82 json::Object obj;
83 for (const auto &entry : symbol_locator_time.map)
84 obj.try_emplace(entry.first().str(), entry.second);
85 module.try_emplace("symbolLocatorTime", std::move(obj));
86 }
87
88 if (!symfile_path.empty())
89 module.try_emplace("symbolFilePath", symfile_path);
90
91 if (!symfile_modules.empty()) {
92 json::Array symfile_ids;
93 for (const auto symfile_id : symfile_modules)
94 symfile_ids.emplace_back(symfile_id);
95 module.try_emplace("symbolFileModuleIdentifiers", std::move(symfile_ids));
96 }
97
98 if (!type_system_stats.empty()) {
99 json::Array type_systems;
100 for (const auto &entry : type_system_stats) {
101 json::Object obj;
102 obj.try_emplace(entry.first().str(), entry.second);
103 type_systems.emplace_back(std::move(obj));
104 }
105 module.try_emplace("typeSystemInfo", std::move(type_systems));
106 }
107
108 return module;
109}
110
111llvm::json::Value ConstStringStats::ToJSON() const {
112 json::Object obj;
113 obj.try_emplace<int64_t>("bytesTotal", stats.GetBytesTotal());
114 obj.try_emplace<int64_t>("bytesUsed", stats.GetBytesUsed());
115 obj.try_emplace<int64_t>("bytesUnused", stats.GetBytesUnused());
116 return obj;
117}
118
119json::Value
121 const lldb_private::StatisticsOptions &options) {
122 json::Object target_metrics_json;
123 ProcessSP process_sp = target.GetProcessSP();
124 const bool summary_only = options.GetSummaryOnly();
125 const bool include_modules = options.GetIncludeModules();
126 if (!summary_only) {
127 CollectStats(target);
128
129 json::Array json_module_uuid_array;
130 for (auto module_identifier : m_module_identifiers)
131 json_module_uuid_array.emplace_back(module_identifier);
132
133 target_metrics_json.try_emplace("expressionEvaluation",
134 m_expr_eval.ToJSON());
135 target_metrics_json.try_emplace("frameVariable", m_frame_var.ToJSON());
136 if (include_modules)
137 target_metrics_json.try_emplace("moduleIdentifiers",
138 std::move(json_module_uuid_array));
139
141 double elapsed_time =
143 target_metrics_json.try_emplace("launchOrAttachTime", elapsed_time);
144 }
146 double elapsed_time =
148 target_metrics_json.try_emplace("firstStopTime", elapsed_time);
149 }
150 target_metrics_json.try_emplace("targetCreateTime",
151 m_create_time.get().count());
152
153 if (m_load_core_time.get().count() > 0) {
154 target_metrics_json.try_emplace("loadCoreTime",
155 m_load_core_time.get().count());
156 }
157
158 json::Array breakpoints_array;
159 double totalBreakpointResolveTime = 0.0;
160 // Report both the normal breakpoint list and the internal breakpoint list.
161 for (int i = 0; i < 2; ++i) {
162 BreakpointList &breakpoints = target.GetBreakpointList(i == 1);
163 std::unique_lock<std::recursive_mutex> lock;
164 breakpoints.GetListMutex(lock);
165 size_t num_breakpoints = breakpoints.GetSize();
166 for (size_t i = 0; i < num_breakpoints; i++) {
167 Breakpoint *bp = breakpoints.GetBreakpointAtIndex(i).get();
168 breakpoints_array.push_back(bp->GetStatistics());
169 totalBreakpointResolveTime += bp->GetResolveTime().count();
170 }
171 }
172 target_metrics_json.try_emplace("breakpoints",
173 std::move(breakpoints_array));
174 target_metrics_json.try_emplace("totalBreakpointResolveTime",
175 totalBreakpointResolveTime);
176
177 if (process_sp) {
178 UnixSignalsSP unix_signals_sp = process_sp->GetUnixSignals();
179 if (unix_signals_sp)
180 target_metrics_json.try_emplace(
181 "signals", unix_signals_sp->GetHitCountStatistics());
182 }
183 }
184
185 // Counting "totalSharedLibraryEventHitCount" from breakpoints of kind
186 // "shared-library-event".
187 {
188 uint32_t shared_library_event_breakpoint_hit_count = 0;
189 // The "shared-library-event" is only found in the internal breakpoint list.
190 BreakpointList &breakpoints = target.GetBreakpointList(/* internal */ true);
191 std::unique_lock<std::recursive_mutex> lock;
192 breakpoints.GetListMutex(lock);
193 size_t num_breakpoints = breakpoints.GetSize();
194 for (size_t i = 0; i < num_breakpoints; i++) {
195 Breakpoint *bp = breakpoints.GetBreakpointAtIndex(i).get();
196 if (strcmp(bp->GetBreakpointKind(), "shared-library-event") == 0)
197 shared_library_event_breakpoint_hit_count += bp->GetHitCount();
198 }
199
200 target_metrics_json.try_emplace("totalSharedLibraryEventHitCount",
201 shared_library_event_breakpoint_hit_count);
202 }
203
204 if (process_sp) {
205 uint32_t stop_id = process_sp->GetStopID();
206 target_metrics_json.try_emplace("stopCount", stop_id);
207
208 llvm::StringRef dyld_plugin_name;
209 if (process_sp->GetDynamicLoader())
210 dyld_plugin_name = process_sp->GetDynamicLoader()->GetPluginName();
211 target_metrics_json.try_emplace("dyldPluginName", dyld_plugin_name);
212
213 if (process_sp->GetCoreFile())
214 target_metrics_json.try_emplace("coreFile",
215 process_sp->GetCoreFile().GetFilename());
216 }
217 target_metrics_json.try_emplace("sourceMapDeduceCount",
219 target_metrics_json.try_emplace("sourceRealpathAttemptCount",
221 target_metrics_json.try_emplace("sourceRealpathCompatibleCount",
223 target_metrics_json.try_emplace("summaryProviderStatistics",
225 return target_metrics_json;
226}
227
232 // Report both the normal breakpoint list and the internal breakpoint list.
233 for (int i = 0; i < 2; ++i) {
234 BreakpointList &breakpoints = target.GetBreakpointList(i == 1);
235 std::unique_lock<std::recursive_mutex> lock;
236 breakpoints.GetListMutex(lock);
237 size_t num_breakpoints = breakpoints.GetSize();
238 for (size_t i = 0; i < num_breakpoints; i++) {
239 Breakpoint *bp = breakpoints.GetBreakpointAtIndex(i).get();
240 bp->ResetStatistics();
241 }
242 }
244}
245
247 m_launch_or_attach_time = StatsClock::now();
248 m_first_private_stop_time = std::nullopt;
249}
250
252 // Launching and attaching has many paths depending on if synchronous mode
253 // was used or if we are stopping at the entry point or not. Only set the
254 // first stop time if it hasn't already been set.
256 m_first_private_stop_time = StatsClock::now();
257}
258
260 // Launching and attaching has many paths depending on if synchronous mode
261 // was used or if we are stopping at the entry point or not. Only set the
262 // first stop time if it hasn't already been set.
264 m_first_public_stop_time = StatsClock::now();
265}
266
270
274
278
280
282 std::lock_guard<std::recursive_mutex> guard(
284 const uint64_t num_modules = target != nullptr
285 ? target->GetImages().GetSize()
287 for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
288 Module *module = target != nullptr
289 ? target->GetImages().GetModuleAtIndex(image_idx).get()
291 if (module == nullptr)
292 continue;
293 module->ResetStatistics();
294 }
295 if (target)
296 target->ResetStatistics();
297 else {
298 for (const auto &target : debugger.GetTargetList().Targets())
299 target->ResetStatistics();
300 }
301}
302
304 Debugger &debugger, Target *target,
305 const lldb_private::StatisticsOptions &options) {
306
307 const bool summary_only = options.GetSummaryOnly();
308 const bool load_all_debug_info = options.GetLoadAllDebugInfo();
309 const bool include_targets = options.GetIncludeTargets();
310 const bool include_modules = options.GetIncludeModules();
311 const bool include_transcript = options.GetIncludeTranscript();
312 const bool include_plugins = options.GetIncludePlugins();
313
314 json::Array json_targets;
315 json::Array json_modules;
316 StatisticsMap symbol_locator_total_time;
317 double symtab_parse_time = 0.0;
318 double symtab_index_time = 0.0;
319 double debug_parse_time = 0.0;
320 double debug_index_time = 0.0;
321 uint32_t symtabs_loaded = 0;
322 uint32_t symtabs_loaded_from_cache = 0;
323 uint32_t symtabs_saved_to_cache = 0;
324 uint32_t debug_index_loaded = 0;
325 uint32_t debug_index_saved = 0;
326 uint64_t debug_info_size = 0;
327
328 std::lock_guard<std::recursive_mutex> guard(
330 const uint64_t num_modules = target != nullptr
331 ? target->GetImages().GetSize()
333 uint32_t num_debug_info_enabled_modules = 0;
334 uint32_t num_modules_has_debug_info = 0;
335 uint32_t num_modules_with_variable_errors = 0;
336 uint32_t num_modules_with_incomplete_types = 0;
337 uint32_t num_stripped_modules = 0;
338 uint32_t symtab_symbol_count = 0;
339 DWOStats total_dwo_stats;
340 for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
341 Module *module = target != nullptr
342 ? target->GetImages().GetModuleAtIndex(image_idx).get()
344 ModuleStats module_stat;
345 module_stat.symtab_parse_time = module->GetSymtabParseTime().get().count();
346 module_stat.symtab_index_time = module->GetSymtabIndexTime().get().count();
347 module_stat.symbol_locator_time = module->GetSymbolLocatorStatistics();
348 symbol_locator_total_time.merge(module_stat.symbol_locator_time);
349 Symtab *symtab = module->GetSymtab(/*can_create=*/false);
350 if (symtab) {
351 module_stat.symtab_symbol_count = symtab->GetNumSymbols();
352 symtab_symbol_count += module_stat.symtab_symbol_count;
353 ++symtabs_loaded;
354 module_stat.symtab_loaded_from_cache = symtab->GetWasLoadedFromCache();
355 if (module_stat.symtab_loaded_from_cache)
356 ++symtabs_loaded_from_cache;
357 module_stat.symtab_saved_to_cache = symtab->GetWasSavedToCache();
358 if (module_stat.symtab_saved_to_cache)
359 ++symtabs_saved_to_cache;
360 }
361 SymbolFile *sym_file = module->GetSymbolFile(/*can_create=*/false);
362 if (sym_file) {
363 if (!summary_only) {
364 if (sym_file->GetObjectFile() != module->GetObjectFile())
365 module_stat.symfile_path =
366 sym_file->GetObjectFile()->GetFileSpec().GetPath();
367 ModuleList symbol_modules = sym_file->GetDebugInfoModules();
368 for (const auto &symbol_module : symbol_modules.Modules())
369 module_stat.symfile_modules.push_back((intptr_t)symbol_module.get());
370 }
371 DWOStats current_dwo_stats = sym_file->GetDwoStats();
372 module_stat.dwo_stats += current_dwo_stats;
373 total_dwo_stats += current_dwo_stats;
377 ++debug_index_loaded;
380 if (module_stat.debug_info_index_saved_to_cache)
381 ++debug_index_saved;
382 module_stat.debug_index_time = sym_file->GetDebugInfoIndexTime().count();
383 module_stat.debug_parse_time = sym_file->GetDebugInfoParseTime().count();
384 module_stat.debug_info_size =
385 sym_file->GetDebugInfoSize(load_all_debug_info);
386 module_stat.symtab_stripped = module->GetObjectFile()->IsStripped();
387 if (module_stat.symtab_stripped)
388 ++num_stripped_modules;
389 module_stat.debug_info_enabled = sym_file->GetLoadDebugInfoEnabled() &&
390 module_stat.debug_info_size > 0;
393 if (module_stat.debug_info_enabled)
394 ++num_debug_info_enabled_modules;
395 if (module_stat.debug_info_size > 0)
396 ++num_modules_has_debug_info;
397 if (module_stat.debug_info_had_variable_errors)
398 ++num_modules_with_variable_errors;
399 }
400 symtab_parse_time += module_stat.symtab_parse_time;
401 symtab_index_time += module_stat.symtab_index_time;
402 debug_parse_time += module_stat.debug_parse_time;
403 debug_index_time += module_stat.debug_index_time;
404 debug_info_size += module_stat.debug_info_size;
405 module->ForEachTypeSystem([&](lldb::TypeSystemSP ts) {
406 if (auto stats = ts->ReportStatistics())
407 module_stat.type_system_stats.insert({ts->GetPluginName(), *stats});
408 if (ts->GetHasForcefullyCompletedTypes())
409 module_stat.debug_info_had_incomplete_types = true;
410 return true;
411 });
412 if (module_stat.debug_info_had_incomplete_types)
413 ++num_modules_with_incomplete_types;
414
415 if (include_modules) {
416 module_stat.identifier = (intptr_t)module;
417 module_stat.path = module->GetFileSpec().GetPath();
418 if (ConstString object_name = module->GetObjectName()) {
419 module_stat.path.append(1, '(');
420 module_stat.path.append(object_name.GetStringRef().str());
421 module_stat.path.append(1, ')');
422 }
423 module_stat.uuid = module->GetUUID().GetAsString();
424 module_stat.triple = module->GetArchitecture().GetTriple().str();
425 json_modules.emplace_back(module_stat.ToJSON());
426 }
427 }
428
429 json::Object global_stats{
430 {"totalSymbolTableParseTime", symtab_parse_time},
431 {"totalSymbolTableIndexTime", symtab_index_time},
432 {"totalSymbolTablesLoaded", symtabs_loaded},
433 {"totalSymbolTablesLoadedFromCache", symtabs_loaded_from_cache},
434 {"totalSymbolTablesSavedToCache", symtabs_saved_to_cache},
435 {"totalDebugInfoParseTime", debug_parse_time},
436 {"totalDebugInfoIndexTime", debug_index_time},
437 {"totalDebugInfoIndexLoadedFromCache", debug_index_loaded},
438 {"totalDebugInfoIndexSavedToCache", debug_index_saved},
439 {"totalDebugInfoByteSize", debug_info_size},
440 {"totalModuleCount", num_modules},
441 {"totalModuleCountHasDebugInfo", num_modules_has_debug_info},
442 {"totalModuleCountWithVariableErrors", num_modules_with_variable_errors},
443 {"totalModuleCountWithIncompleteTypes",
444 num_modules_with_incomplete_types},
445 {"totalDebugInfoEnabled", num_debug_info_enabled_modules},
446 {"totalSymbolTableStripped", num_stripped_modules},
447 {"totalSymbolTableSymbolCount", symtab_symbol_count},
448 {"totalLoadedDwoFileCount", total_dwo_stats.loaded_dwo_file_count},
449 {"totalDwoFileCount", total_dwo_stats.dwo_file_count},
450 {"totalDwoErrorCount", total_dwo_stats.dwo_error_count},
451 };
452
453 if (include_targets) {
454 if (target) {
455 json_targets.emplace_back(target->ReportStatistics(options));
456 } else {
457 for (const auto &target : debugger.GetTargetList().Targets())
458 json_targets.emplace_back(target->ReportStatistics(options));
459 }
460 global_stats.try_emplace("targets", std::move(json_targets));
461 }
462
463 if (!symbol_locator_total_time.map.empty()) {
464 json::Object obj;
465 for (const auto &entry : symbol_locator_total_time.map)
466 obj.try_emplace(entry.first().str(), entry.second);
467 global_stats.try_emplace("totalSymbolLocatorTime", std::move(obj));
468 }
469
470 ConstStringStats const_string_stats;
471 json::Object json_memory{
472 {"strings", const_string_stats.ToJSON()},
473 };
474 global_stats.try_emplace("memory", std::move(json_memory));
475 if (!summary_only) {
476 json::Value cmd_stats = debugger.GetCommandInterpreter().GetStatistics();
477 global_stats.try_emplace("commands", std::move(cmd_stats));
478 }
479
480 if (include_modules) {
481 global_stats.try_emplace("modules", std::move(json_modules));
482 }
483
484 if (include_transcript) {
485 // When transcript is available, add it to the to-be-returned statistics.
486 //
487 // NOTE:
488 // When the statistics is polled by an LLDB command:
489 // - The transcript in the returned statistics *will NOT* contain the
490 // returned statistics itself (otherwise infinite recursion).
491 // - The returned statistics *will* be written to the internal transcript
492 // buffer. It *will* appear in the next statistcs or transcript poll.
493 //
494 // For example, let's say the following commands are run in order:
495 // - "version"
496 // - "statistics dump" <- call it "A"
497 // - "statistics dump" <- call it "B"
498 // The output of "A" will contain the transcript of "version" and
499 // "statistics dump" (A), with the latter having empty output. The output
500 // of B will contain the trascnript of "version", "statistics dump" (A),
501 // "statistics dump" (B), with A's output populated and B's output empty.
502 const StructuredData::Array &transcript =
503 debugger.GetCommandInterpreter().GetTranscript();
504 if (transcript.GetSize() != 0) {
505 std::string buffer;
506 llvm::raw_string_ostream ss(buffer);
507 json::OStream json_os(ss);
508 transcript.Serialize(json_os);
509 if (auto json_transcript = llvm::json::parse(buffer))
510 global_stats.try_emplace("transcript",
511 std::move(json_transcript.get()));
512 else
513 LLDB_LOG_ERROR(GetLog(LLDBLog::Target), json_transcript.takeError(),
514 "failed to parse transcript JSON: {0}");
515 }
516 }
517
518 if (include_plugins) {
519 global_stats.try_emplace("plugins", PluginManager::GetJSON());
520 }
521
522 return std::move(global_stats);
523}
524
525llvm::json::Value SummaryStatistics::ToJSON() const {
526 return json::Object{{
527 {"name", GetName()},
528 {"type", GetSummaryKindName()},
529 {"count", GetSummaryCount()},
530 {"totalTime", GetTotalTime()},
531 }};
532}
533
535 std::lock_guard<std::mutex> guard(m_map_mutex);
536 json::Array json_summary_stats;
537 for (const auto &summary_stat : m_summary_stats_map)
538 json_summary_stats.emplace_back(summary_stat.second->ToJSON());
539
540 return json_summary_stats;
541}
542
544 for (const auto &summary_stat : m_summary_stats_map)
545 summary_stat.second->Reset();
546}
#define LLDB_LOG_ERROR(log, error,...)
Definition Log.h:394
static double elapsed(const StatsTimepoint &start, const StatsTimepoint &end)
static void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key, const std::string &str)
General Outline: Allows adding and removing breakpoints and find by ID and index.
void GetListMutex(std::unique_lock< std::recursive_mutex > &lock)
Sets the passed in Locker to hold the Breakpoint List mutex.
size_t GetSize() const
Returns the number of elements in this breakpoint list.
lldb::BreakpointSP GetBreakpointAtIndex(size_t i) const
Returns a shared pointer to the breakpoint with index i.
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
Definition Breakpoint.h:81
llvm::json::Value GetStatistics()
Get statistics associated with this breakpoint in JSON format.
const char * GetBreakpointKind() const
Return the "kind" description for a breakpoint.
Definition Breakpoint.h:488
uint32_t GetHitCount() const
Return the current hit count for all locations.
StatsDuration::Duration GetResolveTime() const
Get the time it took to resolve all locations in this breakpoint.
Definition Breakpoint.h:639
A uniqued constant string class.
Definition ConstString.h:40
static void ResetStatistics(Debugger &debugger, Target *target)
Reset metrics associated with one or all targets in a debugger.
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.
Definition Debugger.h:100
TargetList & GetTargetList()
Get accessor for the target list.
Definition Debugger.h:224
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition FileSpec.cpp:374
A collection class for Module objects.
Definition ModuleList.h:125
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
ModuleIterable Modules() const
Definition ModuleList.h:570
size_t GetSize() const
Gets the size of the module list.
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:90
virtual ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
Definition Module.cpp:1184
static Module * GetAllocatedModuleAtIndex(size_t idx)
Definition Module.cpp:123
static std::recursive_mutex & GetAllocationModuleCollectionMutex()
Definition Module.cpp:105
static size_t GetNumberAllocatedModules()
Definition Module.cpp:117
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
Definition ObjectFile.h:280
static llvm::json::Object GetJSON(llvm::StringRef pattern="")
A class to count time for plugins.
Definition Statistics.h:94
void merge(StatisticsMap map_to_merge)
Definition Statistics.h:105
std::chrono::duration< double > Duration
Definition Statistics.h:37
void Serialize(llvm::json::OStream &s) const override
llvm::StringMap< SummaryStatisticsSP > m_summary_stats_map
Definition Statistics.h:304
llvm::json::Value ToJSON() const
std::string GetSummaryKindName() const
Definition Statistics.h:246
std::string GetName() const
Definition Statistics.h:237
uint64_t GetSummaryCount() const
Definition Statistics.h:240
Provides public interface for all SymbolFiles.
Definition SymbolFile.h:51
virtual uint64_t GetDebugInfoSize(bool load_all_debug_info=false)=0
Metrics gathering functions.
virtual bool GetDebugInfoIndexWasLoadedFromCache() const =0
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
virtual DWOStats GetDwoStats()
Retrieves statistics about DWO files associated with this symbol file.
Definition SymbolFile.h:505
virtual bool GetDebugInfoIndexWasSavedToCache() const =0
virtual StatsDuration::Duration GetDebugInfoParseTime()
Return the time taken to parse the debug information.
Definition SymbolFile.h:434
virtual bool GetLoadDebugInfoEnabled()
Whether debug info will be loaded or not.
Definition SymbolFile.h:136
virtual bool GetDebugInfoHadFrameVariableErrors() const =0
Accessors for the bool that indicates if there was debug info, but errors stopped variables from bein...
virtual ModuleList GetDebugInfoModules()
Get the additional modules that this symbol file uses to parse debug info.
Definition SymbolFile.h:453
virtual StatsDuration::Duration GetDebugInfoIndexTime()
Return the time it took to index the debug information in the object file.
Definition SymbolFile.h:441
virtual ObjectFile * GetObjectFile()=0
bool GetWasLoadedFromCache() const
Accessors for the bool that indicates if the debug info index was loaded from, or saved to the module...
Definition Symtab.h:228
size_t GetNumSymbols() const
Definition Symtab.cpp:74
bool GetWasSavedToCache() const
Definition Symtab.h:234
TargetIterable Targets()
Definition TargetList.h:204
void Reset(Target &target)
StatsSuccessFail m_frame_var
Definition Statistics.h:334
std::optional< StatsTimepoint > m_launch_or_attach_time
Definition Statistics.h:330
void CollectStats(Target &target)
llvm::json::Value ToJSON(Target &target, const lldb_private::StatisticsOptions &options)
StatsDuration m_create_time
Definition Statistics.h:328
std::optional< StatsTimepoint > m_first_public_stop_time
Definition Statistics.h:332
StatsDuration m_load_core_time
Definition Statistics.h:329
void IncreaseSourceRealpathAttemptCount(uint32_t count)
uint32_t m_source_realpath_compatible_count
Definition Statistics.h:338
StatsSuccessFail m_expr_eval
Definition Statistics.h:333
std::vector< intptr_t > m_module_identifiers
Definition Statistics.h:335
uint32_t m_source_realpath_attempt_count
Definition Statistics.h:337
void IncreaseSourceRealpathCompatibleCount(uint32_t count)
std::optional< StatsTimepoint > m_first_private_stop_time
Definition Statistics.h:331
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:422
lldb_private::SummaryStatisticsCache & GetSummaryStatisticsCache()
Definition Target.cpp:3539
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:327
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1240
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:327
std::chrono::time_point< StatsClock > StatsTimepoint
Definition Statistics.h:30
std::shared_ptr< lldb_private::UnixSignals > UnixSignalsSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Module > ModuleSP
ConstString::MemoryStats stats
Definition Statistics.h:177
llvm::json::Value ToJSON() const
Holds statistics about DWO (Debug With Object) files.
Definition Statistics.h:124
A class that represents statistics for a since lldb_private::Module.
Definition Statistics.h:143
llvm::json::Value ToJSON() const
llvm::StringMap< llvm::json::Value > type_system_stats
Definition Statistics.h:156
StatisticsMap symbol_locator_time
Definition Statistics.h:157
std::vector< intptr_t > symfile_modules
Definition Statistics.h:155
llvm::json::Value ToJSON() const