Add scoped timers to ReadMemoryFromInferior and ReadMemoryFromFileCache.

This commit is contained in:
Adrian Prantl 2021-07-09 13:36:26 -07:00
parent 3338819b08
commit d124133f17
2 changed files with 4 additions and 0 deletions

View File

@ -68,6 +68,7 @@
#include "lldb/Utility/ProcessInfo.h"
#include "lldb/Utility/SelectHelper.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/Timer.h"
using namespace lldb;
using namespace lldb_private;
@ -2044,6 +2045,8 @@ size_t Process::ReadCStringFromMemory(addr_t addr, char *dst,
size_t Process::ReadMemoryFromInferior(addr_t addr, void *buf, size_t size,
Status &error) {
LLDB_SCOPED_TIMER();
if (buf == nullptr || size == 0)
return 0;

View File

@ -1691,6 +1691,7 @@ bool Target::ModuleIsExcludedForUnconstrainedSearches(
size_t Target::ReadMemoryFromFileCache(const Address &addr, void *dst,
size_t dst_len, Status &error) {
LLDB_SCOPED_TIMER();
SectionSP section_sp(addr.GetSection());
if (section_sp) {
// If the contents of this section are encrypted, the on-disk file is