first commit

main
hwwang 6 months ago
parent ab4ca63545
commit 84a8ae5345

@ -1,2 +1,3 @@
LD_LIBRARY_PATH=/sledge/runtime/bin
LD_LIBRARY_PATH=/home/hai/sledge-serverless-framework/runtime/bin
SLEDGE_SCHEDULER=EDF
SLEDGE_SANDBOX_PERF_LOG=/home/hai/sledge-serverless-framework/debuglog.txt

@ -87,7 +87,11 @@
"debuglog.h": "c",
"worker_thread_execute_epoll_loop.h": "c",
"sandbox_set_as_running.h": "c",
"sandbox_summarize_page_allocations.h": "c"
"sandbox_summarize_page_allocations.h": "c",
"sandbox_receive_request.h": "c",
"sandbox_state.h": "c",
"stdint.h": "c",
"stdbool.h": "c"
},
"files.exclude": {
"**/.git": true,

@ -0,0 +1,45 @@
#!/bin/bash
# 获取 sledgert 进程的 PID
SLEDGERT_PID=$(pgrep sledgert)
if [ -z "$SLEDGERT_PID" ]; then
echo "sledgert process not found!"
exit 1
fi
# 启动 perf 监控
sudo perf record -e cycles,instructions,cache-misses -p $SLEDGERT_PID -o perf.data &
PERF_PID=$!
# 确保 perf 已启动
sleep 0.1
# 记录开始时间(纳秒)
start=$(date +%s%N)
# 发送 HTTP 请求
echo "10" | http :10000
# 记录结束时间(纳秒)
end=$(date +%s%N)
# 计算耗时(纳秒)
elapsed=$((end - start))
# 转换为微秒
elapsed_us=$((elapsed / 1000))
echo "Elapsed time: ${elapsed_us} ?s"
# 转换为毫秒
elapsed_ms=$((elapsed / 1000000))
echo "Elapsed time: ${elapsed_ms} ms"
# 停止 perf 监控
sudo pkill -INT -P $PERF_PID
# 等待 perf 写入数据
wait $PERF_PID
# 显示 perf 报告
sudo perf report -i perf.data

@ -47,7 +47,7 @@ BINARY_NAME=sledgert
# CFLAGS += -DNDEBUG
# Redirects debuglogs to /runtime/bin/sledge.log
# CFLAGS += -DLOG_TO_FILE
CFLAGS += -DLOG_TO_FILE
# Various Informational Logs for Debugging
# CFLAGS += -DLOG_HTTP_PARSER
@ -133,6 +133,24 @@ distclean: clean
@make --no-print-directory -C thirdparty clean
fetch:
@git config --global --add safe.directory /sledge
@git config --global --add safe.directory /sledge/awsm
@git config --global --add safe.directory /sledge/runtime/tests/CMSIS_5_NN
@git config --global --add safe.directory /sledge/runtime/tests/TinyEKF
@git config --global --add safe.directory /sledge/runtime/tests/gocr
@git config --global --add safe.directory /sledge/runtime/tests/sod
@git config --global --add safe.directory /sledge/runtime/tests/speechtotext
@git config --global --add safe.directory /sledge/ck
@git config --global --add safe.directory /sledge/http-parser
@git config --global --add safe.directory /sledge/jsmn
@git config --global --add safe.directory /sledge/awsm/wasmception
@git config --global --add safe.directory /sledge/runtime/tests/CMSIS_5_NN/CMSIS_5
@git config --global --add safe.directory /sledge/runtime/tests/speechtotext/thirdparty/pocketsphinx
@git config --global --add safe.directory /sledge/runtime/thirdparty/ck
@git config --global --add safe.directory /sledge/runtime/tests/speechtotext/thirdparty/sphinxbase
@git config --global --add safe.directory /sledge/runtime/thirdparty/http-parser
@git config --global --add safe.directory /sledge/runtime/thirdparty/jsmn
@git config --global --add safe.directory /sledge/runtime/tests/C-Image-Manip
@git submodule update --init --recursive
init: fetch clean thirdparty runtime

@ -0,0 +1,11 @@
#!/bin/bash
HOST_ROOT=${HOST_ROOT:-$(cd "$(dirname "${BASH_SOURCE:-$0}")" && pwd)}
__run_sh__base_path="$(dirname "$(realpath --logical "${BASH_SOURCE[0]}")")"
SYS_SRC_PREFIX=${SYS_SRC_PREFIX:-"$(
cd "$(dirname "$(dirname "${0}")")" || exit 1
pwd -P
)"}
echo ${HOST_ROOT}
echo ${__run_sh__base_path}

@ -0,0 +1,46 @@
Summary:
Total: 4.3910 secs
Slowest: 4.3533 secs
Fastest: 4.3533 secs
Average: 4.3533 secs
Requests/sec: 0.2277
Total data: 1952 bytes
Size/request: 1952 bytes
Response time histogram:
4.353 [1] |■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■
4.353 [0] |
4.353 [0] |
4.353 [0] |
4.353 [0] |
4.353 [0] |
4.353 [0] |
4.353 [0] |
4.353 [0] |
4.353 [0] |
4.353 [0] |
Latency distribution:
0% in 0.0000 secs
0% in 0.0000 secs
0% in 0.0000 secs
0% in 0.0000 secs
0% in 0.0000 secs
0% in 0.0000 secs
0% in 0.0000 secs
Details (average, fastest, slowest):
DNS+dialup: 0.0045 secs, 4.3533 secs, 4.3533 secs
DNS-lookup: 0.0000 secs, 0.0000 secs, 0.0000 secs
req write: 0.0067 secs, 0.0067 secs, 0.0067 secs
resp wait: 4.3413 secs, 4.3413 secs, 4.3413 secs
resp read: 0.0004 secs, 0.0004 secs, 0.0004 secs
Status code distribution:
[200] 1 responses

@ -3,6 +3,7 @@ include Makefile.inc
#TESTS=fibonacci fibonacci2 fibonacci3 big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty
TESTS=fibonacci big_fibonacci C-Image-Manip empty work work1k work10k work100k work1m forever filesys sockserver sockclient empty
TESTSRT=$(TESTS:%=%_rt)
.PHONY: all clean rttests tinyekf cifar10 gocr sod

File diff suppressed because one or more lines are too long

@ -1,10 +0,0 @@
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_fibonacci_multiple.json
# fib(20)
ab -n 100000 -c 100 -p post_body.txt -v 4 localhost:10000/
# fib(10)
ab -n 100000 -c 100 -p post_body2.txt -v 4 localhost:10001/

@ -1,16 +0,0 @@
adpcm_wasm.so:10000:adpcm:2:0:0:0:0
bitcount_wasm.so:10002:bitcount:2:0:0:0:0
basic_math_wasm.so:10004:basic_math:1:0:0:0:0
binarytrees_wasm.so:10006:binarytrees:2:0:0:0:0
crc_wasm.so:10008:crc:2:0:0:0:0
;dijkstra_wasm.so:10010:dijkstra:2:0:0:0:0
forever_wasm.so:10012:forever:1:0:0:0:0
forever_wasm.so:10014:fornever:2:0:0:0:0
;fft_wasm.so:10016:fft:3:0:0:0:0
function_pointers_wasm.so:10018:function_pointers:1:0:0:0:0
gsm_wasm.so:10020:gsm:4:0:0:0:0
;libjpeg_wasm.so:10022:libjpeg:1:0:0:0:0
mandelbrot_wasm.so:10024:mandelbrot:2:0:0:0:0
;matrix_multiply_wasm.so:10026:matrix_multiply:1:0:0:0:0
patricia_wasm.so:10028:patricia:2:0:0:0:0
sqlite_wasm.so:10030:sqlite:1:0:0:0:0

@ -1,33 +0,0 @@
10002$bitcount:bitcount1,16777216
10002$bitcount:bitcount2,16777216
10004$basic_math:basic_math1
10004$basic_math:basic_math2
10006$binarytrees:binarytrees1,16
10006$binarytrees:binarytrees2,16
10008$crc:crc1,crc/large.pcm
10008$crc:crc2,crc/large.pcm
;10010$dijkstra:dijkstra1,dijkstra/input.dat
;10010$dijkstra:dijkstra2,dijkstra/input.dat
;10012$forever:forever01
;10012$forever:forever02
10014$fornever:fornever01,10
10014$fornever:fornever02,20
;10012$forever:forever03
;10012$forever:forever04
10014$fornever:fornever03,30
10014$fornever:fornever04,40
;10016$fft:fft1,8,32768
;10016$fft:fft2,8,32768
;10018$function_pointers:function_pointers1
;10018$function_pointers:function_pointers2
;10020$gsm:gsm1,-fps,-c,gsm/large.au
;10020$gsm:gsm2,-fps,-c,gsm/large.au
;10022$libjpeg:libjpeg1
;10022$libjpeg:libjpeg2
;10024$mandelbrot:mandelbrot1,5000
;10024$mandelbrot:mandelbrot2,5000
;10026$matrix_multiply:matrix_multiply1
;10026$matrix_multiply:matrix_multiply2
;10028$patricia:patricia1,large.udp
;10030$sqlite:sqlite1
;10030$sqlite:sqlite2
Loading…
Cancel
Save