25 #ifndef __MOTR_LIB_FINJECT_H__ 26 #define __MOTR_LIB_FINJECT_H__ 188 #ifdef ENABLE_FAULT_INJECTION 231 #define M0_FI_ENABLED(tag) \ 233 static struct m0_fi_fault_point fp = { \ 236 .fp_module = "UNKNOWN", \ 237 .fp_file = __FILE__, \ 238 .fp_line_num = __LINE__, \ 239 .fp_func = __func__, \ 243 if (unlikely(fp.fp_state == NULL)) { \ 244 m0_fi_register(&fp); \ 245 M0_ASSERT(fp.fp_state != NULL); \ 248 m0_fi_enabled(fp.fp_state); \ 286 #if !defined(__cplusplus) 304 #if !defined(__cplusplus) 325 #if !defined(__cplusplus) 328 .u = { .fpd_p =
p } });
347 uint32_t
n, uint32_t
m)
350 #if !defined(__cplusplus) 354 .u = { .s1 = { .fpd_n =
n, .fpd_m =
m } } });
392 #if !defined(__cplusplus) 397 .fpd_trigger_func = trigger_func,
410 M0_INTERNAL
void m0_fi_disable(
const char *fp_func,
const char *fp_tag);
444 #define M0_FI_ENABLED(tag) (false) 470 uint32_t
n, uint32_t
m)
480 static inline void m0_fi_disable(
const char *fp_func,
const char *fp_tag)
static struct m0_addb2_philter p
struct m0_fi_fpoint_data::@247::@249 s2
m0_fi_fpoint_state_func_t fpd_trigger_func
M0_INTERNAL void m0_fi_print_info(void)
static struct m0_addb2_mach * m
static uint64_t tag(uint8_t code, uint64_t id)
M0_INTERNAL enum m0_fi_fpoint_type m0_fi_fpoint_type_from_str(const char *type_name)
struct m0_fi_fpoint_data::@247::@248 s1
static void m0_fi_enable_random(const char *func, const char *tag, uint32_t p)
void m0_fi_register(struct m0_fi_fault_point *fp)
M0_INTERNAL int m0_fi_init(void)
M0_INTERNAL void m0_fi_disable(const char *fp_func, const char *fp_tag)
static void m0_fi_enable_each_nth_time(const char *func, const char *tag, uint32_t n)
enum m0_fi_fpoint_type fpd_type
static void m0_fi_enable(const char *func, const char *tag)
static void m0_fi_enable_func(const char *func, const char *tag, m0_fi_fpoint_state_func_t trigger_func, void *data)
union m0_fi_fpoint_data::@247 u
struct m0_fi_fpoint_state * fp_state
static void m0_fi_enable_off_n_on_m(const char *func, const char *tag, uint32_t n, uint32_t m)
bool(* m0_fi_fpoint_state_func_t)(void *data)
M0_INTERNAL int m0_fi_enable_fault_point(const char *str)
M0_INTERNAL void m0_fi_enable_generic(const char *fp_func, const char *fp_tag, const struct m0_fi_fpoint_data *fp_data)
bool m0_fi_enabled(struct m0_fi_fpoint_state *fps)
static void m0_fi_enable_once(const char *func, const char *tag)
M0_INTERNAL void m0_fi_fini(void)
M0_INTERNAL int m0_fi_enable_fault_points_from_file(const char *file_name)