consolidation of log/debug message interface

This commit is contained in:
2016-06-17 13:50:07 +02:00
parent c831a90a2e
commit f75ef09cf9
60 changed files with 184 additions and 216 deletions
-1
View File
@@ -12,7 +12,6 @@ include_HEADERS = \
$(top_srcdir)/src/include/H5Part_io.h \
$(top_srcdir)/src/include/H5Part_model.h \
$(top_srcdir)/src/include/H5_attachments.h \
$(top_srcdir)/src/include/H5_debug.h \
$(top_srcdir)/src/include/H5_err.h \
$(top_srcdir)/src/include/H5_file.h \
$(top_srcdir)/src/include/H5_file_attribs.h \
+3 -3
View File
@@ -9,7 +9,7 @@
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_file.h"
#include <hdf5.h>
@@ -248,7 +248,7 @@ h5_set_verbosity_level (
) {
H5_API_ENTER (h5_int64_t, "level=%lld", (long long)*level);
H5_API_RETURN(h5_set_debuglevel (*level));
H5_API_RETURN(h5_set_loglevel (*level));
}
#define h5_abort_on_error FC_MANGLING( \
@@ -259,7 +259,7 @@ h5_abort_on_error (
void
) {
H5_API_ENTER (h5_int64_t, "%s", "");
h5_set_debuglevel (1);
h5_set_loglevel (1);
H5_API_RETURN (h5_set_errorhandler (h5_abort_errorhandler));
}
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5b_attribs.h"
#define H5_R8_T H5_FLOAT64
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5b_io.h"
#define h5bl_3d_write_scalar_field_r8 FC_MANGLING ( \
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5b_model.h"
#include "h5core/h5b_io.h"
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5u_io.h"
+1 -1
View File
@@ -8,7 +8,7 @@
*/
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5u_model.h"
#include "h5core/h5u_io.h"
+1 -1
View File
@@ -9,7 +9,7 @@
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_file_attribs.h"
#include "h5core/h5_step_attribs.h"
+1 -1
View File
@@ -9,7 +9,7 @@
#include "h5_private.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_model.h"
/* H5hut data model */
-1
View File
@@ -9,7 +9,6 @@ F90_FILES = \
$(top_srcdir)/src/include/H5_model.f90 \
$(top_srcdir)/src/include/H5_file_attribs.f90 \
$(top_srcdir)/src/include/H5_step_attribs.f90 \
$(top_srcdir)/src/include/H5_debug.f90 \
$(top_srcdir)/src/include/H5_err.f90 \
$(top_srcdir)/src/include/H5_log.f90 \
$(top_srcdir)/src/include/H5Part_model.f90 \
+3 -3
View File
@@ -34,7 +34,7 @@ EXTRA_HEADERS = \
private/h5u_io.h \
private/h5u_types.h \
private/h5_attribs.h \
private/h5_debug.h \
private/h5_log.h \
private/h5_err.h \
private/h5_fcmp.h
@@ -48,8 +48,8 @@ lib_LTLIBRARIES = libH5hut.la
libH5hut_la_SOURCES = \
h5_attachments.c \
h5_attribs.c \
h5_debug.c \
h5_errorhandling.c \
h5_log.c \
h5_err.c \
h5_init.c \
h5_model.c \
h5_file.c \
+1 -1
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "private/h5_hdf5.h"
#include "private/h5_attribs.h"
+4 -4
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_err.h"
#include "private/h5_init.h"
@@ -103,7 +103,7 @@ h5_report_errorhandler (
const char* fmt,
va_list ap
) {
if (h5_debug_level > 0) {
if (h5_log_level > 0) {
h5_verror (fmt, ap);
}
return h5_errno;
@@ -120,7 +120,7 @@ h5_abort_errorhandler (
const char* fmt,
va_list ap
) {
if (h5_debug_level > 0) {
if (h5_log_level > 0) {
h5_verror (fmt, ap);
}
#ifdef PARALLEL_IO
@@ -178,6 +178,6 @@ h5_verror (
const char* fmt,
va_list ap
) {
if (h5_debug_level == 0) return;
if (h5_log_level == 0) return;
h5priv_vprintf (stderr, "E", h5_call_stack.entry[0].name, fmt, ap);
}
+2 -2
View File
@@ -11,7 +11,7 @@
#include <errno.h>
#include <fcntl.h>
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "private/h5_file.h"
#include "private/h5_hdf5.h"
@@ -67,7 +67,7 @@ hdf5_error_handler (
void* __f
) {
UNUSED_ARGUMENT (__f);
if (h5_get_debuglevel() >= 5) {
if (h5_get_loglevel() >= 5) {
H5Eprint (estack_id, stderr);
}
return 0;
@@ -7,10 +7,10 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "private/h5_init.h"
h5_int32_t h5_debug_level = H5_VERBOSE_ERROR;
h5_int32_t h5_log_level = H5_VERBOSE_ERROR;
struct call_stack h5_call_stack;
char *h5_rfmts[] = {
@@ -54,13 +54,13 @@ char *h5_rfmts[] = {
\return \c H5_ERR_INVAL if debug level is invalid.
*/
h5_err_t
h5_set_debuglevel (
h5_set_loglevel (
const h5_id_t level /*!< debug level */
) {
if (level < 0)
h5_debug_level = ((1 << 20) - 1) & ~0x7;
h5_log_level = ((1 << 20) - 1) & ~0x7;
else
h5_debug_level = level;
h5_log_level = level;
return H5_SUCCESS;
}
@@ -72,8 +72,8 @@ h5_set_debuglevel (
\return current debug level
*/
h5_err_t
h5_get_debuglevel (
h5_get_loglevel (
void
) {
return h5_debug_level;
return h5_log_level;
}
+1 -1
View File
@@ -6,7 +6,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "private/h5_debug.h"
#include "private/h5_log.h"
#include "private/h5_file.h"
#include "private/h5_hdf5.h"
+1 -1
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "private/h5_file.h"
#include "private/h5t_types.h"
+6 -6
View File
@@ -2019,7 +2019,7 @@ distribute_octree_parmetis (
TRY (vtxdist = h5_calloc (m->f->nprocs+1, sizeof (*vtxdist)));
vtxdist[0] = 0;
#if !defined(NDEBUG)
if (h5_debug_level & (1<<5) ) {
if (h5_log_level & (1<<5) ) {
h5_debug ("vtxdist[%d]: %d", 0, 0);
}
#endif
@@ -2031,7 +2031,7 @@ distribute_octree_parmetis (
vtxdist[i] = vtxdist[i-1] + n;
}
#if !defined(NDEBUG)
if (h5_debug_level & (1<<5) ) {
if (h5_log_level & (1<<5) ) {
h5_debug ("vtxdist[%d]: %d", i, vtxdist[i]);
}
#endif
@@ -2067,7 +2067,7 @@ distribute_octree_parmetis (
}
xadj[i+1] = xadj[i] + num_neigh;
#if !defined(NDEBUG)
if (h5_debug_level & (1<<5) ) {
if (h5_log_level & (1<<5) ) {
h5_debug ("xadj[%d]: %d", i+1, xadj[i+1]);
}
#endif
@@ -2077,7 +2077,7 @@ distribute_octree_parmetis (
if (new_numbering[j] == neighbors[k]) {
adjncy[counter] = j;
#if !defined(NDEBUG)
if (h5_debug_level & (1<<5) ) {
if (h5_log_level & (1<<5) ) {
h5_debug ("adjncy[%d]: %d", counter, adjncy[counter]);
}
#endif
@@ -2145,7 +2145,7 @@ distribute_octree_parmetis (
TRY (h5_free (ubvec));
#if !defined(NDEBUG)
if (h5_debug_level & (1<<5) ) {
if (h5_log_level & (1<<5) ) {
for (i = 0; i < num_interior_oct; i++) {
h5_debug ("part[%d]: %llu", i, (unsigned long long)part[i]);
}
@@ -2633,7 +2633,7 @@ read_chunked_elements (
#if NDEBUG == 0
if (h5_debug_level & (1<<6) ) {
if (h5_log_level & (1<<6) ) {
sleep (m->f->myproc*2);
for (int i = 0; i < num_interior_elems;i++) {
h5_debug ("\n"
+1 -1
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "private/h5_file.h"
#include "private/h5_mpi.h"
+1 -1
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "private/h5_file.h"
+1 -1
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5u_model.h"
#include "h5core/h5u_io.h"
+1 -1
View File
@@ -2,7 +2,7 @@
#define __PRIVATE_H5_FILE_H
#include "private/h5_types.h"
#include "private/h5_debug.h"
#include "private/h5_log.h"
#include "private/h5_err.h"
#include "h5core/h5_file.h"
+1 -1
View File
@@ -14,7 +14,7 @@
#include "h5core/h5_types.h"
#include "h5core/h5_err.h"
#include "private/h5_debug.h"
#include "private/h5_log.h"
#include "private/h5_va_macros.h"
ssize_t
+1 -1
View File
@@ -32,7 +32,7 @@
#include <assert.h>
#include <stddef.h>
#include "private/h5_debug.h"
#include "private/h5_log.h"
#include "private/h5_hsearch.h"
#include "h5core/h5_types.h"
@@ -11,7 +11,7 @@
#define __PRIVATE_H5_DEBUG_H
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "private/h5_init.h"
#define H5_CORE_API_ENTER(type, fmt, ...) \
+1 -1
View File
@@ -92,7 +92,7 @@ _get_lustre_stripe_size(h5_file_t *const f, const char *path )
close(fd);
if ( f->myproc == 0 && h5_get_debuglevel() >= 5 )
if ( f->myproc == 0 && h5_get_loglevel() >= 5 )
_print_stripe_info(lum);
ssize_t stripe_size = (ssize_t)lum->lmm_stripe_size;
+2 -2
View File
@@ -11,10 +11,10 @@
#define __PRIVATE_H5_MAPS_H
#include "private/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_err.h"
#include "h5core/h5_syscall.h"
#include "private/h5_debug.h"
#include "private/h5_log.h"
// Allocate new list
#define h5priv_alloc_xlist( type ) \
+1 -1
View File
@@ -14,7 +14,7 @@
#include "h5core/h5_types.h"
#include "h5core/h5_err.h"
#include "private/h5_debug.h"
#include "private/h5_log.h"
static inline h5_err_t
h5priv_mpi_alltoall (
+1 -1
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_syscall.h"
#include "private/h5_file.h"
+1 -1
View File
@@ -7,7 +7,7 @@
License: see file COPYING in top level of source distribution.
*/
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_syscall.h"
#include "private/h5_file.h"
+1 -1
View File
@@ -12,7 +12,7 @@
#include "h5core/h5_types.h"
#include "private/h5t_types.h"
#include "private/h5_debug.h"
#include "private/h5_log.h"
struct h5t_adjacency_methods {
h5_err_t (*get_adjacencies)(
+1 -1
View File
@@ -219,7 +219,7 @@ update_internal_structs (
// create index sets
#if (!defined(NDEBUG) && (h5_debug_level & (1<<5)))
#if (!defined(NDEBUG) && (h5_log_level & (1<<5)))
if (!m->is_chunked) {
h5t_adjacencies_t* adj = &m->adjacencies;
h5_loc_idx_t idx = 0;
+1 -1
View File
@@ -12,7 +12,7 @@
#include "h5core/h5_types.h"
#include "h5core/h5_err.h"
#include "private/h5_debug.h"
#include "private/h5_log.h"
#define ERR_ELEM_NEXIST "Element with local vertex IDs (%s) doesn't exist!"
+2 -2
View File
@@ -11,10 +11,10 @@
#define __PRIVATE_H5T_MAP_H
#include "private/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_err.h"
#include "h5core/h5_syscall.h"
#include "private/h5_debug.h"
#include "private/h5_log.h"
#include "private/h5_maps.h"
#include "private/h5t_model.h"
+1 -1
View File
@@ -203,7 +203,7 @@ compute_neighbor_of_face (
}
if (elem_idx < -1) { // this should only happen if we are on the boarder
// of a loaded chunk and the parent is on a different chunk
if (h5_debug_level >= 6) {
if (h5_log_level >= 6) {
h5_debug ("Elem %d is on different proc than its parent %d \n"
"therefore neighborhood idx is not correct resolved", old_elem_idx, elem_idx);
}
+1 -1
View File
@@ -12,7 +12,7 @@
#include <string.h>
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5b_attribs.h"
#ifdef __cplusplus
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __H5BLOCK_IO_H
#define __H5BLOCK_IO_H
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5b_io.h"
#ifdef __cplusplus
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __H5BLOCK_MODEL
#define __H5BLOCK_MODEL
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5b_model.h"
/**
+1 -1
View File
@@ -11,7 +11,7 @@
#define __H5FED_ADJACENCY_H
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5t_adjacencies.h"
#ifdef __cplusplus
+1 -1
View File
@@ -11,7 +11,7 @@
#define __H5FED_MODEL_H
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5t_model.h"
#ifdef __cplusplus
+1 -1
View File
@@ -11,7 +11,7 @@
#define __H5FED_RETRIEVE_H
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_syscall.h"
#include "h5core/h5t_map.h"
#include "h5core/h5t_retrieve.h"
+1 -1
View File
@@ -11,7 +11,7 @@
#define __H5FED_STORE_H
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5t_store.h"
#ifdef __cplusplus
+1 -1
View File
@@ -11,7 +11,7 @@
#define __H5FED_TAGS_H
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5t_tags.h"
#ifdef __cplusplus
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef H5PART_IO
#define H5PART_IO
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5u_io.h"
#ifdef __cplusplus
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef H5PART_MODEL
#define H5PART_MODEL
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5u_model.h"
/**
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __H5_ATTACHMENTS_H
#define __H5_ATTACHMENTS_H
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_model.h"
#include "h5core/h5_attachments.h"
-45
View File
@@ -1,45 +0,0 @@
!
! Copyright (c) 2006-2016, The Regents of the University of California,
! through Lawrence Berkeley National Laboratory (subject to receipt of any
! required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
! Institut (Switzerland). All rights reserved.!
!
! License: see file COPYING in top level of source distribution.
!
INTERFACE
!> \addtogroup h5_debug_fvalue
!! @{
!>
!! Set debug mask. The debug mask is an or'ed value of
!!
!! - \c H5_DEBUG_API: C-API calls
!! - \c H5_DEBUG_CORE_API: core API calls. The core API is used by the C- and Fortran API.
!! - \c H5_DEBUG_PRIV_API: private API calls
!! - \c H5_DEBUG_PRIV_FUNC: static functions
!! - \c H5_DEBUG_HDF5: HDF5 wrapper calls
!! - \c H5_DEBUG_MPI: MPI wrapper calls
!! - \c H5_DEBUG_MALLOC: memory allocation
!! - \c H5_DEBUG_ALL: enable all
!!
!! \return \c H5_SUCCESS
!!
!! \see h5_get_debug_mask()
SUBROUTINE h5_set_debug_mask ( mask )
INTEGER*8, INTENT(IN) :: mask !< [in] debug mask
END SUBROUTINE h5_set_debug_mask
!>
!! Get debug mask.
!!
!! \return debug mask
!!
!! \see h5_set_debug_mask()
INTEGER*8 FUNCTION h5_get_debug_mask ()
END FUNCTION h5_get_debug_mask
!> @}
END INTERFACE
-76
View File
@@ -1,76 +0,0 @@
/*
Copyright (c) 2006-2016, The Regents of the University of California,
through Lawrence Berkeley National Laboratory (subject to receipt of any
required approvals from the U.S. Dept. of Energy) and the Paul Scherrer
Institut (Switzerland). All rights reserved.
License: see file COPYING in top level of source distribution.
*/
#ifndef __H5_DEBUG_H
#define __H5_DEBUG_H
#include "h5core/h5_debug.h"
/**
\addtogroup h5_debug
@{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
Set debug mask. The debug mask is an or'ed value of
- \c H5_DEBUG_API: C-API calls
- \c H5_DEBUG_CORE_API: core API calls.
- \c H5_DEBUG_PRIV_API: private API calls
- \c H5_DEBUG_PRIV_FUNC: static functions
- \c H5_DEBUG_HDF5: HDF5 wrapper calls
- \c H5_DEBUG_MPI: MPI wrapper calls
- \c H5_DEBUG_MALLOC: memory allocation
- \c H5_DEBUG_ALL: enable all
\return \c H5_SUCCESS
\see H5GetDebugMask()
\note
| Release | Change |
| :------ | :----- |
| \c 1.99.15 | Function introduced in this release. |
*/
static inline h5_err_t
H5SetDebugMask (
const h5_id_t mask ///< [in] debug mask
) {
return h5_set_debuglevel (mask & ~0x03);
}
/**
Get debug mask.
\return debug mask
\see H5SetDebugMask()
\note
| Release | Change |
| :------ | :----- |
| \c 1.99.15 | Function introduced in this release. |
*/
static inline h5_id_t
H5GetDebugMask (
void
) {
return (h5_get_debuglevel () & ~0x03);
}
#ifdef __cplusplus
}
#endif
///< @}
#endif
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __H5_ERROR_H
#define __H5_ERROR_H
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
/**
\addtogroup h5_error
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __H5_FILE_H
#define __H5_FILE_H
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_file.h"
#include <hdf5.h>
+1 -1
View File
@@ -12,7 +12,7 @@
#include <string.h>
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_file_attribs.h"
#ifdef __cplusplus
+36
View File
@@ -41,4 +41,40 @@
END FUNCTION h5_get_verbosity_level
!> @}
!> \addtogroup h5_debug_fvalue
!! @{
!>
!! Set debug mask. The debug mask is an or'ed value of
!!
!! - \c H5_DEBUG_API: C-API calls
!! - \c H5_DEBUG_CORE_API: core API calls. The core API is used by the C- and Fortran API.
!! - \c H5_DEBUG_PRIV_API: private API calls
!! - \c H5_DEBUG_PRIV_FUNC: static functions
!! - \c H5_DEBUG_HDF5: HDF5 wrapper calls
!! - \c H5_DEBUG_MPI: MPI wrapper calls
!! - \c H5_DEBUG_MALLOC: memory allocation
!! - \c H5_DEBUG_ALL: enable all
!!
!! \return \c H5_SUCCESS
!!
!! \see h5_get_debug_mask()
SUBROUTINE h5_set_debug_mask ( mask )
INTEGER*8, INTENT(IN) :: mask !< [in] debug mask
END SUBROUTINE h5_set_debug_mask
!>
!! Get debug mask.
!!
!! \return debug mask
!!
!! \see h5_set_debug_mask()
INTEGER*8 FUNCTION h5_get_debug_mask ()
END FUNCTION h5_get_debug_mask
!> @}
END INTERFACE
+61 -4
View File
@@ -11,7 +11,7 @@
#define __H5_LOG_H
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#if H5HUT_API_VERSION == 2
#define H5SetVerbosityLevel2 H5SetVerbosityLevel
@@ -52,7 +52,7 @@ static inline h5_err_t
H5SetVerbosityLevel2 (
const h5_id_t level ///< [in] verbosity level.
) {
return h5_set_debuglevel (level & 0x03);
return h5_set_loglevel (level & 0x03);
}
/**
@@ -74,7 +74,7 @@ static inline h5_err_t
H5SetVerbosityLevel1 (
const h5_id_t level ///< [in] verbosity level.
) {
return h5_set_debuglevel (level);
return h5_set_loglevel (level);
}
/**
@@ -88,7 +88,62 @@ static inline h5_id_t
H5GetVerbosityLevel (
void
) {
return h5_get_debuglevel () & 0x03;
return h5_get_loglevel () & 0x03;
}
///< @}
/**
\addtogroup h5_debug
@{
*/
/**
Set debug mask. The debug mask is an or'ed value of
- \c H5_DEBUG_API: C-API calls
- \c H5_DEBUG_CORE_API: core API calls.
- \c H5_DEBUG_PRIV_API: private API calls
- \c H5_DEBUG_PRIV_FUNC: static functions
- \c H5_DEBUG_HDF5: HDF5 wrapper calls
- \c H5_DEBUG_MPI: MPI wrapper calls
- \c H5_DEBUG_MALLOC: memory allocation
- \c H5_DEBUG_ALL: enable all
\return \c H5_SUCCESS
\see H5GetDebugMask()
\note
| Release | Change |
| :------ | :----- |
| \c 1.99.15 | Function introduced in this release. |
*/
static inline h5_err_t
H5SetDebugMask (
const h5_id_t mask ///< [in] debug mask
) {
return h5_set_loglevel (mask & ~0x03);
}
/**
Get debug mask.
\return debug mask
\see H5SetDebugMask()
\note
| Release | Change |
| :------ | :----- |
| \c 1.99.15 | Function introduced in this release. |
*/
static inline h5_id_t
H5GetDebugMask (
void
) {
return (h5_get_loglevel () & ~0x03);
}
#ifdef __cplusplus
@@ -96,5 +151,7 @@ H5GetVerbosityLevel (
#endif
///< @}
#endif
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __H5_MODEL_H
#define __H5_MODEL_H
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_model.h"
/**
+1 -1
View File
@@ -12,7 +12,7 @@
#include <string.h>
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#include "h5core/h5_step_attribs.h"
#ifdef __cplusplus
-1
View File
@@ -14,7 +14,6 @@ MODULE H5hut
include 'H5_file_attribs.f90'
include 'H5_step_attribs.f90'
include 'H5_log.f90'
include 'H5_debug.f90'
include 'H5_err.f90'
include 'H5Part_model.f90'
-1
View File
@@ -20,7 +20,6 @@
#include "H5_file_attribs.h"
#include "H5_step_attribs.h"
#include "H5_log.h"
#include "H5_debug.h"
#include "H5_err.h"
#include "H5Part_io.h"
+4 -4
View File
@@ -2,12 +2,12 @@ otherincludedir = $(includedir)/h5core
include_HEADERS = \
h5_attachments.h \
h5_debug.h \
h5_err.h \
h5_file.h \
h5_file_attribs.h \
h5_step_attribs.h \
h5_log.h \
h5_model.h \
h5_step_attribs.h \
h5_syscall.h \
h5_types.h \
h5b_attribs.h \
@@ -20,8 +20,8 @@ include_HEADERS = \
h5t_retrieve.h \
h5t_store.h \
h5t_tags.h \
h5u_model.h \
h5u_io.h
h5u_io.h \
h5u_model.h
clean-local:
$(RM) *~
@@ -7,8 +7,8 @@
License: see file COPYING in top level of source distribution.
*/
#ifndef __H5CORE_H5_DEBUG_H
#define __H5CORE_H5_DEBUG_H
#ifndef __H5CORE_H5_LOG_H
#define __H5CORE_H5_LOG_H
#include <stdio.h>
#include <stddef.h>
@@ -74,7 +74,7 @@ struct call_stack {
struct call_stack_entry entry[1024];
};
extern h5_int32_t h5_debug_level;
extern h5_int32_t h5_log_level;
extern struct call_stack h5_call_stack;
#ifdef __cplusplus
@@ -190,7 +190,7 @@ h5_warn (
const char* fmt,
...
) {
if (h5_debug_level >= 2) {
if (h5_log_level >= 2) {
va_list ap;
va_start (ap, fmt);
h5priv_vprintf (stderr, "W", h5_get_funcname(), fmt, ap);
@@ -218,7 +218,7 @@ h5_info (
const char* fmt,
...
) {
if (h5_debug_level >= 3) {
if (h5_log_level >= 3) {
va_list ap;
va_start (ap, fmt);
h5priv_vprintf (stdout, "I", h5_get_funcname(), fmt, ap);
@@ -246,7 +246,7 @@ h5_debug (
const char *fmt,
...
) {
if (h5_debug_level >= 4) {
if (h5_log_level >= 4) {
char prefix[1024];
snprintf (prefix, sizeof(prefix), "%*s %s",
h5_call_stack_get_level(), "",
@@ -274,13 +274,13 @@ h5_debug (
#define __API_ENTER(type, mask, fmt, ...) \
h5_call_stack_push (__func__,e_##type); \
type ret_value = (type)H5_ERR; \
if (h5_debug_level & mask ) { \
if (h5_log_level & mask ) { \
h5_debug ("(" fmt ")", __VA_ARGS__); \
}
#define __FUNC_ENTER(type, mask, fmt, ...) \
type ret_value = (type)H5_ERR; \
if (h5_debug_level & mask ) { \
if (h5_log_level & mask ) { \
h5_call_stack_push (__func__,e_##type); \
h5_debug ("(" fmt ")", __VA_ARGS__); \
} \
@@ -321,7 +321,7 @@ done: \
ret_value = expr; \
goto done; \
done: \
if (h5_debug_level & mask ) { \
if (h5_log_level & mask ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
@@ -334,7 +334,7 @@ done: \
ret_value = expr; \
goto done; \
done: \
if (h5_debug_level & mask ) { \
if (h5_log_level & mask ) { \
char fmt[256]; \
snprintf (fmt, sizeof(fmt), "return: %s", \
h5_rfmts[h5_call_stack_get_type()]); \
@@ -359,11 +359,11 @@ done: \
}
h5_err_t
h5_set_debuglevel (
h5_set_loglevel (
const h5_id_t);
h5_err_t
h5_get_debuglevel (
h5_get_loglevel (
void);
#ifdef __cplusplus
+1 -1
View File
@@ -14,7 +14,7 @@
#include <string.h>
#include "h5core/h5_types.h"
#include "h5core/h5_debug.h"
#include "h5core/h5_log.h"
#define MALLOC_WRAPPER_ENTER(type, fmt, ...) \
__FUNC_ENTER(type, H5_DEBUG_MALLOC, fmt, __VA_ARGS__)