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