X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/221538a27f21e52c182ae7fcc08c78c1175395b9..1220a3e5916c35ba307f7a7eb48a2820bab961cd:/src/mc/mc_private.h diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index 5c64d95c66..92f7d93c8b 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -20,6 +20,7 @@ #include "xbt/hash.h" #include "msg/msg.h" #include "msg/datatypes.h" +#include "xbt/strbuff.h" /****************************** Snapshots ***********************************/ @@ -33,21 +34,28 @@ typedef struct s_mc_mem_region{ typedef struct s_mc_snapshot{ unsigned int num_reg; mc_mem_region_t *regions; + xbt_dynar_t stacks; } s_mc_snapshot_t, *mc_snapshot_t; -void MC_take_snapshot(mc_snapshot_t); -void MC_take_snapshot_liveness(mc_snapshot_t s); +typedef struct s_mc_snapshot_stack{ + xbt_strbuff_t local_variables; + void *stack_pointer; +}s_mc_snapshot_stack_t, *mc_snapshot_stack_t; + +typedef struct s_mc_global_t{ + mc_snapshot_t snapshot; + int raw_mem_set; +}s_mc_global_t, *mc_global_t; + +//void MC_take_snapshot(mc_snapshot_t); +mc_snapshot_t MC_take_snapshot(void); void MC_restore_snapshot(mc_snapshot_t); void MC_free_snapshot(mc_snapshot_t); - +void snapshot_stack_free_voidp(void *s); /********************************* MC Global **********************************/ extern double *mc_time; -/* Bound of the MC depth-first search algorithm */ -#define MAX_DEPTH 1000 -#define MAX_DEPTH_LIVENESS 500 - int MC_deadlock_check(void); void MC_replay(xbt_fifo_t stack, int start); void MC_replay_liveness(xbt_fifo_t stack, int all_stack); @@ -106,6 +114,7 @@ void MC_state_set_executed_request(mc_state_t state, smx_simcall_t req, int valu smx_simcall_t MC_state_get_executed_request(mc_state_t state, int *value); smx_simcall_t MC_state_get_internal_request(mc_state_t state); smx_simcall_t MC_state_get_request(mc_state_t state, int *value); +void MC_state_remove_interleave_process(mc_state_t state, smx_process_t process); /****************************** Statistics ************************************/ typedef struct mc_stats { @@ -152,8 +161,6 @@ extern void *raw_heap; #define MC_SET_RAW_MEM mmalloc_set_current_heap(raw_heap) #define MC_UNSET_RAW_MEM mmalloc_set_current_heap(std_heap) -extern int raw_mem_set; - /******************************* MEMORY MAPPINGS ***************************/ /* These functions and data structures implements a binary interface for */ /* the proc maps ascii interface */ @@ -182,8 +189,11 @@ typedef struct s_memory_map { memory_map_t get_memory_map(void); void free_memory_map(memory_map_t map); -void get_plt_section(void); +void get_libsimgrid_plt_section(void); +void get_binary_plt_section(void); +extern void *start_data_libsimgrid; +extern void *end_raw_heap; /********************************** DPOR for safety **************************************/ typedef enum { @@ -193,19 +203,27 @@ typedef enum { } e_mc_reduce_t; extern e_mc_reduce_t mc_reduce_kind; +extern mc_global_t initial_state_safety; void MC_dpor_init(void); void MC_dpor(void); void MC_dpor_exit(void); -void MC_init_safety(void); +void MC_init(void); /********************************** Double-DFS for liveness property**************************************/ extern xbt_fifo_t mc_stack_liveness; -extern mc_snapshot_t initial_snapshot_liveness; +extern mc_global_t initial_state_liveness; extern xbt_automaton_t _mc_property_automaton; extern int compare; +extern void *start_plt_libsimgrid; +extern void *end_plt_libsimgrid; +extern void *start_plt_binary; +extern void *end_plt_binary; +extern xbt_dynar_t mc_stack_comparison_ignore; +extern xbt_dynar_t mc_data_bss_comparison_ignore; +extern void *start_bss_libsimgrid; typedef struct s_mc_pair{ mc_snapshot_t system_state; @@ -213,22 +231,49 @@ typedef struct s_mc_pair{ xbt_state_t automaton_state; }s_mc_pair_t, *mc_pair_t; +typedef struct s_mc_comparison_times{ + int nb_comparisons; + xbt_dynar_t snapshot_comparison_times; + xbt_dynar_t chunks_used_comparison_times; + xbt_dynar_t stacks_sizes_comparison_times; + xbt_dynar_t program_data_segment_comparison_times; + xbt_dynar_t libsimgrid_data_segment_comparison_times; + xbt_dynar_t heap_comparison_times; + xbt_dynar_t stacks_comparison_times; +}s_mc_comparison_times_t, *mc_comparison_times_t; + typedef struct s_mc_pair_reached{ int nb; xbt_state_t automaton_state; xbt_dynar_t prop_ato; mc_snapshot_t system_state; + mc_comparison_times_t comparison_times; }s_mc_pair_reached_t, *mc_pair_reached_t; +typedef struct s_mc_pair_visited{ + xbt_state_t automaton_state; + xbt_dynar_t prop_ato; + mc_snapshot_t system_state; +}s_mc_pair_visited_t, *mc_pair_visited_t; + int MC_automaton_evaluate_label(xbt_exp_label_t l); mc_pair_t new_pair(mc_snapshot_t sn, mc_state_t sg, xbt_state_t st); +mc_comparison_times_t new_comparison_times(void); int reached(xbt_state_t st); void set_pair_reached(xbt_state_t st); -int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2); +int visited(xbt_state_t st); +int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2, mc_comparison_times_t ct1, mc_comparison_times_t ct2); void MC_pair_delete(mc_pair_t pair); void MC_exit_liveness(void); mc_state_t MC_state_pair_new(void); +void pair_reached_free(mc_pair_reached_t pair); +void pair_reached_free_voidp(void *p); +void pair_visited_free(mc_pair_visited_t pair); +void pair_visited_free_voidp(void *p); +void MC_init_liveness(void); +void MC_init_memory_map_info(void); +void MC_print_comparison_times_statistics(mc_comparison_times_t ct); /* **** Double-DFS stateless **** */ @@ -243,13 +288,17 @@ void MC_ddfs_init(void); void MC_ddfs(int search_cycle); void MC_show_stack_liveness(xbt_fifo_t stack); void MC_dump_stack_liveness(xbt_fifo_t stack); -void MC_pair_stateless_delete(mc_pair_stateless_t pair); +void pair_stateless_free(mc_pair_stateless_t pair); +void pair_stateless_free_voidp(void *p); /********************************** Configuration of MC **************************************/ extern xbt_fifo_t mc_stack_safety; extern int _surf_mc_checkpoint; extern char* _surf_mc_property_file; +extern int _surf_mc_timeout; +extern int _surf_mc_max_depth; +extern int _surf_mc_stateful; /****** Core dump ******/ @@ -265,9 +314,11 @@ typedef enum { e_dw_fbregister_op, e_dw_piece, e_dw_arithmetic, + e_dw_plus_uconst, e_dw_compose, e_dw_deref, - e_dw_constant, + e_dw_uconstant, + e_dw_sconstant, e_dw_unsupported } e_dw_location_type; @@ -280,34 +331,40 @@ typedef struct s_dw_location{ int reg; struct{ - int reg; + unsigned int reg; int offset; }breg_op; - unsigned lit; + unsigned int lit; int fbreg_op; int piece; - int deref_size; + unsigned short int deref_size; xbt_dynar_t compose; char *arithmetic; struct{ - int is_signed; int bytes; - int value; - }constant; + long unsigned int value; + }uconstant; + + struct{ + int bytes; + long signed int value; + }sconstant; + + unsigned int plus_uconst; }location; }s_dw_location_t, *dw_location_t; typedef struct s_dw_location_entry{ - void *lowpc; - void *highpc; + long lowpc; + long highpc; dw_location_t location; }s_dw_location_entry_t, *dw_location_entry_t; @@ -318,15 +375,30 @@ typedef struct s_dw_local_variable{ typedef struct s_dw_frame{ char *name; - dw_location_t location; - xbt_dynar_t variables; + void *low_pc; + void *high_pc; + dw_location_t frame_base; + xbt_dict_t variables; + unsigned long int start; + unsigned long int end; }s_dw_frame_t, *dw_frame_t; -/* FIXME : implement free functions for each strcuture */ +/* FIXME : implement free functions for each structure */ -extern xbt_dynar_t mc_binary_local_variables; +extern xbt_dict_t mc_local_variables; -void MC_get_binary_local_variables(void); -void print_local_variables(xbt_dynar_t list); +typedef struct s_variable_value{ + char *type; + + union{ + void *address; + long int res; + }value; +}s_variable_value_t, *variable_value_t; + +void MC_get_local_variables(const char *elf_file, xbt_dict_t location_list, xbt_dict_t *variables); +void print_local_variables(xbt_dict_t list); +char *get_libsimgrid_path(void); +xbt_dict_t MC_get_location_list(const char *elf_file); #endif