Commit 4f01033c authored by Philip Carns's avatar Philip Carns

debugging function for mount point table


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@558 3b7491f3-a168-0410-bf4b-c445ed680a29
parent cfab4056
......@@ -201,6 +201,7 @@ static int darshan_file_variance(
int count, int rank);
static void pairwise_variance_reduce (
void *invec, void *inoutvec, int *len, MPI_Datatype *dt);
static void debug_mounts(const char* mtab_file, const char* out_file);
#define CP_MAX_MNTS 32
......@@ -2372,6 +2373,47 @@ static void cp_log_record_hints(struct darshan_job_runtime* final_job, int rank)
return;
}
static void debug_mounts(const char* mtab_file, const char* out_file)
{
FILE* tab;
struct mntent *entry;
int ret;
struct stat statbuf;
char tmp_mnt[256];
FILE* out;
out = fopen(out_file, "w");
if(!out)
{
perror("darshan: fopen");
return;
}
tab = setmntent(mtab_file, "r");
if(!tab)
{
perror("darshan: setmnt");
return;
}
while((entry = getmntent(tab)) != NULL)
{
ret = stat(entry->mnt_dir, &statbuf);
if(ret == 0)
{
int64_t tmp_st_dev = statbuf.st_dev;
fprintf(out, "%" PRId64 "\t%s\t%s\n", tmp_st_dev,
entry->mnt_type, entry->mnt_dir);
}
else
{
perror("darshan: stat");
}
}
return;
}
/*
* Local variables:
* c-indent-level: 4
......
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