summaryrefslogtreecommitdiffstats
path: root/src/H5ACprivate.h
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1997-11-07 05:16:53 (GMT)
committerRobb Matzke <matzke@llnl.gov>1997-11-07 05:16:53 (GMT)
commit73897627660169de753597b9ff045d3112646506 (patch)
treeb02e9ffd202a7448cdf4bc0bdfe5da728dde862b /src/H5ACprivate.h
parent833e82fec5f654c1ed93a6e4e4266f280e20311c (diff)
downloadhdf5-73897627660169de753597b9ff045d3112646506.zip
hdf5-73897627660169de753597b9ff045d3112646506.tar.gz
hdf5-73897627660169de753597b9ff045d3112646506.tar.bz2
[svn-r135] ./config/linux
./config/freebsd2.2.1 Rewritten to be more flexible. ./src/H5AC.c ./src/H5ACprivate.h ./src/H5F.c ./src/H5H.c ./src/H5Gpkg.h ./src/H5Gshad.c ./src/H5O.c ./test/istore.c ./test/tstab.c Accumulates cache statistics and displays the results on stderr when the file is closed if it was opened with H5F_ACC_DEBUG passed into H5F_open() ./src/H5B.c ./src/H5Bprivate.h ./src/H5Fistore.c ./src/H5Gnode.c Added more debugging which is turned on if H5B_DEBUG is defined on the compile command (see config/linux). Fixed a couple of bugs with left insertions which are used by the indexed storage stuff. ./src/H5Flow.c Fixed a memory leak. ./src/H5Fprivate.h Fixed warnings about shifting more than size of object. ./src/H5Fstdio.c Fixed seek optimizations back to the way Quincey originally had them. ./src/H5V.c Removed unused variables.
Diffstat (limited to 'src/H5ACprivate.h')
-rw-r--r--src/H5ACprivate.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index 25549ff..884bc3c6 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -38,8 +38,18 @@
* function is also responsible for freeing memory allocated
* by the LOAD method if the DEST argument is non-zero.
*/
+typedef enum H5AC_subid_t {
+ H5AC_BT_ID =0, /*B-tree nodes */
+ H5AC_SNODE_ID =1, /*symbol table nodes */
+ H5AC_HEAP_ID =2, /*object or name heap */
+ H5AC_OHDR_ID =3, /*object header */
+ H5AC_NTYPES =4 /*THIS MUST BE LAST!*/
+} H5AC_subid_t;
+
typedef struct H5AC_class_t {
- void *(*load)(H5F_t*, haddr_t addr, void *udata1, void *udata2);
+ H5AC_subid_t id;
+ void *(*load)(H5F_t*, haddr_t addr, const void *udata1,
+ void *udata2);
herr_t (*flush)(H5F_t*, hbool_t dest, haddr_t addr, void *thing);
} H5AC_class_t;
@@ -70,17 +80,22 @@ typedef struct H5AC_t {
intn nslots; /*number of cache slots */
H5AC_slot_t *slot; /*the cache slots */
intn nprots; /*number of protected objects */
+ struct {
+ uintn nhits; /*number of cache hits */
+ uintn nmisses; /*number of cache misses */
+ uintn ninits; /*number of cache initializations */
+ uintn nflushes; /*number of flushes to disk */
+ } diagnostics[H5AC_NTYPES]; /*diagnostics for each type of object */
} H5AC_t;
-
/*
* Library prototypes.
*/
herr_t H5AC_dest (H5F_t *f);
void *H5AC_find_f (H5F_t *f, const H5AC_class_t *type, haddr_t addr,
- void *udata1, void *udata2);
+ const void *udata1, void *udata2);
void * H5AC_protect (H5F_t *f, const H5AC_class_t *type, haddr_t addr,
- void *udata1, void *udata2);
+ const void *udata1, void *udata2);
herr_t H5AC_unprotect (H5F_t *f, const H5AC_class_t *type, haddr_t addr,
void *thing);
herr_t H5AC_flush (H5F_t *f, const H5AC_class_t *type, haddr_t addr,
@@ -90,11 +105,13 @@ herr_t H5AC_rename (H5F_t *f, const H5AC_class_t *type, haddr_t old,
haddr_t new);
herr_t H5AC_set (H5F_t *f, const H5AC_class_t *type, haddr_t addr,
void *thing);
+herr_t H5AC_debug (H5F_t *f);
#define H5AC_find(F,TYPE,ADDR,UDATA1,UDATA2) \
(((F)->shared->cache->slot[H5AC_HASH(F,ADDR)].type==(TYPE) && \
(F)->shared->cache->slot[H5AC_HASH(F,ADDR)].addr==(ADDR)) ? \
- (F)->shared->cache->slot[H5AC_HASH(F,ADDR)].thing : \
+ ((F)->shared->cache->diagnostics[(TYPE)->id].nhits++, \
+ (F)->shared->cache->slot[H5AC_HASH(F,ADDR)].thing) : \
H5AC_find_f (F, TYPE, ADDR, UDATA1, UDATA2))