[Darshan-commits] [Git][darshan/darshan][master] 3 commits: added whitelist so that datawarp mounts under /var are still tracked

Shane Snyder xgitlab at cels.anl.gov
Wed Jan 25 10:34:21 CST 2017


Shane Snyder pushed to branch master at darshan / darshan


Commits:
fe09b90e by Glenn K. Lockwood at 2017-01-24T17:40:19-08:00
added whitelist so that datawarp mounts under /var are still tracked

- - - - -
1721e240 by Glenn K. Lockwood at 2017-01-24T18:09:08-08:00
remove /dev/shm (and /var/tmp) from whitelist for now

- - - - -
c49c9a1e by Shane Snyder at 2017-01-25T10:34:18-06:00
Merge branch 'issue-216-var-whitelist' into 'master'

fix #216 (whitelist to allow some subdirs of /var to be tracked)

Closes #216

See merge request !7
- - - - -


1 changed file:

- darshan-runtime/lib/darshan-core.c


Changes:

=====================================
darshan-runtime/lib/darshan-core.c
=====================================
--- a/darshan-runtime/lib/darshan-core.c
+++ b/darshan-runtime/lib/darshan-core.c
@@ -49,20 +49,27 @@ static int nprocs = -1;
 static int darshan_mem_alignment = 1;
 static long darshan_mod_mem_quota = DARSHAN_MOD_MEM_MAX;
 
-/* paths prefixed with the following directories are not traced by darshan */
+/* paths prefixed with the following directories are not tracked by darshan */
 char* darshan_path_exclusions[] = {
-"/etc/",
-"/dev/",
-"/usr/",
-"/bin/",
-"/boot/",
-"/lib/",
-"/opt/",
-"/sbin/",
-"/sys/",
-"/proc/",
-"/var/",
-NULL
+    "/etc/",
+    "/dev/",
+    "/usr/",
+    "/bin/",
+    "/boot/",
+    "/lib/",
+    "/opt/",
+    "/sbin/",
+    "/sys/",
+    "/proc/",
+    "/var/",
+    NULL
+};
+/* paths prefixed with the following directories are tracked by darshan even if
+ * they share a root with a path listed in darshan_path_exclusions
+ */
+char* darshan_path_inclusions[] = {
+    "/var/opt/cray/dws/mounts/",
+    NULL
 };
 
 #ifdef DARSHAN_BGQ
@@ -2075,15 +2082,24 @@ double darshan_core_wtime()
 
 int darshan_core_excluded_path(const char *path)
 {
-    char *exclude;
+    char *exclude, *include;
     int tmp_index = 0;
-
-    while((exclude = darshan_path_exclusions[tmp_index])) {
-        if(!(strncmp(exclude, path, strlen(exclude))))
-            return(1);
-        tmp_index++;
+    int tmp_jndex;
+
+    /* scan blacklist for paths to exclude */
+    while((exclude = darshan_path_exclusions[tmp_index++])) {
+        if(!(strncmp(exclude, path, strlen(exclude)))) {
+            /* before excluding path, ensure it's not in whitelist */
+            tmp_jndex = 0;
+            while((include = darshan_path_inclusions[tmp_jndex++])) {
+                if(!(strncmp(include, path, strlen(include))))
+                    return(0); /* whitelist hits are always tracked */
+            }
+            return(1); /* if not in whitelist, then blacklist it */
+        }
     }
 
+    /* if not in blacklist, no problem */
     return(0);
 }
 



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/c95a5d88b871c72b6c092f58985235321d52f747...c49c9a1e8a8eb4d3dd108855bf012806acef1e40
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20170125/6e469b89/attachment-0001.html>


More information about the Darshan-commits mailing list