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("symbolTableParsedFromObjectFile",
63 symtab_parsed_from_object_file);
64 module.try_emplace("symbolTableSavedToCache", symtab_saved_to_cache);
65 module.try_emplace("symbolTableSymbolFileAddedSymbols",
66 symtab_symbol_file_added_symbols);
67 module.try_emplace("debugInfoParseTime", debug_parse_time);
68 module.try_emplace("debugInfoIndexTime", debug_index_time);
69 module.try_emplace("debugInfoByteSize", (int64_t)debug_info_size);
70 module.try_emplace("debugInfoIndexLoadedFromCache",
71 debug_info_index_loaded_from_cache);
72 module.try_emplace("debugInfoIndexSavedToCache",
73 debug_info_index_saved_to_cache);
74 module.try_emplace("debugInfoEnabled", debug_info_enabled);
75 module.try_emplace("debugInfoHadVariableErrors",
76 debug_info_had_variable_errors);
77 module.try_emplace("debugInfoHadIncompleteTypes",
78 debug_info_had_incomplete_types);
79 module.try_emplace("symbolTableStripped", symtab_stripped);
80 module.try_emplace("symbolTableSymbolCount", symtab_symbol_count);
81 module.try_emplace("dwoFileCount", dwo_stats.dwo_file_count);
82 module.try_emplace("loadedDwoFileCount", dwo_stats.loaded_dwo_file_count);
83 module.try_emplace("dwoErrorCount", dwo_stats.dwo_error_count);
84
85 if (!symbol_locator_time.map.empty()) {
86 json::Object obj;
87 for (const auto &entry : symbol_locator_time.map)
88 obj.try_emplace(entry.first().str(), entry.second);
89 module.try_emplace("symbolLocatorTime", std::move(obj));
90 }
91
92 if (!symfile_path.empty())
93 module.try_emplace("symbolFilePath", symfile_path);
94
95 if (!symfile_modules.empty()) {
96 json::Array symfile_ids;
97 for (const auto symfile_id : symfile_modules)
98 symfile_ids.emplace_back(symfile_id);
99 module.try_emplace("symbolFileModuleIdentifiers", std::move(symfile_ids));
100 }
101
102 if (!type_system_stats.empty()) {
103 json::Array type_systems;
104 for (const auto &entry : type_system_stats) {
105 json::Object obj;
106 obj.try_emplace(entry.first().str(), entry.second);
107 type_systems.emplace_back(std::move(obj));
108 }
109 module.try_emplace("typeSystemInfo", std::move(type_systems));
110 }
111
112 return module;
113}
114
115llvm::json::Value ConstStringStats::ToJSON() const {
116 json::Object obj;
117 obj.try_emplace<int64_t>("bytesTotal", stats.GetBytesTotal());
118 obj.try_emplace<int64_t>("bytesUsed", stats.GetBytesUsed());
119 obj.try_emplace<int64_t>("bytesUnused", stats.GetBytesUnused());
120 return obj;
121}
122
123json::Value
125 const lldb_private::StatisticsOptions &options) {
126 json::Object target_metrics_json;
127 ProcessSP process_sp = target.GetProcessSP();
128 const bool summary_only = options.GetSummaryOnly();
129 const bool include_modules = options.GetIncludeModules();
130 if (!summary_only) {
131 CollectStats(target);
132
133 json::Array json_module_uuid_array;
134 for (auto module_identifier : m_module_identifiers)
135 json_module_uuid_array.emplace_back(module_identifier);
136
137 target_metrics_json.try_emplace("expressionEvaluation",
138 m_expr_eval.ToJSON());
139 target_metrics_json.try_emplace("frameVariable", m_frame_var.ToJSON());
140 if (include_modules)
141 target_metrics_json.try_emplace("moduleIdentifiers",
142 std::move(json_module_uuid_array));
143
145 double elapsed_time =
147 target_metrics_json.try_emplace("launchOrAttachTime", elapsed_time);
148 }
150 double elapsed_time =
152 target_metrics_json.try_emplace("firstStopTime", elapsed_time);
153 }
154 target_metrics_json.try_emplace("targetCreateTime",
155 m_create_time.get().count());
156
157 if (m_load_core_time.get().count() > 0) {
158 target_metrics_json.try_emplace("loadCoreTime",
159 m_load_core_time.get().count());
160 }
161
162 json::Array breakpoints_array;
163 double totalBreakpointResolveTime = 0.0;
164 // Report both the normal breakpoint list and the internal breakpoint list.
165 for (int i = 0; i < 2; ++i) {
166 BreakpointList &breakpoints = target.GetBreakpointList(i == 1);
167 std::unique_lock<std::recursive_mutex> lock;
168 breakpoints.GetListMutex(lock);
169 size_t num_breakpoints = breakpoints.GetSize();
170 for (size_t i = 0; i < num_breakpoints; i++) {
171 Breakpoint *bp = breakpoints.GetBreakpointAtIndex(i).get();
172 breakpoints_array.push_back(bp->GetStatistics());
173 totalBreakpointResolveTime += bp->GetResolveTime().count();
174 }
175 }
176 target_metrics_json.try_emplace("breakpoints",
177 std::move(breakpoints_array));
178 target_metrics_json.try_emplace("totalBreakpointResolveTime",
179 totalBreakpointResolveTime);
180
181 if (process_sp) {
182 UnixSignalsSP unix_signals_sp = process_sp->GetUnixSignals();
183 if (unix_signals_sp)
184 target_metrics_json.try_emplace(
185 "signals", unix_signals_sp->GetHitCountStatistics());
186 }
187 }
188
189 // Counting "totalSharedLibraryEventHitCount" from breakpoints of kind
190 // "shared-library-event".
191 {
192 uint32_t shared_library_event_breakpoint_hit_count = 0;
193 // The "shared-library-event" is only found in the internal breakpoint list.
194 BreakpointList &breakpoints = target.GetBreakpointList(/* internal */ true);
195 std::unique_lock<std::recursive_mutex> lock;
196 breakpoints.GetListMutex(lock);
197 size_t num_breakpoints = breakpoints.GetSize();
198 for (size_t i = 0; i < num_breakpoints; i++) {
199 Breakpoint *bp = breakpoints.GetBreakpointAtIndex(i).get();
200 if (strcmp(bp->GetBreakpointKind(), "shared-library-event") == 0)
201 shared_library_event_breakpoint_hit_count += bp->GetHitCount();
202 }
203
204 target_metrics_json.try_emplace("totalSharedLibraryEventHitCount",
205 shared_library_event_breakpoint_hit_count);
206 }
207
208 if (process_sp) {
209 uint32_t stop_id = process_sp->GetStopID();
210 target_metrics_json.try_emplace("stopCount", stop_id);
211
212 llvm::StringRef dyld_plugin_name;
213 if (process_sp->GetDynamicLoader())
214 dyld_plugin_name = process_sp->GetDynamicLoader()->GetPluginName();
215 target_metrics_json.try_emplace("dyldPluginName", dyld_plugin_name);
216
217 if (process_sp->GetCoreFile())
218 target_metrics_json.try_emplace(
219 "coreFile", process_sp->GetCoreFile().GetFilename().str());
220 }
221 target_metrics_json.try_emplace("sourceMapDeduceCount",
223 target_metrics_json.try_emplace("sourceRealpathAttemptCount",
225 target_metrics_json.try_emplace("sourceRealpathCompatibleCount",
227 target_metrics_json.try_emplace("summaryProviderStatistics",
229 return target_metrics_json;
230}
231
236 // Report both the normal breakpoint list and the internal breakpoint list.
237 for (int i = 0; i < 2; ++i) {
238 BreakpointList &breakpoints = target.GetBreakpointList(i == 1);
239 std::unique_lock<std::recursive_mutex> lock;
240 breakpoints.GetListMutex(lock);
241 size_t num_breakpoints = breakpoints.GetSize();
242 for (size_t i = 0; i < num_breakpoints; i++) {
243 Breakpoint *bp = breakpoints.GetBreakpointAtIndex(i).get();
244 bp->ResetStatistics();
245 }
246 }
248}
249
251 m_launch_or_attach_time = StatsClock::now();
252 m_first_private_stop_time = std::nullopt;
253}
254
256 // Launching and attaching has many paths depending on if synchronous mode
257 // was used or if we are stopping at the entry point or not. Only set the
258 // first stop time if it hasn't already been set.
260 m_first_private_stop_time = StatsClock::now();
261}
262
264 // Launching and attaching has many paths depending on if synchronous mode
265 // was used or if we are stopping at the entry point or not. Only set the
266 // first stop time if it hasn't already been set.
268 m_first_public_stop_time = StatsClock::now();
269}
270
274
278
282
284
286 std::lock_guard<std::recursive_mutex> guard(
288 const uint64_t num_modules = target != nullptr
289 ? target->GetImages().GetSize()
291 for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
292 Module *module = target != nullptr
293 ? target->GetImages().GetModuleAtIndex(image_idx).get()
295 if (module == nullptr)
296 continue;
297 module->ResetStatistics();
298 }
299 if (target)
300 target->ResetStatistics();
301 else {
302 for (const auto &target : debugger.GetTargetList().Targets())
303 target->ResetStatistics();
304 }
305}
306
308 Debugger &debugger, Target *target,
309 const lldb_private::StatisticsOptions &options) {
310
311 const bool summary_only = options.GetSummaryOnly();
312 const bool load_all_debug_info = options.GetLoadAllDebugInfo();
313 const bool include_targets = options.GetIncludeTargets();
314 const bool include_modules = options.GetIncludeModules();
315 const bool include_transcript = options.GetIncludeTranscript();
316 const bool include_plugins = options.GetIncludePlugins();
317
318 json::Array json_targets;
319 json::Array json_modules;
320 StatisticsMap symbol_locator_total_time;
321 double symtab_parse_time = 0.0;
322 double symtab_index_time = 0.0;
323 double debug_parse_time = 0.0;
324 double debug_index_time = 0.0;
325 uint32_t symtabs_loaded = 0;
326 uint32_t symtabs_loaded_from_cache = 0;
327 uint32_t symtabs_parsed_from_object_file = 0;
328 uint32_t symtabs_saved_to_cache = 0;
329 uint32_t symtabs_symbol_file_added_symbols = 0;
330 uint32_t debug_index_loaded = 0;
331 uint32_t debug_index_saved = 0;
332 uint64_t debug_info_size = 0;
333
334 std::lock_guard<std::recursive_mutex> guard(
336 const uint64_t num_modules = target != nullptr
337 ? target->GetImages().GetSize()
339 uint32_t num_debug_info_enabled_modules = 0;
340 uint32_t num_modules_has_debug_info = 0;
341 uint32_t num_modules_with_variable_errors = 0;
342 uint32_t num_modules_with_incomplete_types = 0;
343 uint32_t num_stripped_modules = 0;
344 uint32_t symtab_symbol_count = 0;
345 DWOStats total_dwo_stats;
346 for (size_t image_idx = 0; image_idx < num_modules; ++image_idx) {
347 Module *module = target != nullptr
348 ? target->GetImages().GetModuleAtIndex(image_idx).get()
350 ModuleStats module_stat;
351 module_stat.symtab_parse_time = module->GetSymtabParseTime().get().count();
352 module_stat.symtab_index_time = module->GetSymtabIndexTime().get().count();
353 module_stat.symbol_locator_time = module->GetSymbolLocatorStatistics();
354 symbol_locator_total_time.merge(module_stat.symbol_locator_time);
355 Symtab *symtab = module->GetSymtab(/*can_create=*/false);
356 if (symtab) {
357 module_stat.symtab_symbol_count = symtab->GetNumSymbols();
358 symtab_symbol_count += module_stat.symtab_symbol_count;
359 ++symtabs_loaded;
360 const uint32_t state = symtab->GetState();
361 module_stat.symtab_loaded_from_cache =
362 state & eSymtabStateLoadedFromCache;
363 if (module_stat.symtab_loaded_from_cache)
364 ++symtabs_loaded_from_cache;
366 state & eSymtabStateParsedFromObjectFile;
367 if (module_stat.symtab_parsed_from_object_file)
368 ++symtabs_parsed_from_object_file;
369 module_stat.symtab_saved_to_cache = state & eSymtabStateSavedToCache;
370 if (module_stat.symtab_saved_to_cache)
371 ++symtabs_saved_to_cache;
373 state & eSymtabStateSymbolFileAddedSymbols;
374 if (module_stat.symtab_symbol_file_added_symbols)
375 ++symtabs_symbol_file_added_symbols;
376 }
377 SymbolFile *sym_file = module->GetSymbolFile(/*can_create=*/false);
378 if (sym_file) {
379 // Only record on include_modules, as `GetObjectFile` and
380 // `GetDebugInfoModules` may be expensive to parse.
381 if (!summary_only && include_modules) {
382 if (sym_file->GetObjectFile() != module->GetObjectFile())
383 module_stat.symfile_path =
384 sym_file->GetObjectFile()->GetFileSpec().GetPath();
385 ModuleList symbol_modules = sym_file->GetDebugInfoModules();
386 for (const auto &symbol_module : symbol_modules.Modules())
387 module_stat.symfile_modules.push_back((intptr_t)symbol_module.get());
388 }
389 DWOStats current_dwo_stats = sym_file->GetDwoStats();
390 module_stat.dwo_stats += current_dwo_stats;
391 total_dwo_stats += current_dwo_stats;
395 ++debug_index_loaded;
398 if (module_stat.debug_info_index_saved_to_cache)
399 ++debug_index_saved;
400 module_stat.debug_index_time = sym_file->GetDebugInfoIndexTime().count();
401 module_stat.debug_parse_time = sym_file->GetDebugInfoParseTime().count();
402 module_stat.debug_info_size =
403 sym_file->GetDebugInfoSize(load_all_debug_info);
404 module_stat.symtab_stripped = module->GetObjectFile()->IsStripped();
405 if (module_stat.symtab_stripped)
406 ++num_stripped_modules;
407 module_stat.debug_info_enabled = sym_file->GetLoadDebugInfoEnabled() &&
408 module_stat.debug_info_size > 0;
411 if (module_stat.debug_info_enabled)
412 ++num_debug_info_enabled_modules;
413 if (module_stat.debug_info_size > 0)
414 ++num_modules_has_debug_info;
415 if (module_stat.debug_info_had_variable_errors)
416 ++num_modules_with_variable_errors;
417 }
418 symtab_parse_time += module_stat.symtab_parse_time;
419 symtab_index_time += module_stat.symtab_index_time;
420 debug_parse_time += module_stat.debug_parse_time;
421 debug_index_time += module_stat.debug_index_time;
422 debug_info_size += module_stat.debug_info_size;
423 module->ForEachTypeSystem([&](lldb::TypeSystemSP ts) {
424 if (auto stats = ts->ReportStatistics())
425 module_stat.type_system_stats.insert({ts->GetPluginName(), *stats});
426 if (ts->GetHasForcefullyCompletedTypes())
427 module_stat.debug_info_had_incomplete_types = true;
428 return true;
429 });
430 if (module_stat.debug_info_had_incomplete_types)
431 ++num_modules_with_incomplete_types;
432
433 if (include_modules) {
434 module_stat.identifier = (intptr_t)module;
435 module_stat.path = module->GetFileSpec().GetPath();
436 if (llvm::StringRef object_name = module->GetObjectName();
437 !object_name.empty()) {
438 module_stat.path.append(1, '(');
439 module_stat.path.append(object_name.str());
440 module_stat.path.append(1, ')');
441 }
442 module_stat.uuid = module->GetUUID().GetAsString();
443 module_stat.triple = module->GetArchitecture().GetTriple().str();
444 json_modules.emplace_back(module_stat.ToJSON());
445 }
446 }
447
448 json::Object global_stats{
449 {"totalSymbolTableParseTime", symtab_parse_time},
450 {"totalSymbolTableIndexTime", symtab_index_time},
451 {"totalSymbolTablesLoaded", symtabs_loaded},
452 {"totalSymbolTablesLoadedFromCache", symtabs_loaded_from_cache},
453 {"totalSymbolTablesParsedFromObjectFile",
454 symtabs_parsed_from_object_file},
455 {"totalSymbolTablesSavedToCache", symtabs_saved_to_cache},
456 {"totalSymbolTablesSymbolFileAddedSymbols",
457 symtabs_symbol_file_added_symbols},
458 {"totalDebugInfoParseTime", debug_parse_time},
459 {"totalDebugInfoIndexTime", debug_index_time},
460 {"totalDebugInfoIndexLoadedFromCache", debug_index_loaded},
461 {"totalDebugInfoIndexSavedToCache", debug_index_saved},
462 {"totalDebugInfoByteSize", debug_info_size},
463 {"totalModuleCount", num_modules},
464 {"totalModuleCountHasDebugInfo", num_modules_has_debug_info},
465 {"totalModuleCountWithVariableErrors", num_modules_with_variable_errors},
466 {"totalModuleCountWithIncompleteTypes",
467 num_modules_with_incomplete_types},
468 {"totalDebugInfoEnabled", num_debug_info_enabled_modules},
469 {"totalSymbolTableStripped", num_stripped_modules},
470 {"totalSymbolTableSymbolCount", symtab_symbol_count},
471 {"totalLoadedDwoFileCount", total_dwo_stats.loaded_dwo_file_count},
472 {"totalDwoFileCount", total_dwo_stats.dwo_file_count},
473 {"totalDwoErrorCount", total_dwo_stats.dwo_error_count},
474 };
475
476 if (include_targets) {
477 if (target) {
478 json_targets.emplace_back(target->ReportStatistics(options));
479 } else {
480 for (const auto &target : debugger.GetTargetList().Targets())
481 json_targets.emplace_back(target->ReportStatistics(options));
482 }
483 global_stats.try_emplace("targets", std::move(json_targets));
484 }
485
486 if (!symbol_locator_total_time.map.empty()) {
487 json::Object obj;
488 for (const auto &entry : symbol_locator_total_time.map)
489 obj.try_emplace(entry.first().str(), entry.second);
490 global_stats.try_emplace("totalSymbolLocatorTime", std::move(obj));
491 }
492
493 ConstStringStats const_string_stats;
494 json::Object json_memory{
495 {"strings", const_string_stats.ToJSON()},
496 };
497 global_stats.try_emplace("memory", std::move(json_memory));
498 if (!summary_only) {
499 json::Value cmd_stats = debugger.GetCommandInterpreter().GetStatistics();
500 global_stats.try_emplace("commands", std::move(cmd_stats));
501 }
502
503 if (include_modules) {
504 global_stats.try_emplace("modules", std::move(json_modules));
505 }
506
507 if (include_transcript) {
508 // When transcript is available, add it to the to-be-returned statistics.
509 //
510 // NOTE:
511 // When the statistics is polled by an LLDB command:
512 // - The transcript in the returned statistics *will NOT* contain the
513 // returned statistics itself (otherwise infinite recursion).
514 // - The returned statistics *will* be written to the internal transcript
515 // buffer. It *will* appear in the next statistcs or transcript poll.
516 //
517 // For example, let's say the following commands are run in order:
518 // - "version"
519 // - "statistics dump" <- call it "A"
520 // - "statistics dump" <- call it "B"
521 // The output of "A" will contain the transcript of "version" and
522 // "statistics dump" (A), with the latter having empty output. The output
523 // of B will contain the trascnript of "version", "statistics dump" (A),
524 // "statistics dump" (B), with A's output populated and B's output empty.
525 const StructuredData::Array &transcript =
526 debugger.GetCommandInterpreter().GetTranscript();
527 if (transcript.GetSize() != 0) {
528 std::string buffer;
529 llvm::raw_string_ostream ss(buffer);
530 json::OStream json_os(ss);
531 transcript.Serialize(json_os);
532 if (auto json_transcript = llvm::json::parse(buffer))
533 global_stats.try_emplace("transcript",
534 std::move(json_transcript.get()));
535 else
536 LLDB_LOG_ERROR(GetLog(LLDBLog::Target), json_transcript.takeError(),
537 "failed to parse transcript JSON: {0}");
538 }
539 }
540
541 if (include_plugins) {
542 global_stats.try_emplace("plugins", PluginManager::GetJSON());
543 }
544
545 return std::move(global_stats);
546}
547
548llvm::json::Value SummaryStatistics::ToJSON() const {
549 return json::Object{{
550 {"name", GetName()},
551 {"type", GetSummaryKindName()},
552 {"count", GetSummaryCount()},
553 {"totalTime", GetTotalTime()},
554 }};
555}
556
558 std::lock_guard<std::mutex> guard(m_map_mutex);
559 json::Array json_summary_stats;
560 for (const auto &summary_stat : m_summary_stats_map)
561 json_summary_stats.emplace_back(summary_stat.second->ToJSON());
562
563 return json_summary_stats;
564}
565
567 for (const auto &summary_stat : m_summary_stats_map)
568 summary_stat.second->Reset();
569}
#define LLDB_LOG_ERROR(log, error,...)
Definition Log.h:405
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:83
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:491
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:642
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:106
TargetList & GetTargetList()
Get accessor for the target list.
Definition Debugger.h:230
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition FileSpec.cpp:380
A collection class for Module objects.
Definition ModuleList.h:127
lldb::ModuleSP GetModuleAtIndex(size_t idx) const
Get the module shared pointer for the module at index idx.
ModuleIterable Modules() const
Definition ModuleList.h:573
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:92
virtual ObjectFile * GetObjectFile()
Get the object file representation for the current architecture.
Definition Module.cpp:1208
static Module * GetAllocatedModuleAtIndex(size_t idx)
Definition Module.cpp:121
static std::recursive_mutex & GetAllocationModuleCollectionMutex()
Definition Module.cpp:104
static size_t GetNumberAllocatedModules()
Definition Module.cpp:115
virtual FileSpec & GetFileSpec()
Get accessor to the object file specification.
Definition ObjectFile.h:284
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:306
llvm::json::Value ToJSON() const
std::string GetSummaryKindName() const
Definition Statistics.h:248
std::string GetName() const
Definition Statistics.h:239
uint64_t GetSummaryCount() const
Definition Statistics.h:242
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:518
virtual bool GetDebugInfoIndexWasSavedToCache() const =0
virtual StatsDuration::Duration GetDebugInfoParseTime()
Return the time taken to parse the debug information.
Definition SymbolFile.h:447
virtual bool GetLoadDebugInfoEnabled()
Whether debug info will be loaded or not.
Definition SymbolFile.h:141
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:466
virtual StatsDuration::Duration GetDebugInfoIndexTime()
Return the time it took to index the debug information in the object file.
Definition SymbolFile.h:454
virtual ObjectFile * GetObjectFile()=0
size_t GetNumSymbols() const
Definition Symtab.cpp:75
uint32_t GetState() const
Returns a bitmask of lldb::SymtabState flags describing the state of this symbol table.
Definition Symtab.h:236
TargetIterable Targets()
Definition TargetList.h:204
void Reset(Target &target)
StatsSuccessFail m_frame_var
Definition Statistics.h:336
std::optional< StatsTimepoint > m_launch_or_attach_time
Definition Statistics.h:332
void CollectStats(Target &target)
llvm::json::Value ToJSON(Target &target, const lldb_private::StatisticsOptions &options)
StatsDuration m_create_time
Definition Statistics.h:330
std::optional< StatsTimepoint > m_first_public_stop_time
Definition Statistics.h:334
StatsDuration m_load_core_time
Definition Statistics.h:331
void IncreaseSourceRealpathAttemptCount(uint32_t count)
uint32_t m_source_realpath_compatible_count
Definition Statistics.h:340
StatsSuccessFail m_expr_eval
Definition Statistics.h:335
std::vector< intptr_t > m_module_identifiers
Definition Statistics.h:337
uint32_t m_source_realpath_attempt_count
Definition Statistics.h:339
void IncreaseSourceRealpathCompatibleCount(uint32_t count)
std::optional< StatsTimepoint > m_first_private_stop_time
Definition Statistics.h:333
BreakpointList & GetBreakpointList(bool internal=false)
Definition Target.cpp:443
lldb_private::SummaryStatisticsCache & GetSummaryStatisticsCache()
Definition Target.cpp:3620
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:335
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1283
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:338
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:179
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