Commit 5c5f5334 authored by Shane Snyder's avatar Shane Snyder

Merge branch 'dev-stdio'

Conflicts:
	darshan-log-format.h
	darshan-runtime/Makefile.in
	darshan-util/Makefile.in
	darshan-util/darshan-logutils.h
parents 2770f997 06b84605
...@@ -112,6 +112,7 @@ struct darshan_base_record ...@@ -112,6 +112,7 @@ struct darshan_base_record
#include "darshan-pnetcdf-log-format.h" #include "darshan-pnetcdf-log-format.h"
#include "darshan-bgq-log-format.h" #include "darshan-bgq-log-format.h"
#include "darshan-lustre-log-format.h" #include "darshan-lustre-log-format.h"
#include "darshan-stdio-log-format.h"
/* X-macro for keeping module ordering consistent */ /* X-macro for keeping module ordering consistent */
/* NOTE: first val used to define module enum values, /* NOTE: first val used to define module enum values,
...@@ -130,7 +131,8 @@ struct darshan_base_record ...@@ -130,7 +131,8 @@ struct darshan_base_record
X(DARSHAN_HDF5_MOD, "HDF5", DARSHAN_HDF5_VER, &hdf5_logutils) \ X(DARSHAN_HDF5_MOD, "HDF5", DARSHAN_HDF5_VER, &hdf5_logutils) \
X(DARSHAN_PNETCDF_MOD, "PNETCDF", DARSHAN_PNETCDF_VER, &pnetcdf_logutils) \ X(DARSHAN_PNETCDF_MOD, "PNETCDF", DARSHAN_PNETCDF_VER, &pnetcdf_logutils) \
X(DARSHAN_BGQ_MOD, "BG/Q", DARSHAN_BGQ_VER, &bgq_logutils) \ X(DARSHAN_BGQ_MOD, "BG/Q", DARSHAN_BGQ_VER, &bgq_logutils) \
X(DARSHAN_LUSTRE_MOD, "LUSTRE", DARSHAN_LUSTRE_VER, &lustre_logutils) X(DARSHAN_LUSTRE_MOD, "LUSTRE", DARSHAN_LUSTRE_VER, &lustre_logutils) \
X(DARSHAN_STDIO_MOD, "STDIO", DARSHAN_STDIO_VER, &stdio_logutils)
/* unique identifiers to distinguish between available darshan modules */ /* unique identifiers to distinguish between available darshan modules */
/* NOTES: - valid ids range from [0...DARSHAN_MAX_MODS-1] /* NOTES: - valid ids range from [0...DARSHAN_MAX_MODS-1]
......
...@@ -35,8 +35,8 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir) ...@@ -35,8 +35,8 @@ CFLAGS_SHARED = -DDARSHAN_CONFIG_H=\"darshan-runtime-config.h\" -I . -I$(srcdir)
LIBS = -lz @LIBBZ2@ LIBS = -lz @LIBBZ2@
DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o lib/darshan-stdio.o
DARSHAN_DYNAMIC_MOD_OBJS = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po DARSHAN_DYNAMIC_MOD_OBJS = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po lib/darshan-stdio.po
ifdef DARSHAN_USE_BGQ ifdef DARSHAN_USE_BGQ
DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o
...@@ -121,6 +121,12 @@ lib/darshan-lustre.o: lib/darshan-lustre.c darshan-lustre.h darshan.h darshan-co ...@@ -121,6 +121,12 @@ lib/darshan-lustre.o: lib/darshan-lustre.c darshan-lustre.h darshan.h darshan-co
lib/darshan-lustre.po: lib/darshan-lustre.c darshan-lustre.h darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | lib lib/darshan-lustre.po: lib/darshan-lustre.c darshan-lustre.h darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@ $(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/darshan-stdio.o: lib/darshan-stdio.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-stdio-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-stdio.po: lib/darshan-stdio.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-stdio-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/lookup3.o: lib/lookup3.c lib/lookup3.o: lib/lookup3.c
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
...@@ -172,6 +178,7 @@ endif ...@@ -172,6 +178,7 @@ endif
install -m 644 $(srcdir)/share/ld-opts/darshan-posix-ld-opts $(datarootdir)/ld-opts/darshan-posix-ld-opts install -m 644 $(srcdir)/share/ld-opts/darshan-posix-ld-opts $(datarootdir)/ld-opts/darshan-posix-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-hdf5-ld-opts $(datarootdir)/ld-opts/darshan-hdf5-ld-opts install -m 644 $(srcdir)/share/ld-opts/darshan-hdf5-ld-opts $(datarootdir)/ld-opts/darshan-hdf5-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts install -m 644 $(srcdir)/share/ld-opts/darshan-pnetcdf-ld-opts $(datarootdir)/ld-opts/darshan-pnetcdf-ld-opts
install -m 644 $(srcdir)/share/ld-opts/darshan-stdio-ld-opts $(datarootdir)/ld-opts/darshan-stdio-ld-opts
ifdef ENABLE_MMAP_LOGS ifdef ENABLE_MMAP_LOGS
install -m 755 share/darshan-mmap-epilog.sh $(datarootdir)/darshan-mmap-epilog.sh install -m 755 share/darshan-mmap-epilog.sh $(datarootdir)/darshan-mmap-epilog.sh
endif endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME #undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
......
...@@ -45,8 +45,6 @@ DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...)); ...@@ -45,8 +45,6 @@ DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...));
DARSHAN_FORWARD_DECL(open64, int, (const char *path, int flags, ...)); DARSHAN_FORWARD_DECL(open64, int, (const char *path, int flags, ...));
DARSHAN_FORWARD_DECL(creat, int, (const char* path, mode_t mode)); DARSHAN_FORWARD_DECL(creat, int, (const char* path, mode_t mode));
DARSHAN_FORWARD_DECL(creat64, int, (const char* path, mode_t mode)); DARSHAN_FORWARD_DECL(creat64, int, (const char* path, mode_t mode));
DARSHAN_FORWARD_DECL(fopen, FILE*, (const char *path, const char *mode));
DARSHAN_FORWARD_DECL(fopen64, FILE*, (const char *path, const char *mode));
DARSHAN_FORWARD_DECL(mkstemp, int, (char *template)); DARSHAN_FORWARD_DECL(mkstemp, int, (char *template));
DARSHAN_FORWARD_DECL(mkostemp, int, (char *template, int flags)); DARSHAN_FORWARD_DECL(mkostemp, int, (char *template, int flags));
DARSHAN_FORWARD_DECL(mkstemps, int, (char *template, int suffixlen)); DARSHAN_FORWARD_DECL(mkstemps, int, (char *template, int suffixlen));
...@@ -59,11 +57,8 @@ DARSHAN_FORWARD_DECL(pread64, ssize_t, (int fd, void *buf, size_t count, off64_t ...@@ -59,11 +57,8 @@ DARSHAN_FORWARD_DECL(pread64, ssize_t, (int fd, void *buf, size_t count, off64_t
DARSHAN_FORWARD_DECL(pwrite64, ssize_t, (int fd, const void *buf, size_t count, off64_t offset)); DARSHAN_FORWARD_DECL(pwrite64, ssize_t, (int fd, const void *buf, size_t count, off64_t offset));
DARSHAN_FORWARD_DECL(readv, ssize_t, (int fd, const struct iovec *iov, int iovcnt)); DARSHAN_FORWARD_DECL(readv, ssize_t, (int fd, const struct iovec *iov, int iovcnt));
DARSHAN_FORWARD_DECL(writev, ssize_t, (int fd, const struct iovec *iov, int iovcnt)); DARSHAN_FORWARD_DECL(writev, ssize_t, (int fd, const struct iovec *iov, int iovcnt));
DARSHAN_FORWARD_DECL(fread, size_t, (void *ptr, size_t size, size_t nmemb, FILE *stream));
DARSHAN_FORWARD_DECL(fwrite, size_t, (const void *ptr, size_t size, size_t nmemb, FILE *stream));
DARSHAN_FORWARD_DECL(lseek, off_t, (int fd, off_t offset, int whence)); DARSHAN_FORWARD_DECL(lseek, off_t, (int fd, off_t offset, int whence));
DARSHAN_FORWARD_DECL(lseek64, off64_t, (int fd, off64_t offset, int whence)); DARSHAN_FORWARD_DECL(lseek64, off64_t, (int fd, off64_t offset, int whence));
DARSHAN_FORWARD_DECL(fseek, int, (FILE *stream, long offset, int whence));
DARSHAN_FORWARD_DECL(__xstat, int, (int vers, const char* path, struct stat *buf)); DARSHAN_FORWARD_DECL(__xstat, int, (int vers, const char* path, struct stat *buf));
DARSHAN_FORWARD_DECL(__xstat64, int, (int vers, const char* path, struct stat64 *buf)); DARSHAN_FORWARD_DECL(__xstat64, int, (int vers, const char* path, struct stat64 *buf));
DARSHAN_FORWARD_DECL(__lxstat, int, (int vers, const char* path, struct stat *buf)); DARSHAN_FORWARD_DECL(__lxstat, int, (int vers, const char* path, struct stat *buf));
...@@ -75,7 +70,6 @@ DARSHAN_FORWARD_DECL(mmap64, void*, (void *addr, size_t length, int prot, int fl ...@@ -75,7 +70,6 @@ DARSHAN_FORWARD_DECL(mmap64, void*, (void *addr, size_t length, int prot, int fl
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));
DARSHAN_FORWARD_DECL(fclose, int, (FILE *fp));
DARSHAN_FORWARD_DECL(aio_read, int, (struct aiocb *aiocbp)); DARSHAN_FORWARD_DECL(aio_read, int, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(aio_write, int, (struct aiocb *aiocbp)); DARSHAN_FORWARD_DECL(aio_write, int, (struct aiocb *aiocbp));
DARSHAN_FORWARD_DECL(aio_read64, int, (struct aiocb64 *aiocbp)); DARSHAN_FORWARD_DECL(aio_read64, int, (struct aiocb64 *aiocbp));
...@@ -197,7 +191,7 @@ static int darshan_mem_alignment = 1; ...@@ -197,7 +191,7 @@ static int darshan_mem_alignment = 1;
POSIX_UNLOCK(); \ POSIX_UNLOCK(); \
} while(0) } while(0)
#define POSIX_RECORD_OPEN(__ret, __path, __mode, __stream_flag, __tm1, __tm2) do { \ #define POSIX_RECORD_OPEN(__ret, __path, __mode, __tm1, __tm2) do { \
darshan_record_id rec_id; \ darshan_record_id rec_id; \
struct posix_file_record_ref *rec_ref; \ struct posix_file_record_ref *rec_ref; \
char *newpath; \ char *newpath; \
...@@ -220,10 +214,7 @@ static int darshan_mem_alignment = 1; ...@@ -220,10 +214,7 @@ static int darshan_mem_alignment = 1;
rec_ref->offset = 0; \ rec_ref->offset = 0; \
rec_ref->last_byte_written = 0; \ rec_ref->last_byte_written = 0; \
rec_ref->last_byte_read = 0; \ rec_ref->last_byte_read = 0; \
if(__stream_flag)\ rec_ref->file_rec->counters[POSIX_OPENS] += 1; \
rec_ref->file_rec->counters[POSIX_FOPENS] += 1; \
else \
rec_ref->file_rec->counters[POSIX_OPENS] += 1; \
if(rec_ref->file_rec->fcounters[POSIX_F_OPEN_TIMESTAMP] == 0 || \ if(rec_ref->file_rec->fcounters[POSIX_F_OPEN_TIMESTAMP] == 0 || \
rec_ref->file_rec->fcounters[POSIX_F_OPEN_TIMESTAMP] > __tm1) \ rec_ref->file_rec->fcounters[POSIX_F_OPEN_TIMESTAMP] > __tm1) \
rec_ref->file_rec->fcounters[POSIX_F_OPEN_TIMESTAMP] = __tm1; \ rec_ref->file_rec->fcounters[POSIX_F_OPEN_TIMESTAMP] = __tm1; \
...@@ -234,7 +225,7 @@ static int darshan_mem_alignment = 1; ...@@ -234,7 +225,7 @@ static int darshan_mem_alignment = 1;
if(newpath != __path) free(newpath); \ if(newpath != __path) free(newpath); \
} while(0) } while(0)
#define POSIX_RECORD_READ(__ret, __fd, __pread_flag, __pread_offset, __aligned, __stream_flag, __tm1, __tm2) do { \ #define POSIX_RECORD_READ(__ret, __fd, __pread_flag, __pread_offset, __aligned, __tm1, __tm2) do { \
struct posix_file_record_ref* rec_ref; \ struct posix_file_record_ref* rec_ref; \
size_t stride; \ size_t stride; \
int64_t this_offset; \ int64_t this_offset; \
...@@ -261,10 +252,7 @@ static int darshan_mem_alignment = 1; ...@@ -261,10 +252,7 @@ static int darshan_mem_alignment = 1;
if(rec_ref->file_rec->counters[POSIX_MAX_BYTE_READ] < (this_offset + __ret - 1)) \ if(rec_ref->file_rec->counters[POSIX_MAX_BYTE_READ] < (this_offset + __ret - 1)) \
rec_ref->file_rec->counters[POSIX_MAX_BYTE_READ] = (this_offset + __ret - 1); \ rec_ref->file_rec->counters[POSIX_MAX_BYTE_READ] = (this_offset + __ret - 1); \
rec_ref->file_rec->counters[POSIX_BYTES_READ] += __ret; \ rec_ref->file_rec->counters[POSIX_BYTES_READ] += __ret; \
if(__stream_flag) \ rec_ref->file_rec->counters[POSIX_READS] += 1; \
rec_ref->file_rec->counters[POSIX_FREADS] += 1; \
else \
rec_ref->file_rec->counters[POSIX_READS] += 1; \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[POSIX_SIZE_READ_0_100]), __ret); \ DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[POSIX_SIZE_READ_0_100]), __ret); \
darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, __ret, \ darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, __ret, \
&(rec_ref->file_rec->counters[POSIX_ACCESS1_ACCESS]), \ &(rec_ref->file_rec->counters[POSIX_ACCESS1_ACCESS]), \
...@@ -291,7 +279,7 @@ static int darshan_mem_alignment = 1; ...@@ -291,7 +279,7 @@ static int darshan_mem_alignment = 1;
__tm1, __tm2, rec_ref->last_read_end); \ __tm1, __tm2, rec_ref->last_read_end); \
} while(0) } while(0)
#define POSIX_RECORD_WRITE(__ret, __fd, __pwrite_flag, __pwrite_offset, __aligned, __stream_flag, __tm1, __tm2) do { \ #define POSIX_RECORD_WRITE(__ret, __fd, __pwrite_flag, __pwrite_offset, __aligned, __tm1, __tm2) do { \
struct posix_file_record_ref* rec_ref; \ struct posix_file_record_ref* rec_ref; \
size_t stride; \ size_t stride; \
int64_t this_offset; \ int64_t this_offset; \
...@@ -318,10 +306,7 @@ static int darshan_mem_alignment = 1; ...@@ -318,10 +306,7 @@ static int darshan_mem_alignment = 1;
if(rec_ref->file_rec->counters[POSIX_MAX_BYTE_WRITTEN] < (this_offset + __ret - 1)) \ if(rec_ref->file_rec->counters[POSIX_MAX_BYTE_WRITTEN] < (this_offset + __ret - 1)) \
rec_ref->file_rec->counters[POSIX_MAX_BYTE_WRITTEN] = (this_offset + __ret - 1); \ rec_ref->file_rec->counters[POSIX_MAX_BYTE_WRITTEN] = (this_offset + __ret - 1); \
rec_ref->file_rec->counters[POSIX_BYTES_WRITTEN] += __ret; \ rec_ref->file_rec->counters[POSIX_BYTES_WRITTEN] += __ret; \
if(__stream_flag) \ rec_ref->file_rec->counters[POSIX_WRITES] += 1; \
rec_ref->file_rec->counters[POSIX_FWRITES] += 1; \
else \
rec_ref->file_rec->counters[POSIX_WRITES] += 1; \
DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[POSIX_SIZE_WRITE_0_100]), __ret); \ DARSHAN_BUCKET_INC(&(rec_ref->file_rec->counters[POSIX_SIZE_WRITE_0_100]), __ret); \
darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, __ret, \ darshan_common_val_counter(&rec_ref->access_root, &rec_ref->access_count, __ret, \
&(rec_ref->file_rec->counters[POSIX_ACCESS1_ACCESS]), \ &(rec_ref->file_rec->counters[POSIX_ACCESS1_ACCESS]), \
...@@ -404,7 +389,7 @@ int DARSHAN_DECL(open)(const char *path, int flags, ...) ...@@ -404,7 +389,7 @@ int DARSHAN_DECL(open)(const char *path, int flags, ...)
} }
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, path, mode, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, path, mode, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -437,7 +422,7 @@ int DARSHAN_DECL(open64)(const char *path, int flags, ...) ...@@ -437,7 +422,7 @@ int DARSHAN_DECL(open64)(const char *path, int flags, ...)
} }
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, path, mode, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, path, mode, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -455,7 +440,7 @@ int DARSHAN_DECL(creat)(const char* path, mode_t mode) ...@@ -455,7 +440,7 @@ int DARSHAN_DECL(creat)(const char* path, mode_t mode)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, path, mode, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, path, mode, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -473,55 +458,7 @@ int DARSHAN_DECL(creat64)(const char* path, mode_t mode) ...@@ -473,55 +458,7 @@ int DARSHAN_DECL(creat64)(const char* path, mode_t mode)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, path, mode, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, path, mode, tm1, tm2);
POSIX_POST_RECORD();
return(ret);
}
FILE* DARSHAN_DECL(fopen)(const char *path, const char *mode)
{
FILE* ret;
int fd;
double tm1, tm2;
MAP_OR_FAIL(fopen);
tm1 = darshan_core_wtime();
ret = __real_fopen(path, mode);
tm2 = darshan_core_wtime();
if(ret == NULL)
fd = -1;
else
fd = fileno(ret);
POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(fd, path, 0, 1, tm1, tm2);
POSIX_POST_RECORD();
return(ret);
}
FILE* DARSHAN_DECL(fopen64)(const char *path, const char *mode)
{
FILE* ret;
int fd;
double tm1, tm2;
MAP_OR_FAIL(fopen64);
tm1 = darshan_core_wtime();
ret = __real_fopen64(path, mode);
tm2 = darshan_core_wtime();
if(ret == NULL)
fd = -1;
else
fd = fileno(ret);
POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(fd, path, 0, 1, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -539,7 +476,7 @@ int DARSHAN_DECL(mkstemp)(char* template) ...@@ -539,7 +476,7 @@ int DARSHAN_DECL(mkstemp)(char* template)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, template, 0, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -557,7 +494,7 @@ int DARSHAN_DECL(mkostemp)(char* template, int flags) ...@@ -557,7 +494,7 @@ int DARSHAN_DECL(mkostemp)(char* template, int flags)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, template, 0, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -575,7 +512,7 @@ int DARSHAN_DECL(mkstemps)(char* template, int suffixlen) ...@@ -575,7 +512,7 @@ int DARSHAN_DECL(mkstemps)(char* template, int suffixlen)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, template, 0, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -593,7 +530,7 @@ int DARSHAN_DECL(mkostemps)(char* template, int suffixlen, int flags) ...@@ -593,7 +530,7 @@ int DARSHAN_DECL(mkostemps)(char* template, int suffixlen, int flags)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2); POSIX_RECORD_OPEN(ret, template, 0, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -614,7 +551,7 @@ ssize_t DARSHAN_DECL(read)(int fd, void *buf, size_t count) ...@@ -614,7 +551,7 @@ ssize_t DARSHAN_DECL(read)(int fd, void *buf, size_t count)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_READ(ret, fd, 0, 0, aligned_flag, 0, tm1, tm2); POSIX_RECORD_READ(ret, fd, 0, 0, aligned_flag, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -635,7 +572,7 @@ ssize_t DARSHAN_DECL(write)(int fd, const void *buf, size_t count) ...@@ -635,7 +572,7 @@ ssize_t DARSHAN_DECL(write)(int fd, const void *buf, size_t count)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_WRITE(ret, fd, 0, 0, aligned_flag, 0, tm1, tm2); POSIX_RECORD_WRITE(ret, fd, 0, 0, aligned_flag, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -656,7 +593,7 @@ ssize_t DARSHAN_DECL(pread)(int fd, void *buf, size_t count, off_t offset) ...@@ -656,7 +593,7 @@ ssize_t DARSHAN_DECL(pread)(int fd, void *buf, size_t count, off_t offset)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_READ(ret, fd, 1, offset, aligned_flag, 0, tm1, tm2); POSIX_RECORD_READ(ret, fd, 1, offset, aligned_flag, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -677,7 +614,7 @@ ssize_t DARSHAN_DECL(pwrite)(int fd, const void *buf, size_t count, off_t offset ...@@ -677,7 +614,7 @@ ssize_t DARSHAN_DECL(pwrite)(int fd, const void *buf, size_t count, off_t offset
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_WRITE(ret, fd, 1, offset, aligned_flag, 0, tm1, tm2); POSIX_RECORD_WRITE(ret, fd, 1, offset, aligned_flag, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -698,7 +635,7 @@ ssize_t DARSHAN_DECL(pread64)(int fd, void *buf, size_t count, off64_t offset) ...@@ -698,7 +635,7 @@ ssize_t DARSHAN_DECL(pread64)(int fd, void *buf, size_t count, off64_t offset)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_READ(ret, fd, 1, offset, aligned_flag, 0, tm1, tm2); POSIX_RECORD_READ(ret, fd, 1, offset, aligned_flag, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -719,7 +656,7 @@ ssize_t DARSHAN_DECL(pwrite64)(int fd, const void *buf, size_t count, off64_t of ...@@ -719,7 +656,7 @@ ssize_t DARSHAN_DECL(pwrite64)(int fd, const void *buf, size_t count, off64_t of
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_WRITE(ret, fd, 1, offset, aligned_flag, 0, tm1, tm2); POSIX_RECORD_WRITE(ret, fd, 1, offset, aligned_flag, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -745,7 +682,7 @@ ssize_t DARSHAN_DECL(readv)(int fd, const struct iovec *iov, int iovcnt) ...@@ -745,7 +682,7 @@ ssize_t DARSHAN_DECL(readv)(int fd, const struct iovec *iov, int iovcnt)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_READ(ret, fd, 0, 0, aligned_flag, 0, tm1, tm2); POSIX_RECORD_READ(ret, fd, 0, 0, aligned_flag, tm1, tm2);
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -771,67 +708,7 @@ ssize_t DARSHAN_DECL(writev)(int fd, const struct iovec *iov, int iovcnt) ...@@ -771,67 +708,7 @@ ssize_t DARSHAN_DECL(writev)(int fd, const struct iovec *iov, int iovcnt)
tm2 = darshan_core_wtime(); tm2 = darshan_core_wtime();
POSIX_PRE_RECORD(); POSIX_PRE_RECORD();
POSIX_RECORD_WRITE(ret, fd, 0, 0, aligned_flag, 0, tm1, tm2); POSIX_RECORD_WRITE(ret, fd, 0, 0, aligned_flag, tm1, tm2);
POSIX_POST_RECORD();
return(ret);
}
size_t DARSHAN_DECL(fread)(void *ptr, size_t size, size_t nmemb, FILE *stream)
{
size_t ret;
int aligned_flag = 0;
int fd;
double tm1, tm2;
MAP_OR_FAIL(fread);
if((unsigned long)ptr % darshan_mem_alignment == 0) aligned_flag = 1;
tm1 = darshan_core_wtime();
ret = __real_fread(ptr, size, nmemb, stream);
tm2 = darshan_core_wtime();
fd = fileno(stream);
POSIX_PRE_RECORD();
if(ret > 0)
{
POSIX_RECORD_READ(size*ret, fd, 0, 0, aligned_flag, 1, tm1, tm2);
}
else
{
POSIX_RECORD_READ(ret, fd, 0, 0, aligned_flag, 1, tm1, tm2);
}
POSIX_POST_RECORD();
return(ret);
}
size_t DARSHAN_DECL(fwrite)(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
size_t ret;
int aligned_flag = 0;
int fd;
double tm1, tm2;
MAP_OR_FAIL(fwrite);
if((unsigned long)ptr % darshan_mem_alignment == 0) aligned_flag = 1;
tm1 = darshan_core_wtime();
ret = __real_fwrite(ptr, size, nmemb, stream);
tm2 = darshan_core_wtime();
fd = fileno(stream);
POSIX_PRE_RECORD();
if(ret > 0)
{
POSIX_RECORD_WRITE(size*ret, fd, 0, 0, aligned_flag, 1, tm1, tm2);
}
else
{
POSIX_RECORD_WRITE(ret, fd, 0, 0, aligned_flag, 1, tm1, tm2);
}
POSIX_POST_RECORD(); POSIX_POST_RECORD();
return(ret); return(ret);
...@@ -897,38 +774,6 @@ off_t DARSHAN_DECL(lseek64)(int fd, off_t offset, int whence) ...@@ -897,38 +774,6 @@ off_t DARSHAN_DECL(lseek64)(int fd, off_t offset, int whence)
return(ret); return(ret);
} }
int DARSHAN_DECL(fseek)(FILE *stream, long offset, int whence)
{
int ret;
struct posix_file_record_ref *rec_ref;
int fd;
double tm1, tm2;
MAP_OR_FAIL(fseek);
tm1 = darshan_core_wtime();
ret = __real_fseek(stream, offset, whence);
tm2 = darshan_core_wtime();
if(ret >= 0)
{
POSIX_PRE_RECORD();
fd = fileno(stream);
rec_ref = darshan_lookup_record_ref(posix_runtime->fd_hash, &fd, sizeof(int));
if(rec_ref)
{
rec_ref->offset = ftell(stream);
DARSHAN_TIMER_INC_NO_OVERLAP(
rec_ref->file_rec->fcounters[POSIX_F_META_TIME],
tm1, tm2, rec_ref->last_meta_end);
rec_ref->file_rec->counters[POSIX_FSEEKS] += 1;
}
POSIX_POST_RECORD();
}
return(ret);
}
int DARSHAN_DECL(__xstat)(int vers, const char *path, struct stat *buf) int DARSHAN_DECL(__xstat)(int vers, const char *path, struct stat *buf)
{ {
int ret; int ret;
...@@ -1199,37 +1044,6 @@ int DARSHAN_DECL(close)(int fd) ...@@ -1199,37 +1044,6 @@ int DARSHAN_DECL(close)(int fd)
return(ret); return(ret);
} }
int DARSHAN_DECL(fclose)(FILE *fp)
{
int ret;
struct posix_file_record_ref *rec_ref;
int fd = fileno(fp);
double tm1, tm2;
MAP_OR_FAIL(fclose);
tm1 = darshan_core_wtime();
ret = __real_fclose(fp);
tm2 = darshan_core_wtime();
POSIX_PRE_RECORD();
rec_ref = darshan_lookup_record_ref(posix_runtime->fd_hash, &fd, sizeof(int));
if(rec_ref)
{
rec_ref->last_byte_written = 0;
rec_ref->last_byte_read = 0;
rec_ref->file_rec->fcounters[POSIX_F_CLOSE_TIMESTAMP] =
darshan_core_wtime();
DARSHAN_TIMER_INC_NO_OVERLAP(
rec_ref->file_rec->fcounters[POSIX_F_META_TIME],
tm1, tm2, rec_ref->last_meta_end);
darshan_delete_record_ref(&(posix_runtime->fd_hash), &fd, sizeof(int));
}
POSIX_POST_RECORD();
return(ret);
}
int DARSHAN_DECL(aio_read)(struct aiocb *aiocbp) int DARSHAN_DECL(aio_read)(struct aiocb *aiocbp)
{ {
int ret; int ret;
...@@ -1319,13 +1133,13 @@ ssize_t DARSHAN_DECL(aio_return)(struct aiocb *aiocbp) ...@@ -1319,13 +1133,13 @@ ssize_t DARSHAN_DECL(aio_return)(struct aiocb *aiocbp)
if(aiocbp->aio_lio_opcode == LIO_WRITE) if(aiocbp->aio_lio_opcode == LIO_WRITE)
{ {
POSIX_RECORD_WRITE(ret, aiocbp->aio_fildes, POSIX_RECORD_WRITE(ret, aiocbp->aio_fildes,
1, aiocbp->aio_offset, aligned_flag, 0, 1, aiocbp->aio_offset, aligned_flag,
tmp->tm1, tm2); tmp->tm1, tm2);
} }
else if(aiocbp->aio_lio_opcode == LIO_READ) else if(aiocbp->aio_lio_opcode == LIO_READ)
{ {
POSIX_RECORD_READ(ret, aiocbp->aio_fildes, POSIX_RECORD_READ(ret, aiocbp->aio_fildes,
1, aiocbp->aio_offset, aligned_flag, 0, 1, aiocbp->aio_offset, aligned_flag,
tmp->tm1, tm2); tmp->tm1, tm2);
} }
free(tmp); free(tmp);
...@@ -1356,13 +1170,13 @@ ssize_t DARSHAN_DECL(aio_return64)(struct aiocb64 *aiocbp) ...@@ -1356,13 +1170,13 @@ ssize_t DARSHAN_DECL(aio_return64)(struct aiocb64 *aiocbp)
if(aiocbp->aio_lio_opcode == LIO_WRITE) if(aiocbp->aio_lio_opcode == LIO_WRITE)
{ {
POSIX_RECORD_WRITE(ret, aiocbp->aio_fildes, POSIX_RECORD_WRITE(ret, aiocbp->aio_fildes,
1, aiocbp->aio_offset, aligned_flag, 0, 1, aiocbp->aio_offset, aligned_flag,
tmp->tm1, tm2); tmp->tm1, tm2);
} }
else if(aiocbp->aio_lio_opcode == LIO_READ) else if(aiocbp->aio_lio_opcode == LIO_READ)
{ {
POSIX_RECORD_READ(ret, aiocbp->aio_fildes, POSIX_RECORD_READ(ret, aiocbp->aio_fildes,
1, aiocbp->aio_offset, aligned_flag, 0, 1, aiocbp->aio_offset, aligned_flag,
tmp->tm1, tm2); tmp->tm1, tm2);
} }
free(tmp); free(tmp);
...@@ -1927,15 +1741,15 @@ void darshan_posix_shutdown_bench_setup(int test_case) ...@@ -1927,15 +1741,15 @@ void darshan_posix_shutdown_bench_setup(int test_case)
case 1: /* single file-per-process */ case 1: /* single file-per-process */
snprintf(filepath, 256, "fpp-0_rank-%d", my_rank); snprintf(filepath, 256, "fpp-0_rank-%d", my_rank);
POSIX_RECORD_OPEN(fd_array[0], filepath, 777, 0, 0, 1); POSIX_RECORD_OPEN(fd_array[0], filepath, 777, 0, 1);
POSIX_RECORD_WRITE(size_array[0], fd_array[0], 0, 0, 1, 0, 1, 2); POSIX_RECORD_WRITE(size_array[0], fd_array[0], 0, 0, 1, 1, 2);
break; break;
case 2: /* single shared file */ case 2: /* single shared file */
snprintf(filepath, 256, "shared-0"); snprintf(filepath, 256, "shared-0");
POSIX_RECORD_OPEN(fd_array[0], filepath, 777, 0, 0, 1); POSIX_RECORD_OPEN(fd_array[0], filepath, 777, 0, 1);
POSIX_RECORD_WRITE(size_array[0], fd_array[0], 0, 0, 1, 0, 1, 2); POSIX_RECORD_WRITE(size_array[0], fd_array[0], 0, 0, 1, 1, 2);
break; break;
case 3: /* 1024 unique files per proc */ case 3: /* 1024 unique files per proc */
...@@ -1943,9 +1757,9 @@ void darshan_posix_shutdown_bench_setup(int test_case) ...@@ -1943,9 +1757,9 @@ void darshan_posix_shutdown_bench_setup(int test_case)
{ {
snprintf(filepath, 256, "fpp-%d_rank-%d", i , my_rank); snprintf(filepath, 256, "fpp-%d_rank-%d", i , my_rank);
POSIX_RECORD_OPEN(fd_array[i], filepath, 777, 0, 0, 1);