summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormyang6 <myang6@hdfgroup.org>2021-11-02 20:41:28 (GMT)
committermyang6 <myang6@hdfgroup.org>2021-11-02 20:41:28 (GMT)
commit0e3dc9ffedd3ab68f561803dbfb2d7c23210bb91 (patch)
treebc7d42bebcba75ef9e0c430a5e54227c483879aa /src
parent43c2c955b876b5eef2446bac2159c8e03fe60b47 (diff)
downloadhdf5-0e3dc9ffedd3ab68f561803dbfb2d7c23210bb91.zip
hdf5-0e3dc9ffedd3ab68f561803dbfb2d7c23210bb91.tar.gz
hdf5-0e3dc9ffedd3ab68f561803dbfb2d7c23210bb91.tar.bz2
Make entry log code as a #define macro as John suggests.
Diffstat (limited to 'src')
-rw-r--r--src/H5Fint.c2
-rw-r--r--src/H5Fpkg.h9
-rw-r--r--src/H5Fvfd_swmr.c6
3 files changed, 13 insertions, 4 deletions
diff --git a/src/H5Fint.c b/src/H5Fint.c
index c0579bd..c3fc346 100644
--- a/src/H5Fint.c
+++ b/src/H5Fint.c
@@ -2228,7 +2228,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id)
ret_value = file;
#if 1 /*Kent: write to the log file when H5F_open ends. Tested, can be commented out if necessary.*/
- H5F_POST_VFD_SWMR_LOG_ENTRY(file, 1, "File open ends");
+ H5F_POST_VFD_SWMR_LOG_ENTRY(file, FILE_OPEN, "File open ends");
#endif
done:
if ((NULL == ret_value) && file) {
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 6dd896e..f8909b3 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -666,4 +666,13 @@ H5_DLL void H5F_post_vfd_swmr_log_entry(H5F_t *f, int entry_type_code, char *log
#define H5F_POST_VFD_SWMR_LOG_ENTRY(f, c, m) H5F_POST_VFD_SWMR_LOG_ENTRY_PRODUCTION(f, c, 1, m)
#endif
+/* Macros for VFD SWMR log entry code
+ * Note: this should be consistent with const char *H5Fvfd_swmr_log_tags[] declared at
+ * H5Fvfd_swmr.c .
+ */
+#define EOT_PROCESSING_TIME 0
+#define FILE_OPEN 1
+#define FILE_CLOSE 2
+#define EOT_TRIGGER_TIME 3
+#define EOT_META_FILE_INDEX 4
#endif /* H5Fpkg_H */
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c
index b3c3ffe..8da238c 100644
--- a/src/H5Fvfd_swmr.c
+++ b/src/H5Fvfd_swmr.c
@@ -61,7 +61,7 @@
* The following is the first version. Developers can add/modify the tags as necessary.
*
* If the entry code is 0, H5Fvfd_swmr_log_tags[0] is used to report the entry tag.
- * H5F_POST_VFD_SWMR_LOG_ENTRY(f, 0, log_msg) will put the log_msg attached to
+ * H5F_POST_VFD_SWMR_LOG_ENTRY(f, EOT_PROCESSING_TIME, log_msg) will put the log_msg attached to
* the entry tag "EOT_PROCESSING_TIME".
* The entry code number is listed in the comment for convenience.
* Currently for the production mode, only the "EOT_PROCESSING_TIME" is present.
@@ -358,7 +358,7 @@ H5F_vfd_swmr_close_or_flush(H5F_t *f, hbool_t closing)
}
#if 1 /*Kent Save the end of close info. to the log file, subject to comment out. */
if (closing)
- H5F_POST_VFD_SWMR_LOG_ENTRY(f, 2, "VFD SWMR File close ends");
+ H5F_POST_VFD_SWMR_LOG_ENTRY(f, FILE_CLOSE, "VFD SWMR File close ends");
#endif
done:
@@ -958,7 +958,7 @@ done:
if (NULL != (log_msg = HDmalloc(eot_pt_log_mesg_length * sizeof(char)))) {
temp_time = (unsigned int)((end_elapsed_time - start_elapsed_time) * 1000);
HDsprintf(log_msg, "Writer time is %u milliseconds", temp_time);
- H5F_POST_VFD_SWMR_LOG_ENTRY(f, 0, log_msg);
+ H5F_POST_VFD_SWMR_LOG_ENTRY(f, EOT_PROCESSING_TIME, log_msg);
HDfree(log_msg);
}
}