aboutsummaryrefslogtreecommitdiff
path: root/src/os/linux
diff options
context:
space:
mode:
authorzgu <none@none>2012-10-19 21:40:07 -0400
committerzgu <none@none>2012-10-19 21:40:07 -0400
commit89286bf80269390264eb1f1dbe4816151d9afb47 (patch)
tree0b515f4414d91d5b0cffa32a41b444e3d141fd12 /src/os/linux
parentcc6e45ae9023c7f1b3a457e82c18a36ec5b105b9 (diff)
7199092: NMT: NMT needs to deal overlapped virtual memory ranges
Summary: Enhanced virtual memory tracking to track committed regions as well as reserved regions, so NMT now can generate virtual memory map. Reviewed-by: acorn, coleenp
Diffstat (limited to 'src/os/linux')
-rw-r--r--src/os/linux/vm/perfMemory_linux.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/os/linux/vm/perfMemory_linux.cpp b/src/os/linux/vm/perfMemory_linux.cpp
index 2adae8d18..b54c5db14 100644
--- a/src/os/linux/vm/perfMemory_linux.cpp
+++ b/src/os/linux/vm/perfMemory_linux.cpp
@@ -30,6 +30,7 @@
#include "os_linux.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/perfMemory.hpp"
+#include "services/memTracker.hpp"
#include "utilities/exceptions.hpp"
// put OS-includes here
@@ -753,6 +754,10 @@ static char* mmap_create_shared(size_t size) {
// clear the shared memory region
(void)::memset((void*) mapAddress, 0, size);
+ // it does not go through os api, the operation has to record from here
+ MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC);
+ MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal);
+
return mapAddress;
}
@@ -912,6 +917,10 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor
"Could not map PerfMemory");
}
+ // it does not go through os api, the operation has to record from here
+ MemTracker::record_virtual_memory_reserve((address)mapAddress, size, CURRENT_PC);
+ MemTracker::record_virtual_memory_type((address)mapAddress, mtInternal);
+
*addr = mapAddress;
*sizep = size;