[llvm-branch-commits] [compiler-rt-branch] r195462 - Merging r195434:

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Nov 22 06:00:45 PST 2013


Author: eugenis
Date: Fri Nov 22 08:00:45 2013
New Revision: 195462

URL: http://llvm.org/viewvc/llvm-project?rev=195462&view=rev
Log:
Merging r195434:
------------------------------------------------------------------------
r195434 | eugenis | 2013-11-22 13:32:39 +0400 (Fri, 22 Nov 2013) | 4 lines

[sanitizer] Restore perf_event_attr handling.

This time in a forward/backward compatible way.

------------------------------------------------------------------------

Modified:
    compiler-rt/branches/release_34/   (props changed)
    compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_common_syscalls.inc
    compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
    compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_posix.h

Propchange: compiler-rt/branches/release_34/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov 22 08:00:45 2013
@@ -1 +1 @@
-/compiler-rt/trunk:195427,195433
+/compiler-rt/trunk:195427,195433-195434

Modified: compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_common_syscalls.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_common_syscalls.inc?rev=195462&r1=195461&r2=195462&view=diff
==============================================================================
--- compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_common_syscalls.inc (original)
+++ compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_common_syscalls.inc Fri Nov 22 08:00:45 2013
@@ -2703,11 +2703,13 @@ PRE_SYSCALL(syncfs)(long fd) {}
 
 POST_SYSCALL(syncfs)(long res, long fd) {}
 
-PRE_SYSCALL(perf_event_open)(void *attr_uptr, long pid, long cpu, long group_fd,
-                             long flags) {}
+PRE_SYSCALL(perf_event_open)(__sanitizer_perf_event_attr *attr_uptr, long pid,
+                             long cpu, long group_fd, long flags) {
+  if (attr_uptr) PRE_READ(attr_uptr, attr_uptr->size);
+}
 
-POST_SYSCALL(perf_event_open)(long res, void *attr_uptr, long pid, long cpu,
-                              long group_fd, long flags) {}
+POST_SYSCALL(perf_event_open)(long res, __sanitizer_perf_event_attr *attr_uptr,
+                              long pid, long cpu, long group_fd, long flags) {}
 
 PRE_SYSCALL(mmap_pgoff)(long addr, long len, long prot, long flags, long fd,
                         long pgoff) {}

Modified: compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_linux.cc?rev=195462&r1=195461&r2=195462&view=diff
==============================================================================
--- compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_linux.cc (original)
+++ compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_linux.cc Fri Nov 22 08:00:45 2013
@@ -52,6 +52,13 @@ COMPILER_CHECK(struct_kernel_stat64_sz =
 
 COMPILER_CHECK(struct_io_event_sz == sizeof(struct io_event));
 
+#if !SANITIZER_ANDROID
+COMPILER_CHECK(sizeof(struct __sanitizer_perf_event_attr) <=
+               sizeof(struct perf_event_attr));
+CHECK_SIZE_AND_OFFSET(perf_event_attr, type);
+CHECK_SIZE_AND_OFFSET(perf_event_attr, size);
+#endif
+
 COMPILER_CHECK(iocb_cmd_pread == IOCB_CMD_PREAD);
 COMPILER_CHECK(iocb_cmd_pwrite == IOCB_CMD_PWRITE);
 

Modified: compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_posix.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_posix.h?rev=195462&r1=195461&r2=195462&view=diff
==============================================================================
--- compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_posix.h (original)
+++ compiler-rt/branches/release_34/lib/sanitizer_common/sanitizer_platform_limits_posix.h Fri Nov 22 08:00:45 2013
@@ -59,6 +59,11 @@ namespace __sanitizer {
   const unsigned struct_kernel_stat64_sz = 96;
 #endif
   const unsigned struct_io_event_sz = 32;
+  struct __sanitizer_perf_event_attr {
+    unsigned type;
+    unsigned size;
+    // More fields that vary with the kernel version.
+  };
 
   extern unsigned struct_utimbuf_sz;
   extern unsigned struct_new_utsname_sz;





More information about the llvm-branch-commits mailing list