/* SIMIX */
MC_ignore_global_variable("smx_total_comms");
- MC_ignore_heap(mc_time, simix_process_maxpid * sizeof(double));
-
- smx_process_t process;
- // FIXME, cross-process support (simix_global->process_list)
-
if (mc_mode == MC_MODE_STANDALONE || mc_mode == MC_MODE_CLIENT) {
+ MC_ignore_heap(mc_time, simix_process_maxpid * sizeof(double));
+ smx_process_t process;
xbt_swag_foreach(process, simix_global->process_list) {
MC_ignore_heap(&(process->process_hookup),
sizeof(process->process_hookup));
}
- } else {
- // TODO
}
}
void MC_heap_region_ignore_send(mc_heap_ignore_region_t region)
{
- s_mc_ignore_region_message_t message;
- message.type = MC_MESSAGE_IGNORE_REGION;
+ s_mc_ignore_heap_message_t message;
+ message.type = MC_MESSAGE_IGNORE_HEAP;
message.region = *region;
if (MC_protocol_send(mc_client->fd, &message, sizeof(message)))
xbt_die("Could not send ignored region to MCer");
// FIXME, cross-process support? (or make this it is used on the app-side)
void MC_ignore_heap(void *address, size_t size)
{
- if(!std_heap)
- return;
-
int raw_mem_set = (mmalloc_get_current_heap() == mc_heap);
MC_SET_MC_HEAP;
- mc_heap_ignore_region_t region = NULL;
- region = xbt_new0(s_mc_heap_ignore_region_t, 1);
+ mc_heap_ignore_region_t region = xbt_new0(s_mc_heap_ignore_region_t, 1);
region->address = address;
region->size = size;
void MC_remove_ignore_heap(void *address, size_t size)
{
+ if (mc_mode == MC_MODE_CLIENT) {
+ s_mc_ignore_memory_message_t message;
+ message.type = MC_MESSAGE_UNIGNORE_HEAP;
+ message.addr = address;
+ message.size = size;
+ MC_client_send_message(&message, sizeof(message));
+ }
int raw_mem_set = (mmalloc_get_current_heap() == mc_heap);
// ***** Messages
typedef enum {
- MC_MESSAGE_NONE = 0,
- MC_MESSAGE_HELLO = 1,
- MC_MESSAGE_CONTINUE = 2,
- MC_MESSAGE_IGNORE_REGION = 3,
- MC_MESSAGE_IGNORE_MEMORY = 4,
+ MC_MESSAGE_NONE,
+ MC_MESSAGE_HELLO,
+ MC_MESSAGE_CONTINUE,
+ MC_MESSAGE_IGNORE_HEAP,
+ MC_MESSAGE_UNIGNORE_HEAP,
+ MC_MESSAGE_IGNORE_MEMORY,
} e_mc_message_type;
#define MC_MESSAGE_LENGTH 512
e_mc_message_type type;
} s_mc_message_t, *mc_message_t;
-typedef struct s_mc_ignore_region_message {
+typedef struct s_mc_ignore_heap_message {
e_mc_message_type type;
s_mc_heap_ignore_region_t region;
-} s_mc_ignore_region_message_t, *mc_ignore_region_message_t;
+} s_mc_ignore_heap_message_t, *mc_ignore_heap_message_t;
typedef struct s_mc_ignore_memory_message {
e_mc_message_type type;
switch(base_message.type) {
- case MC_MESSAGE_IGNORE_REGION:
+ case MC_MESSAGE_IGNORE_HEAP:
XBT_DEBUG("Received ignored region");
- if (size != sizeof(s_mc_ignore_region_message_t))
+ if (size != sizeof(s_mc_ignore_heap_message_t))
+ xbt_die("Broken messsage");
+ // TODO, handle the message
+ break;
+
+ case MC_MESSAGE_UNIGNORE_HEAP:
+ XBT_DEBUG("Received unignored region");
+ if (size != sizeof(s_mc_ignore_memory_message_t))
xbt_die("Broken messsage");
// TODO, handle the message
break;