mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-30 15:32:37 +08:00
Move cache image macros (#2732)
* Move cache image stats macros to cache image source file * Disable formatting on the macros
This commit is contained in:
parent
2cb733ff1b
commit
2ad5a25243
@ -80,6 +80,48 @@
|
||||
/* Maximum ring allowed in image */
|
||||
#define H5C_MAX_RING_IN_IMAGE H5C_RING_MDFSM
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* Stats collection macros
|
||||
*
|
||||
* The following macros must handle stats collection when collection
|
||||
* is enabled, and evaluate to the empty string when it is not.
|
||||
*
|
||||
***********************************************************************/
|
||||
#if H5C_COLLECT_CACHE_STATS
|
||||
/* clang-format off */
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) \
|
||||
(cache_ptr)->images_created++;
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) \
|
||||
{ \
|
||||
/* make sure image len is still good */ \
|
||||
HDassert((cache_ptr)->image_len > 0); \
|
||||
(cache_ptr)->images_read++; \
|
||||
}
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \
|
||||
{ \
|
||||
/* make sure image len is still good */ \
|
||||
HDassert((cache_ptr)->image_len > 0); \
|
||||
(cache_ptr)->images_loaded++; \
|
||||
(cache_ptr)->last_image_size = (cache_ptr)->image_len; \
|
||||
}
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) \
|
||||
{ \
|
||||
(cache_ptr)->prefetches++; \
|
||||
if (dirty) \
|
||||
(cache_ptr)->dirty_prefetches++; \
|
||||
}
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) \
|
||||
(cache_ptr)->prefetch_hits++;
|
||||
/* clang-format on */
|
||||
#else /* H5C_COLLECT_CACHE_STATS */
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty)
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr)
|
||||
#endif /* H5C_COLLECT_CACHE_STATS */
|
||||
|
||||
/******************/
|
||||
/* Local Typedefs */
|
||||
/******************/
|
||||
|
33
src/H5Cpkg.h
33
src/H5Cpkg.h
@ -596,34 +596,6 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \
|
||||
#define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) \
|
||||
(cache_ptr)->index_scan_restarts++;
|
||||
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) \
|
||||
(cache_ptr)->images_created++;
|
||||
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) \
|
||||
{ \
|
||||
/* make sure image len is still good */ \
|
||||
HDassert((cache_ptr)->image_len > 0); \
|
||||
(cache_ptr)->images_read++; \
|
||||
}
|
||||
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \
|
||||
{ \
|
||||
/* make sure image len is still good */ \
|
||||
HDassert((cache_ptr)->image_len > 0); \
|
||||
(cache_ptr)->images_loaded++; \
|
||||
(cache_ptr)->last_image_size = (cache_ptr)->image_len; \
|
||||
}
|
||||
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) \
|
||||
{ \
|
||||
(cache_ptr)->prefetches++; \
|
||||
if (dirty) \
|
||||
(cache_ptr)->dirty_prefetches++; \
|
||||
}
|
||||
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) \
|
||||
(cache_ptr)->prefetch_hits++;
|
||||
|
||||
#if H5C_COLLECT_CACHE_ENTRY_STATS
|
||||
|
||||
#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) \
|
||||
@ -831,11 +803,6 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \
|
||||
#define H5C__UPDATE_STATS_FOR_SLIST_SCAN_RESTART(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr)
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty)
|
||||
#define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr)
|
||||
|
||||
#endif /* H5C_COLLECT_CACHE_STATS */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user