Commit 01bc23aa authored by Glenn K. Lockwood's avatar Glenn K. Lockwood

moved the call to the lustre module up into the file open macro

parent 19147a7b
......@@ -39,6 +39,10 @@ typedef int64_t off64_t;
#define aiocb64 aiocb
#endif
#ifndef LL_SUPER_MAGIC
#define LL_SUPER_MAGIC 0x0BD00BD0
#endif
DARSHAN_FORWARD_DECL(open, int, (const char *path, int flags, ...));
DARSHAN_FORWARD_DECL(open64, int, (const char *path, int flags, ...));
DARSHAN_FORWARD_DECL(creat, int, (const char* path, mode_t mode));
......@@ -128,6 +132,7 @@ struct posix_file_runtime
int access_count;
void* stride_root;
int stride_count;
int fs_type; /* same as darshan_fs_info->fs_type */
struct posix_aio_tracker* aio_list;
UT_hash_handle hlink;
};
......@@ -179,7 +184,7 @@ struct posix_runtime
/* XXX modules don't expose an API for other modules, so use extern to get
* Lustre instrumentation function
*/
extern void darshan_instrument_lustre_file(char *filepath);
extern void darshan_instrument_lustre_file(const char *filepath, int fd);
static struct posix_runtime *posix_runtime = NULL;
static pthread_mutex_t posix_runtime_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
......@@ -234,6 +239,8 @@ static void posix_shutdown(void);
if(file->file_record->fcounters[POSIX_F_OPEN_TIMESTAMP] == 0 || \
file->file_record->fcounters[POSIX_F_OPEN_TIMESTAMP] > __tm1) \
file->file_record->fcounters[POSIX_F_OPEN_TIMESTAMP] = __tm1; \
if(file->fs_type == LL_SUPER_MAGIC) \
darshan_instrument_lustre_file(__path, __ret); \
DARSHAN_TIMER_INC_NO_OVERLAP(file->file_record->fcounters[POSIX_F_META_TIME], __tm1, __tm2, file->last_meta_end); \
} while(0)
......@@ -1561,18 +1568,12 @@ static struct posix_file_runtime* posix_file_by_name(const char *name)
file->file_record->rank = my_rank;
file->file_record->counters[POSIX_MEM_ALIGNMENT] = darshan_mem_alignment;
file->file_record->counters[POSIX_FILE_ALIGNMENT] = fs_info.block_size;
file->fs_type = fs_info.fs_type;
/* add new record to file hash table */
HASH_ADD(hlink, posix_runtime->file_hash, file_record->f_id, sizeof(darshan_record_id), file);
posix_runtime->file_array_ndx++;
/* XXX: check for lustre and call in */
#ifndef LL_SUPER_MAGIC
#define LL_SUPER_MAGIC 0x0BD00BD0
#endif
if(fs_info.fs_type == LL_SUPER_MAGIC)
darshan_instrument_lustre_file(newname);
if(newname != name)
free(newname);
return(file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment