[PATCH] D13609: [asan] On OS X, tag mapped regions with VM_MEMORY_ANALYSIS_TOOL tag

Anna Zaks via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 9 15:26:57 PDT 2015


zaks.anna created this revision.
zaks.anna added reviewers: kcc, glider, kubabrecka.
zaks.anna added a subscriber: llvm-commits.

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

Files:
  lib/sanitizer_common/sanitizer_mac.cc

Index: lib/sanitizer_common/sanitizer_mac.cc
===================================================================
--- lib/sanitizer_common/sanitizer_mac.cc
+++ lib/sanitizer_common/sanitizer_mac.cc
@@ -41,6 +41,7 @@
 #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 @@
 // ---------------------- 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);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D13609.36998.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151009/83017019/attachment.bin>


More information about the llvm-commits mailing list