[Darshan-commits] [Git][darshan/darshan][darshan_core_fprintf] 5 commits: bugfix to enable compilation on 32-bit platforms (resolves #252)

Shane Snyder xgitlab at cels.anl.gov
Thu Nov 29 10:46:28 CST 2018


Shane Snyder pushed to branch darshan_core_fprintf at darshan / darshan


Commits:
ddc4cbb4 by Glenn K. Lockwood at 2018-11-24T17:46:38Z
bugfix to enable compilation on 32-bit platforms (resolves #252)

- - - - -
1a8977a1 by Phil Carns at 2018-11-27T15:11:35Z
add wrapper for __open_2 function call

- - - - -
be086b44 by Shane Snyder at 2018-11-27T17:13:51Z
Merge branch 'carns/dev-issue-253' into 'master'

add wrapper for __open_2 function call

Closes #253

See merge request darshan/darshan!28
- - - - -
f119346b by Shane Snyder at 2018-11-27T17:26:17Z
Merge branch 'bugfix-32bit' into 'master'

bugfix to enable compilation on 32-bit platforms (resolves #252)

Closes #252

See merge request darshan/darshan!26
- - - - -
9c83fab7 by Shane Snyder at 2018-11-29T16:45:57Z
Merge branch 'master' into darshan_core_fprintf

- - - - -


4 changed files:

- ChangeLog
- darshan-runtime/lib/darshan-posix.c
- darshan-runtime/lib/darshan-stdio.c
- darshan-runtime/share/ld-opts/darshan-posix-ld-opts


Changes:

=====================================
ChangeLog
=====================================
@@ -9,6 +9,8 @@ Darshan-3.1.7
   were not properly up-converted.  Reported by Teng Wang.
 * bug fix to MiB reported in I/O performance estimate of
   darshan-job-summary.pl when both posix and stdio access is present
+* added wrapper for __open_2(), bug reported by Cormac Garvey in which open
+  calls are not intercepted with some versions of glibc/gcc
 
 Darshan-3.1.6
 =============


=====================================
darshan-runtime/lib/darshan-posix.c
=====================================
@@ -40,6 +40,7 @@ typedef int64_t off64_t;
 
 DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...));
 DARSHAN_FORWARD_DECL(open64, int, (const char *path, int flags, ...));
+DARSHAN_FORWARD_DECL(__open_2, int, (const char *path, int oflag));
 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(mkstemp, int, (char *template));
@@ -403,6 +404,24 @@ int DARSHAN_DECL(open)(const char *path, int flags, ...)
     return(ret);
 }
 
+int DARSHAN_DECL(__open_2)(const char *path, int oflag)
+{
+    int ret;
+    double tm1, tm2;
+
+    MAP_OR_FAIL(__open_2);
+
+    tm1 = darshan_core_wtime();
+    ret = __real___open_2(path, oflag);
+    tm2 = darshan_core_wtime();
+
+    POSIX_PRE_RECORD();
+    POSIX_RECORD_OPEN(ret, path, 0, tm1, tm2);
+    POSIX_POST_RECORD();
+
+    return(ret);
+}
+
 int DARSHAN_DECL(open64)(const char *path, int flags, ...)
 {
     int mode = 0;
@@ -752,7 +771,7 @@ off_t DARSHAN_DECL(lseek)(int fd, off_t offset, int whence)
     return(ret);
 }
 
-off_t DARSHAN_DECL(lseek64)(int fd, off_t offset, int whence)
+off64_t DARSHAN_DECL(lseek64)(int fd, off64_t offset, int whence)
 {
     off_t ret;
     struct posix_file_record_ref *rec_ref;


=====================================
darshan-runtime/lib/darshan-stdio.c
=====================================
@@ -84,6 +84,10 @@
 #include "darshan.h"
 #include "darshan-dynamic.h"
 
+#ifndef HAVE_OFF64_T
+typedef int64_t off64_t;
+#endif
+
 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(fdopen, FILE*, (int fd, const char *mode));
@@ -110,7 +114,7 @@ DARSHAN_FORWARD_DECL(vfscanf, int, (FILE *stream, const char *format, va_list ap
 DARSHAN_FORWARD_DECL(fgets, char*, (char *s, int size, FILE *stream));
 DARSHAN_FORWARD_DECL(fseek, int, (FILE *stream, long offset, int whence));
 DARSHAN_FORWARD_DECL(fseeko, int, (FILE *stream, off_t offset, int whence));
-DARSHAN_FORWARD_DECL(fseeko64, int, (FILE *stream, off_t offset, int whence));
+DARSHAN_FORWARD_DECL(fseeko64, int, (FILE *stream, off64_t offset, int whence));
 DARSHAN_FORWARD_DECL(fsetpos, int, (FILE *stream, const fpos_t *pos));
 DARSHAN_FORWARD_DECL(fsetpos64, int, (FILE *stream, const fpos64_t *pos));
 DARSHAN_FORWARD_DECL(rewind, void, (FILE *stream));
@@ -855,7 +859,7 @@ int DARSHAN_DECL(fseeko)(FILE *stream, off_t offset, int whence)
     return(ret);
 }
 
-int DARSHAN_DECL(fseeko64)(FILE *stream, off_t offset, int whence)
+int DARSHAN_DECL(fseeko64)(FILE *stream, off64_t offset, int whence)
 {
     int ret;
     struct stdio_file_record_ref *rec_ref;


=====================================
darshan-runtime/share/ld-opts/darshan-posix-ld-opts
=====================================
@@ -1,5 +1,6 @@
 --wrap=open
 --wrap=open64
+--wrap=__open_2
 --wrap=creat
 --wrap=creat64
 --wrap=mkstemp



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/500db6a0684154224f121f4f4422d0b52b0a2db6...9c83fab794b5733fb22f9b52c9e7594285f87abf

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/500db6a0684154224f121f4f4422d0b52b0a2db6...9c83fab794b5733fb22f9b52c9e7594285f87abf
You're receiving this email because of your account on xgitlab.cels.anl.gov.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20181129/5d177a2d/attachment-0001.html>


More information about the Darshan-commits mailing list