summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2015-10-27 20:12:53 +0000
committerAnna Zaks <ganna@apple.com>2015-10-27 20:12:53 +0000
commitab1aa081911fc52c840215499995d0dcde7a8756 (patch)
treeecfab7874bf2b819d8c933ca1d5b515f9e4f17c6
parent0a0490b1520e96b728448b8c43ca873fcaa809dc (diff)
downloadbcm5719-llvm-ab1aa081911fc52c840215499995d0dcde7a8756.tar.gz
bcm5719-llvm-ab1aa081911fc52c840215499995d0dcde7a8756.zip
[asan] On OS X, tag mapped regions with VM_MEMORY_ANALYSIS_TOOL tag
This will tag all mmapped memory sanitizers use with "Performance tool data" when viewed in vmmap. (Even though sanitizers are not performance tools, it's the best available match and better than having the unidentified objects.) http://reviews.llvm.org/D13609 llvm-svn: 251445
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_mac.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
index d448ddaba64..3151cf8b911 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
@@ -41,6 +41,7 @@ extern char **environ;
#include <libkern/OSAtomic.h>
#include <mach-o/dyld.h>
#include <mach/mach.h>
+#include <mach/vm_statistics.h>
#include <pthread.h>
#include <sched.h>
#include <signal.h>
@@ -59,6 +60,7 @@ namespace __sanitizer {
// ---------------------- sanitizer_libc.h
uptr internal_mmap(void *addr, size_t length, int prot, int flags,
int fd, u64 offset) {
+ if (fd == -1) fd = VM_MAKE_TAG(VM_MEMORY_ANALYSIS_TOOL);
return (uptr)mmap(addr, length, prot, flags, fd, offset);
}
OpenPOWER on IntegriCloud