diff options
Diffstat (limited to 'src/H5Clog_trace.c')
-rw-r--r-- | src/H5Clog_trace.c | 101 |
1 files changed, 50 insertions, 51 deletions
diff --git a/src/H5Clog_trace.c b/src/H5Clog_trace.c index ffa415f..6b31d98 100644 --- a/src/H5Clog_trace.c +++ b/src/H5Clog_trace.c @@ -163,7 +163,7 @@ H5C__trace_write_log_message(H5C_log_trace_udata_t *trace_udata) assert(trace_udata->message); /* Write the log message and flush */ - n_chars = HDstrlen(trace_udata->message); + n_chars = strlen(trace_udata->message); if ((int)n_chars != fprintf(trace_udata->outfile, "%s", trace_udata->message)) HGOTO_ERROR(H5E_CACHE, H5E_LOGGING, FAIL, "error writing log message"); memset((void *)(trace_udata->message), 0, (size_t)(n_chars * sizeof(char))); @@ -226,16 +226,16 @@ H5C__log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int m * * allocation size = <path length> + dot + <rank # length> + \0 */ - n_chars = HDstrlen(log_location) + 1 + 39 + 1; + n_chars = strlen(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"); /* Add the rank to the log file name when MPI is in use */ if (-1 == mpi_rank) - HDsnprintf(file_name, n_chars, "%s", log_location); + snprintf(file_name, n_chars, "%s", log_location); else - HDsnprintf(file_name, n_chars, "%s.%d", log_location, mpi_rank); + snprintf(file_name, n_chars, "%s.%d", log_location, mpi_rank); /* Open log file and set it to be unbuffered */ if (NULL == (trace_udata->outfile = fopen(file_name, "w"))) @@ -329,8 +329,8 @@ H5C__trace_write_expunge_entry_log_msg(void *udata, haddr_t address, int type_id assert(trace_udata->message); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -362,7 +362,7 @@ H5C__trace_write_flush_cache_log_msg(void *udata, herr_t fxn_ret_value) assert(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); + snprintf(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) @@ -395,8 +395,8 @@ H5C__trace_write_insert_entry_log_msg(void *udata, haddr_t address, int type_id, assert(trace_udata->message); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -429,8 +429,8 @@ H5C__trace_write_mark_entry_dirty_log_msg(void *udata, const H5C_cache_entry_t * assert(entry); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -463,8 +463,8 @@ H5C__trace_write_mark_entry_clean_log_msg(void *udata, const H5C_cache_entry_t * assert(entry); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -498,8 +498,8 @@ H5C__trace_write_mark_unserialized_entry_log_msg(void *udata, const H5C_cache_en assert(entry); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -533,8 +533,8 @@ H5C__trace_write_mark_serialized_entry_log_msg(void *udata, const H5C_cache_entr assert(entry); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -567,8 +567,8 @@ H5C__trace_write_move_entry_log_msg(void *udata, haddr_t old_addr, haddr_t new_a assert(trace_udata->message); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -601,8 +601,8 @@ H5C__trace_write_pin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry, assert(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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -638,9 +638,9 @@ H5C__trace_write_create_fd_log_msg(void *udata, const H5C_cache_entry_t *parent, assert(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); + snprintf(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) @@ -674,8 +674,8 @@ H5C__trace_write_protect_entry_log_msg(void *udata, const H5C_cache_entry_t *ent assert(entry); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -709,8 +709,8 @@ H5C__trace_write_resize_entry_log_msg(void *udata, const H5C_cache_entry_t *entr assert(entry); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -743,8 +743,8 @@ H5C__trace_write_unpin_entry_log_msg(void *udata, const H5C_cache_entry_t *entry assert(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); + snprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_unpin_entry 0x%lx %d\n", + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -780,9 +780,9 @@ H5C__trace_write_destroy_fd_log_msg(void *udata, const H5C_cache_entry_t *parent assert(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); + snprintf(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) @@ -815,8 +815,8 @@ H5C__trace_write_unprotect_entry_log_msg(void *udata, haddr_t address, int type_ assert(trace_udata->message); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -850,20 +850,19 @@ H5C__trace_write_set_cache_config_log_msg(void *udata, const H5AC_cache_config_t assert(config); /* 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); + snprintf(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); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) @@ -896,8 +895,8 @@ H5C__trace_write_remove_entry_log_msg(void *udata, const H5C_cache_entry_t *entr assert(entry); /* 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); + snprintf(trace_udata->message, H5C_MAX_TRACE_LOG_MSG_SIZE, "H5AC_remove_entry 0x%lx %d\n", + (unsigned long)(entry->addr), (int)fxn_ret_value); /* Write the log message to the file */ if (H5C__trace_write_log_message(trace_udata) < 0) |