From 62ef333af12243ec6a04be079bd94081fd2372f0 Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Fri, 7 Feb 2014 09:25:30 +0100 Subject: [PATCH] [mc] Remove old hash code --- src/mc/mc_checkpoint.c | 98 ------------------------------------------ src/mc/mc_compare.c | 56 ------------------------ src/mc/mc_private.h | 4 -- 3 files changed, 158 deletions(-) diff --git a/src/mc/mc_checkpoint.c b/src/mc/mc_checkpoint.c index 9b11f18a9e..97a9b7ed24 100644 --- a/src/mc/mc_checkpoint.c +++ b/src/mc/mc_checkpoint.c @@ -333,102 +333,6 @@ static void MC_find_object_address(memory_map_t maps, mc_object_info_t result) { /************************************* Take Snapshot ************************************/ /****************************************************************************************/ -static void MC_get_hash_global(char *snapshot_hash, void *data1, void *data2){ - - /* unsigned int cursor = 0; */ - /* size_t offset; */ - /* global_variable_t current_var; */ - /* void *addr_pointed = NULL; */ - /* void *res = NULL; */ - - /* xbt_strbuff_t clear = xbt_strbuff_new(); */ - - /* xbt_dynar_foreach(mc_global_variables, cursor, current_var){ */ - /* if(current_var->address < start_data_libsimgrid){ /\* binary *\/ */ - /* offset = (char *)current_var->address - (char *)start_data_binary; */ - /* addr_pointed = *((void **)((char *)data2 + offset)); */ - /* if(((addr_pointed >= start_plt_binary && addr_pointed <= end_plt_binary)) || ((addr_pointed >= std_heap && (char *)addr_pointed <= (char *)std_heap + STD_HEAP_SIZE ))) */ - /* continue; */ - /* res = xbt_malloc0(current_var->size + 1); */ - /* memset(res, 0, current_var->size + 1); */ - /* memcpy(res, (char*)data2 + offset, current_var->size); */ - /* }else{ /\* libsimgrid *\/ */ - /* offset = (char *)current_var->address - (char *)start_data_libsimgrid; */ - /* addr_pointed = *((void **)((char *)data1 + offset)); */ - /* if((addr_pointed >= start_plt_libsimgrid && addr_pointed <= end_plt_libsimgrid) || (addr_pointed >= std_heap && (char *)addr_pointed <= (char *)std_heap + STD_HEAP_SIZE )) */ - /* continue; */ - /* res = xbt_malloc0(current_var->size + 1); */ - /* memset(res, 0, current_var->size + 1); */ - /* memcpy(res, (char*)data1 + offset, current_var->size); */ - /* } */ - /* if(res != NULL){ */ - /* xbt_strbuff_append(clear, (const char*)res); */ - /* xbt_free(res); */ - /* res = NULL; */ - /* } */ - /* } */ - - /* xbt_sha(clear->data, snapshot_hash); */ - - /* xbt_strbuff_free(clear); */ - -} - -static void MC_get_hash_local(char *snapshot_hash, xbt_dynar_t stacks){ - - /* xbt_dynar_t tokens = NULL, s_tokens = NULL; */ - /* unsigned int cursor1 = 0, cursor2 = 0; */ - /* mc_snapshot_stack_t current_stack; */ - /* char *frame_name = NULL; */ - /* void *addr; */ - - /* xbt_strbuff_t clear = xbt_strbuff_new(); */ - - /* while(cursor1 < xbt_dynar_length(stacks)){ */ - /* current_stack = xbt_dynar_get_as(stacks, cursor1, mc_snapshot_stack_t); */ - /* tokens = xbt_str_split(current_stack->local_variables->data, NULL); */ - /* cursor2 = 0; */ - /* while(cursor2 < xbt_dynar_length(tokens)){ */ - /* s_tokens = xbt_str_split(xbt_dynar_get_as(tokens, cursor2, char *), "="); */ - /* if(xbt_dynar_length(s_tokens) > 1){ */ - /* if(strcmp(xbt_dynar_get_as(s_tokens, 0, char *), "frame_name") == 0){ */ - /* xbt_free(frame_name); */ - /* frame_name = xbt_strdup(xbt_dynar_get_as(s_tokens, 1, char *)); */ - /* xbt_strbuff_append(clear, (const char*)xbt_dynar_get_as(tokens, cursor2, char *)); */ - /* cursor2++; */ - /* xbt_dynar_free(&s_tokens); */ - /* continue; */ - /* } */ - /* addr = (void *) strtoul(xbt_dynar_get_as(s_tokens, 1, char *), NULL, 16); */ - /* if(addr > std_heap && (char *)addr <= (char *)std_heap + STD_HEAP_SIZE){ */ - /* cursor2++; */ - /* xbt_dynar_free(&s_tokens); */ - /* continue; */ - /* } */ - /* if(is_stack_ignore_variable(frame_name, xbt_dynar_get_as(s_tokens, 0, char *))){ */ - /* cursor2++; */ - /* xbt_dynar_free(&s_tokens); */ - /* continue; */ - /* } */ - /* xbt_strbuff_append(clear, (const char *)xbt_dynar_get_as(tokens, cursor2, char *)); */ - /* } */ - /* xbt_dynar_free(&s_tokens); */ - /* cursor2++; */ - /* } */ - /* xbt_dynar_free(&tokens); */ - /* cursor1++; */ - /* } */ - - /* xbt_free(frame_name); */ - - /* xbt_sha(clear->data, snapshot_hash); */ - - /* xbt_strbuff_free(clear); */ - -} - - - static xbt_dynar_t MC_get_local_variables_values(void *stack_context){ unw_cursor_t c; @@ -612,8 +516,6 @@ mc_snapshot_t MC_take_snapshot(int num_state){ if(_sg_mc_visited > 0 || strcmp(_sg_mc_property_file,"")){ snapshot->stacks = MC_take_snapshot_stacks(&snapshot, snapshot->regions[0]->data); - //MC_get_hash_global(snapshot->hash_global, snapshot->regions[1]->data, snapshot->regions[2]->data); - //MC_get_hash_local(snapshot->hash_local, snapshot->stacks); } if(num_state > 0) diff --git a/src/mc/mc_compare.c b/src/mc/mc_compare.c index fd5b72245b..bfa1332a1a 100644 --- a/src/mc/mc_compare.c +++ b/src/mc/mc_compare.c @@ -445,62 +445,6 @@ int snapshot_compare(void *state1, void *state2){ xbt_os_walltimer_start(timer); #endif - /* Compare hash of global variables */ - if(s1->hash_global != NULL && s2->hash_global != NULL){ - if(strcmp(s1->hash_global, s2->hash_global) != 0){ - #ifdef MC_DEBUG - xbt_os_walltimer_stop(timer); - mc_comp_times->hash_global_variables_comparison_time = xbt_os_timer_elapsed(timer); - XBT_DEBUG("Different hash of global variables : %s - %s", s1->hash_global, s2->hash_global); - errors++; - #else - #ifdef MC_VERBOSE - XBT_VERB("Different hash of global variables : %s - %s", s1->hash_global, s2->hash_global); - #endif - - xbt_os_walltimer_stop(timer); - xbt_os_timer_free(timer); - xbt_os_walltimer_stop(global_timer); - mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer); - xbt_os_timer_free(global_timer); - - return 1; - #endif - } - } - - #ifdef MC_DEBUG - xbt_os_walltimer_start(timer); - #endif - - /* Compare hash of local variables */ - if(s1->hash_local != NULL && s2->hash_local != NULL){ - if(strcmp(s1->hash_local, s2->hash_local) != 0){ - #ifdef MC_DEBUG - xbt_os_walltimer_stop(timer); - mc_comp_times->hash_local_variables_comparison_time = xbt_os_timer_elapsed(timer); - XBT_DEBUG("Different hash of local variables : %s - %s", s1->hash_local, s2->hash_local); - errors++; - #else - #ifdef MC_VERBOSE - XBT_VERB("Different hash of local variables : %s - %s", s1->hash_local, s2->hash_local); - #endif - - xbt_os_walltimer_stop(timer); - xbt_os_timer_free(timer); - xbt_os_walltimer_stop(global_timer); - mc_snapshot_comparison_time = xbt_os_timer_elapsed(global_timer); - xbt_os_timer_free(global_timer); - - return 1; - #endif - } - } - - #ifdef MC_DEBUG - xbt_os_walltimer_start(timer); - #endif - /* Init heap information used in heap comparison algorithm */ res_init = init_heap_information((xbt_mheap_t)s1->regions[0]->data, (xbt_mheap_t)s2->regions[0]->data, s1->to_ignore, s2->to_ignore); if(res_init == -1){ diff --git a/src/mc/mc_private.h b/src/mc/mc_private.h index 45e6bc89af..305f751bbf 100644 --- a/src/mc/mc_private.h +++ b/src/mc/mc_private.h @@ -46,8 +46,6 @@ typedef struct s_mc_snapshot{ xbt_dynar_t stacks; xbt_dynar_t to_ignore; uint64_t hash; - char hash_global[41]; - char hash_local[41]; } s_mc_snapshot_t, *mc_snapshot_t; typedef struct s_mc_snapshot_stack{ @@ -237,8 +235,6 @@ typedef struct s_mc_comparison_times{ double libsimgrid_global_variables_comparison_time; double heap_comparison_time; double stacks_comparison_time; - double hash_global_variables_comparison_time; - double hash_local_variables_comparison_time; }s_mc_comparison_times_t, *mc_comparison_times_t; extern __thread mc_comparison_times_t mc_comp_times; -- 2.20.1