xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
}
+void _mc_cfg_cb_timeout(const char *name, int pos) {
+ if (_surf_init_status && !_surf_do_model_check) {
+ xbt_die("You are specifying a value to enable/disable timeout for wait requests after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
+ }
+ _surf_mc_timeout= xbt_cfg_get_int(_surf_cfg_set, name);
+ xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
+}
+
+void _mc_cfg_cb_max_depth(const char *name, int pos) {
+ if (_surf_init_status && !_surf_do_model_check) {
+ xbt_die("You are specifying a max depth value after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
+ }
+ _surf_mc_max_depth= xbt_cfg_get_int(_surf_cfg_set, name);
+ xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
+}
+
+void _mc_cfg_cb_stateful(const char *name, int pos) {
+ if (_surf_init_status && !_surf_do_model_check) {
+ xbt_die("You are trying to change stateful mode after the initialization (through MSG_config?), but model-checking was not activated at config time (through --cfg=model-check:1). This won't work, sorry.");
+ }
+ _surf_mc_stateful= xbt_cfg_get_int(_surf_cfg_set, name);
+ xbt_cfg_set_int(_surf_cfg_set,"model-check",1);
+}
+
/* MC global data structures */
/* Ignore mechanism */
xbt_dynar_t mc_stack_comparison_ignore;
+xbt_dynar_t mc_data_bss_comparison_ignore;
extern xbt_dynar_t mc_heap_comparison_ignore;
extern xbt_dynar_t stacks_areas;
xbt_dict_t libsimgrid_location_list = MC_get_location_list(ls_path);
MC_get_local_variables(ls_path, libsimgrid_location_list, &mc_local_variables);
+ initial_state_liveness = xbt_new0(s_mc_global_t, 1);
+
MC_UNSET_RAW_MEM;
MC_init_memory_map_info();
*/
void MC_replay(xbt_fifo_t stack, int start)
{
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem = (mmalloc_get_current_heap() == raw_heap);
int value, i = 1;
char *req_str;
}
XBT_DEBUG("**** End Replay ****");
- if(raw_mem_set)
+ if(raw_mem)
MC_SET_RAW_MEM;
else
MC_UNSET_RAW_MEM;
void MC_replay_liveness(xbt_fifo_t stack, int all_stack)
{
- raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+ int raw_mem = (mmalloc_get_current_heap() == raw_heap);
int value;
char *req_str;
XBT_DEBUG("**** End Replay ****");
- if(raw_mem_set)
+ if(raw_mem)
MC_SET_RAW_MEM;
else
MC_UNSET_RAW_MEM;
//XBT_INFO("Executed transitions = %lu", stats->executed_transitions);
XBT_INFO("Expanded / Visited = %lf",
(double) stats->visited_pairs / stats->expanded_pairs);
- /*XBT_INFO("Exploration coverage = %lf",
- (double)stats->expanded_states / stats->state_size); */
+
+ if(mmalloc_get_current_heap() == raw_heap)
+ MC_UNSET_RAW_MEM;
}
void MC_assert(int prop)
MC_SET_RAW_MEM;
}
+void MC_ignore_data_bss(void *address, size_t size){
+
+ raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
+
+ MC_SET_RAW_MEM;
+
+ if(mc_data_bss_comparison_ignore == NULL)
+ mc_data_bss_comparison_ignore = xbt_dynar_new(sizeof(mc_data_bss_ignore_variable_t), NULL);
+
+ if(xbt_dynar_is_empty(mc_data_bss_comparison_ignore)){
+
+ mc_data_bss_ignore_variable_t var = NULL;
+ var = xbt_new0(s_mc_data_bss_ignore_variable_t, 1);
+ var->address = address;
+ var->size = size;
+
+ xbt_dynar_insert_at(mc_data_bss_comparison_ignore, 0, &var);
+
+ }else{
+
+ unsigned int cursor = 0;
+ int start = 0;
+ int end = xbt_dynar_length(mc_data_bss_comparison_ignore) - 1;
+ mc_data_bss_ignore_variable_t current_var = NULL;
+
+ while(start <= end){
+ cursor = (start + end) / 2;
+ current_var = (mc_data_bss_ignore_variable_t)xbt_dynar_get_as(mc_data_bss_comparison_ignore, cursor, mc_data_bss_ignore_variable_t);
+ if(current_var->address == address){
+ MC_UNSET_RAW_MEM;
+ if(raw_mem_set)
+ MC_SET_RAW_MEM;
+ return;
+ }
+ if(current_var->address < address)
+ start = cursor + 1;
+ if(current_var->address > address)
+ end = cursor - 1;
+ }
+
+ mc_data_bss_ignore_variable_t var = NULL;
+ var = xbt_new0(s_mc_data_bss_ignore_variable_t, 1);
+ var->address = address;
+ var->size = size;
+
+ if(current_var->address > address)
+ xbt_dynar_insert_at(mc_data_bss_comparison_ignore, cursor + 1, &var);
+ else
+ xbt_dynar_insert_at(mc_data_bss_comparison_ignore, cursor, &var);
+
+ }
+
+ MC_UNSET_RAW_MEM;
+
+ if(raw_mem_set)
+ MC_SET_RAW_MEM;
+}
+
void MC_ignore_stack(const char *var_name, const char *frame){
raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
}
-void MC_new_stack_area(void *stack, char *name, void* context){
+void MC_new_stack_area(void *stack, char *name, void* context, size_t size){
raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
region->address = stack;
region->process_name = strdup(name);
region->context = context;
+ region->size = size;
xbt_dynar_push(stacks_areas, ®ion);
MC_UNSET_RAW_MEM;