Commit 45e9d26c authored by Philip Carns's avatar Philip Carns

stub wrappers for aio functions


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@758 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 26c31d04
......@@ -4117,7 +4117,7 @@ done
# libc functions wrapped by darshan
CP_WRAPPERS="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose"
CP_WRAPPERS="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64"
# ,-u,__wrap___fxstat64,-u,pthread_mutex_lock,-u,pthread_mutex_unlock
......
......@@ -168,7 +168,7 @@ CFLAGS="$old_cflags"
AC_CHECK_HEADERS(mntent.h sys/mount.h)
# libc functions wrapped by darshan
CP_WRAPPERS="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose"
CP_WRAPPERS="-Wl,-u,MPI_Init,-u,MPI_Wtime,-wrap,write,-wrap,open,-wrap,creat,-wrap,creat64,-wrap,open64,-wrap,close,-wrap,read,-wrap,lseek,-wrap,lseek64,-wrap,pread,-wrap,pwrite,-wrap,readv,-wrap,writev,-wrap,__xstat,-wrap,__lxstat,-wrap,__fxstat,-wrap,__xstat64,-wrap,__lxstat64,-wrap,__fxstat64,-wrap,mmap,-wrap,mmap64,-wrap,fopen,-wrap,fclose,-wrap,fread,-wrap,fwrite,-wrap,fseek,-wrap,fopen64,-wrap,pread64,-wrap,pwrite64,-wrap,fsync,-wrap,fdatasync,-wrap,ncmpi_create,-wrap,ncmpi_open,-wrap,ncmpi_close,-wrap,H5Fcreate,-wrap,H5Fopen,-wrap,H5Fclose,-wrap,aio_write,-wrap,aio_write64,-wrap,aio_read,-wrap,aio_read64,-wrap,lio_listio,-wrap,lio_listio64,-wrap,aio_return,-wrap,aio_return64"
# ,-u,__wrap___fxstat64,-u,pthread_mutex_lock,-u,pthread_mutex_unlock
......
......@@ -20,6 +20,7 @@
#include <assert.h>
#include <libgen.h>
#include <limits.h>
#include <aio.h>
#define __USE_GNU
#include <pthread.h>
......@@ -101,6 +102,14 @@ DARSHAN_FORWARD_DECL(fwrite, size_t, (const void *ptr, size_t size, size_t nmemb
DARSHAN_FORWARD_DECL(fseek, int, (FILE *stream, long offset, int whence));
DARSHAN_FORWARD_DECL(fsync, int, (int fd));
DARSHAN_FORWARD_DECL(fdatasync, int, (int fd));
DARSHAN_FORWARD_DECL(aio_read, int, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(aio_read64, int, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(aio_write, int, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(aio_write64, int, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(lio_listio, int, (int mode, struct aiocb *const aiocb_list[], int nitems, struct sigevent *sevp));
DARSHAN_FORWARD_DECL(lio_listio64, int, (int mode, struct aiocb *const aiocb_list[], int nitems, struct sigevent *sevp));
DARSHAN_FORWARD_DECL(aio_return, ssize_t, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(aio_return64, ssize_t, (struct aiocb *aiocbp));
pthread_mutex_t cp_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
struct darshan_job_runtime* darshan_global_job = NULL;
......@@ -1019,6 +1028,113 @@ off_t DARSHAN_DECL(lseek)(int fd, off_t offset, int whence)
return(ret);
}
ssize_t DARSHAN_DECL(aio_return64)(struct aiocb *aiocbp)
{
int ret;
MAP_OR_FAIL(aio_return64);
printf("TESTING: wrapped aio_return64()\n");
ret = __real_aio_return64(aiocbp);
return(ret);
}
ssize_t DARSHAN_DECL(aio_return)(struct aiocb *aiocbp)
{
int ret;
MAP_OR_FAIL(aio_return);
printf("TESTING: wrapped aio_return()\n");
ret = __real_aio_return(aiocbp);
return(ret);
}
int DARSHAN_DECL(lio_listio)(int mode, struct aiocb *const aiocb_list[],
int nitems, struct sigevent *sevp)
{
int ret;
MAP_OR_FAIL(lio_listio);
printf("TESTING: wrapped lio_listio()\n");
ret = __real_lio_listio(mode, aiocb_list, nitems, sevp);
return(ret);
}
int DARSHAN_DECL(lio_listio64)(int mode, struct aiocb *const aiocb_list[],
int nitems, struct sigevent *sevp)
{
int ret;
MAP_OR_FAIL(lio_listio64);
printf("TESTING: wrapped lio_listio64()\n");
ret = __real_lio_listio64(mode, aiocb_list, nitems, sevp);
return(ret);
}
int DARSHAN_DECL(aio_write64)(struct aiocb *aiocbp)
{
int ret;
MAP_OR_FAIL(aio_write64);
printf("TESTING: wrapped aio_write64()\n");
ret = __real_aio_write64(aiocbp);
return(ret);
}
int DARSHAN_DECL(aio_write)(struct aiocb *aiocbp)
{
int ret;
MAP_OR_FAIL(aio_write);
printf("TESTING: wrapped aio_write()\n");
ret = __real_aio_write(aiocbp);
return(ret);
}
int DARSHAN_DECL(aio_read64)(struct aiocb *aiocbp)
{
int ret;
MAP_OR_FAIL(aio_read64);
printf("TESTING: wrapped aio_read64()\n");
ret = __real_aio_read64(aiocbp);
return(ret);
}
int DARSHAN_DECL(aio_read)(struct aiocb *aiocbp)
{
int ret;
MAP_OR_FAIL(aio_read);
printf("TESTING: wrapped aio_read()\n");
ret = __real_aio_read(aiocbp);
return(ret);
}
int DARSHAN_DECL(fseek)(FILE *stream, long offset, int whence)
{
int ret;
......
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