aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <me@fwei.tk>2018-07-30 19:28:27 +0000
committerFranklin Wei <me@fwei.tk>2018-07-30 19:28:27 +0000
commitf15dc2baf99f2c7e1517e3370a946bbc13e89ff6 (patch)
treebb00b568220109080b231704a9e3d74d5b189f36
parent8be4b2fb7a04c2ea095263d462a4284af345ab80 (diff)
downloadcsaa-f15dc2baf99f2c7e1517e3370a946bbc13e89ff6.zip
csaa-f15dc2baf99f2c7e1517e3370a946bbc13e89ff6.tar.gz
csaa-f15dc2baf99f2c7e1517e3370a946bbc13e89ff6.tar.bz2
csaa-f15dc2baf99f2c7e1517e3370a946bbc13e89ff6.tar.xz
Finish up data processing scripts for new profiling method
-rw-r--r--Makefile2
-rwxr-xr-xaverage.sh6
-rwxr-xr-xgraph.gnu22
-rw-r--r--postprocess.cpp2
-rw-r--r--service_provider.c6
-rwxr-xr-xtabulate.sh58
6 files changed, 51 insertions, 45 deletions
diff --git a/Makefile b/Makefile
index 94dd005..433afbc 100644
--- a/Makefile
+++ b/Makefile
@@ -16,6 +16,6 @@ client: client.o crypto.o test.o iomt.o
server: service_provider.o crypto.o helper.o trusted_module.o main.o test.o iomt.o sqlinit.o
cc -o $@ $^ -lcrypto $(CFLAGS)
postprocess: postprocess.cpp
- c++ -o $@ $^
+ c++ -o $@ $^ $(CFLAGS)
clean:
rm -f *.o a.out client server dummy_client dummy_server postprocess
diff --git a/average.sh b/average.sh
new file mode 100755
index 0000000..7fef93d
--- /dev/null
+++ b/average.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+awk '{for(i=1;i<=NF;i++) {sum[i] += $i; sumsq[i] += ($i)^2}}
+ END {for (i=1;i<=NF;i++) {
+ printf "%f %f \n", sum[i]/NR, sqrt((sumsq[i]-sum[i]^2/NR)/NR)}
+ }'
diff --git a/graph.gnu b/graph.gnu
index 636bd1b..9f30c7b 100755
--- a/graph.gnu
+++ b/graph.gnu
@@ -1,30 +1,32 @@
#!/usr/bin/gnuplot
set xlabel "logleaves"
-set ylabel "avg time per operation (sec)"
-set yrange [0:.04]
+set ylabel "avg time per operation (μs)"
+set yrange [0:]
set style line 1 lc rgb '#0060ad' lt 1 lw 2 pt -1 ps 0
set style line 3 pt -1 ps 0
set terminal eps
set output "graph_create.eps"
-plot "results/final_data_create.txt" u 1:2:3 w yerrorbars ls 1 title "+/- 1.96 SE", '' u 1:2 w lines ls 2 title "Create", \
- "results/final_data_dummy_create.txt" u 1:2:3 w yerrorbars ls 3 title "+/- 1.96 SE", '' u 1:2 w lines ls 4 title "Dummy Create";
+plot for[i=1:4] 'results/final_data_0_'.i.'.txt' u 1:2:3 title 'Create subtime '.i w yerrorbars, \
+ for[i=1:4] 'results/final_data_0_'.i.'.txt' u 1:2 w lines ls i;
set output "graph_modify.eps"
-plot "results/final_data_modify.txt" u 1:2:3 w yerrorbars ls 1 title "+/- 1.96 SE", '' u 1:2 w lines ls 2 title "Modify", \
- "results/final_data_dummy_modify.txt" u 1:2:3 w yerrorbars ls 3 title "+/- 1.96 SE", '' u 1:2 w lines ls 4 title "Dummy Modify";
+plot for[i=1:1] 'results/final_data_1_'.i.'.txt' u 1:2:3 title 'Modify subtime '.i w yerrorbars ls 1, \
+ for[i=1:1] 'results/final_data_1_'.i.'.txt' u 1:2 w lines ls i;
set output "graph_retrieve.eps"
-plot "results/final_data_retrieve.txt" u 1:2:3 w yerrorbars ls 1 title "+/- 1.96 SE", '' u 1:2 w lines ls 2 title "Retrieve", \
- "results/final_data_dummy_retrieve.txt" u 1:2:3 w yerrorbars ls 3 title "+/- 1.96 SE", '' u 1:2 w lines ls 4 title "Dummy Retrieve";
+plot for[i=1:5] 'results/final_data_2_'.i.'.txt' u 1:2:3 title 'Retrieve subtime '.i w yerrorbars ls 1, \
+for[i=1:5] 'results/final_data_2_'.i.'.txt' u 1:2 w lines ls i;
set output "graph_modifyenc.eps"
-plot "results/final_data_modifyenc.txt" u 1:2:3 w yerrorbars ls 1 title "+/- 1.96 SE", '' u 1:2 w lines ls 2 title "Modify (encrypted)";
+plot for[i=1:1] 'results/final_data_3_'.i.'.txt' u 1:2:3 title 'Modify (encrypted) subtime '.i w yerrorbars ls 1, \
+for[i=1:1] 'results/final_data_3_'.i.'.txt' u 1:2 w lines ls i;
set output "graph_retrieveenc.eps"
-plot "results/final_data_retrieveenc.txt" u 1:2:3 w yerrorbars ls 1 title "+/- 1.96 SE", '' u 1:2 w lines ls 2 title "Retrieve (encrypted)";
+plot for[i=1:5] 'results/final_data_4_'.i.'.txt' u 1:2:3 title 'Retrieve (encrypted) subtime '.i w yerrorbars ls 1, \
+for[i=1:5] 'results/final_data_4_'.i.'.txt' u 1:2 w lines ls i;
diff --git a/postprocess.cpp b/postprocess.cpp
index 349a4ec..7fe230a 100644
--- a/postprocess.cpp
+++ b/postprocess.cpp
@@ -32,7 +32,7 @@ int main()
int x;
double y;
unsigned long long div = 1;
- cin >> x >> y >> div;
+ cin >> x >> y; // >> div;
values[x][counts[x]] = y / div;
sums[x] += values[x][counts[x]];
diff --git a/service_provider.c b/service_provider.c
index 5fc5f7d..79e6cd0 100644
--- a/service_provider.c
+++ b/service_provider.c
@@ -1087,6 +1087,8 @@ void *sp_retrieve_file(struct service_provider *sp,
{
struct file_record *rec = lookup_record(sp, file_idx);
+ prof_add(&sp->profile, "finish_lookup");
+
if(!rec || !rec->version)
{
/* Newly created file, no contents. We don't bother to set
@@ -1101,6 +1103,7 @@ void *sp_retrieve_file(struct service_provider *sp,
version = rec->version;
struct file_version *ver = lookup_version(sp, file_idx, version);
+ prof_add(&sp->profile, "finish_lookupver");
if(!ver)
{
@@ -1113,6 +1116,8 @@ void *sp_retrieve_file(struct service_provider *sp,
struct tm_cert rv1 = cert_rv_by_idx(sp->tm, sp->iomt, file_idx, &rv1_hmac);
struct tm_cert rv2 = cert_rv_by_idx(sp->tm, rec->acl, user_id, &rv2_hmac);
+ prof_add(&sp->profile, "finish_rvcerts");
+
if(hash_to_u64(rv2.rv.val) < 1)
{
free_version(ver);
@@ -1130,6 +1135,7 @@ void *sp_retrieve_file(struct service_provider *sp,
&rec->fr_cert, rec->fr_hmac,
ver->encrypted_secret, ver->kf);
}
+ prof_add(&sp->profile, "finish_retsec");
if(kf)
*kf = ver->kf;
diff --git a/tabulate.sh b/tabulate.sh
index 872d8f2..7d70b1d 100755
--- a/tabulate.sh
+++ b/tabulate.sh
@@ -1,25 +1,25 @@
#!/bin/bash
+logleaves_start=10
+logleaves_end=12
trials=2
runs_test=500
-create_times=4
-modify_times=1
-retrieve_times=1
rm -f all_*.txt dummy_all_*.txt
-for i in `seq 10 12`
+for i in `seq $logleaves_start $logleaves_end`
do
for j in `seq 1 $trials`
do
- echo -n "$i $j " >> all_"$i".txt
echo -n "$i $j " >> dummy_all_"$i".txt
-
- # 5 operations
+
+ # 5 operations in each file
for k in `seq 0 4`
do
start=$(expr $runs_test \* $k + 1)
end=$(expr $runs_test \* \( $k + 1 \))
- cat run_"$i"_"$j".txt | sed -n $start,$runs_test'p' | ../average.sh | awk '{printf($1" ");}' >> all_"$i".txt
+
+ echo -n "$i " > rundata_"$i"_"$j"_"$k".txt
+ cat run_"$i"_"$j".txt | sed -n $start,$end'p' | ../average.sh | awk '{printf($1" ");}' >> rundata_"$i"_"$j"_"$k".txt
done
echo >> all_"$i".txt
@@ -27,31 +27,23 @@ do
done
done
-rm -f data_create.txt data_modify.txt data_retrieve.txt data_modifyenc.txt data_retrieveenc.txt
-rm -f data_dummy_create.txt data_dummy_modify.txt data_dummy_retrieve.txt
-
-cat all_*.txt | awk '{
- print $1, $3, $4, $5, $6 >> "data_create.txt";
- print $1, $7 >> "data_modify.txt"
- print $1, $8 >> "data_retrieve.txt"
- print $1, $9 >> "data_modifyenc.txt"
- print $1, $10 >> "data_retrieveenc.txt"
-}'
-
-cat dummy_all_*.txt | awk '{
-runs_create=lshift(1, $1);
-runs_test='$runs_test';
-if(NF >= 5)
- print $1, $5, runs_test >> "data_dummy_create.txt";
-if(NF >= 9)
- print $1, $9, runs_test >> "data_dummy_modify.txt";
-if(NF >= 13)
- print $1, $13, runs_test >> "data_dummy_retrieve.txt";
-}'
+# generate the data files
+for k in `seq 0 4`
+do
+ rm -f "data_"$k"_"*.txt
+ for i in `seq $logleaves_start $logleaves_end`
+ do
+ for j in `seq 1 $trials`
+ do
+ cat rundata_"$i"_"$j"_"$k".txt | awk '{for(i=2;i<=NF;i++) { print $1, $i >> "data_"'$k'"_"i - 1".txt";} }'
+ done
+ done
+done
-for f in data*.txt
+for k in `seq 0 4`
do
- echo $f
- cat $f | awk '{cmd = "echo " $2 " | ../timetosec.sh"; cmd | getline sec; print $1, sec, $3;}' > sec_$f
- cat sec_$f | ../postprocess | sort -n > final_$f
+ for f in data_$k*
+ do
+ cat $f | ../postprocess > final_$f
+ done
done