HDF5  1.12.0
H5Clog.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * Purpose: Cache logging header file
16  */
17 
18 #ifndef _H5Clog_H
19 #define _H5Clog_H
20 
21 /* Get package's private header */
22 #include "H5Cprivate.h" /* Cache */
23 
24 /**************************/
25 /* Package Private Macros */
26 /**************************/
27 
28 /****************************/
29 /* Package Private Typedefs */
30 /****************************/
31 
32 /* Forward declaration for class struct */
33 typedef struct H5C_log_info_t H5C_log_info_t;
34 
35 /* Class for generating logging messages */
36 typedef struct H5C_log_class_t {
37  const char *name; /* String for debugging */
38 
39  /* Callbacks for writing log messages */
43  herr_t (*write_start_log_msg)(void *udata);
44  herr_t (*write_stop_log_msg)(void *udata);
45  herr_t (*write_create_cache_log_msg)(void *udata, herr_t fxn_ret_value);
47  herr_t (*write_evict_cache_log_msg)(void *udata, herr_t fxn_ret_value);
48  herr_t (*write_expunge_entry_log_msg)(void *udata, haddr_t address, int type_id, herr_t fxn_ret_value);
49  herr_t (*write_flush_cache_log_msg)(void *udata, herr_t fxn_ret_value);
50  herr_t (*write_insert_entry_log_msg)(void *udata, haddr_t address, int type_id, unsigned flags, size_t size, herr_t fxn_ret_value);
51  herr_t (*write_mark_entry_dirty_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
52  herr_t (*write_mark_entry_clean_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
53  herr_t (*write_mark_unserialized_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
54  herr_t (*write_mark_serialized_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
55  herr_t (*write_move_entry_log_msg)(void *udata, haddr_t old_addr, haddr_t new_addr, int type_id, herr_t fxn_ret_value);
56  herr_t (*write_pin_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
57  herr_t (*write_create_fd_log_msg)(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value);
58  herr_t (*write_protect_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value);
59  herr_t (*write_resize_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value);
60  herr_t (*write_unpin_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
61  herr_t (*write_destroy_fd_log_msg)(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value);
62  herr_t (*write_unprotect_entry_log_msg)(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value);
63  herr_t (*write_set_cache_config_log_msg)(void *udata, const H5AC_cache_config_t *config, herr_t fxn_ret_value);
64  herr_t (*write_remove_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
65 
67 
68 /* Logging information */
70  hbool_t enabled; /* Was the logging set up? */
71  hbool_t logging; /* Are we currently logging? */
72  H5C_log_class_t *cls; /* Callbacks for writing log messages */
73  void *udata; /* Log-specific data */
74 };
75 
76 
77 /*****************************/
78 /* Package Private Variables */
79 /*****************************/
80 
81 
82 /******************************/
83 /* Package Private Prototypes */
84 /******************************/
85 H5_DLL herr_t H5C_log_set_up(H5C_t *cache, const char log_location[], H5C_log_style_t style, hbool_t start_immediately);
87 
91 H5_DLL herr_t H5C_log_write_expunge_entry_msg(H5C_t *cache, haddr_t address, int type_id, herr_t fxn_ret_value);
93 H5_DLL herr_t H5C_log_write_insert_entry_msg(H5C_t *cache, haddr_t address, int type_id, unsigned flags, size_t size, herr_t fxn_ret_value);
98 H5_DLL herr_t H5C_log_write_move_entry_msg(H5C_t *cache, haddr_t old_addr, haddr_t new_addr, int type_id, herr_t fxn_ret_value);
99 H5_DLL herr_t H5C_log_write_pin_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
100 H5_DLL herr_t H5C_log_write_create_fd_msg(H5C_t *cache, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value);
101 H5_DLL herr_t H5C_log_write_protect_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value);
102 H5_DLL herr_t H5C_log_write_resize_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value);
103 H5_DLL herr_t H5C_log_write_unpin_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
104 H5_DLL herr_t H5C_log_write_destroy_fd_msg(H5C_t *cache, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value);
105 H5_DLL herr_t H5C_log_write_unprotect_entry_msg(H5C_t *cache, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value);
107 H5_DLL herr_t H5C_log_write_remove_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value);
108 
109 /* Logging-specific setup functions */
110 H5_DLL herr_t H5C_log_json_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi_rank);
111 H5_DLL herr_t H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi_rank);
112 
113 #endif /* _H5Clog_H */
114 
H5C_log_class_t::write_mark_entry_clean_log_msg
herr_t(* write_mark_entry_clean_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.h:52
H5C_log_class_t::write_destroy_fd_log_msg
herr_t(* write_destroy_fd_log_msg)(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value)
Definition: H5Clog.h:61
H5C_log_class_t::write_unprotect_entry_log_msg
herr_t(* write_unprotect_entry_log_msg)(void *udata, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value)
Definition: H5Clog.h:62
H5C_log_class_t::write_remove_entry_log_msg
herr_t(* write_remove_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.h:64
H5C_log_class_t::write_set_cache_config_log_msg
herr_t(* write_set_cache_config_log_msg)(void *udata, const H5AC_cache_config_t *config, herr_t fxn_ret_value)
Definition: H5Clog.h:63
H5C_log_write_insert_entry_msg
H5_DLL herr_t H5C_log_write_insert_entry_msg(H5C_t *cache, haddr_t address, int type_id, unsigned flags, size_t size, herr_t fxn_ret_value)
Definition: H5Clog.c:480
H5C_log_write_destroy_fd_msg
H5_DLL herr_t H5C_log_write_destroy_fd_msg(H5C_t *cache, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value)
Definition: H5Clog.c:855
size
iblock size
Definition: H5EAcache.c:787
H5C_log_class_t::write_unpin_entry_log_msg
herr_t(* write_unpin_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.h:60
H5C_log_write_create_fd_msg
H5_DLL herr_t H5C_log_write_create_fd_msg(H5C_t *cache, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value)
Definition: H5Clog.c:717
H5C_log_class_t::write_expunge_entry_log_msg
herr_t(* write_expunge_entry_log_msg)(void *udata, haddr_t address, int type_id, herr_t fxn_ret_value)
Definition: H5Clog.h:48
H5C_log_write_set_cache_config_msg
H5_DLL herr_t H5C_log_write_set_cache_config_msg(H5C_t *cache, const H5AC_cache_config_t *config, herr_t fxn_ret_value)
Definition: H5Clog.c:923
H5C_log_class_t::tear_down_logging
herr_t(* tear_down_logging)(H5C_log_info_t *log_info)
Definition: H5Clog.h:40
H5C_t
Definition: H5Cpkg.h:4642
H5C_log_write_remove_entry_msg
H5_DLL herr_t H5C_log_write_remove_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.c:957
H5C_log_class_t::write_resize_entry_log_msg
herr_t(* write_resize_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value)
Definition: H5Clog.h:59
H5C_log_class_t::start_logging
herr_t(* start_logging)(H5C_log_info_t *log_info)
Definition: H5Clog.h:41
haddr_t
CATCH haddr_t
Definition: H5EAdblock.c:162
H5C_log_class_t::write_pin_entry_log_msg
herr_t(* write_pin_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.h:56
H5C_log_class_t::write_insert_entry_log_msg
herr_t(* write_insert_entry_log_msg)(void *udata, haddr_t address, int type_id, unsigned flags, size_t size, herr_t fxn_ret_value)
Definition: H5Clog.h:50
H5C_log_write_flush_cache_msg
H5_DLL herr_t H5C_log_write_flush_cache_msg(H5C_t *cache, herr_t fxn_ret_value)
Definition: H5Clog.c:448
H5C_log_tear_down
H5_DLL herr_t H5C_log_tear_down(H5C_t *cache)
Definition: H5Clog.c:150
H5C_log_json_set_up
H5_DLL herr_t H5C_log_json_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi_rank)
Definition: H5Clog_json.c:205
H5C_log_write_move_entry_msg
H5_DLL herr_t H5C_log_write_move_entry_msg(H5C_t *cache, haddr_t old_addr, haddr_t new_addr, int type_id, herr_t fxn_ret_value)
Definition: H5Clog.c:649
H5C_log_write_destroy_cache_msg
H5_DLL herr_t H5C_log_write_destroy_cache_msg(H5C_t *cache)
Definition: H5Clog.c:351
H5C_log_class_t::write_protect_entry_log_msg
herr_t(* write_protect_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value)
Definition: H5Clog.h:58
H5C_log_set_up
H5_DLL herr_t H5C_log_set_up(H5C_t *cache, const char log_location[], H5C_log_style_t style, hbool_t start_immediately)
Definition: H5Clog.c:88
H5C_log_class_t
struct H5C_log_class_t H5C_log_class_t
H5C_log_write_expunge_entry_msg
H5_DLL herr_t H5C_log_write_expunge_entry_msg(H5C_t *cache, haddr_t address, int type_id, herr_t fxn_ret_value)
Definition: H5Clog.c:415
H5C_log_class_t::write_destroy_cache_log_msg
herr_t(* write_destroy_cache_log_msg)(void *udata)
Definition: H5Clog.h:46
H5C_log_class_t::write_flush_cache_log_msg
herr_t(* write_flush_cache_log_msg)(void *udata, herr_t fxn_ret_value)
Definition: H5Clog.h:49
H5C_log_write_evict_cache_msg
H5_DLL herr_t H5C_log_write_evict_cache_msg(H5C_t *cache, herr_t fxn_ret_value)
Definition: H5Clog.c:383
H5C_log_write_resize_entry_msg
H5_DLL herr_t H5C_log_write_resize_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, size_t new_size, herr_t fxn_ret_value)
Definition: H5Clog.c:786
H5C_log_info_t::udata
void * udata
Definition: H5Clog.h:73
H5Cprivate.h
H5C_log_class_t::write_mark_entry_dirty_log_msg
herr_t(* write_mark_entry_dirty_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.h:51
H5C_log_write_unprotect_entry_msg
H5_DLL herr_t H5C_log_write_unprotect_entry_msg(H5C_t *cache, haddr_t address, int type_id, unsigned flags, herr_t fxn_ret_value)
Definition: H5Clog.c:890
H5C_log_trace_set_up
H5_DLL herr_t H5C_log_trace_set_up(H5C_log_info_t *log_info, const char log_location[], int mpi_rank)
Definition: H5Clog_trace.c:200
H5C_log_write_protect_entry_msg
H5_DLL herr_t H5C_log_write_protect_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, int type_id, unsigned flags, herr_t fxn_ret_value)
Definition: H5Clog.c:752
H5C_log_info_t::cls
H5C_log_class_t * cls
Definition: H5Clog.h:72
H5C_log_class_t::write_start_log_msg
herr_t(* write_start_log_msg)(void *udata)
Definition: H5Clog.h:43
H5C_log_write_create_cache_msg
H5_DLL herr_t H5C_log_write_create_cache_msg(H5C_t *cache, herr_t fxn_ret_value)
Definition: H5Clog.c:316
H5C_log_class_t::write_mark_serialized_entry_log_msg
herr_t(* write_mark_serialized_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.h:54
H5C_log_write_mark_unserialized_entry_msg
H5_DLL herr_t H5C_log_write_mark_unserialized_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.c:581
H5C_log_class_t::write_move_entry_log_msg
herr_t(* write_move_entry_log_msg)(void *udata, haddr_t old_addr, haddr_t new_addr, int type_id, herr_t fxn_ret_value)
Definition: H5Clog.h:55
H5C_log_write_mark_entry_dirty_msg
H5_DLL herr_t H5C_log_write_mark_entry_dirty_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.c:513
H5AC_cache_config_t
Definition: H5ACpublic.h:448
H5C_log_class_t::stop_logging
herr_t(* stop_logging)(H5C_log_info_t *log_info)
Definition: H5Clog.h:42
H5C_log_class_t::write_create_fd_log_msg
herr_t(* write_create_fd_log_msg)(void *udata, const H5C_cache_entry_t *parent, const H5C_cache_entry_t *child, herr_t fxn_ret_value)
Definition: H5Clog.h:57
H5C_log_write_mark_serialized_entry_msg
H5_DLL herr_t H5C_log_write_mark_serialized_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.c:615
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5C_log_class_t::write_mark_unserialized_entry_log_msg
herr_t(* write_mark_unserialized_entry_log_msg)(void *udata, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.h:53
H5C_log_class_t::write_create_cache_log_msg
herr_t(* write_create_cache_log_msg)(void *udata, herr_t fxn_ret_value)
Definition: H5Clog.h:45
H5C_log_class_t::write_stop_log_msg
herr_t(* write_stop_log_msg)(void *udata)
Definition: H5Clog.h:44
H5C_log_write_mark_entry_clean_msg
H5_DLL herr_t H5C_log_write_mark_entry_clean_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.c:547
H5C_log_write_unpin_entry_msg
H5_DLL herr_t H5C_log_write_unpin_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.c:820
H5C_log_style_t
H5C_log_style_t
Definition: H5Cprivate.h:2223
H5C_log_info_t::logging
hbool_t logging
Definition: H5Clog.h:71
H5C_log_info_t::enabled
hbool_t enabled
Definition: H5Clog.h:70
herr_t
int herr_t
Definition: H5public.h:128
H5C_log_class_t::write_evict_cache_log_msg
herr_t(* write_evict_cache_log_msg)(void *udata, herr_t fxn_ret_value)
Definition: H5Clog.h:47
hbool_t
bool hbool_t
Definition: H5public.h:159
H5C_log_class_t::name
const char * name
Definition: H5Clog.h:37
H5C_cache_entry_t
Definition: H5Cprivate.h:1597
H5C_log_class_t
Definition: H5Clog.h:36
H5C_log_write_pin_entry_msg
H5_DLL herr_t H5C_log_write_pin_entry_msg(H5C_t *cache, const H5C_cache_entry_t *entry, herr_t fxn_ret_value)
Definition: H5Clog.c:682
H5C_log_info_t
Definition: H5Clog.h:69