#include "simgrid_config.h"
#include <stdio.h>
+#ifndef WIN32
#include <sys/mman.h>
+#endif
#include "mc/mc.h"
#include "mc/datatypes.h"
#include "xbt/fifo.h"
/****************************** Snapshots ***********************************/
-#define nb_regions 3 /* binary data (data + BSS), libsimgrid data (data + BSS), std_heap */
+#define NB_REGIONS 3 /* binary data (data + BSS) (type = 2), libsimgrid data (data + BSS) (type = 1), std_heap (type = 0)*/
typedef struct s_mc_mem_region{
- int type;
void *start_addr;
void *data;
size_t size;
} s_mc_mem_region_t, *mc_mem_region_t;
typedef struct s_mc_snapshot{
- unsigned int num_reg;
- int region_type[nb_regions];
size_t heap_bytes_used;
- mc_mem_region_t *regions;
+ mc_mem_region_t regions[NB_REGIONS];
+ int nb_processes;
size_t *stack_sizes;
xbt_dynar_t stacks;
- int nb_processes;
xbt_dynar_t to_ignore;
+ char hash_global[41];
+ char hash_local[41];
} s_mc_snapshot_t, *mc_snapshot_t;
typedef struct s_mc_snapshot_stack{
int raw_mem_set;
}s_mc_global_t, *mc_global_t;
-//void MC_take_snapshot(mc_snapshot_t);
mc_snapshot_t SIMIX_pre_mc_snapshot(smx_simcall_t simcall);
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);
+int is_stack_ignore_variable(char *frame, char *var_name);
/********************************* MC Global **********************************/
extern double *mc_time;
void MC_replay(xbt_fifo_t stack, int start);
void MC_replay_liveness(xbt_fifo_t stack, int all_stack);
void MC_wait_for_requests(void);
-void MC_get_enabled_processes();
void MC_show_deadlock(smx_simcall_t req);
void MC_show_stack_safety(xbt_fifo_t stack);
void MC_dump_stack_safety(xbt_fifo_t stack);
+int SIMIX_pre_mc_random(smx_simcall_t simcall, int min, int max);
+
/********************************* Requests ***********************************/
int MC_request_depend(smx_simcall_t req1, smx_simcall_t req2);
char* MC_request_to_string(smx_simcall_t req, int value);
mc_snapshot_t system_state; /* Snapshot of system state */
} s_mc_state_t, *mc_state_t;
-extern xbt_fifo_t mc_stack_safety_stateless;
-
mc_state_t MC_state_new(void);
void MC_state_delete(mc_state_t state);
void MC_state_interleave_process(mc_state_t state, smx_process_t process);
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 mc_comparison_times_t mc_comp_times;
void MC_dpor_init(void);
void MC_dpor(void);
-void MC_dpor_exit(void);
void MC_init(void);
typedef struct s_mc_safety_visited_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);
int reached(xbt_state_t st);
void set_pair_reached(xbt_state_t st);
int visited(xbt_state_t st);
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);
int get_heap_region_index(mc_snapshot_t s);
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);
/**** Global variables ****/