[Darshan-commits] [Git][darshan/darshan][master] 2 commits: typo in ChangeLog
Shane Snyder
xgitlab at cels.anl.gov
Thu Oct 6 13:02:24 CDT 2016
Shane Snyder pushed to branch master at darshan / darshan
Commits:
297778b8 by Shane Snyder at 2016-10-06T09:18:07-05:00
typo in ChangeLog
- - - - -
a2d4d607 by Shane Snyder at 2016-10-06T12:55:52-05:00
update darshan-util to error with invalid versions
darshan-logutils now returns an error when encountering a log file
with a module version number greater than what the library was
built with. all utilities were also updated to account for this
modification
- - - - -
5 changed files:
- ChangeLog
- darshan-util/darshan-convert.c
- darshan-util/darshan-diff.c
- darshan-util/darshan-logutils.c
- darshan-util/darshan-parser.c
Changes:
=====================================
ChangeLog
=====================================
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,7 +14,7 @@ Darshan-3.1.0
- this handles instrumentation of file stream I/O functions
like fopen(), fprintf(), fscanf(), etc.
- this module also captures stats on the standard streams (stdin,
- stdout, & stdin)
+ stdout, & stderr)
* add Lustre instrumentation module (Glenn Lockwood)
- this module provides Lustre striping details (e.g., stripe
width, stripe size, list of OSTs a file is striped over)
=====================================
darshan-util/darshan-convert.c
=====================================
--- a/darshan-util/darshan-convert.c
+++ b/darshan-util/darshan-convert.c
@@ -360,6 +360,7 @@ int main(int argc, char **argv)
{
darshan_log_close(infile);
darshan_log_close(outfile);
+ unlink(outfile_name);
return(-1);
}
@@ -368,6 +369,7 @@ int main(int argc, char **argv)
{
darshan_log_close(infile);
darshan_log_close(outfile);
+ unlink(outfile_name);
return(-1);
}
@@ -389,19 +391,8 @@ int main(int argc, char **argv)
/* we have module data to convert */
memset(mod_buf, 0, DEF_MOD_BUF_SIZE);
- ret = mod_logutils[i]->log_get_record(infile, (void **)&mod_buf);
- if(ret != 1)
- {
- fprintf(stderr, "Error: failed to parse the first %s module record.\n",
- darshan_module_names[i]);
- darshan_log_close(infile);
- darshan_log_close(outfile);
- unlink(outfile_name);
- return(-1);
- }
-
/* loop over each of the module's records and convert */
- do
+ while((ret = mod_logutils[i]->log_get_record(infile, (void **)&mod_buf)) == 1)
{
base_rec = (struct darshan_base_record *)mod_buf;
@@ -412,12 +403,22 @@ int main(int argc, char **argv)
{
darshan_log_close(infile);
darshan_log_close(outfile);
+ unlink(outfile_name);
return(-1);
}
memset(mod_buf, 0, DEF_MOD_BUF_SIZE);
}
- } while((ret = mod_logutils[i]->log_get_record(infile, (void **)&mod_buf)) == 1);
+ }
+ if(ret < 0)
+ {
+ fprintf(stderr, "Error: failed to parse %s module record.\n",
+ darshan_module_names[i]);
+ darshan_log_close(infile);
+ darshan_log_close(outfile);
+ unlink(outfile_name);
+ return(-1);
+ }
}
darshan_log_close(infile);
=====================================
darshan-util/darshan-diff.c
=====================================
--- a/darshan-util/darshan-diff.c
+++ b/darshan-util/darshan-diff.c
@@ -384,13 +384,11 @@ static int darshan_build_global_record_hash(
{
fprintf(stderr, "Error: unable to read module %s data from log file.\n",
darshan_module_names[i]);
- free(mod_rec->mod_dat);
free(mod_rec);
return(-1);
}
else if(ret == 0)
{
- free(mod_rec->mod_dat);
free(mod_rec);
break;
}
=====================================
darshan-util/darshan-logutils.c
=====================================
--- a/darshan-util/darshan-logutils.c
+++ b/darshan-util/darshan-logutils.c
@@ -643,6 +643,17 @@ int darshan_log_get_mod(darshan_fd fd, darshan_module_id mod_id,
if(fd->mod_map[mod_id].len == 0)
return(0); /* no data corresponding to this mod_id */
+ /* assume module will support backwards compatibility, but we obviously
+ * can't provide any sort of "forwards" compatibility
+ */
+ if(fd->mod_ver[mod_id] > darshan_module_versions[mod_id])
+ {
+ fprintf(stderr, "Error: invalid %s module log format version "
+ "(expected %d, got %d)\n", darshan_module_names[mod_id],
+ darshan_module_versions[mod_id], fd->mod_ver[mod_id]);
+ return(-1);
+ }
+
/* read this module's data from the log file */
ret = darshan_log_dzread(fd, mod_id, mod_buf, mod_buf_sz);
if(ret < 0)
=====================================
darshan-util/darshan-parser.c
=====================================
--- a/darshan-util/darshan-parser.c
+++ b/darshan-util/darshan-parser.c
@@ -398,7 +398,8 @@ int main(int argc, char **argv)
/* currently only POSIX, MPIIO, and STDIO modules support non-base
* parsing
*/
- else if((i != DARSHAN_POSIX_MOD) && (i != DARSHAN_MPIIO_MOD) && (i != DARSHAN_STDIO_MOD) && !(mask & OPTION_BASE))
+ else if((i != DARSHAN_POSIX_MOD) && (i != DARSHAN_MPIIO_MOD) &&
+ (i != DARSHAN_STDIO_MOD) && !(mask & OPTION_BASE))
continue;
/* this module has data to be parsed and printed */
@@ -425,22 +426,24 @@ int main(int argc, char **argv)
}
}
- ret = mod_logutils[i]->log_get_record(fd, (void **)&mod_buf);
- if(ret != 1)
- {
- fprintf(stderr, "Error: failed to parse the first %s module record.\n",
- darshan_module_names[i]);
- ret = -1;
- goto cleanup;
- }
-
/* loop over each of this module's records and print them */
- do
+ while(1)
{
char *mnt_pt = NULL;
char *fs_type = NULL;
char *rec_name = NULL;
hash_entry_t *hfile = NULL;
+
+ ret = mod_logutils[i]->log_get_record(fd, (void **)&mod_buf);
+ if(ret < 1)
+ {
+ if(ret == -1)
+ {
+ fprintf(stderr, "Error: failed to parse %s module record.\n",
+ darshan_module_names[i]);
+ }
+ break;
+ }
base_rec = (struct darshan_base_record *)mod_buf;
/* get the pathname for this record */
@@ -528,13 +531,9 @@ int main(int argc, char **argv)
}
memset(mod_buf, 0, DEF_MOD_BUF_SIZE);
-
- } while((ret = mod_logutils[i]->log_get_record(fd, (void **)&mod_buf)) == 1);
- if (ret < 0)
- {
- ret = -1;
- goto cleanup;
}
+ if(ret == -1)
+ continue; /* move on to the next module if there was an error with this one */
/* we calculate more detailed stats for POSIX and MPI-IO modules,
* if the parser is executed with more than the base option
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/dc43bfcd4d98adc7e330f5049bd98a8191b93e62...a2d4d607cc5cd94013c37ed6b64618dd647d5cbd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20161006/2d6a098d/attachment-0001.html>
More information about the Darshan-commits
mailing list