Commit 449b7a8e authored by Florian Fischer's avatar Florian Fischer
Browse files

add dataref target

parent de592221
Pipeline #66519 passed with stage
in 1 minute and 12 seconds
BENCH_MAIN := bench.c BENCH_MAIN := bench.c
SYSCALLS := blocking io-uring io-uring-sqpoll io-uring-no-syscall epoll paio-sig paio-thrd SYSCALLS := blocking io-uring io-uring-sqpoll io-uring-no-syscall epoll paio-sig paio-thrd
STATS ?=
OBJ := $(addprefix bench-,$(SYSCALLS)) OBJ := $(addprefix bench-,$(SYSCALLS))
LDFLAGS := -luring -pthread -lrt -lm LDFLAGS := -luring -pthread -lrt -lm
...@@ -10,20 +8,26 @@ LDFLAGS := -luring -pthread -lrt -lm ...@@ -10,20 +8,26 @@ LDFLAGS := -luring -pthread -lrt -lm
CFLAGS := -Werror -Wall -g -O3 CFLAGS := -Werror -Wall -g -O3
# CFLAGS := -Werror -Wall -g -O0 # CFLAGS := -Werror -Wall -g -O0
.PHONY: all clean eval eval-stats docker-eval docker-eval-stats check .PHONY: all clean eval stats dataref docker-eval docker-stats docker-dataref check
eval: all eval: all
@for syscall in $(SYSCALLS); do ./bench-$$syscall $(STATS); done @for syscall in $(SYSCALLS); do echo -n "$$syscall "; ./bench-$$syscall; done
stats:
@for syscall in $(SYSCALLS); do echo "$$syscall:"; ./bench-$$syscall --stats; done
eval-stats: dataref:
@$(MAKE) STATS=--stats eval @$(MAKE) eval-stats | tools/yaml2dataref.sh
docker-eval: docker-eval:
./docker.sh make eval ./docker.sh make eval
docker-eval-stats: docker-stats:
./docker.sh make eval-stats ./docker.sh make eval-stats
docker-dataref:
./docker.sh make dataref
all: $(OBJ) all: $(OBJ)
define generateTargets define generateTargets
......
...@@ -54,13 +54,12 @@ int main(int argc, char *argv[]) { ...@@ -54,13 +54,12 @@ int main(int argc, char *argv[]) {
} }
if (print_stats) { if (print_stats) {
printf("%s:\n", argv[0]);
print_desc_stats("nanos", " ", nanos, exp_iterations); print_desc_stats("nanos", " ", nanos, exp_iterations);
print_desc_stats("cycles", " ", cycles, exp_iterations); print_desc_stats("cycles", " ", cycles, exp_iterations);
} else { } else {
uint64_t avg_nanos = calc_mean(nanos, exp_iterations); uint64_t avg_nanos = calc_mean(nanos, exp_iterations);
uint64_t avg_cycles = calc_mean(cycles, exp_iterations); uint64_t avg_cycles = calc_mean(cycles, exp_iterations);
printf("%s avg-nanos: %lu, avg-cycles: %lu\n", argv[0], avg_nanos, avg_cycles); printf("avg-nanos: %lu, avg-cycles: %lu\n", avg_nanos, avg_cycles);
} }
free(nanos); free(nanos);
......
...@@ -62,7 +62,7 @@ void print_desc_stats(const char* name, const char* indentation, const uint64_t* ...@@ -62,7 +62,7 @@ void print_desc_stats(const char* name, const char* indentation, const uint64_t*
const uint64_t var = calc_var(data, size, mean); const uint64_t var = calc_var(data, size, mean);
const uint64_t std = (uint64_t)sqrt((double)var); const uint64_t std = (uint64_t)sqrt((double)var);
printf("%s%s\n", indentation, name); printf("%s%s:\n", indentation, name);
printf("%s%smin: %lu\n", indentation, indentation, min); printf("%s%smin: %lu\n", indentation, indentation, min);
printf("%s%smax: %lu\n", indentation, indentation, max); printf("%s%smax: %lu\n", indentation, indentation, max);
printf("%s%smedian: %lu\n", indentation, indentation, median); printf("%s%smedian: %lu\n", indentation, indentation, median);
......
#!/bin/bash
# taken from here:
# https://stackoverflow.com/questions/5014632/how-can-i-parse-a-yaml-file-from-a-linux-shell-script
s='[[:space:]]*'
w='[a-zA-Z0-9_]*'
fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\):|\1|" \
-e "s|^\($s\)\($w\)$s:${s}[\"']\(.*\)[\"']$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" |
awk -F"$fs" '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
if (length($3) > 0) {
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("/")}
printf("\\setdref{%s%s}{%s}\n", vn, $2, $3);
}
}'
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment