[PATCH] D45703: Use a utility function to speed up "process load image" for POSIX Platforms

Jim Ingham via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 16 14:52:46 PDT 2018


jingham created this revision.
jingham added reviewers: davide, labath.
Herald added subscribers: llvm-commits, emaste.

The original implementation of PlatformPosix::DoLoadImage compiled the expression to load the image & check the error a fresh every time.  That was causing performance problems in some cases where lldb had to load a bunch of images into the process.

This patch replaces that mechanism with an lldb UtilityFunction, so we can JIT the required code once per process and then reuse it on subsequent calls.  The work to set up a UtilityFunction is simpler than to compile an expression, so even in the case where you only do one load this will be faster.  But then if you are doing many it will be much faster.

The only tricky bit in this is that the Platform holds the DoLoadImage code, but the UtilityFunction has to be per process.  Rather than trying to get the Platform to track the Targets & Processes that use it (which it does not do at present) I put the Utility function in the Process, and hand it out from there.

I think I got the android dlopen remapping header in there correctly, but I don't have a way to test that, so if somebody on the Android side could check that out, that would be helpful.


Repository:
  rL LLVM

https://reviews.llvm.org/D45703

Files:
  include/lldb/Target/Process.h
  source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
  source/Target/Process.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45703.142702.patch
Type: text/x-patch
Size: 16284 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180416/e26531e3/attachment.bin>


More information about the llvm-commits mailing list