chore: update wasm apps

master
Sean McBride 3 years ago
parent ac374e72fd
commit 135ba6105f

@ -110,6 +110,7 @@
"current_wasm_module_instance.h": "c",
"wasm_memory.h": "c",
"sledge_abi.h": "c",
"vec.h": "c"
},
"files.exclude": {
"**/.git": true,

@ -85,3 +85,6 @@ trap_divzero.install: ../runtime/bin/trap_divzero.wasm.so
.PHONY: stack_overflow.install
stack_overflow.install: ../runtime/bin/stack_overflow.wasm.so
.PHONY: html.install
html.install: ../runtime/bin/html.wasm.so

@ -1 +1 @@
Subproject commit a52b7f278b751f7a0ecc146edb4585fd702534f6
Subproject commit d1c345ffacf11a9478ee5ec0772fe5104bc752f5

@ -268,7 +268,7 @@ wasi_snapshot_preview1_poll_oneoff(__wasi_size_t in_baseoffset, __wasi_size_t ou
void
wasi_snapshot_preview1_proc_exit(__wasi_exitcode_t exitcode)
{
sledge_abi__wasi_snapshot_preview1_proc_raise(exitcode);
sledge_abi__wasi_snapshot_preview1_proc_exit(exitcode);
}
uint32_t

@ -109,3 +109,5 @@ current_sandbox_trap(enum sledge_abi__wasm_trap trapno)
siglongjmp(sandbox->ctxt.start_buf, trapno);
}
extern noreturn void current_sandbox_fini();

@ -7,7 +7,7 @@
#define HTTP_MAX_HEADER_COUNT 16
#define HTTP_MAX_HEADER_LENGTH 32
#define HTTP_MAX_HEADER_VALUE_LENGTH 64
#define HTTP_MAX_HEADER_VALUE_LENGTH 256
#define HTTP_RESPONSE_200_TEMPLATE \
"HTTP/1.1 200 OK\r\n" \

@ -78,7 +78,7 @@ sandbox_receive_request(struct sandbox *sandbox)
#ifdef LOG_HTTP_PARSER
debuglog("Sandbox: %lu http_parser_execute(%p, %p, %p, %zu\n)", sandbox->id, parser, settings,
&sandbox->request.base[sandbox->request.length], bytes_received);
&sandbox->request.buffer[sandbox->request.length], bytes_received);
#endif
size_t bytes_parsed = http_parser_execute(parser, settings,
(const char *)&request->buffer[request_length],

@ -187,7 +187,7 @@ err:
return NULL;
}
static inline void
extern noreturn void
current_sandbox_fini()
{
struct sandbox *sandbox = current_sandbox_get();

@ -28,7 +28,6 @@ http_parser_settings_on_url(http_parser *parser, const char *at, size_t length)
#ifdef LOG_HTTP_PARSER
debuglog("sandbox: %lu, length: %zu, Content \"%.*s\"\n", sandbox->id, length, (int)length, at);
assert(strncmp(sandbox->module->name, (at + 1), length - 1) == 0);
#endif
return 0;

@ -1064,9 +1064,8 @@ wasi_snapshot_preview1_backing_poll_oneoff(wasi_context_t *context, const __wasi
noreturn void
wasi_snapshot_preview1_backing_proc_exit(wasi_context_t *context, __wasi_exitcode_t exitcode)
{
struct sandbox *s = current_sandbox_get();
s->return_value = exitcode;
siglongjmp(s->ctxt.start_buf, WASM_TRAP_EXIT);
current_sandbox_fini();
assert(0);
}
/**

@ -921,7 +921,8 @@ sledge_abi__wasi_snapshot_preview1_poll_oneoff(__wasi_size_t in_baseoffset, __wa
EXPORT void
sledge_abi__wasi_snapshot_preview1_proc_exit(__wasi_exitcode_t exitcode)
{
wasi_unsupported_syscall(__func__);
struct sandbox *sandbox = current_sandbox_get();
wasi_snapshot_preview1_backing_proc_exit(sandbox->wasi_context, exitcode);
}
/**

@ -0,0 +1,3 @@
res
perf.data
perf.data.old

@ -0,0 +1,47 @@
RUNTIME_DIR=../../runtime/
SLEDGE_BINARY_DIR=${RUNTIME_DIR}/bin
SLEDGE_TESTS_DIR=${RUNTIME_DIR}/tests
HOSTNAME=localhost
DURATION_SEC=15
all: run
clean:
make -C ${RUNTIME_DIR} clean
make -C ${SLEDGE_TESTS_DIR} clean
rm -f ${SLEDGE_BINARY_DIR}/html.wasm.so
${SLEDGE_BINARY_DIR}/sledgert:
make -C ${RUNTIME_DIR} runtime
.PHONY: sledgert
sledgert: ${SLEDGE_BINARY_DIR}/sledgert
${SLEDGE_BINARY_DIR}/html.wasm.so:
make -C ../../applications html.install
.PHONY: html
html: ${SLEDGE_BINARY_DIR}/html.wasm.so
run: sledgert html
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} ${SLEDGE_BINARY_DIR}/sledgert spec.json
debug: sledgert html
SLEDGE_DISABLE_PREEMPTION=true SLEDGE_NWORKERS=1 \
LD_LIBRARY_PATH=${SLEDGE_BINARY_DIR} gdb ${SLEDGE_BINARY_DIR}/sledgert \
--eval-command="handle SIGUSR1 noprint nostop" \
--eval-command="handle SIGPIPE noprint nostop" \
--eval-command="set pagination off" \
--eval-command="run spec.json"
client-fib10-once:
echo "10" | http :1337
client-fib40-once:
echo "40" | http :1337
client-preempt:
(echo "40" | http :10040 &); echo "10" | http :1337
client-fib10-multi:
hey -z ${DURATION_SEC}s -cpus 4 -c 100 -t 0 -o csv -m GET -d "10\n" "http://${HOSTNAME}:1337"

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=true

@ -0,0 +1,3 @@
SLEDGE_SCHEDULER=EDF
SLEDGE_DISABLE_PREEMPTION=false
SLEDGE_SIGALRM_HANDLER=TRIAGED

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=true

@ -0,0 +1,2 @@
SLEDGE_SCHEDULER=FIFO
SLEDGE_DISABLE_PREEMPTION=false

@ -0,0 +1,13 @@
#!/bin/bash
if ! command -v hey > /dev/null; then
HEY_URL=https://hey-release.s3.us-east-2.amazonaws.com/hey_linux_amd64
wget $HEY_URL -O hey
chmod +x hey
if [[ $(whoami) == "root" ]]; then
mv hey /usr/bin/hey
else
sudo mv hey /usr/bin/hey
fi
fi

@ -0,0 +1,13 @@
[
{
"name": "html",
"path": "html.wasm.so",
"port": 1337,
"expected-execution-us": 10000000,
"admissions-percentile": 70,
"relative-deadline-us": 20000000,
"http-req-size": 1024,
"http-resp-size": 102400,
"http-resp-content-type": "text/html"
}
]
Loading…
Cancel
Save