Motr  M0
finject_internal.h File Reference
#include "lib/mutex.h"
Include dependency graph for finject_internal.h:

Go to the source code of this file.

Data Structures

struct  m0_fi_fpoint_id
 
struct  m0_fi_fpoint_state
 
struct  m0_fi_fpoint_state_info
 

Macros

#define __MOTR_LIB_FINJECT_INTERNAL_H__
 

Typedefs

typedef bool(* fp_state_func_t) (struct m0_fi_fpoint_state *fps)
 

Functions

static bool fi_state_enabled (const struct m0_fi_fpoint_state *state)
 
M0_INTERNAL const struct m0_fi_fpoint_statem0_fi_states_get (void)
 
M0_INTERNAL uint32_t m0_fi_states_get_free_idx (void)
 
M0_INTERNAL void m0_fi_states_get_state_info (const struct m0_fi_fpoint_state *s, struct m0_fi_fpoint_state_info *si)
 
M0_INTERNAL int m0_fi_add_dyn_id (char *str)
 
M0_INTERNAL const char * m0_fi_fpoint_type_name (enum m0_fi_fpoint_type type)
 
M0_INTERNAL enum m0_fi_fpoint_type m0_fi_fpoint_type_from_str (const char *type_name)
 
M0_INTERNAL void fi_states_init (void)
 
M0_INTERNAL void fi_states_fini (void)
 

Variables

struct m0_mutex fi_states_mutex
 
const char * m0_fi_states_headline []
 
const char m0_fi_states_print_format []
 

Macro Definition Documentation

◆ __MOTR_LIB_FINJECT_INTERNAL_H__

#define __MOTR_LIB_FINJECT_INTERNAL_H__

Definition at line 26 of file finject_internal.h.

Typedef Documentation

◆ fp_state_func_t

typedef bool(* fp_state_func_t) (struct m0_fi_fpoint_state *fps)

Definition at line 42 of file finject_internal.h.

Function Documentation

◆ fi_state_enabled()

static bool fi_state_enabled ( const struct m0_fi_fpoint_state state)
inlinestatic

Definition at line 90 of file finject_internal.h.

Here is the caller graph for this function:

◆ fi_states_fini()

M0_INTERNAL void fi_states_fini ( void  )

Definition at line 204 of file finject.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fi_states_init()

M0_INTERNAL void fi_states_init ( void  )

Definition at line 199 of file finject.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_fi_add_dyn_id()

M0_INTERNAL int m0_fi_add_dyn_id ( char *  str)

Add a dynamically allocated fault point ID string to persistent storage, which will be cleaned during m0_fi_fini() execution.

This function aimed to be used together with m0_fi_enable_xxx() functions.

Definition at line 171 of file finject.c.

Here is the call graph for this function:

◆ m0_fi_fpoint_type_name()

M0_INTERNAL const char* m0_fi_fpoint_type_name ( enum m0_fi_fpoint_type  type)

Returns the name of fault point type

Definition at line 357 of file finject.c.

Here is the caller graph for this function:

◆ m0_fi_states_get()

M0_INTERNAL const struct m0_fi_fpoint_state* m0_fi_states_get ( void  )

A read-only "getter" of global fi_states array, which stores all FP states.

The fi_states array is a private data of lib/finject.c and it should not be modified by external code. This function deliberately returns a const pointer to emphasize this. The main purpose of this function is to provide the FP states information to m0ctl driver, which displays it via debugfs.

Returns
A constant pointer to global fi_states array.

Definition at line 88 of file finject.c.

Here is the caller graph for this function:

◆ m0_fi_states_get_free_idx()

M0_INTERNAL uint32_t m0_fi_states_get_free_idx ( void  )

A read-only "getter" of global fi_states_free_idx index of fi_states array.

Returns
Current value of fi_states_free_idx variable.

Definition at line 94 of file finject.c.

Here is the caller graph for this function:

◆ m0_fi_states_get_state_info()

M0_INTERNAL void m0_fi_states_get_state_info ( const struct m0_fi_fpoint_state s,
struct m0_fi_fpoint_state_info si 
)

Fills m0_fi_fpoint_state_info structure.

Definition at line 123 of file finject.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ fi_states_mutex

struct m0_mutex fi_states_mutex

Definition at line 50 of file finject.c.

◆ m0_fi_states_headline

const char* m0_fi_states_headline[]

Definition at line 77 of file finject.c.

◆ m0_fi_states_print_format

const char m0_fi_states_print_format[]

Definition at line 83 of file finject.c.