#ifndef ERROR_H #define ERROR_H enum { LT_ERROR_FILTER_TYPE_NTH, LT_ERROR_FILTER_TYPE_SEQ, LT_ERROR_FILTER_TYPE_STACK, LT_ERROR_FILTER_TYPE_INTERACTIVE, }; struct lt_error_config_filter { int type; }; struct lt_error_config_sym { /* FIXME put to the end of the structure as symbol[0] */ #define LT_MAXNAME 20 char symbol[LT_MAXNAME]; #define LT_MAXRET 20 long ret; struct lt_error_config_filter filter; int handle_sigsegv; int keep; }; struct lt_error_config { unsigned long n; int automated; int sym_cnt; off_t names_size; struct lt_error_config_sym sym[0]; }; struct lt_error_audit_filter { int type; union { int **nth; }; }; struct lt_error_sym { char *name; unsigned long ret; unsigned long call; int handle_sigsegv; struct lt_error_audit_filter filter; struct lt_list_head list; }; struct lt_error_app_return_sym { char *name; #define LT_MAX_SYM_RETURNS 10 union { long val; long vals[LT_MAX_SYM_RETURNS]; }; int val_idx; int val_cnt; /* When the symbol return is changed, * set SIGSEGV handlers. */ int handle_sigsegv; /* Do not change the return value. */ int keep; struct lt_list_head list; }; struct lt_error_app_filter { int type; }; struct lt_error_app_return { char *name; struct lt_error_app_filter filter; struct lt_list_head head_sym; struct lt_list_head list_app; struct lt_list_head list_run; }; struct lt_error_app_run { char *name; char **args; struct lt_list_head head_return; struct lt_list_head list_go; struct lt_list_head list_app; }; struct lt_error_app_go { int n; int start; int automated; int replay; char *name; struct lt_list_head head_run; struct lt_list_head list; }; struct lt_error_app { char *name; char *dir; int no_storage; char *prog; struct lt_list_head head_run; struct lt_list_head head_go; struct lt_list_head head_return; struct lt_list_head list; }; struct lt_config_app; struct lt_config_audit; #ifdef CONFIG_ARCH_HAVE_ERROR_SIM int lt_error_app(struct lt_config_app *cfg, struct lt_error_app *error_app); int lt_error_go(struct lt_config_app *cfg, struct lt_error_app_go **go, struct lt_error_app *error_app, char *name, int start, int n, int automated, int replay, struct lt_list_head *runs); int lt_error_run_return(struct lt_config_app *cfg, struct lt_error_app_run **run, struct lt_error_app *error_app, struct lt_list_head *ret); int lt_error_run_args(struct lt_config_app *cfg, struct lt_error_app_run **run, struct lt_list_head *args); int lt_error_return_ass(struct lt_config_app *cfg, struct lt_error_app_return **ret, char *name, struct lt_list_head *list_vals, int handle_sigsegv, int keep); int lt_error_return_filter(struct lt_config_app *cfg, struct lt_error_app_return **ret, int type, void *data); int lt_error_app_init(struct lt_error_app *app); int lt_error_config_write(struct lt_config_app *cfg, int fd); int lt_error_config_read(struct lt_config_audit *cfg, int fd); #else static inline int lt_error_app(struct lt_config_app *cfg, struct lt_error_app *error_app) { return -1; } static inline int lt_error_go(struct lt_config_app *cfg, struct lt_error_app_go **go, struct lt_error_app *error_app, char *name, int start, int n, int automated, int replay, struct lt_list_head *runs) { return -1; } static inline int lt_error_run_return(struct lt_config_app *cfg, struct lt_error_app_run **run, struct lt_error_app *error_app, struct lt_list_head *ret) { return -1; } static inline int lt_error_run_args(struct lt_config_app *cfg, struct lt_error_app_run **run, struct lt_list_head *args) { return -1; } static inline int lt_error_app_init(struct lt_error_app *app) { return -1; } static inline int lt_error_return_ass(struct lt_config_app *cfg, struct lt_error_app_return **ret, char *name, struct lt_list_head *list_vals, int handle_sigsegv, int keep) { return -1; } static inline int lt_error_return_filter(struct lt_config_app *cfg, struct lt_error_app_return **ret, int type, void *data) { return -1; } static inline int lt_error_config_write(struct lt_config_app *cfg, int fd) { return 0; } #endif #endif /* ERROR_H */