[Darshan-commits] [Git][darshan/darshan][master] 2 commits: add wrapper for __open_2 function call

Shane Snyder xgitlab at cels.anl.gov
Tue Nov 27 11:13:52 CST 2018


Shane Snyder pushed to branch master at darshan / darshan


Commits:
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
- - - - -


3 changed files:

- ChangeLog
- darshan-runtime/lib/darshan-posix.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;


=====================================
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/4c900db7a5f71c1577aff0b0b4addd353d49b941...be086b444241ef5b641c6a763f532ce96db261b7

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/4c900db7a5f71c1577aff0b0b4addd353d49b941...be086b444241ef5b641c6a763f532ce96db261b7
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/20181127/c0deae74/attachment-0001.html>


More information about the Darshan-commits mailing list