1. let each sandbox in the chain share the same request id. 2. fflush after fprintf

main
xiaosuGW 3 years ago
parent b2385f70a0
commit cc51da253a

@ -183,4 +183,5 @@ sandbox_print_perf(struct sandbox *sandbox)
sandbox->module->name, sandbox->module->port, sandbox_state_stringify(sandbox->state), sandbox->module->name, sandbox->module->port, sandbox_state_stringify(sandbox->state),
sandbox->module->relative_deadline_us, total_time_us, queued_us, initializing_us, runnable_us, sandbox->module->relative_deadline_us, total_time_us, queued_us, initializing_us, runnable_us,
running_us, blocked_us, returned_us, sandbox->linear_memory_size); running_us, blocked_us, returned_us, sandbox->linear_memory_size);
fflush(runtime_sandbox_perf_log);
} }

@ -114,7 +114,9 @@ current_sandbox_start(void)
next_module->name, sandbox->client_socket_descriptor, next_module->name, sandbox->client_socket_descriptor,
(const struct sockaddr *)&sandbox->client_address, (const struct sockaddr *)&sandbox->client_address,
sandbox->request_arrival_timestamp, true, pre_func_output, output_length); sandbox->request_arrival_timestamp, true, pre_func_output, output_length);
/* Add to the Global Sandbox Request Scheduler */ /* reset the request id to the same as the current request id */
sandbox_request->id = sandbox->id;
/* Add to the Global Sandbox Request Scheduler */
global_request_scheduler_add(sandbox_request); global_request_scheduler_add(sandbox_request);
sandbox_remove_from_epoll(sandbox); sandbox_remove_from_epoll(sandbox);
sandbox_set_as_returned(sandbox, SANDBOX_RUNNING); sandbox_set_as_returned(sandbox, SANDBOX_RUNNING);

@ -226,6 +226,7 @@ runtime_configure()
if (runtime_sandbox_perf_log == NULL) { perror("sandbox perf log"); } if (runtime_sandbox_perf_log == NULL) { perror("sandbox perf log"); }
fprintf(runtime_sandbox_perf_log, "id,function,state,deadline,actual,queued,initializing,runnable," fprintf(runtime_sandbox_perf_log, "id,function,state,deadline,actual,queued,initializing,runnable,"
"running,blocked,returned,memory\n"); "running,blocked,returned,memory\n");
fflush(runtime_sandbox_perf_log);
} else { } else {
printf("\tSandbox Performance Log: Disabled\n"); printf("\tSandbox Performance Log: Disabled\n");
} }

Loading…
Cancel
Save