parent
a696655ad5
commit
87ba8af8a0
@ -0,0 +1,26 @@
|
|||||||
|
import sys
|
||||||
|
|
||||||
|
def process_file(input_file, noop_functions):
|
||||||
|
data = {noop: [] for noop in noop_functions}
|
||||||
|
|
||||||
|
with open(input_file, "r") as infile:
|
||||||
|
for line in infile:
|
||||||
|
for noop in noop_functions:
|
||||||
|
if noop in line:
|
||||||
|
value = line.split(",")[6]
|
||||||
|
data[noop].append(value)
|
||||||
|
|
||||||
|
for noop, values in data.items():
|
||||||
|
with open(f"{noop}.txt", "w") as outfile:
|
||||||
|
outfile.write("\n".join(values))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
|
||||||
|
|
||||||
|
argv = sys.argv[1:]
|
||||||
|
if len(argv) < 1:
|
||||||
|
print("usage:", sys.argv[0], "file_dir percentage")
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
input_file = argv[0]
|
||||||
|
process_file(input_file, noop_functions)
|
@ -0,0 +1,11 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
|
void noop() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
noop();
|
||||||
|
return 0;
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
import os
|
||||||
|
|
||||||
|
def calculate_average(filename):
|
||||||
|
with open(filename, "r") as file:
|
||||||
|
values = file.readlines()
|
||||||
|
values = [int(value.strip()) for value in values]
|
||||||
|
average = sum(values) / len(values) if values else 0
|
||||||
|
return average
|
||||||
|
|
||||||
|
def main():
|
||||||
|
noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"]
|
||||||
|
|
||||||
|
for noop in noop_functions:
|
||||||
|
filename = f"{noop}.txt"
|
||||||
|
if os.path.exists(filename):
|
||||||
|
average = calculate_average(filename)
|
||||||
|
print(f"Average for {filename}: {average}")
|
||||||
|
else:
|
||||||
|
print(f"{filename} does not exist.")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
@ -0,0 +1,32 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
function usage {
|
||||||
|
echo "$0 [perf output file, chain_function_perf.log or single_function_perf.log or opt_function_perf.log]"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ $# != 1 ] ; then
|
||||||
|
usage
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
output=$1
|
||||||
|
|
||||||
|
|
||||||
|
declare project_path="$(
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
pwd
|
||||||
|
)"
|
||||||
|
echo $project_path
|
||||||
|
path=`pwd`
|
||||||
|
#export SLEDGE_DISABLE_PREEMPTION=true
|
||||||
|
export SLEDGE_CPU_SPEED=2500
|
||||||
|
export SLEDGE_SCHEDULER=FIFO
|
||||||
|
export SLEDGE_SIGALRM_HANDLER=BROADCAST
|
||||||
|
#export SLEDGE_SIGALRM_HANDLER=TRIAGED
|
||||||
|
#export SLEDGE_NWORKERS=16
|
||||||
|
#export SLEDGE_SCHEDULER=EDF
|
||||||
|
export SLEDGE_SANDBOX_PERF_LOG=$path/$output
|
||||||
|
echo $SLEDGE_SANDBOX_PERF_LOG
|
||||||
|
cd $project_path/runtime/bin
|
||||||
|
LD_LIBRARY_PATH="$(pwd):$LD_LIBRARY_PATH" ./sledgert ../tests/test_noop1.json
|
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"active": true,
|
||||||
|
"name": "noop1",
|
||||||
|
"path": "noop_wasm.so",
|
||||||
|
"port": 10000,
|
||||||
|
"relative-deadline-us": 0,
|
||||||
|
"argsize": 0,
|
||||||
|
"priority": 1,
|
||||||
|
"pre_module_count": 0,
|
||||||
|
"next_modules": [],
|
||||||
|
"http-req-headers": [],
|
||||||
|
"http-req-content-type": "text/plain",
|
||||||
|
"http-req-size": 0,
|
||||||
|
"http-resp-headers": [],
|
||||||
|
"http-resp-size": 0,
|
||||||
|
"http-resp-content-type": "text/plain",
|
||||||
|
}
|
Loading…
Reference in new issue