Page MenuHomePhabricator

Increase use of svr4 packets to improve performance on POSIX remotes
ClosedPublic

Authored by fjricci on Jan 8 2016, 11:47 AM.

Details

Summary

Allows the remote to enumerate the link map when adding and removing
shared libraries, so that lldb doesn't need to read it manually from
the remote's memory.

This provides very large speedups (on the order of 50%) in total
startup time when using the ds2 remote on android or Tizen devices.

Diff Detail

Event Timeline

fjricci updated this revision to Diff 44352.Jan 8 2016, 11:47 AM
fjricci retitled this revision from to Increase use of svr4 packets to improve performance on POSIX remotes.
fjricci updated this object.
fjricci added reviewers: tfiala, ADodds.
fjricci added subscribers: llvm-commits, sas.
tberghammer added inline comments.Jan 11 2016, 7:25 AM
source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
198

This function have a lot of common code with UpdateSUEntries(). It would be good to merge the 2 in some way especially if we consider that they have some platform specific hacks inside what we don't want to diverge between the 2 implementation.

262–268

Please use the isLoadBiasIncorrect function instead

262–274

Please move this into a new function and also use the new function from ReadSOEntryFromMemory. We don't want to duplicate these hacks.

ADodds added inline comments.Jan 11 2016, 9:32 AM
source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
247–365

If your adding AddSOEntriesFromRemote() should the above function be renamed to AddSOEntries() for consistency?

289

As a nitpick there seems to be inconsistent use of { on the same line and on a new line. For lldb it should really be placed on a new line.

396

If your adding RemoveSOEntriesFromRemote() should the above function be renamed to RemoveSOEntries() for consistency?

ADodds added inline comments.Jan 11 2016, 9:43 AM
include/lldb/Core/LoadedModuleInfoList.h
100

can also be made const.

109

Should we be checking the m_has fields here when making each comparison?

tfiala edited edge metadata.Jan 11 2016, 9:49 AM

Aside from the other comments, I'm having a look at it now from the perspective of how it cross-cuts other gdb-remote clients (e.g. OS X/debugserver).

Aside from the other comments, I'm having a look at it now from the perspective of how it cross-cuts other gdb-remote clients (e.g. OS X/debugserver).

The test suite passes on OS X with this patch applied to r257342.

Assuming the comments from Tamas and Aidan are addressed, it looks good.

fjricci updated this revision to Diff 44590.Jan 11 2016, 5:23 PM
fjricci marked 8 inline comments as done.
fjricci edited edge metadata.

Refactoring and style improvements

fjricci updated this revision to Diff 44591.Jan 11 2016, 5:25 PM

Remove accidental binary file addition

ADodds accepted this revision.Jan 12 2016, 9:50 AM
ADodds added a reviewer: tberghammer.

Looks good to me, assuming that Tamas is happy also.

This revision is now accepted and ready to land.Jan 12 2016, 9:50 AM
tberghammer accepted this revision.Jan 12 2016, 9:52 AM
tberghammer edited edge metadata.

Looks good

tfiala accepted this revision.Jan 12 2016, 10:52 AM
tfiala edited edge metadata.

LGTM with latest changes.

sas closed this revision.Jan 12 2016, 11:06 AM

Committed as r257502.