tree of leftchild

tree
hwwang 6 months ago
parent bc6a861e77
commit 2fd2b99319

@ -10,10 +10,10 @@ PAGE_SIZE := $(shell getconf PAGESIZE)
# Compiler Settings
CC=clang
CC_OPTIONS = -O3 -flto -g -pthread -D_GNU_SOURCE
# CC_OPTIONS = -O3 -flto -g -pthread -D_GNU_SOURCE
# CC_OPTIONS for Debugging
# CC_OPTIONS = -O0 -g -pthread -D_GNU_SOURCE
CC_OPTIONS = -O0 -g -pthread -D_GNU_SOURCE
# CFI Sanitizer
# CC_OPTIONS = -O0 -g -pthread -D_GNU_SOURCE -flto -fvisibility=default -fsanitize=cfi

@ -70,7 +70,8 @@ current_sandbox_start(void)
char *error_message = "";
sandbox_initialize_stdio(sandbox);
struct module * next_module = sandbox->module->next_module;
//struct module * next_module = sandbox->module->next_module;
struct module * next_module = sandbox->module->left_module;
/*
* Add the client fd to epoll if it is the first or last sandbox in the chain because they

@ -180,7 +180,8 @@ listener_thread_main(void *dummy)
struct module * next_module = module;
while(next_module) {
estimated_execution_time += admission_info_get_percentile(&next_module->admissions_info);
next_module = next_module->next_module;
//next_module = next_module->next_module;
next_module = next_module->left_module;
}
/* Adding system start timestamp to avoid negative remaining slack in the following update. They are all cycles */

@ -609,7 +609,8 @@ module_new_from_json(char *file_name)
{
module->is_parent = false;
}
module->left_module = NULL;
module->right_module = NULL;
nodes[i] = module;
// if (tail_module != NULL) { tail_module->next_module = module; }
// tail_module = module;
@ -630,11 +631,11 @@ module_new_from_json(char *file_name)
}
if (module_count == 0) panic("%s contained no active modules\n", file_name);
for (int i = 0; i <= module_count; i++) {
for (int i = 0; i < module_count; i++) {
int left_index = 2 * i + 1;
int right_index = 2 * i + 2;
if (left_index <= module_count) nodes[i]->left_module = nodes[left_index];
if (right_index <= module_count) nodes[i]->right_module = nodes[right_index];
if (left_index < module_count) nodes[i]->left_module = nodes[left_index];
if (right_index < module_count) nodes[i]->right_module = nodes[right_index];
}
free(nodes);
#ifdef LOG_MODULE_LOADING

Loading…
Cancel
Save