diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 15:29:53 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-10-01 15:29:53 (GMT) |
commit | ec8ad09125032c9c232878d02e90aa86df162841 (patch) | |
tree | 5d63105d3a0db7d5bbee41c5b74b097649a2115e /src/H5Clog_trace.c | |
parent | 453238e90e1574ef1c15e3c79f7fb3d77920e77c (diff) | |
download | hdf5-ec8ad09125032c9c232878d02e90aa86df162841.zip hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.gz hdf5-ec8ad09125032c9c232878d02e90aa86df162841.tar.bz2 |
Source formatted
Diffstat (limited to 'src/H5Clog_trace.c')
-rw-r--r-- | src/H5Clog_trace.c | 390 |
1 files changed, 176 insertions, 214 deletions
diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index 63fe382..002b3f9 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -24,17 +24,16 @@ /****************/ /* Module Setup */ /****************/ -#include "H5Cmodule.h" /* This source code file is part of the H5C module */ +#include "H5Cmodule.h" /* This source code file is part of the H5C module */ /***********/ /* Headers */ /***********/ -#include "H5private.h" /* Generic Functions */ -#include "H5Cpkg.h" /* Cache */ -#include "H5Clog.h" /* Cache logging */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5MMprivate.h" /* Memory management */ - +#include "H5private.h" /* Generic Functions */ +#include "H5Cpkg.h" /* Cache */ +#include "H5Clog.h" /* Cache logging */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5MMprivate.h" /* Memory management */ /****************/ /* Local Macros */ @@ -43,12 +42,10 @@ /* Max log message size */ #define H5C_MAX_TRACE_LOG_MSG_SIZE 4096 - /******************/ /* Local Typedefs */ /******************/ - /********************/ /* Package Typedefs */ /********************/ @@ -58,7 +55,6 @@ typedef struct H5C_log_trace_udata_t { char *message; } H5C_log_trace_udata_t; - /********************/ /* Local Prototypes */ /********************/ @@ -68,35 +64,48 @@ static herr_t H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata); /* Log message callbacks */ static herr_t H5C__trace_tear_down_logging(H5C_log_info_t *log_info); -static herr_t H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, int type_id, herr_t fxn_ret_value); +static herr_t H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, int type_id, + herr_t fxn_ret_value); static herr_t H5C__trace_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value); -static herr_t H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, size_t size, herr_t fxn_ret_value); -static herr_t H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); -static herr_t H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); -static herr_t H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); -static herr_t H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); -static herr_t H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_addr, int type_id, herr_t fxn_ret_value); -static herr_t H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); -static herr_t H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value); -static herr_t H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value); -static herr_t H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value); -static herr_t H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); -static herr_t H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value); -static herr_t H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value); -static herr_t H5C__trace_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t *config, herr_t fxn_ret_value); -static herr_t H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value); - +static herr_t H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, + size_t size, herr_t fxn_ret_value); +static herr_t H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value); +static herr_t H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value); +static herr_t H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value); +static herr_t H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value); +static herr_t H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_addr, + int type_id, herr_t fxn_ret_value); +static herr_t H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value); +static herr_t H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, + const H5C_cache_entry_t *child, herr_t fxn_ret_value); +static herr_t H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, int type_id, + unsigned flags, herr_t fxn_ret_value); +static herr_t H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, + size_t new_size, herr_t fxn_ret_value); +static herr_t H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value); +static herr_t H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, + const H5C_cache_entry_t *child, herr_t fxn_ret_value); +static herr_t H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_id, + unsigned flags, herr_t fxn_ret_value); +static herr_t H5C__trace_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t *config, + herr_t fxn_ret_value); +static herr_t H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value); /*********************/ /* Package Variables */ /*********************/ - /*****************************/ /* Library Private Variables */ /*****************************/ - /*******************/ /* Local Variables */ /*******************/ @@ -104,37 +113,33 @@ static herr_t H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache /* Note that there's no cache set up call since that's the * place where this struct is wired into the cache. */ -static H5C_log_class_t H5C_trace_log_class_g = { - "trace", - H5C__trace_tear_down_logging, - NULL, /* start logging */ - NULL, /* stop logging */ - NULL, /* write start message */ - NULL, /* write stop message */ - NULL, /* write create cache message */ - NULL, /* write destroy cache message */ - NULL, /* write evict cache message */ - H5C__trace_write_expunge_entry_log_msg, - H5C__trace_write_flush_cache_log_msg, - H5C__trace_write_insert_entry_log_msg, - H5C__trace_write_mark_entry_dirty_log_msg, - H5C__trace_write_mark_entry_clean_log_msg, - H5C__trace_write_mark_unserialized_entry_log_msg, - H5C__trace_write_mark_serialized_entry_log_msg, - H5C__trace_write_move_entry_log_msg, - H5C__trace_write_pin_entry_log_msg, - H5C__trace_write_create_fd_log_msg, - H5C__trace_write_protect_entry_log_msg, - H5C__trace_write_resize_entry_log_msg, - H5C__trace_write_unpin_entry_log_msg, - H5C__trace_write_destroy_fd_log_msg, - H5C__trace_write_unprotect_entry_log_msg, - H5C__trace_write_set_cache_config_log_msg, - H5C__trace_write_remove_entry_log_msg -}; - - - +static H5C_log_class_t H5C_trace_log_class_g = {"trace", + H5C__trace_tear_down_logging, + NULL, /* start logging */ + NULL, /* stop logging */ + NULL, /* write start message */ + NULL, /* write stop message */ + NULL, /* write create cache message */ + NULL, /* write destroy cache message */ + NULL, /* write evict cache message */ + H5C__trace_write_expunge_entry_log_msg, + H5C__trace_write_flush_cache_log_msg, + H5C__trace_write_insert_entry_log_msg, + H5C__trace_write_mark_entry_dirty_log_msg, + H5C__trace_write_mark_entry_clean_log_msg, + H5C__trace_write_mark_unserialized_entry_log_msg, + H5C__trace_write_mark_serialized_entry_log_msg, + H5C__trace_write_move_entry_log_msg, + H5C__trace_write_pin_entry_log_msg, + H5C__trace_write_create_fd_log_msg, + H5C__trace_write_protect_entry_log_msg, + H5C__trace_write_resize_entry_log_msg, + H5C__trace_write_unpin_entry_log_msg, + H5C__trace_write_destroy_fd_log_msg, + H5C__trace_write_unprotect_entry_log_msg, + H5C__trace_write_set_cache_config_log_msg, + H5C__trace_write_remove_entry_log_msg}; + /*------------------------------------------------------------------------- * Function: H5C__trace_write_log_message * @@ -152,7 +157,7 @@ static herr_t H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata) { size_t n_chars; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -163,7 +168,7 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata) /* Write the log message and flush */ n_chars = HDstrlen(trace_udata->message); - if((int)n_chars != HDfprintf(trace_udata->outfile, trace_udata->message)) + if ((int)n_chars != HDfprintf(trace_udata->outfile, trace_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message") HDmemset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char))); @@ -171,7 +176,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_log_message() */ - /*------------------------------------------------------------------------- * Function: H5C_log_trace_set_up * @@ -200,9 +204,9 @@ herr_t H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi_rank) { H5C_log_trace_udata_t *trace_udata = NULL; - char *file_name = NULL; - size_t n_chars; - herr_t ret_value = SUCCEED; /* Return value */ + char * file_name = NULL; + size_t n_chars; + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -214,12 +218,12 @@ H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mp log_info->cls = &H5C_trace_log_class_g; /* Allocate memory for the JSON-specific data */ - if(NULL == (log_info->udata = H5MM_calloc(sizeof(H5C_log_trace_udata_t)))) + if (NULL == (log_info->udata = H5MM_calloc(sizeof(H5C_log_trace_udata_t)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") trace_udata = (H5C_log_trace_udata_t *)(log_info->udata); /* Allocate memory for the message buffer */ - if(NULL == (trace_udata->message = (char *)H5MM_calloc(H5C_MAX_TRACE_LOG_MSG_SIZE * sizeof(char)))) + if (NULL == (trace_udata->message = (char *)H5MM_calloc(H5C_MAX_TRACE_LOG_MSG_SIZE * sizeof(char)))) HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "memory allocation failed") /* Possibly fix up the log file name. @@ -230,44 +234,44 @@ H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mp * allocation size = <path length> + dot + <rank # length> + \0 */ n_chars = HDstrlen(log_location) + 1 + 39 + 1; - if(NULL == (file_name = (char *)H5MM_calloc(n_chars * sizeof(char)))) - HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, "can't allocate memory for mdc log file name manipulation") + if (NULL == (file_name = (char *)H5MM_calloc(n_chars * sizeof(char)))) + HGOTO_ERROR(H5E_CACHE, H5E_CANTALLOC, FAIL, + "can't allocate memory for mdc log file name manipulation") /* Add the rank to the log file name when MPI is in use */ - if(-1 == mpi_rank) + if (-1 == mpi_rank) HDsnprintf(file_name, n_chars, "%s", log_location); else HDsnprintf(file_name, n_chars, "%s.%d", log_location, mpi_rank); /* Open log file and set it to be unbuffered */ - if(NULL == (trace_udata->outfile = HDfopen(file_name, "w"))) + if (NULL == (trace_udata->outfile = HDfopen(file_name, "w"))) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "can't create mdc log file") HDsetbuf(trace_udata->outfile, NULL); /* Write the header */ HDfprintf(trace_udata->outfile, "### HDF5 metadata cache trace file version 1 ###\n"); - done: - if(file_name) +done: + if (file_name) H5MM_xfree(file_name); /* Free and reset the log info struct on errors */ - if(FAIL == ret_value) { + if (FAIL == ret_value) { /* Free */ - if(trace_udata && trace_udata->message) + if (trace_udata && trace_udata->message) H5MM_xfree(trace_udata->message); - if(trace_udata) + if (trace_udata) H5MM_xfree(trace_udata); /* Reset */ log_info->udata = NULL; - log_info->cls = NULL; + log_info->cls = NULL; } FUNC_LEAVE_NOAPI(ret_value) } /* H5C_log_trace_set_up() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_tear_down_logging * @@ -284,7 +288,7 @@ static herr_t H5C__trace_tear_down_logging(H5C_log_info_t *log_info) { H5C_log_trace_udata_t *trace_udata = NULL; - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -298,7 +302,7 @@ H5C__trace_tear_down_logging(H5C_log_info_t *log_info) H5MM_xfree(trace_udata->message); /* Close log file */ - if(EOF == HDfclose(trace_udata->outfile)) + if (EOF == HDfclose(trace_udata->outfile)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "problem closing mdc log file") trace_udata->outfile = NULL; @@ -306,14 +310,13 @@ H5C__trace_tear_down_logging(H5C_log_info_t *log_info) H5MM_xfree(trace_udata); /* Reset the log class info and udata */ - log_info->cls = NULL; + log_info->cls = NULL; log_info->udata = NULL; - done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_tear_down_logging() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_expunge_entry_log_msg * @@ -327,11 +330,10 @@ H5C__trace_tear_down_logging(H5C_log_info_t *log_info) *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, - int type_id, herr_t fxn_ret_value) +H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, int type_id, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -341,17 +343,16 @@ H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_expunge_entry 0x%lx %d %d\n", - (unsigned long)address, type_id, (int)fxn_ret_value); + (unsigned long)address, type_id, (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_expunge_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_flush_cache_log_msg * @@ -368,7 +369,7 @@ static herr_t H5C__trace_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -377,18 +378,16 @@ H5C__trace_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) HDassert(trace_udata->message); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_flush %d\n", - (int)fxn_ret_value); + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_flush %d\n", (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_flush_cache_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_insert_entry_log_msg * @@ -402,11 +401,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, - int type_id, unsigned flags, size_t size, herr_t fxn_ret_value) +H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, size_t size, + herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -416,17 +415,16 @@ H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_insert_entry 0x%lx %d 0x%x %d %d\n", - (unsigned long)address, type_id, flags, (int)size, (int)fxn_ret_value); + (unsigned long)address, type_id, flags, (int)size, (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_insert_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_mark_entry_dirty_log_msg * @@ -440,11 +438,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *entry, - herr_t fxn_ret_value) +H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -455,17 +452,16 @@ H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t * /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_dirty 0x%lx %d\n", - (unsigned long)(entry->addr), (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_mark_entry_dirty_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_mark_entry_clean_log_msg * @@ -479,11 +475,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *entry, - herr_t fxn_ret_value) +H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -494,17 +489,16 @@ H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t * /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_clean 0x%lx %d\n", - (unsigned long)(entry->addr), (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_mark_entry_clean_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_mark_unserialized_entry_log_msg * @@ -518,11 +512,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, - const H5C_cache_entry_t *entry, herr_t fxn_ret_value) +H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, + herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -533,17 +527,16 @@ H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_unserialized 0x%lx %d\n", - (unsigned long)(entry->addr), (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_mark_unserialized_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_mark_serialized_entry_log_msg * @@ -558,10 +551,10 @@ done: */ static herr_t H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, - herr_t fxn_ret_value) + herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_STATIC @@ -572,17 +565,16 @@ H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entr /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_mark_entry_serialized 0x%lx %d\n", - (unsigned long)(entry->addr), (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_mark_serialized_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_move_entry_log_msg * @@ -596,11 +588,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_addr, - int type_id, herr_t fxn_ret_value) +H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_addr, int type_id, + herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -610,17 +602,16 @@ H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_a /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_move_entry 0x%lx 0x%lx %d %d\n", - (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); + (unsigned long)old_addr, (unsigned long)new_addr, type_id, (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_move_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_pin_entry_log_msg * @@ -634,11 +625,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, - herr_t fxn_ret_value) +H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -649,17 +639,16 @@ H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_pin_protected_entry 0x%lx %d\n", - (unsigned long)(entry->addr), (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_pin_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_create_fd_log_msg * @@ -675,10 +664,10 @@ done: */ static herr_t H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, - const H5C_cache_entry_t *child, herr_t fxn_ret_value) + const H5C_cache_entry_t *child, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -689,18 +678,18 @@ H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, HDassert(child); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_create_flush_dependency 0x%lx 0x%lx %d\n", - (unsigned long)(parent->addr), (unsigned long)(child->addr), (int)fxn_ret_value); + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, + "H5AC_create_flush_dependency 0x%lx 0x%lx %d\n", (unsigned long)(parent->addr), + (unsigned long)(child->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_create_fd_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_protect_entry_log_msg * @@ -714,11 +703,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, - int type_id, unsigned flags, herr_t fxn_ret_value) +H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, int type_id, + unsigned flags, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -729,17 +718,16 @@ H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *ent /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_protect 0x%lx %d 0x%x %d %d\n", - (unsigned long)(entry->addr), type_id, flags, (int)(entry->size), (int)fxn_ret_value); + (unsigned long)(entry->addr), type_id, flags, (int)(entry->size), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_protect_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_resize_entry_log_msg * @@ -753,11 +741,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, - size_t new_size, herr_t fxn_ret_value) +H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, size_t new_size, + herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -768,17 +756,16 @@ H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entr /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_resize_entry 0x%lx %d %d\n", - (unsigned long)(entry->addr), (int)new_size, (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)new_size, (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_resize_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_unpin_entry_log_msg * @@ -792,11 +779,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, - herr_t fxn_ret_value) +H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -807,17 +793,16 @@ H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unpin_entry 0x%lx %d\n", - (unsigned long)(entry->addr), (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_unpin_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_destroy_fd_log_msg * @@ -833,10 +818,10 @@ done: */ static herr_t H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, - const H5C_cache_entry_t *child, herr_t fxn_ret_value) + const H5C_cache_entry_t *child, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -847,18 +832,18 @@ H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent HDassert(child); /* Create the log message string */ - HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_destroy_flush_dependency 0x%lx 0x%lx %d\n", - (unsigned long)(parent->addr), (unsigned long)(child->addr), (int)fxn_ret_value); + HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, + "H5AC_destroy_flush_dependency 0x%lx 0x%lx %d\n", (unsigned long)(parent->addr), + (unsigned long)(child->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_destroy_fd_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_unprotect_entry_log_msg * @@ -872,11 +857,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, - int type_id, unsigned flags, herr_t fxn_ret_value) +H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_id, unsigned flags, + herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -886,17 +871,16 @@ H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unprotect 0x%lx %d 0x%x %d\n", - (unsigned long)(address), type_id, flags, (int)fxn_ret_value); + (unsigned long)(address), type_id, flags, (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_unprotect_entry_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_set_cache_config_log_msg * @@ -911,10 +895,10 @@ done: */ static herr_t H5C__trace_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t *config, - herr_t fxn_ret_value) + herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -925,48 +909,28 @@ H5C__trace_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, - "H5AC_set_cache_auto_resize_config %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %f %f %d %d %d %f %f %d %d %d %d %f %zu %d %d\n", - config->version, - (int)(config->rpt_fcn_enabled), - (int)(config->open_trace_file), - (int)(config->close_trace_file), - config->trace_file_name, - (int)(config->evictions_enabled), - (int)(config->set_initial_size), - (int)(config->initial_size), - config->min_clean_fraction, - (int)(config->max_size), - (int)(config->min_size), - config->epoch_length, - (int)(config->incr_mode), - config->lower_hr_threshold, - config->increment, - (int)(config->flash_incr_mode), - config->flash_multiple, - config->flash_threshold, - (int)(config->apply_max_increment), - (int)(config->max_increment), - (int)(config->decr_mode), - config->upper_hr_threshold, - config->decrement, - (int)(config->apply_max_decrement), - (int)(config->max_decrement), - config->epochs_before_eviction, - (int)(config->apply_empty_reserve), - config->empty_reserve, - config->dirty_bytes_threshold, - config->metadata_write_strategy, - (int)fxn_ret_value); + "H5AC_set_cache_auto_resize_config %d %d %d %d \"%s\" %d %d %d %f %d %d %ld %d %f %f %d %f %f " + "%d %d %d %f %f %d %d %d %d %f %zu %d %d\n", + config->version, (int)(config->rpt_fcn_enabled), (int)(config->open_trace_file), + (int)(config->close_trace_file), config->trace_file_name, (int)(config->evictions_enabled), + (int)(config->set_initial_size), (int)(config->initial_size), config->min_clean_fraction, + (int)(config->max_size), (int)(config->min_size), config->epoch_length, + (int)(config->incr_mode), config->lower_hr_threshold, config->increment, + (int)(config->flash_incr_mode), config->flash_multiple, config->flash_threshold, + (int)(config->apply_max_increment), (int)(config->max_increment), (int)(config->decr_mode), + config->upper_hr_threshold, config->decrement, (int)(config->apply_max_decrement), + (int)(config->max_decrement), config->epochs_before_eviction, + (int)(config->apply_empty_reserve), config->empty_reserve, config->dirty_bytes_threshold, + config->metadata_write_strategy, (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_set_cache_config_log_msg() */ - /*------------------------------------------------------------------------- * Function: H5C__trace_write_remove_entry_log_msg * @@ -980,11 +944,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, - herr_t fxn_ret_value) +H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value) { H5C_log_trace_udata_t *trace_udata = (H5C_log_trace_udata_t *)(udata); - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -995,13 +958,12 @@ H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entr /* Create the log message string */ HDsnprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_remove_entry 0x%lx %d\n", - (unsigned long)(entry->addr), (int)fxn_ret_value); + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ - if(H5C__trace_write_log_message(trace_udata) < 0) + if (H5C__trace_write_log_message(trace_udata) < 0) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "unable to emit log message") done: FUNC_LEAVE_NOAPI(ret_value) } /* H5C__trace_write_remove_entry_log_msg() */ - |