summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
diff options
context:
space:
mode:
authorAntonio Afonso <antonio.afonso@gmail.com>2019-06-18 23:27:57 +0000
committerAntonio Afonso <antonio.afonso@gmail.com>2019-06-18 23:27:57 +0000
commita7335393f50246b59db450dc6005f7c8f29e73a6 (patch)
tree68d612eac21a3a524b39154f5976d224272bf2fa /lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
parentdf195d8aedffa9211f37db7fd08f46adf41386f0 (diff)
downloadbcm5719-llvm-a7335393f50246b59db450dc6005f7c8f29e73a6.tar.gz
bcm5719-llvm-a7335393f50246b59db450dc6005f7c8f29e73a6.zip
Add ReadCStringFromMemory for faster string reads
Summary: This is the fifth patch to improve module loading in a series that started here (where I explain the motivation and solution): D62499 Reading strings with ReadMemory is really slow when reading the path of the shared library. This is because we don't know the length of the path so use PATH_MAX (4096) and these strings are actually super close to the boundary of an unreadable page. So even though we use process_vm_readv it will usually fail because the read size spans to the unreadable page and we then default to read the string word by word with ptrace. This new function is very similar to another ReadCStringFromMemory that already exists in lldb that makes sure it never reads cross page boundaries and checks if we already read the entire string by finding '\0'. I was able to reduce the GetLoadedSharedLibraries call from 30ms to 4ms (or something of that order). Reviewers: clayborg, xiaobai, labath Reviewed By: labath Subscribers: emaste, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D62503 llvm-svn: 363750
Diffstat (limited to 'lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp')
-rw-r--r--lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index b40b70104ea..7637237aa16 100644
--- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -2076,4 +2076,4 @@ Status NativeProcessLinux::StopProcessorTracingOnThread(lldb::user_id_t traceid,
m_processor_trace_monitor.erase(iter);
return error;
-} \ No newline at end of file
+}
OpenPOWER on IntegriCloud