Commit 90de4de4 authored by Philip Carns's avatar Philip Carns

disable mmap wrapper for dynamic linking

see #223
parent f8cfb07e
...@@ -16,7 +16,10 @@ Darshan-3.1.3-pre1 ...@@ -16,7 +16,10 @@ Darshan-3.1.3-pre1
applications (contributed by Cristian Simarro) applications (contributed by Cristian Simarro)
* skip instrumentation attempts for anonymous mmap() calls; this avoids a * skip instrumentation attempts for anonymous mmap() calls; this avoids a
potentential deadlock condition when used with hugepages on Cray systems. potentential deadlock condition when used with hugepages on Cray systems.
Reported by Glenn Lockwood and Cristian Simarro. Reported by Glenn Lockwood for static linking case.
* disable instrumentation for mmap when dynamically linking; this avoids a
potential deadlock condition on Cray systems using dynamically linked
executabes. Reported by Cristian Simarro for dynamic linking case.
* fix segmentation fault in statistics collection for applications that issue * fix segmentation fault in statistics collection for applications that issue
operations with a large number of distince access sizes or strides on the operations with a large number of distince access sizes or strides on the
same file. Reported by Glenn Lockwood. same file. Reported by Glenn Lockwood.
......
...@@ -87,7 +87,7 @@ lib/darshan-null.po: lib/darshan-null.c darshan.h darshan-dynamic.h darshan-comm ...@@ -87,7 +87,7 @@ lib/darshan-null.po: lib/darshan-null.c darshan.h darshan-dynamic.h darshan-comm
$(CC) $(CFLAGS_SHARED) -c $< -o $@ $(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib lib/darshan-posix.o: lib/darshan-posix.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -DDARSHAN_WRAP_MMAP -c $< -o $@
lib/darshan-posix.po: lib/darshan-posix.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib lib/darshan-posix.po: lib/darshan-posix.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-posix-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@ $(CC) $(CFLAGS_SHARED) -c $< -o $@
......
...@@ -62,8 +62,10 @@ DARSHAN_FORWARD_DECL(__lxstat, int, (int vers, const char* path, struct stat *bu ...@@ -62,8 +62,10 @@ DARSHAN_FORWARD_DECL(__lxstat, int, (int vers, const char* path, struct stat *bu
DARSHAN_FORWARD_DECL(__lxstat64, int, (int vers, const char* path, struct stat64 *buf)); DARSHAN_FORWARD_DECL(__lxstat64, int, (int vers, const char* path, struct stat64 *buf));
DARSHAN_FORWARD_DECL(__fxstat, int, (int vers, int fd, struct stat *buf)); DARSHAN_FORWARD_DECL(__fxstat, int, (int vers, int fd, struct stat *buf));
DARSHAN_FORWARD_DECL(__fxstat64, int, (int vers, int fd, struct stat64 *buf)); DARSHAN_FORWARD_DECL(__fxstat64, int, (int vers, int fd, struct stat64 *buf));
#ifdef DARSHAN_WRAP_MMAP
DARSHAN_FORWARD_DECL(mmap, void*, (void *addr, size_t length, int prot, int flags, int fd, off_t offset)); DARSHAN_FORWARD_DECL(mmap, void*, (void *addr, size_t length, int prot, int flags, int fd, off_t offset));
DARSHAN_FORWARD_DECL(mmap64, void*, (void *addr, size_t length, int prot, int flags, int fd, off64_t offset)); DARSHAN_FORWARD_DECL(mmap64, void*, (void *addr, size_t length, int prot, int flags, int fd, off64_t offset));
#endif /* DARSHAN_WRAP_MMAP */
DARSHAN_FORWARD_DECL(fsync, int, (int fd)); DARSHAN_FORWARD_DECL(fsync, int, (int fd));
DARSHAN_FORWARD_DECL(fdatasync, int, (int fd)); DARSHAN_FORWARD_DECL(fdatasync, int, (int fd));
DARSHAN_FORWARD_DECL(close, int, (int fd)); DARSHAN_FORWARD_DECL(close, int, (int fd));
...@@ -917,6 +919,7 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf) ...@@ -917,6 +919,7 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf)
return(ret); return(ret);
} }
#ifdef DARSHAN_WRAP_MMAP
void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags, void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
int fd, off_t offset) int fd, off_t offset)
{ {
...@@ -947,7 +950,9 @@ void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags, ...@@ -947,7 +950,9 @@ void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
return(ret); return(ret);
} }
#endif /* DARSHAN_WRAP_MMAP */
#ifdef DARSHAN_WRAP_MMAP
void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags, void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
int fd, off64_t offset) int fd, off64_t offset)
{ {
...@@ -978,6 +983,7 @@ void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags, ...@@ -978,6 +983,7 @@ void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
return(ret); return(ret);
} }
#endif /* DARSHAN_WRAP_MMAP */
int DARSHAN_DECL(fsync)(int fd) int DARSHAN_DECL(fsync)(int fd)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment