summaryrefslogtreecommitdiffstats
path: root/src/H5PB.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2020-02-10 19:48:35 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2020-02-10 19:48:35 (GMT)
commit0d94627836643e7ea3a6a874b20505613041dc19 (patch)
tree909e62600a0173310ae78b21e9774101c2e6aa4d /src/H5PB.c
parent6500ad88a8485f37bbaffa5fc7c2618079a458ab (diff)
downloadhdf5-0d94627836643e7ea3a6a874b20505613041dc19.zip
hdf5-0d94627836643e7ea3a6a874b20505613041dc19.tar.gz
hdf5-0d94627836643e7ea3a6a874b20505613041dc19.tar.bz2
Rename loglib_ / LOGLIB_ to hlog_ / HLOG_, remove the syslog-based
implementation, rename hlog_log() to hlog(), hlog_vlog() to vhlog(), et cetera. Rename hlog_lazy() to hlog_fast(). Define some log sinks and use them in the page buffer and in VFD SWMR.
Diffstat (limited to 'src/H5PB.c')
-rw-r--r--src/H5PB.c33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/H5PB.c b/src/H5PB.c
index b1772a4..5b306f0 100644
--- a/src/H5PB.c
+++ b/src/H5PB.c
@@ -45,6 +45,8 @@
#include "H5PBpkg.h" /* File access */
+#include "hlog.h"
+
/****************/
/* Local Macros */
/****************/
@@ -97,8 +99,6 @@ static herr_t H5PB__write_meta(H5F_shared_t *, H5FD_mem_t, haddr_t,
static herr_t H5PB__write_raw(H5F_shared_t *, H5FD_mem_t, haddr_t,
size_t, const void *);
-static void ldbgf(const char *, ...) H5_ATTR_FORMAT(printf, 1, 2);
-
/*********************/
/* Package Variables */
/*********************/
@@ -123,22 +123,10 @@ H5FL_DEFINE_STATIC(H5PB_t);
/* Declare a free list to manage the H5PB_entry_t struct */
H5FL_DEFINE_STATIC(H5PB_entry_t);
-static const bool ldbg_enabled = false;
-
-static void
-ldbgf(const char *fmt, ...)
-{
- va_list ap;
-
- va_start(ap, fmt);
-
- if (!ldbg_enabled)
- return;
-
- (void)vprintf(fmt, ap);
-
- va_end(ap);
-}
+HLOG_SINK_DECL(pagebuffer);
+HLOG_SINK_SHORT_DEFN(pagebuffer, all);
+HLOG_SINK_SHORT_DEFN(pbflush, pagebuffer);
+HLOG_SINK_SHORT_DEFN(pbflush_entry, pbflush);
/*-------------------------------------------------------------------------
@@ -811,14 +799,14 @@ H5PB_flush(H5F_shared_t *shared)
flush_ptr = entry_ptr;
entry_ptr = entry_ptr->ht_next;
- ldbgf("%s: visiting %zu-byte page %" PRIu64 "\n",
+ hlog_fast(pbflush, "%s: visiting %zu-byte page %" PRIu64,
__func__, flush_ptr->size, flush_ptr->page);
if ( flush_ptr->is_dirty ) {
if (flush_ptr->delay_write_until != 0) {
- ldbgf("%s: delaying %zu-byte page %" PRIu64
- " until %" PRIu64 " (now %" PRIu64 ")\n",
+ hlog_fast(pbflush, "%s: delaying %zu-byte page %" PRIu64
+ " until %" PRIu64 " (now %" PRIu64 ")",
__func__, flush_ptr->size, flush_ptr->page,
flush_ptr->delay_write_until,
shared->tick_num);
@@ -2467,7 +2455,8 @@ H5PB__flush_entry(H5F_shared_t *shared, H5PB_t *pb_ptr, H5PB_entry_t *entry_ptr)
HDassert((pb_ptr->vfd_swmr_writer) || (!(entry_ptr->is_mpmde)));
HDassert(0 == entry_ptr->delay_write_until);
- ldbgf("%s: flushing %zu-byte page %" PRIu64 " @ %" PRIuHADDR "\n",
+ hlog_fast(pbflush_entry,
+ "%s: flushing %zu-byte page %" PRIu64 " @ %" PRIuHADDR,
__func__, entry_ptr->size, entry_ptr->page, entry_ptr->addr);
/* Retrieve the 'eoa' for the file */