<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>
GitLab
</title>

</head>
<body>
<style type="text/css">
img {
max-width: 100%; height: auto;
}
</style>
<div class="content">
<h3>
Philip Carns pushed to branch dev-stdio
at <a href="https://xgitlab.cels.anl.gov/darshan/darshan">darshan / darshan</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/2813125263dd0df65050808b627d6c6a3350f4fa">28131252</a></strong>
<div>
<span>by Phil Carns</span>
<i>at 2016-04-29T17:22:27-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap">start filling in fopen counters</pre>
</li>
</ul>
<h4>2 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#620f2ecad2bb6f74b2fcd0134963a841" style="text-decoration: none">
darshan-runtime/lib/darshan-stdio.c
</a>
</li>
<li class="file-stats">
<a href="#ad29afc395839758d41094872298bd0d" style="text-decoration: none">
darshan-stdio-log-format.h
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="620f2ecad2bb6f74b2fcd0134963a841">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/2813125263dd0df65050808b627d6c6a3350f4fa#diff-0">
<strong>
darshan-runtime/lib/darshan-stdio.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- a/darshan-runtime/lib/darshan-stdio.c
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-runtime/lib/darshan-stdio.c
</span><span style="color: #aaaaaa">@@ -135,15 +135,52 @@ static void stdio_shutdown(void);
</span> #define STDIO_LOCK() pthread_mutex_lock(&stdio_runtime_mutex)
 #define STDIO_UNLOCK() pthread_mutex_unlock(&stdio_runtime_mutex)
 
<span style="background: #ddffdd; color: #000000">+/* TODO: remember to clean up stream_flag in posix module */
+/* TODO: remember to update start_timestamp logic in other modules */
+
+#define STDIO_RECORD_OPEN(__ret, __path, __tm1, __tm2) do { \
+    struct stdio_file_runtime* file; \
+    char* exclude; \
+    int tmp_index = 0; \
+    if(__ret == NULL) break; \
+    while((exclude = darshan_path_exclusions[tmp_index])) { \
+        if(!(strncmp(exclude, __path, strlen(exclude)))) \
+            break; \
+        tmp_index++; \
+    } \
+    if(exclude) break; \
+    file = stdio_file_by_name_setstream(__path, __ret); \
+    if(!file) break; \
+    file->offset = 0; \
+    file->last_byte_written = 0; \
+    file->last_byte_read = 0; \
+    file->file_record->counters[STDIO_FOPENS] += 1; \
+    if(file->file_record->fcounters[STDIO_F_OPEN_START_TIMESTAMP] == 0 || \
+     file->file_record->fcounters[STDIO_F_OPEN_START_TIMESTAMP] > __tm1) \
+        file->file_record->fcounters[STDIO_F_OPEN_START_TIMESTAMP] = __tm1; \
+    file->file_record->fcounters[STDIO_F_OPEN_END_TIMESTAMP] = __tm2; \
+    DARSHAN_TIMER_INC_NO_OVERLAP(file->file_record->fcounters[STDIO_F_META_TIME], __tm1, __tm2, file->last_meta_end); \
+} while(0)
+
+
+
</span> FILE* DARSHAN_DECL(fopen)(const char *path, const char *mode)
 {
     FILE* ret;
<span style="background: #ddffdd; color: #000000">+    double tm1, tm2;
</span> 
     fprintf(stderr, "FOO: HELLO WORLD (FOPEN)\n");
 
     MAP_OR_FAIL(fopen);
 
<span style="background: #ddffdd; color: #000000">+    tm1 = darshan_core_wtime();
</span>     ret = __real_fopen(path, mode);
<span style="background: #ddffdd; color: #000000">+    tm2 = darshan_core_wtime();
+
+    STDIO_LOCK();
+    stdio_runtime_initialize();
+    STDIO_RECORD_OPEN(ret, path, tm1, tm2);
+    STDIO_UNLOCK();
</span> 
     return(ret);
 }
</code></pre>

<br>
</li>
<li id="ad29afc395839758d41094872298bd0d">
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/2813125263dd0df65050808b627d6c6a3350f4fa#diff-1">
<strong>
darshan-stdio-log-format.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="background: #ffdddd; color: #000000">--- a/darshan-stdio-log-format.h
</span><span style="background: #ddffdd; color: #000000">+++ b/darshan-stdio-log-format.h
</span><span style="color: #aaaaaa">@@ -56,18 +56,18 @@
</span>  */
 
 #define STDIO_COUNTERS \
<span style="background: #ffdddd; color: #000000">-    /* count of number of 'bar' function calls */\
-    X(STDIO_BARS) \
-    /* arbitrary data value set by last call to 'bar' */\
-    X(STDIO_BAR_DAT) \
</span><span style="background: #ddffdd; color: #000000">+    /* count of fopens */\
+    X(STDIO_FOPENS) \
</span>     /* end of counters */\
     X(STDIO_NUM_INDICES)
 
 #define STDIO_F_COUNTERS \
<span style="background: #ffdddd; color: #000000">-    /* timestamp of the first call to function 'bar' */\
-    X(STDIO_F_BAR_TIMESTAMP) \
-    /* timer indicating duration of last call to 'bar' */\
-    X(STDIO_F_BAR_DURATION) \
</span><span style="background: #ddffdd; color: #000000">+    /* timestamp of first open */\
+    X(STDIO_F_OPEN_START_TIMESTAMP) \
+    /* timestamp of last open completion */\
+    X(STDIO_F_OPEN_END_TIMESTAMP) \
+    /* cumulative meta time */\
+    X(STDIO_F_META_TIME) \
</span>     /* end of counters */\
     X(STDIO_F_NUM_INDICES)
 
</code></pre>

<br>
</li>

</div>
<div class="footer" style="margin-top: 10px">
<p style="color: #777; font-size: small">

<br>
<a href="https://xgitlab.cels.anl.gov/darshan/darshan/commit/2813125263dd0df65050808b627d6c6a3350f4fa">View it on GitLab</a>.
<br>
You're receiving this email because of your account on xgitlab.cels.anl.gov.
If you'd like to receive fewer emails, you can
adjust your notification settings.

</p>
</div>
</body>
</html>