} // namespace lldb_private
+#define LLDB_SCOPED_TIMER() \
+ static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \
+ ::lldb_private::Timer _scoped_timer(_cat, LLVM_PRETTY_FUNCTION)
+#define LLDB_SCOPED_TIMERF(...) \
+ static ::lldb_private::Timer::Category _cat(LLVM_PRETTY_FUNCTION); \
+ ::lldb_private::Timer _scoped_timer(_cat, __VA_ARGS__)
+
#endif // LLDB_UTILITY_TIMER_H
}
void SystemInitializerFull::Terminate() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
-
Debugger::SettingsTerminate();
// Terminate plug-ins in core LLDB
}
const char *file_path = command.GetArgumentAtIndex(0);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "(lldb) target create '%s'", file_path);
+ LLDB_SCOPED_TIMERF("(lldb) target create '%s'", file_path);
FileSpec file_spec;
if (file_path) {
DisassemblerSP Disassembler::FindPlugin(const ArchSpec &arch,
const char *flavor,
const char *plugin_name) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "Disassembler::FindPlugin (arch = %s, plugin_name = %s)",
+ LLDB_SCOPED_TIMERF("Disassembler::FindPlugin (arch = %s, plugin_name = %s)",
arch.GetArchitectureName(), plugin_name);
DisassemblerCreateInstance create_callback = nullptr;
bool Mangled::DemangleWithRichManglingInfo(
RichManglingContext &context, SkipMangledNameFn *skip_mangled_name) {
// We need to generate and cache the demangled name.
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "Mangled::DemangleWithRichNameIndexInfo (m_mangled = %s)",
+ LLDB_SCOPED_TIMERF("Mangled::DemangleWithRichNameIndexInfo (m_mangled = %s)",
m_mangled.GetCString());
// Others are not meant to arrive here. ObjC names or C's main() for example
// already decoded our mangled name.
if (m_mangled && m_demangled.IsNull()) {
// We need to generate and cache the demangled name.
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "Mangled::GetDemangledName (m_mangled = %s)",
+ LLDB_SCOPED_TIMERF("Mangled::GetDemangledName (m_mangled = %s)",
m_mangled.GetCString());
// Don't bother running anything that isn't mangled
size_t Module::GetNumCompileUnits() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "Module::GetNumCompileUnits (module = %p)",
+ LLDB_SCOPED_TIMERF("Module::GetNumCompileUnits (module = %p)",
static_cast<void *>(this));
if (SymbolFile *symbols = GetSymbolFile())
return symbols->GetNumCompileUnits();
bool Module::ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "Module::ResolveFileAddress (vm_addr = 0x%" PRIx64 ")",
+ LLDB_SCOPED_TIMERF("Module::ResolveFileAddress (vm_addr = 0x%" PRIx64 ")",
vm_addr);
SectionList *section_list = GetSectionList();
if (section_list)
const FileSpec &file_spec, uint32_t line, bool check_inlines,
lldb::SymbolContextItem resolve_scope, SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "Module::ResolveSymbolContextForFilePath (%s:%u, "
+ LLDB_SCOPED_TIMERF("Module::ResolveSymbolContextForFilePath (%s:%u, "
"check_inlines = %s, resolve_scope = 0x%8.8x)",
file_spec.GetPath().c_str(), line,
check_inlines ? "yes" : "no", resolve_scope);
size_t max_matches,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeMap &types) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
if (SymbolFile *symbols = GetSymbolFile())
symbols->FindTypes(name, parent_decl_ctx, max_matches,
searched_symbol_files, types);
llvm::ArrayRef<CompilerContext> pattern, LanguageSet languages,
llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files,
TypeMap &types) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
if (SymbolFile *symbols = GetSymbolFile())
symbols->FindTypes(pattern, languages, searched_symbol_files, types);
}
if (!m_did_load_symfile.load() && can_create) {
ObjectFile *obj_file = GetObjectFile();
if (obj_file != nullptr) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
m_symfile_up.reset(
SymbolVendor::FindPlugin(shared_from_this(), feedback_strm));
m_did_load_symfile = true;
if (!m_did_load_objfile.load()) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (!m_did_load_objfile.load()) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "Module::GetObjectFile () module = %s",
+ LLDB_SCOPED_TIMERF("Module::GetObjectFile () module = %s",
GetFileSpec().GetFilename().AsCString(""));
lldb::offset_t data_offset = 0;
lldb::offset_t file_size = 0;
const Symbol *Module::FindFirstSymbolWithNameAndType(ConstString name,
SymbolType symbol_type) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat, "Module::FindFirstSymbolWithNameAndType (name = %s, type = %i)",
+ LLDB_SCOPED_TIMERF(
+ "Module::FindFirstSymbolWithNameAndType (name = %s, type = %i)",
name.AsCString(), symbol_type);
if (Symtab *symtab = GetSymtab())
return symtab->FindFirstSymbolWithNameAndType(
void Module::FindFunctionSymbols(ConstString name,
uint32_t name_type_mask,
SymbolContextList &sc_list) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "Module::FindSymbolsFunctions (name = %s, mask = 0x%8.8x)",
+ LLDB_SCOPED_TIMERF("Module::FindSymbolsFunctions (name = %s, mask = 0x%8.8x)",
name.AsCString(), name_type_mask);
if (Symtab *symtab = GetSymtab())
symtab->FindFunctionSymbols(name, name_type_mask, sc_list);
SymbolContextList &sc_list) {
// No need to protect this call using m_mutex all other method calls are
// already thread safe.
-
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat, "Module::FindSymbolsWithNameAndType (name = %s, type = %i)",
+ LLDB_SCOPED_TIMERF(
+ "Module::FindSymbolsWithNameAndType (name = %s, type = %i)",
name.AsCString(), symbol_type);
if (Symtab *symtab = GetSymtab()) {
std::vector<uint32_t> symbol_indexes;
SymbolContextList &sc_list) {
// No need to protect this call using m_mutex all other method calls are
// already thread safe.
-
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat,
+ LLDB_SCOPED_TIMERF(
"Module::FindSymbolsMatchingRegExAndType (regex = %s, type = %i)",
regex.GetText().str().c_str(), symbol_type);
if (Symtab *symtab = GetSymtab()) {
if (error)
return error;
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
process_gdb_remote::ProcessGDBRemoteLog::Initialize();
}
void SystemInitializerCommon::Terminate() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
#if defined(_WIN32)
ProcessWindowsLog::Terminate();
}
void CommandInterpreter::Initialize() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
CommandReturnObject result(m_debugger.GetUseColor());
m_command_dict[NAME] = std::make_shared<CLASS>(*this);
void CommandInterpreter::LoadCommandDictionary() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
REGISTER_COMMAND_OBJECT("apropos", CommandObjectApropos);
REGISTER_COMMAND_OBJECT("breakpoint", CommandObjectMultiwordBreakpoint);
command_line);
LLDB_LOGF(log, "Processing command: %s", command_line);
-
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "Handling command: %s.", command_line);
+ LLDB_SCOPED_TIMERF("Processing command: %s.", command_line);
if (!no_context_switching)
UpdateExecutionContext(override_context);
CPPLanguageRuntime::LibCppStdFunctionCallableInfo
CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo(
lldb::ValueObjectSP &valobj_sp) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "CPPLanguageRuntime::FindLibCppStdFunctionCallableInfo");
+ LLDB_SCOPED_TIMER();
LibCppStdFunctionCallableInfo optional_info;
}
void AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded() {
- Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_TYPES));
+ LLDB_SCOPED_TIMER();
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_TYPES));
// Else we need to check with our process to see when the map was updated.
Process *process = GetProcess();
DataExtractor data;
data.SetData(data_sp, data_offset, length);
if (file && data_sp && ObjectContainerBSDArchive::MagicBytesMatch(data)) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat,
+ LLDB_SCOPED_TIMERF(
"ObjectContainerBSDArchive::CreateInstance (module = %s, file = "
"%p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
module_sp->GetFileSpec().GetPath().c_str(),
uint32_t core_notes_crc = 0;
if (!gnu_debuglink_crc) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- lldb_private::Timer scoped_timer(
- func_cat,
+ LLDB_SCOPED_TIMERF(
"Calculating module crc32 %s with size %" PRIu64 " KiB",
file.GetLastPathComponent().AsCString(),
(length - file_offset) / 1024);
enum { DebugSymbols = true, NonDebugSymbols = false };
size_t ObjectFileMachO::ParseSymtab() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "ObjectFileMachO::ParseSymtab () module = %s",
+ LLDB_SCOPED_TIMERF("ObjectFileMachO::ParseSymtab () module = %s",
m_file.GetFilename().AsCString(""));
ModuleSP module_sp(GetModule());
if (!module_sp)
}
void ScriptInterpreterLua::ExecuteInterpreterLoop() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
// At the moment, the only time the debugger does not have an input file
// handle is when this is called directly from lua, in which case it is
}
void ScriptInterpreterPythonImpl::ExecuteInterpreterLoop() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
Debugger &debugger = m_debugger;
StructuredData::ObjectSP &callee_wrapper_sp,
const TypeSummaryOptions &options, std::string &retval) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
if (!valobj.get()) {
retval.assign("<no object>");
g_initialized = true;
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
// RAII-based initialization which correctly handles multiple-initialization,
// version- specific differences among Python 2 and Python 3, and saving and
}
void DWARFDebugAranges::Sort(bool minimize) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
+ LLDB_SCOPED_TIMERF("%s this = %p", LLVM_PRETTY_FUNCTION,
static_cast<void *>(this));
m_aranges.Sort();
if (m_first_die)
return; // Already parsed
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%8.8x: DWARFUnit::ExtractUnitDIEIfNeeded()",
- GetOffset());
+ LLDB_SCOPED_TIMERF("%8.8x: DWARFUnit::ExtractUnitDIEIfNeeded()", GetOffset());
// Set the offset to that of the first DIE and calculate the start of the
// next compilation unit header.
void DWARFUnit::ExtractDIEsRWLocked() {
llvm::sys::ScopedWriter first_die_lock(m_first_die_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%8.8x: DWARFUnit::ExtractDIEsIfNeeded()",
- GetOffset());
+ LLDB_SCOPED_TIMERF("%8.8x: DWARFUnit::ExtractDIEsIfNeeded()", GetOffset());
// Set the offset to that of the first DIE and calculate the start of the
// next compilation unit header.
SymbolFileDWARF &main_dwarf = *m_dwarf;
m_dwarf = nullptr;
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%p", static_cast<void *>(&main_dwarf));
+ LLDB_SCOPED_TIMERF("%p", static_cast<void *>(&main_dwarf));
DWARFDebugInfo &main_info = main_dwarf.DebugInfo();
SymbolFileDWARFDwo *dwp_dwarf = main_dwarf.GetDwpSymbolFile().get();
DWARFDebugInfo &SymbolFileDWARF::DebugInfo() {
llvm::call_once(m_info_once_flag, [&] {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
+ LLDB_SCOPED_TIMERF("%s this = %p", LLVM_PRETTY_FUNCTION,
static_cast<void *>(this));
m_info = std::make_unique<DWARFDebugInfo>(*this, m_context);
});
DWARFDebugRanges *SymbolFileDWARF::GetDebugRanges() {
if (!m_ranges) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s this = %p", LLVM_PRETTY_FUNCTION,
+ LLDB_SCOPED_TIMERF("%s this = %p", LLVM_PRETTY_FUNCTION,
static_cast<void *>(this));
if (m_context.getOrLoadRangesData().GetByteSize() > 0)
}
size_t SymbolFileDWARF::ParseFunctions(CompileUnit &comp_unit) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "SymbolFileDWARF::ParseFunctions");
+ LLDB_SCOPED_TIMER();
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
DWARFUnit *dwarf_cu = GetDWARFCompileUnit(&comp_unit);
if (!dwarf_cu)
SymbolContextItem resolve_scope,
SymbolContext &sc) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "SymbolFileDWARF::"
+ LLDB_SCOPED_TIMERF("SymbolFileDWARF::"
"ResolveSymbolContext (so_addr = { "
"section = %p, offset = 0x%" PRIx64
" }, resolve_scope = 0x%8.8x)",
bool include_inlines,
SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "SymbolFileDWARF::FindFunctions (name = '%s')",
+ LLDB_SCOPED_TIMERF("SymbolFileDWARF::FindFunctions (name = '%s')",
name.AsCString());
// eFunctionNameTypeAuto should be pre-resolved by a call to
bool include_inlines,
SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "SymbolFileDWARF::FindFunctions (regex = '%s')",
+ LLDB_SCOPED_TIMERF("SymbolFileDWARF::FindFunctions (regex = '%s')",
regex.GetText().str().c_str());
Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
FunctionNameType name_type_mask, bool include_inlines,
SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "SymbolFileDWARFDebugMap::FindFunctions (name = %s)",
+ LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::FindFunctions (name = %s)",
name.GetCString());
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
bool include_inlines,
SymbolContextList &sc_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "SymbolFileDWARFDebugMap::FindFunctions (regex = '%s')",
+ LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::FindFunctions (regex = '%s')",
regex.GetText().str().c_str());
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
lldb::TypeClass type_mask,
TypeList &type_list) {
std::lock_guard<std::recursive_mutex> guard(GetModuleMutex());
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "SymbolFileDWARFDebugMap::GetTypes (type_mask = 0x%8.8x)",
+ LLDB_SCOPED_TIMERF("SymbolFileDWARFDebugMap::GetTypes (type_mask = 0x%8.8x)",
type_mask);
SymbolFileDWARF *oso_dwarf = nullptr;
if (!fspec)
fspec = obj_file->GetDebugLink().getValueOr(FileSpec());
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "SymbolVendorELF::CreateInstance (module = %s)",
+ LLDB_SCOPED_TIMERF("SymbolVendorELF::CreateInstance (module = %s)",
module_sp->GetFileSpec().GetPath().c_str());
ModuleSpec module_spec;
lldb::eSectionTypeDWARFDebugInfo, true))
return nullptr;
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "SymbolVendorWasm::CreateInstance (module = %s)",
+ LLDB_SCOPED_TIMERF("SymbolVendorWasm::CreateInstance (module = %s)",
module_sp->GetFileSpec().GetPath().c_str());
ModuleSpec module_spec;
lldb::FunctionSP CompileUnit::FindFunction(
llvm::function_ref<bool(const FunctionSP &)> matching_lambda) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "CompileUnit::FindFunction");
+ LLDB_SCOPED_TIMER();
lldb::ModuleSP module = CalculateSymbolContextModule();
if (m_fde_index_initialized) // if two threads hit the locker
return;
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s - %s", LLVM_PRETTY_FUNCTION,
+ LLDB_SCOPED_TIMERF("%s - %s", LLVM_PRETTY_FUNCTION,
m_objfile.GetFileSpec().GetFilename().AsCString(""));
bool clear_address_zeroth_bit = false;
const ArchSpec *arch = module_spec.GetArchitecturePtr();
const UUID *uuid = module_spec.GetUUIDPtr();
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat,
+ LLDB_SCOPED_TIMERF(
"LocateExecutableSymbolFileDsym (file = %s, arch = %s, uuid = %p)",
exec_fspec ? exec_fspec->GetFilename().AsCString("<NULL>") : "<NULL>",
arch ? arch->GetArchitectureName() : "<NULL>", (const void *)uuid);
const FileSpec &exec_fspec = module_spec.GetFileSpec();
const ArchSpec *arch = module_spec.GetArchitecturePtr();
const UUID *uuid = module_spec.GetUUIDPtr();
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat, "LocateExecutableObjectFile (file = %s, arch = %s, uuid = %p)",
+ LLDB_SCOPED_TIMERF(
+ "LocateExecutableObjectFile (file = %s, arch = %s, uuid = %p)",
exec_fspec ? exec_fspec.GetFilename().AsCString("<NULL>") : "<NULL>",
arch ? arch->GetArchitectureName() : "<NULL>", (const void *)uuid);
ObjectFileSP object_file_sp;
if (module_sp) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat,
+ LLDB_SCOPED_TIMERF(
"ObjectFile::FindPlugin (module = %s, file = %p, file_offset = "
"0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
module_sp->GetFileSpec().GetPath().c_str(),
ObjectFileSP object_file_sp;
if (module_sp) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "ObjectFile::FindPlugin (module = "
+ LLDB_SCOPED_TIMERF("ObjectFile::FindPlugin (module = "
"%s, process = %p, header_addr = "
"0x%" PRIx64 ")",
module_sp->GetFileSpec().GetPath().c_str(),
// Protected function, no need to lock mutex...
if (!m_name_indexes_computed) {
m_name_indexes_computed = true;
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
// Create the name index vector to be able to quickly search by name
const size_t num_symbols = m_symbols.size();
m_name_to_index.Reserve(num_symbols);
void Symtab::AppendSymbolNamesToMap(const IndexCollection &indexes,
bool add_demangled, bool add_mangled,
NameToIndexMap &name_to_index_map) const {
+ LLDB_SCOPED_TIMER();
if (add_demangled || add_mangled) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
std::lock_guard<std::recursive_mutex> guard(m_mutex);
// Create the name index vector to be able to quickly search by name
void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes,
bool remove_duplicates) const {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
-
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
// No need to sort if we have zero or one items...
if (indexes.size() <= 1)
return;
std::vector<uint32_t> &indexes) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
if (symbol_name) {
if (!m_name_indexes_computed)
InitNameIndexes();
std::vector<uint32_t> &indexes) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
if (symbol_name) {
const size_t old_size = indexes.size();
if (!m_name_indexes_computed)
std::vector<uint32_t> &symbol_indexes) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
// Initialize all of the lookup by name indexes before converting NAME to a
// uniqued string NAME_STR below.
if (!m_name_indexes_computed)
Visibility symbol_visibility, std::vector<uint32_t> &symbol_indexes) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
// Initialize all of the lookup by name indexes before converting NAME to a
// uniqued string NAME_STR below.
if (!m_name_indexes_computed)
Debug symbol_debug_type,
Visibility symbol_visibility) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
-
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
+ LLDB_SCOPED_TIMER();
if (!m_name_indexes_computed)
InitNameIndexes();
ClearModules(false);
if (executable_sp) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "Target::SetExecutableModule (executable = '%s')",
+ LLDB_SCOPED_TIMERF("Target::SetExecutableModule (executable = '%s')",
executable_sp->GetFileSpec().GetPath().c_str());
const bool notify = true;
LoadDependentFiles load_dependent_files,
lldb::PlatformSP &platform_sp,
lldb::TargetSP &target_sp) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat, "TargetList::CreateTarget (file = '%s', arch = '%s')",
- user_exe_path.str().c_str(), specified_arch.GetArchitectureName());
+ LLDB_SCOPED_TIMERF("TargetList::CreateTarget (file = '%s', arch = '%s')",
+ user_exe_path.str().c_str(),
+ specified_arch.GetArchitectureName());
Status error;
const bool is_dummy_target = false;
}
void SystemInitializerTest::Terminate() {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
-
Debugger::SettingsTerminate();
// Terminate and unload and loaded system or user LLDB plug-ins