[Darshan-commits] [Git][darshan/darshan][lustre-mod] fixed bugs that prevented record names from mapping to file systems in darshan-u…

Glenn K. Lockwood xgitlab at cels.anl.gov
Tue Jun 21 15:36:00 CDT 2016


Glenn K. Lockwood pushed to branch lustre-mod at darshan / darshan


Commits:
7d9b5b37 by Glenn K. Lockwood at 2016-06-21T13:35:33-07:00
fixed bugs that prevented record names from mapping to file systems in darshan-util; also fixed thread safety and deadlock issues

- - - - -


1 changed file:

- darshan-runtime/lib/darshan-lustre.c


Changes:

=====================================
darshan-runtime/lib/darshan-lustre.c
=====================================
--- a/darshan-runtime/lib/darshan-lustre.c
+++ b/darshan-runtime/lib/darshan-lustre.c
@@ -57,14 +57,29 @@ void darshan_instrument_lustre_file(const char* filepath, int fd)
     size_t lumsize = sizeof(struct lov_user_md) +
         LOV_MAX_STRIPE_COUNT * sizeof(struct lov_user_ost_data);
     size_t rec_size;
+    char *newname = NULL;
 
     LUSTRE_LOCK();
+    if(instrumentation_disabled)
+    {
+        LUSTRE_UNLOCK();
+        return;
+    }
+
     /* make sure the lustre module is already initialized */
     lustre_runtime_initialize();
+    if(!lustre_runtime)
+    {
+        LUSTRE_UNLOCK();
+        return;
+    }
 
     /* if we can't issue ioctl, we have no counter data at all */
     if ( (lum = calloc(1, lumsize)) == NULL )
+    {
+        LUSTRE_UNLOCK();
         return;
+    }
 
     /* find out the OST count of this file so we can allocate memory */
     lum->lmm_magic = LOV_USER_MAGIC;
@@ -74,11 +89,17 @@ void darshan_instrument_lustre_file(const char* filepath, int fd)
     if ( ioctl( fd, LL_IOC_LOV_GETSTRIPE, (void *)lum ) == -1 )
     {
         free(lum);
+        LUSTRE_UNLOCK();
         return;
     }
 
     rec_size = LUSTRE_RECORD_SIZE( lum->lmm_stripe_count );
 
+    /* get fully qualified name for record */
+    newname = darshan_clean_file_path(filepath);
+    if(!newname)
+        newname = (char*)filepath;
+
     {
         /* broken out for clarity */
         void *end_of_new_record = (char*)lustre_runtime->next_free_record + rec_size;
@@ -89,8 +110,8 @@ void darshan_instrument_lustre_file(const char* filepath, int fd)
     /* register a Lustre file record with Darshan */
     fs_info.fs_type = -1;
     darshan_core_register_record(
-        (void *)filepath,
-        strlen(filepath),
+        (void *)newname,
+        strlen(newname),
         DARSHAN_LUSTRE_MOD,
         1,
         limit_flag,



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/7d9b5b37a6c9223d42f295c5e2ca3b66106d66e1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20160621/90d0a80d/attachment-0001.html>


More information about the Darshan-commits mailing list