diff --git a/hammer.sh b/hammer.sh new file mode 100755 index 0000000..2cb11fe --- /dev/null +++ b/hammer.sh @@ -0,0 +1,88 @@ +#!/bin/sh +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "45" | http :10000 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & +echo "25" | http :10001 --timeout 100 & diff --git a/runtime/include/sandbox_request.h b/runtime/include/sandbox_request.h index ca1b677..6f35d52 100644 --- a/runtime/include/sandbox_request.h +++ b/runtime/include/sandbox_request.h @@ -43,7 +43,7 @@ sandbox_request_allocate(struct module *module, char *arguments, int socket_desc sandbox_request->absolute_deadline = start_time + module->relative_deadline_us * runtime_processor_speed_MHz; // TODO: Refactor to log file - printf("Set absolute deadline of %lu\n", sandbox_request->absolute_deadline); + // printf("Set absolute deadline of %lu\n", sandbox_request->absolute_deadline); debuglog("[%p: %s]\n", sandbox_request, sandbox_request->module->name); return sandbox_request; diff --git a/runtime/src/sandbox.c b/runtime/src/sandbox.c index 438bd7a..dabeaaf 100644 --- a/runtime/src/sandbox.c +++ b/runtime/src/sandbox.c @@ -142,14 +142,15 @@ done: u64 end_time = __getcycles(); curr->total_time = end_time - curr->start_time; // TODO: Refactor to log file - printf("Function returned in %lu cycles\n", curr->total_time); - if (end_time < curr->absolute_deadline) { - printf("Deadline Met with %f us to spare\n", - (curr->absolute_deadline - end_time) / runtime_processor_speed_MHz); - } else { - printf("Deadline NOT MET! Overran by %f us\n", - (end_time - curr->absolute_deadline) / runtime_processor_speed_MHz); - } + printf("%s():%d, %d, %lu\n", curr->module->name, curr->module->port, curr->module->relative_deadline_us, + (uint64_t)(curr->total_time / runtime_processor_speed_MHz)); + // if (end_time < curr->absolute_deadline) { + // printf("meadDeadline Met with %f us to spare\n", + // (curr->absolute_deadline - end_time) / runtime_processor_speed_MHz); + // } else { + // printf("Deadline NOT MET! Overran by %f us\n", + // (end_time - curr->absolute_deadline) / runtime_processor_speed_MHz); + // } #ifndef USE_HTTP_UVIO int r = send(curr->client_socket_descriptor, curr->request_response_data, sndsz, 0); diff --git a/runtime/tests/test_fibonacci_multiple.json b/runtime/tests/test_fibonacci_multiple.json new file mode 100644 index 0000000..55aabf4 --- /dev/null +++ b/runtime/tests/test_fibonacci_multiple.json @@ -0,0 +1,28 @@ +{ + "active": "yes", + "name": "fibonacci", + "path": "fibonacci_wasm.so", + "port": 10000, + "relative-deadline-us": 50000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 1024, + "http-resp-headers": [], + "http-resp-size": 1024, + "http-resp-content-type": "text/plain" +}, +{ + "active": "yes", + "name": "fibonacci2", + "path": "fibonacci_wasm.so", + "port": 10001, + "relative-deadline-us": 10000, + "argsize": 1, + "http-req-headers": [], + "http-req-content-type": "text/plain", + "http-req-size": 1024, + "http-resp-headers": [], + "http-resp-size": 1024, + "http-resp-content-type": "text/plain" +}