Commit a235da7e authored by Philip Carns's avatar Philip Carns
Browse files

updated parser to map files to mount points, other misc bug fixes


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@134 3b7491f3-a168-0410-bf4b-c445ed680a29
parent c2e58260
...@@ -475,12 +475,20 @@ void darshan_log_close(darshan_fd file) ...@@ -475,12 +475,20 @@ void darshan_log_close(darshan_fd file)
*/ */
void darshan_log_print_version_warnings(struct darshan_job *job) void darshan_log_print_version_warnings(struct darshan_job *job)
{ {
if(strcmp(job->version_string, "1.22") == 0) if(strcmp(job->version_string, "1.23") == 0)
{ {
/* nothing to do, this is the current version */ /* nothing to do, this is the current version */
return; return;
} }
if(strcmp(job->version_string, "1.22") == 0)
{
printf("# WARNING: version 1.22 log format does not support the following parameters:\n");
printf("# CP_DEVICE\n");
printf("# It also does not record mounted file systems, mount points, or fs types.\n");
return;
}
if(strcmp(job->version_string, "1.21") == 0) if(strcmp(job->version_string, "1.21") == 0)
{ {
printf("# WARNING: version 1.21 log format does not support the following parameters:\n"); printf("# WARNING: version 1.21 log format does not support the following parameters:\n");
...@@ -489,8 +497,10 @@ void darshan_log_print_version_warnings(struct darshan_job *job) ...@@ -489,8 +497,10 @@ void darshan_log_print_version_warnings(struct darshan_job *job)
printf("# CP_HDF5_OPENS\n"); printf("# CP_HDF5_OPENS\n");
printf("# CP_MAX_READ_TIME_SIZE\n"); printf("# CP_MAX_READ_TIME_SIZE\n");
printf("# CP_MAX_WRITE_TIME_SIZE\n"); printf("# CP_MAX_WRITE_TIME_SIZE\n");
printf("# CP_DEVICE\n");
printf("# CP_F_MAX_READ_TIME\n"); printf("# CP_F_MAX_READ_TIME\n");
printf("# CP_F_MAX_WRITE_TIME\n"); printf("# CP_F_MAX_WRITE_TIME\n");
printf("# It also does not record mounted file systems, mount points, or fs types.\n");
printf("#\n"); printf("#\n");
return; return;
} }
......
...@@ -24,16 +24,18 @@ void darshan_log_close(darshan_fd file); ...@@ -24,16 +24,18 @@ void darshan_log_close(darshan_fd file);
void darshan_log_print_version_warnings(struct darshan_job *job); void darshan_log_print_version_warnings(struct darshan_job *job);
/* convenience macros for printing out counters */ /* convenience macros for printing out counters */
#define CP_PRINT_HEADER() printf("#<rank>\t<file>\t<counter>\t<value>\t<name suffix>\n") #define CP_PRINT_HEADER() printf("#<rank>\t<file>\t<counter>\t<value>\t<name suffix>\t<mount pt>\t<fs type>\n")
#define CP_PRINT(__job, __file, __counter) do {\ #define CP_PRINT(__job, __file, __counter, __mnt_pt, __fs_type) do {\
printf("%d\t%llu\t%s\t%lld\t...%s\n", \ printf("%d\t%llu\t%s\t%lld\t...%s\t%s\t%s\n", \
(__file)->rank, llu((__file)->hash), darshan_names[__counter], \ (__file)->rank, llu((__file)->hash), darshan_names[__counter], \
lld((__file)->counters[__counter]), (__file)->name_suffix); \ lld((__file)->counters[__counter]), (__file)->name_suffix, \
__mnt_pt, __fs_type); \
} while(0) } while(0)
#define CP_F_PRINT(__job, __file, __counter) do {\ #define CP_F_PRINT(__job, __file, __counter, __mnt_pt, __fs_type) do {\
printf("%d\t%llu\t%s\t%f\t...%s\n", \ printf("%d\t%llu\t%s\t%f\t...%s\t%s\t%s\n", \
(__file)->rank, llu((__file)->hash), darshan_f_names[__counter], \ (__file)->rank, llu((__file)->hash), darshan_f_names[__counter], \
(__file)->fcounters[__counter], (__file)->name_suffix); \ (__file)->fcounters[__counter], (__file)->name_suffix, \
__mnt_pt, __fs_type); \
} while(0) } while(0)
#endif #endif
...@@ -86,12 +86,7 @@ int main(int argc, char **argv) ...@@ -86,12 +86,7 @@ int main(int argc, char **argv)
for(i=0; i<mount_count; i++) for(i=0; i<mount_count; i++)
{ {
printf("# mount entry: %d\t%s\t%s\n", devs[i], mnt_pts[i], fs_types[i]); printf("# mount entry: %d\t%s\t%s\n", devs[i], mnt_pts[i], fs_types[i]);
free(mnt_pts[i]);
free(fs_types[i]);
} }
free(devs);
free(mnt_pts);
free(fs_types);
if(no_files_flag) if(no_files_flag)
{ {
...@@ -153,13 +148,30 @@ int main(int argc, char **argv) ...@@ -153,13 +148,30 @@ int main(int argc, char **argv)
while((ret = darshan_log_getfile(file, &job, &cp_file)) == 1) while((ret = darshan_log_getfile(file, &job, &cp_file)) == 1)
{ {
char* mnt_pt = NULL;
char* fs_type = NULL;
for(i=0; i<mount_count; i++)
{
if(cp_file.counters[CP_DEVICE] == devs[i])
{
mnt_pt = mnt_pts[i];
fs_type = fs_types[i];
break;
}
}
if(!mnt_pt)
mnt_pt = "UNKNOWN";
if(!fs_type)
fs_type = "UNKNOWN";
for(i=0; i<CP_NUM_INDICES; i++) for(i=0; i<CP_NUM_INDICES; i++)
{ {
CP_PRINT(&job, &cp_file, i); CP_PRINT(&job, &cp_file, i, mnt_pt, fs_type);
} }
for(i=0; i<CP_F_NUM_INDICES; i++) for(i=0; i<CP_F_NUM_INDICES; i++)
{ {
CP_F_PRINT(&job, &cp_file, i); CP_F_PRINT(&job, &cp_file, i, mnt_pt, fs_type);
} }
} }
...@@ -169,6 +181,15 @@ int main(int argc, char **argv) ...@@ -169,6 +181,15 @@ int main(int argc, char **argv)
return(-1); return(-1);
} }
for(i=0; i<mount_count; i++)
{
free(mnt_pts[i]);
free(fs_types[i]);
}
free(devs);
free(mnt_pts);
free(fs_types);
darshan_log_close(file); darshan_log_close(file);
return(0); return(0);
} }
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