heap_equality_free((heap_equality_t) * (void **) e);
}
-int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2){
+int snapshot_compare(mc_snapshot_t s1, mc_snapshot_t s2, mc_comparison_times_t ct1, mc_comparison_times_t ct2){
raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
}
}
+ ct1->nb_comparisons++;
+ ct2->nb_comparisons++;
+
xbt_os_timer_t global_timer = xbt_os_timer_new();
xbt_os_timer_t timer = xbt_os_timer_new();
size_t chunks_used2 = mmalloc_get_chunks_used((xbt_mheap_t)s2->regions[heap_index]->data);
if(chunks_used1 != chunks_used2){
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
+ xbt_os_timer_stop(timer);
+ xbt_dynar_push_as(ct1->chunks_used_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct2->chunks_used_comparison_times, double, xbt_os_timer_elapsed(timer));
XBT_DEBUG("Different number of chunks used in each heap : %zu - %zu", chunks_used1, chunks_used2);
errors++;
}else{
xbt_os_timer_free(timer);
xbt_os_timer_stop(global_timer);
- xbt_dynar_push_as(initial_state_liveness->snapshot_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct1->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
if(!raw_mem_set)
return 1;
}
+ }else{
+ if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug))
+ xbt_os_timer_stop(timer);
}
-
- if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
- xbt_os_timer_stop(timer);
- xbt_dynar_push_as(initial_state_liveness->chunks_used_comparison_times, double, xbt_os_timer_elapsed(timer));
-
- XBT_DEBUG("Chunks used comparison : %f", xbt_os_timer_elapsed(timer));
-
+
+ if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug))
xbt_os_timer_start(timer);
- }
/* Compare size of stacks */
unsigned int cursor = 0;
void *addr_stack1, *addr_stack2;
void *sp1, *sp2;
size_t size_used1, size_used2;
+ int is_diff = 0;
while(cursor < xbt_dynar_length(stacks_areas)){
addr_stack1 = (char *)s1->regions[heap_index]->data + ((char *)((stack_region_t)xbt_dynar_get_as(stacks_areas, cursor, stack_region_t))->address - (char *)std_heap);
addr_stack2 = (char *)s2->regions[heap_index]->data + ((char *)((stack_region_t)xbt_dynar_get_as(stacks_areas, cursor, stack_region_t))->address - (char *)std_heap);
size_used2 = ((stack_region_t)xbt_dynar_get_as(stacks_areas, cursor, stack_region_t))->size - ((char*)sp2 - (char*)addr_stack2);
if(size_used1 != size_used2){
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
+ if(is_diff == 0){
+ xbt_os_timer_stop(timer);
+ xbt_dynar_push_as(ct1->stacks_sizes_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct2->stacks_sizes_comparison_times, double, xbt_os_timer_elapsed(timer));
+ }
XBT_DEBUG("Different size used in stacks : %zu - %zu", size_used1, size_used2);
errors++;
+ is_diff = 1;
}else{
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose))
XBT_VERB("Different size used in stacks : %zu - %zu", size_used1, size_used2);
xbt_os_timer_free(timer);
xbt_os_timer_stop(global_timer);
- xbt_dynar_push_as(initial_state_liveness->snapshot_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct1->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
if(!raw_mem_set)
}
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
- xbt_os_timer_stop(timer);
- xbt_dynar_push_as(initial_state_liveness->stacks_sizes_comparison_times, double, xbt_os_timer_elapsed(timer));
-
- XBT_DEBUG("Stacks sizes comparison : %f", xbt_os_timer_elapsed(timer));
-
+ if(is_diff == 0)
+ xbt_os_timer_stop(timer);
xbt_os_timer_start(timer);
}
-
+
/* Compare program data segment(s) */
+ is_diff = 0;
i = data_program_index;
while(i < s1->num_reg && s1->regions[i]->type == 2){
if(data_bss_program_region_compare(s1->regions[i]->data, s2->regions[i]->data, s1->regions[i]->size) != 0){
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
+ if(is_diff == 0){
+ xbt_os_timer_stop(timer);
+ xbt_dynar_push_as(ct1->program_data_segment_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct2->program_data_segment_comparison_times, double, xbt_os_timer_elapsed(timer));
+ }
XBT_DEBUG("Different memcmp for data in program");
errors++;
+ is_diff = 1;
}else{
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose))
XBT_VERB("Different memcmp for data in program");
xbt_os_timer_free(timer);
xbt_os_timer_stop(global_timer);
- xbt_dynar_push_as(initial_state_liveness->snapshot_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct1->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
if(!raw_mem_set)
}
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
- xbt_os_timer_stop(timer);
- xbt_dynar_push_as(initial_state_liveness->program_data_segment_comparison_times, double, xbt_os_timer_elapsed(timer));
-
- XBT_DEBUG("Program data segment comparison : %f", xbt_os_timer_elapsed(timer));
-
+ if(is_diff == 0)
+ xbt_os_timer_stop(timer);
xbt_os_timer_start(timer);
}
/* Compare libsimgrid data segment(s) */
+ is_diff = 0;
i = data_libsimgrid_index;
while(i < s1->num_reg && s1->regions[i]->type == 1){
if(data_bss_libsimgrid_region_compare(s1->regions[i]->data, s2->regions[i]->data, s1->regions[i]->size) != 0){
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
+ if(is_diff == 0){
+ xbt_os_timer_stop(timer);
+ xbt_dynar_push_as(ct1->libsimgrid_data_segment_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct2->libsimgrid_data_segment_comparison_times, double, xbt_os_timer_elapsed(timer));
+ }
XBT_DEBUG("Different memcmp for data in libsimgrid");
errors++;
+ is_diff = 1;
}else{
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_verbose))
XBT_VERB("Different memcmp for data in libsimgrid");
xbt_os_timer_free(timer);
xbt_os_timer_stop(global_timer);
- xbt_dynar_push_as(initial_state_liveness->snapshot_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct1->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
if(!raw_mem_set)
}
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
- xbt_os_timer_stop(timer);
- xbt_dynar_push_as(initial_state_liveness->libsimgrid_data_segment_comparison_times, double, xbt_os_timer_elapsed(timer));
-
- XBT_DEBUG("Libsimgrid data segment comparison : %f", xbt_os_timer_elapsed(timer));
-
+ if(is_diff == 0)
+ xbt_os_timer_stop(timer);
xbt_os_timer_start(timer);
}
if(mmalloc_compare_heap((xbt_mheap_t)s1->regions[heap_index]->data, (xbt_mheap_t)s2->regions[heap_index]->data, &stacks1, &stacks2, &equals)){
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
+ xbt_os_timer_stop(timer);
+ xbt_dynar_push_as(ct1->heap_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct2->heap_comparison_times, double, xbt_os_timer_elapsed(timer));
XBT_DEBUG("Different heap (mmalloc_compare)");
errors++;
}else{
XBT_VERB("Different heap (mmalloc_compare)");
xbt_os_timer_stop(global_timer);
- xbt_dynar_push_as(initial_state_liveness->snapshot_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct1->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
if(!raw_mem_set)
MC_UNSET_RAW_MEM;
return 1;
}
+ }else{
+ if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug))
+ xbt_os_timer_stop(timer);
}
- if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
- xbt_os_timer_stop(timer);
- xbt_dynar_push_as(initial_state_liveness->heap_comparison_times, double, xbt_os_timer_elapsed(timer));
-
- XBT_DEBUG("Heap comparison : %f", xbt_os_timer_elapsed(timer));
-
+ if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug))
xbt_os_timer_start(timer);
- }
/* Stacks comparison */
cursor = 0;
stack_region_t stack_region1, stack_region2;
int diff = 0, diff_local = 0;
+ is_diff = 0;
while(cursor < xbt_dynar_length(stacks1)){
stack_region1 = (stack_region_t)(xbt_dynar_get_as(stacks1, cursor, stack_region_t));
diff_local = compare_local_variables(((mc_snapshot_stack_t)xbt_dynar_get_as(s1->stacks, cursor, mc_snapshot_stack_t))->local_variables->data, ((mc_snapshot_stack_t)xbt_dynar_get_as(s2->stacks, cursor, mc_snapshot_stack_t))->local_variables->data, equals);
if(diff_local > 0){
if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
+ if(is_diff == 0){
+ xbt_os_timer_stop(timer);
+ xbt_dynar_push_as(ct1->stacks_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct2->stacks_comparison_times, double, xbt_os_timer_elapsed(timer));
+ }
XBT_DEBUG("Different local variables between stacks %d", cursor + 1);
errors++;
+ is_diff = 1;
}else{
xbt_dynar_free(&stacks1);
xbt_dynar_free(&stacks2);
xbt_os_timer_free(timer);
xbt_os_timer_stop(global_timer);
- xbt_dynar_push_as(initial_state_liveness->snapshot_comparison_times, double, xbt_os_timer_elapsed(timer));
+ xbt_dynar_push_as(ct1->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
xbt_os_timer_free(global_timer);
if(!raw_mem_set)
xbt_dynar_free(&stacks2);
xbt_dynar_free(&equals);
- if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
- xbt_os_timer_stop(timer);
- xbt_dynar_push_as(initial_state_liveness->stacks_comparison_times, double, xbt_os_timer_elapsed(timer));
-
- XBT_DEBUG("Stacks comparison : %f", xbt_os_timer_elapsed(timer));
-
+ if(XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug))
xbt_os_timer_free(timer);
- }
- xbt_os_timer_stop(global_timer);
- xbt_dynar_push_as(initial_state_liveness->snapshot_comparison_times, double, xbt_os_timer_elapsed(timer));
+ if(!XBT_LOG_ISENABLED(mc_compare, xbt_log_priority_debug)){
+ xbt_os_timer_stop(global_timer);
+ xbt_dynar_push_as(ct1->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ xbt_dynar_push_as(ct2->snapshot_comparison_times, double, xbt_os_timer_elapsed(global_timer));
+ }
xbt_os_timer_free(global_timer);
if(!raw_mem_set)
MC_get_local_variables(ls_path, libsimgrid_location_list, &mc_local_variables);
initial_state_liveness = xbt_new0(s_mc_global_t, 1);
- initial_state_liveness->snapshot_comparison_times = xbt_dynar_new(sizeof(double), NULL);
- initial_state_liveness->chunks_used_comparison_times = xbt_dynar_new(sizeof(double), NULL);
- initial_state_liveness->stacks_sizes_comparison_times = xbt_dynar_new(sizeof(double), NULL);
- initial_state_liveness->program_data_segment_comparison_times = xbt_dynar_new(sizeof(double), NULL);
- initial_state_liveness->libsimgrid_data_segment_comparison_times = xbt_dynar_new(sizeof(double), NULL);
- initial_state_liveness->heap_comparison_times = xbt_dynar_new(sizeof(double), NULL);
- initial_state_liveness->stacks_comparison_times = xbt_dynar_new(sizeof(double), NULL);
MC_UNSET_RAW_MEM;
return 0;
}
+void MC_print_comparison_times_statistics(mc_comparison_times_t ct){
+
+ XBT_DEBUG("Comparisons done : %d", ct->nb_comparisons);
+
+ double total, min, max;
+ unsigned int cursor;
+
+ if(xbt_dynar_length(ct->chunks_used_comparison_times) > 0){
+ cursor = 0;
+ total = 0.0;
+ max = 0.0;
+ min = xbt_dynar_get_as(ct->chunks_used_comparison_times, cursor, double);
+ while(cursor < xbt_dynar_length(ct->chunks_used_comparison_times) - 1){
+ total += xbt_dynar_get_as(ct->chunks_used_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->chunks_used_comparison_times, cursor, double) > max)
+ max = xbt_dynar_get_as(ct->chunks_used_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->chunks_used_comparison_times, cursor, double) < min)
+ min = xbt_dynar_get_as(ct->chunks_used_comparison_times, cursor, double);
+ cursor++;
+ }
+ XBT_DEBUG("Chunks used comparison -- Different states : %lu/%d, time (in seconds) : average = %lf, max = %lf, min = %lf", xbt_dynar_length(ct->chunks_used_comparison_times), ct->nb_comparisons, total/xbt_dynar_length(ct->chunks_used_comparison_times), max, min);
+ }
+
+ if(xbt_dynar_length(ct->stacks_sizes_comparison_times) > 0){
+ cursor = 0;
+ total = 0.0;
+ max = 0.0;
+ min = xbt_dynar_get_as(ct->stacks_sizes_comparison_times, cursor, double);
+ while(cursor < xbt_dynar_length(ct->stacks_sizes_comparison_times) - 1){
+ total += xbt_dynar_get_as(ct->stacks_sizes_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->stacks_sizes_comparison_times, cursor, double) > max)
+ max = xbt_dynar_get_as(ct->stacks_sizes_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->stacks_sizes_comparison_times, cursor, double) < min)
+ min = xbt_dynar_get_as(ct->stacks_sizes_comparison_times, cursor, double);
+ cursor++;
+ }
+ XBT_DEBUG("Stacks sizes comparison -- Different states : %lu/%d, time (in seconds) : average = %lf, max = %lf, min = %lf", xbt_dynar_length(ct->stacks_sizes_comparison_times), ct->nb_comparisons, total/xbt_dynar_length(ct->stacks_sizes_comparison_times), max, min);
+ }
+
+ if(xbt_dynar_length(ct->program_data_segment_comparison_times) > 0){
+ cursor = 0;
+ total = 0.0;
+ max = 0.0;
+ min = xbt_dynar_get_as(ct->program_data_segment_comparison_times, cursor, double);
+ while(cursor < xbt_dynar_length(ct->program_data_segment_comparison_times) - 1){
+ total += xbt_dynar_get_as(ct->program_data_segment_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->program_data_segment_comparison_times, cursor, double) > max)
+ max = xbt_dynar_get_as(ct->program_data_segment_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->program_data_segment_comparison_times, cursor, double) < min)
+ min = xbt_dynar_get_as(ct->program_data_segment_comparison_times, cursor, double);
+ cursor++;
+ }
+ XBT_DEBUG("Program data/bss segments comparison -- Different states : %lu/%d, time (in seconds) : average = %lf, max = %lf, min = %lf", xbt_dynar_length(ct->program_data_segment_comparison_times), ct->nb_comparisons, total/xbt_dynar_length(ct->program_data_segment_comparison_times), max, min);
+ }
+
+ if(xbt_dynar_length(ct->libsimgrid_data_segment_comparison_times) > 0){
+ cursor = 0;
+ total = 0.0;
+ max = 0.0;
+ min = xbt_dynar_get_as(ct->libsimgrid_data_segment_comparison_times, cursor, double);
+ while(cursor < xbt_dynar_length(ct->libsimgrid_data_segment_comparison_times) - 1){
+ total += xbt_dynar_get_as(ct->libsimgrid_data_segment_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->libsimgrid_data_segment_comparison_times, cursor, double) > max)
+ max = xbt_dynar_get_as(ct->libsimgrid_data_segment_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->libsimgrid_data_segment_comparison_times, cursor, double) < min)
+ min = xbt_dynar_get_as(ct->libsimgrid_data_segment_comparison_times, cursor, double);
+ cursor++;
+ }
+ XBT_DEBUG("Libsimgrid data/bss segments comparison -- Different states : %lu/%d, time (in seconds) : average = %lf, max = %lf, min = %lf", xbt_dynar_length(ct->libsimgrid_data_segment_comparison_times), ct->nb_comparisons, total/xbt_dynar_length(ct->libsimgrid_data_segment_comparison_times), max, min);
+ }
+
+ if(xbt_dynar_length(ct->heap_comparison_times) > 0){
+ cursor = 0;
+ total = 0.0;
+ max = 0.0;
+ min = xbt_dynar_get_as(ct->heap_comparison_times, cursor, double);
+ while(cursor < xbt_dynar_length(ct->heap_comparison_times) - 1){
+ total += xbt_dynar_get_as(ct->heap_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->heap_comparison_times, cursor, double) > max)
+ max = xbt_dynar_get_as(ct->heap_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->heap_comparison_times, cursor, double) < min)
+ min = xbt_dynar_get_as(ct->heap_comparison_times, cursor, double);
+ cursor++;
+ }
+ XBT_DEBUG("Heap comparison -- Different states : %lu/%d, time (in seconds) : average = %lf, max = %lf, min = %lf", xbt_dynar_length(ct->heap_comparison_times), ct->nb_comparisons, total/xbt_dynar_length(ct->heap_comparison_times), max, min);
+ }
+
+ if(xbt_dynar_length(ct->stacks_comparison_times) > 0){
+ cursor = 0;
+ total = 0.0;
+ max = 0.0;
+ min = xbt_dynar_get_as(ct->stacks_comparison_times, cursor, double);
+ while(cursor < xbt_dynar_length(ct->stacks_comparison_times) - 1){
+ total += xbt_dynar_get_as(ct->stacks_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->stacks_comparison_times, cursor, double) > max)
+ max = xbt_dynar_get_as(ct->stacks_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->stacks_comparison_times, cursor, double) < min)
+ min = xbt_dynar_get_as(ct->stacks_comparison_times, cursor, double);
+ cursor++;
+ }
+ XBT_DEBUG("Stacks comparison -- Different states : %lu/%d, time (in seconds) : average = %lf, max = %lf, min = %lf", xbt_dynar_length(ct->stacks_comparison_times), ct->nb_comparisons, total/xbt_dynar_length(ct->stacks_comparison_times), max, min);
+ }
+
+ if(xbt_dynar_length(ct->snapshot_comparison_times) > 0){
+ cursor = 0;
+ total = 0.0;
+ max = 0.0;
+ min = xbt_dynar_get_as(ct->snapshot_comparison_times, cursor, double);
+ while(cursor < xbt_dynar_length(ct->snapshot_comparison_times) - 1){
+ total += xbt_dynar_get_as(ct->snapshot_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->snapshot_comparison_times, cursor, double) > max)
+ max = xbt_dynar_get_as(ct->snapshot_comparison_times, cursor, double);
+ if(xbt_dynar_get_as(ct->snapshot_comparison_times, cursor, double) < min)
+ min = xbt_dynar_get_as(ct->snapshot_comparison_times, cursor, double);
+ cursor++;
+ }
+ XBT_DEBUG("Snapshot comparison (Whole funnel) -- Different states : %lu/%d, time (in seconds) : average = %lf, max = %lf, min = %lf", xbt_dynar_length(ct->snapshot_comparison_times), ct->nb_comparisons, total/xbt_dynar_length(ct->snapshot_comparison_times), max, min);
+ }
+
+}
+
+mc_comparison_times_t new_comparison_times(){
+ mc_comparison_times_t ct = NULL;
+ ct = xbt_new0(s_mc_comparison_times_t, 1);
+ ct->nb_comparisons = 0;
+ ct->snapshot_comparison_times = xbt_dynar_new(sizeof(double), NULL);
+ ct->chunks_used_comparison_times = xbt_dynar_new(sizeof(double), NULL);
+ ct->stacks_sizes_comparison_times = xbt_dynar_new(sizeof(double), NULL);
+ ct->program_data_segment_comparison_times = xbt_dynar_new(sizeof(double), NULL);
+ ct->libsimgrid_data_segment_comparison_times = xbt_dynar_new(sizeof(double), NULL);
+ ct->heap_comparison_times = xbt_dynar_new(sizeof(double), NULL);
+ ct->stacks_comparison_times = xbt_dynar_new(sizeof(double), NULL);
+ return ct;
+}
+
int reached(xbt_state_t st){
raw_mem_set = (mmalloc_get_current_heap() == raw_heap);
new_pair->nb = xbt_dynar_length(reached_pairs) + 1;
new_pair->automaton_state = st;
new_pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
+ new_pair->comparison_times = new_comparison_times();
new_pair->system_state = MC_take_snapshot_liveness();
/* Get values of propositional symbols */
mc_pair_reached_t pair_test = NULL;
xbt_dynar_foreach(reached_pairs, cursor, pair_test){
- XBT_INFO("Pair reached #%d", pair_test->nb);
+ if(XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug))
+ XBT_DEBUG("****** Pair reached #%d ******", pair_test->nb);
if(automaton_state_compare(pair_test->automaton_state, st) == 0){
if(propositional_symbols_compare_value(pair_test->prop_ato, new_pair->prop_ato) == 0){
- if(snapshot_compare(new_pair->system_state, pair_test->system_state) == 0){
+ if(snapshot_compare(new_pair->system_state, pair_test->system_state, new_pair->comparison_times, pair_test->comparison_times) == 0){
if(raw_mem_set)
MC_SET_RAW_MEM;
}else{
XBT_INFO("Different automaton state");
}
+ if(pair_test->comparison_times != NULL && XBT_LOG_ISENABLED(mc_liveness, xbt_log_priority_debug)){
+ XBT_DEBUG("*** Comparison times statistics ***");
+ MC_print_comparison_times_statistics(pair_test->comparison_times);
+ }
}
/* New pair reached */
pair->nb = xbt_dynar_length(reached_pairs) + 1;
pair->automaton_state = st;
pair->prop_ato = xbt_dynar_new(sizeof(int), NULL);
+ pair->comparison_times = new_comparison_times();
pair->system_state = MC_take_snapshot_liveness();
/* Get values of propositional symbols */
typedef struct s_mc_global_t{
mc_snapshot_t initial_snapshot;
- 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_global_t, *mc_global_t;
void MC_take_snapshot(mc_snapshot_t);
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;
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 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_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 **** */
case SIMCALL_MC_COMPARE_SNAPSHOTS:
simcall->mc_compare_snapshots.result =
- snapshot_compare(simcall->mc_compare_snapshots.snapshot1, simcall->mc_compare_snapshots.snapshot2);
+ snapshot_compare(simcall->mc_compare_snapshots.snapshot1, simcall->mc_compare_snapshots.snapshot2, NULL, NULL);
SIMIX_simcall_answer(simcall);
break;
#endif /* HAVE_MC */