[Darshan-commits] [Darshan] branch, dev-modular, updated. darshan-2.3.1-82-gc97d2f1

Service Account git at mcs.anl.gov
Wed Apr 1 12:35:42 CDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "".

The branch, dev-modular has been updated
       via  c97d2f192f6c2e27bdd50f8fac007f5df4a07f90 (commit)
       via  6b4f41096ff819be3bbe77948b92f945f10a7ed2 (commit)
      from  1c701efff1a082d2bba582190da5ad9d2c5bbe86 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c97d2f192f6c2e27bdd50f8fac007f5df4a07f90
Author: Shane Snyder <ssnyder at mcs.anl.gov>
Date:   Wed Apr 1 12:35:00 2015 -0500

    more posix wrappers: mkstemp family

commit 6b4f41096ff819be3bbe77948b92f945f10a7ed2
Author: Shane Snyder <ssnyder at mcs.anl.gov>
Date:   Wed Apr 1 10:15:19 2015 -0500

    more posix wrappers: mmap

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

Summary of changes:
 darshan-posix-log-format.h            |    5 -
 darshan-runtime/darshan-posix-ld-opts |    6 ++
 darshan-runtime/lib/darshan-posix.c   |  132 ++++++++++++++++++++++++++++++++-
 darshan-util/darshan-posix-parser.c   |    2 +
 4 files changed, 138 insertions(+), 7 deletions(-)


Diff of changes:
diff --git a/darshan-posix-log-format.h b/darshan-posix-log-format.h
index e699ab5..bdf8546 100644
--- a/darshan-posix-log-format.h
+++ b/darshan-posix-log-format.h
@@ -16,9 +16,7 @@ enum darshan_posix_indices
     POSIX_WRITES,             /* count of posix writes */
     POSIX_SEEKS,              /* count of posix seeks */
     POSIX_STATS,              /* count of posix stat/lstat/fstats */
-#if 0
     POSIX_MMAPS,              /* count of posix mmaps */
-#endif
     POSIX_FOPENS,             /* count of posix fopens */
     POSIX_FREADS,             /* count of posix freads */
     POSIX_FWRITES,            /* count of posix fwrites */
@@ -99,9 +97,6 @@ enum darshan_posix_indices
 /* floating point statistics for POSIX file records */
 enum darshan_posix_f_indices
 {
-    /* NOTE: adjust cp_normalize_timestamps() function if any TIMESTAMPS are
-     * added or modified in this list
-     */
     POSIX_F_OPEN_TIMESTAMP = 0,    /* timestamp of first open */
     POSIX_F_READ_START_TIMESTAMP,  /* timestamp of first read */
     POSIX_F_WRITE_START_TIMESTAMP, /* timestamp of first write */
diff --git a/darshan-runtime/darshan-posix-ld-opts b/darshan-runtime/darshan-posix-ld-opts
index dea658e..4521894 100644
--- a/darshan-runtime/darshan-posix-ld-opts
+++ b/darshan-runtime/darshan-posix-ld-opts
@@ -4,6 +4,10 @@
 --wrap=creat64
 --wrap=fopen
 --wrap=fopen64
+--wrap=mkstemp
+--wrap=mkostemp
+--wrap=mkstemps
+--wrap=mkostemps
 --wrap=read
 --wrap=write
 --wrap=pread
@@ -23,6 +27,8 @@
 --wrap=__lxstat64
 --wrap=__fxstat
 --wrap=__fxstat64
+--wrap=mmap
+--wrap=mmap64
 --wrap=fsync
 --wrap=fdatasync
 --wrap=close
diff --git a/darshan-runtime/lib/darshan-posix.c b/darshan-runtime/lib/darshan-posix.c
index a06cbd0..ee48afc 100644
--- a/darshan-runtime/lib/darshan-posix.c
+++ b/darshan-runtime/lib/darshan-posix.c
@@ -43,6 +43,10 @@ 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(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(mkostemp, int, (char *template, int flags));
+DARSHAN_FORWARD_DECL(mkstemps, int, (char *template, int suffixlen));
+DARSHAN_FORWARD_DECL(mkostemps, int, (char *template, int suffixlen, int flags));
 DARSHAN_FORWARD_DECL(read, ssize_t, (int fd, void *buf, size_t count));
 DARSHAN_FORWARD_DECL(write, ssize_t, (int fd, const void *buf, size_t count));
 DARSHAN_FORWARD_DECL(pread, ssize_t, (int fd, void *buf, size_t count, off_t offset));
@@ -62,12 +66,12 @@ 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(__fxstat, int, (int vers, int fd, struct stat *buf));
 DARSHAN_FORWARD_DECL(__fxstat64, int, (int vers, int fd, struct stat64 *buf));
-/* TODO mmaps */
+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(fsync, int, (int fd));
 DARSHAN_FORWARD_DECL(fdatasync, int, (int fd));
 DARSHAN_FORWARD_DECL(close, int, (int fd));
 DARSHAN_FORWARD_DECL(fclose, int, (FILE *fp));
-/* TODO mkstemp */
 /* TODO aio */
 /* TODO listio */
 
@@ -497,6 +501,82 @@ FILE* DARSHAN_DECL(fopen64)(const char *path, const char *mode)
     return(ret);
 }
 
+int DARSHAN_DECL(mkstemp)(char* template)
+{
+    int ret;
+    double tm1, tm2;
+
+    MAP_OR_FAIL(mkstemp);
+
+    tm1 = darshan_core_wtime();
+    ret = __real_mkstemp(template);
+    tm2 = darshan_core_wtime();
+
+    POSIX_LOCK();
+    posix_runtime_initialize();
+    POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2);
+    POSIX_UNLOCK();
+
+    return(ret);
+}
+
+int DARSHAN_DECL(mkostemp)(char* template, int flags)
+{
+    int ret;
+    double tm1, tm2;
+
+    MAP_OR_FAIL(mkostemp);
+
+    tm1 = darshan_core_wtime();
+    ret = __real_mkostemp(template, flags);
+    tm2 = darshan_core_wtime();
+
+    POSIX_LOCK();
+    posix_runtime_initialize();
+    POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2);
+    POSIX_UNLOCK();
+
+    return(ret);
+}
+
+int DARSHAN_DECL(mkstemps)(char* template, int suffixlen)
+{
+    int ret;
+    double tm1, tm2;
+
+    MAP_OR_FAIL(mkstemps);
+
+    tm1 = darshan_core_wtime();
+    ret = __real_mkstemps(template, suffixlen);
+    tm2 = darshan_core_wtime();
+
+    POSIX_LOCK();
+    posix_runtime_initialize();
+    POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2);
+    POSIX_UNLOCK();
+
+    return(ret);
+}
+
+int DARSHAN_DECL(mkostemps)(char* template, int suffixlen, int flags)
+{
+    int ret;
+    double tm1, tm2;
+
+    MAP_OR_FAIL(mkostemps);
+
+    tm1 = darshan_core_wtime();
+    ret = __real_mkostemps(template, suffixlen, flags);
+    tm2 = darshan_core_wtime();
+
+    POSIX_LOCK();
+    posix_runtime_initialize();
+    POSIX_RECORD_OPEN(ret, template, 0, 0, tm1, tm2);
+    POSIX_UNLOCK();
+
+    return(ret);
+}
+
 ssize_t DARSHAN_DECL(read)(int fd, void *buf, size_t count)
 {
     ssize_t ret;
@@ -993,6 +1073,54 @@ int DARSHAN_DECL(__fxstat64)(int vers, int fd, struct stat64 *buf)
     return(ret);
 }
 
+void* DARSHAN_DECL(mmap)(void *addr, size_t length, int prot, int flags,
+    int fd, off_t offset)
+{
+    void* ret;
+    struct posix_file_runtime* file;
+
+    MAP_OR_FAIL(mmap);
+
+    ret = __real_mmap(addr, length, prot, flags, fd, offset);
+    if(ret == MAP_FAILED)
+        return(ret);
+
+    POSIX_LOCK();
+    posix_runtime_initialize();
+    file = posix_file_by_fd(fd);
+    if(file)
+    {
+        DARSHAN_COUNTER_INC(file->file_record, POSIX_MMAPS, 1);
+    }
+    POSIX_UNLOCK();
+
+    return(ret);
+}
+
+void* DARSHAN_DECL(mmap64)(void *addr, size_t length, int prot, int flags,
+    int fd, off64_t offset)
+{
+    void* ret;
+    struct posix_file_runtime* file;
+
+    MAP_OR_FAIL(mmap64);
+
+    ret = __real_mmap64(addr, length, prot, flags, fd, offset);
+    if(ret == MAP_FAILED)
+        return(ret);
+
+    POSIX_LOCK();
+    posix_runtime_initialize();
+    file = posix_file_by_fd(fd);
+    if(file)
+    {
+        DARSHAN_COUNTER_INC(file->file_record, POSIX_MMAPS, 1);
+    }
+    POSIX_UNLOCK();
+
+    return(ret);
+}
+
 int DARSHAN_DECL(fsync)(int fd)
 {
     int ret;
diff --git a/darshan-util/darshan-posix-parser.c b/darshan-util/darshan-posix-parser.c
index eddf56c..9ff4a41 100644
--- a/darshan-util/darshan-posix-parser.c
+++ b/darshan-util/darshan-posix-parser.c
@@ -175,6 +175,7 @@ int main(int argc, char **argv)
             "\t\tPOSIX_WRITES:\t%"PRIu64"\n"
             "\t\tPOSIX_SEEKS:\t%"PRIu64"\n"
             "\t\tPOSIX_STATS:\t%"PRIu64"\n"
+            "\t\tPOSIX_MMAPS:\t%"PRIu64"\n"
             "\t\tPOSIX_FOPENS:\t%"PRIu64"\n"
             "\t\tPOSIX_FREADS:\t%"PRIu64"\n"
             "\t\tPOSIX_FWRITES:\t%"PRIu64"\n"
@@ -210,6 +211,7 @@ int main(int argc, char **argv)
             next_file.counters[POSIX_WRITES],
             next_file.counters[POSIX_SEEKS],
             next_file.counters[POSIX_STATS],
+            next_file.counters[POSIX_MMAPS],
             next_file.counters[POSIX_FOPENS],
             next_file.counters[POSIX_FREADS],
             next_file.counters[POSIX_FWRITES],


hooks/post-receive
--



More information about the Darshan-commits mailing list