Commit 4d0c757c authored by Shane Snyder's avatar Shane Snyder

add function to query name associated with recid

parent e0bc4a1a
......@@ -178,6 +178,14 @@ void *darshan_core_register_record(
int rec_len,
struct darshan_fs_info *fs_info);
/* darshan_core_lookup_record_name()
*
* Looks up the name associated with a given Darshan record ID.
*/
char *darshan_core_lookup_record_name(
darshan_record_id rec_id);
/* darshan_core_wtime()
*
* Returns the elapsed time relative to (roughly) the start of
......
......@@ -2107,6 +2107,21 @@ void *darshan_core_register_record(
return(rec_buf);;
}
char *darshan_core_lookup_record_name(darshan_record_id rec_id)
{
struct darshan_core_name_record_ref *ref;
char *name = NULL;
DARSHAN_CORE_LOCK();
HASH_FIND(hlink, darshan_core->name_hash, &rec_id,
sizeof(darshan_record_id), ref);
if(ref)
name = ref->name_record->name;
DARSHAN_CORE_UNLOCK();
return(name);
}
void darshan_instrument_fs_data(int fs_type, const char *path, int fd)
{
#ifdef DARSHAN_LUSTRE
......
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