Skip to content

Commit

Permalink
i#2037 re-walk-maps: refactor to share main walk with re-walk (#2887)
Browse files Browse the repository at this point in the history
Refactors find_executable_vm_areas() to share its map entry skipping with
the re-takeover re-walk from b06a702, but not its module list or
executable area updates.  This entry skipping for vmheap turns out to make
a big performance difference when attaching.

Removes individual updates to memcache for entries inside vmheap which were
already bulk-added for the find_executable_vm_areas() walk.

Issue: #2037
  • Loading branch information
derekbruening authored Mar 20, 2018
1 parent ce3a9f4 commit 8471d5c
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 134 deletions.
2 changes: 2 additions & 0 deletions core/os_shared.h
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,9 @@ app_pc get_dynamorio_dll_start(void);
app_pc get_dynamorio_dll_preferred_base(void);

bool is_in_dynamo_dll(app_pc pc);
/* Returns the number of separate regions added to the dynamo vm areas list. */
int find_dynamo_library_vm_areas(void);
/* Returns the number of executable regions found in the address space. */
int find_executable_vm_areas(void);

/* all_memory_areas is !HAVE_MEMINFO-only: nop elsewhere */
Expand Down
6 changes: 1 addition & 5 deletions core/unix/memcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -587,11 +587,7 @@ memcache_update_all_from_os(void)
memcache_lock();
/* We clear the entire cache to avoid false positive queries. */
vmvector_reset_vector(GLOBAL_DCONTEXT, all_memory_areas);
while (memquery_iterator_next(&iter)) {
/* We do a heavyweight overlap check with everything. */
memcache_update_locked(iter.vm_start, iter.vm_end, iter.prot,
-1, false/*!exists*/);
}
os_walk_address_space(&iter, false);
memcache_unlock();
memquery_iterator_stop(&iter);
}
Loading

0 comments on commit 8471d5c

Please sign in to comment.