aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile6
-rw-r--r--graph.gnu24
-rw-r--r--iomt.c1
-rw-r--r--postprocess.cpp43
-rwxr-xr-xtabulate.sh24
-rwxr-xr-xtestmain.sh8
-rwxr-xr-xtimetosec.sh2
7 files changed, 97 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 38359d2..982a51a 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-all: client server dummy_client dummy_server
+all: client server dummy_client dummy_server postprocess
CFLAGS = -g -Wall -Wformat-overflow=0 -O3 -lsqlite3 -ftrapv
sqlinit.c: sqlinit.txt
@@ -15,5 +15,7 @@ client: client.o crypto.o test.o iomt.o
cc -o $@ $^ -lcrypto $(CFLAGS)
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 $@ $^
clean:
- rm -f *.o a.out client server dummy_client dummy_server
+ rm -f *.o a.out client server dummy_client dummy_server postprocess
diff --git a/graph.gnu b/graph.gnu
new file mode 100644
index 0000000..e744081
--- /dev/null
+++ b/graph.gnu
@@ -0,0 +1,24 @@
+set xlabel "logleaves"
+set ylabel "avg time per operation (sec)"
+
+set terminal eps
+
+set output "graph_create.eps"
+
+plot "results/final_data_create.txt" u 1:2 w lines title "Create";
+
+set output "graph_modify.eps"
+
+plot "results/final_data_modify.txt" u 1:2 w lines title "Modify";
+
+set output "graph_retrieve.eps"
+
+plot "results/final_data_retrieve.txt" u 1:2 w lines title "Retrieve";
+
+set output "graph_modifyenc.eps"
+
+plot "results/final_data_modifyenc.txt" u 1:2 w lines title "Modify (enc)";
+
+set output "graph_retrieveenc.eps"
+
+plot "results/final_data_retrieveenc.txt" u 1:2 w lines title "Retrieve (enc)";
diff --git a/iomt.c b/iomt.c
index 10774ea..fca951e 100644
--- a/iomt.c
+++ b/iomt.c
@@ -604,6 +604,7 @@ struct iomt *iomt_new_from_db(void *db,
and_clauses);
sqlite3_prepare_v2(db, sql, -1, &tree->db.findleaf, 0);
+ /* These both need table scans. FIXME */
sprintf(sql, "SELECT LeafIdx, Idx, NextIdx, Val FROM %s WHERE ( ( Idx < ?3 AND ?3 < NextIdx ) OR ( NextIdx < Idx AND Idx < ?3 ) OR ( ?3 < NextIdx AND NextIdx < Idx ) )%s;",
tree->db.leaves_table,
and_clauses);
diff --git a/postprocess.cpp b/postprocess.cpp
new file mode 100644
index 0000000..c57d9ff
--- /dev/null
+++ b/postprocess.cpp
@@ -0,0 +1,43 @@
+#include <iostream>
+#include <stdio.h>
+using namespace std;
+
+/* post-process the output of tabulate.sh */
+/* input:
+ [x1] [y1_0]
+ [x1] [y1_1]
+ ...
+ [x2] [y2_0]
+ [x2] [y2_1]
+ ...
+ [x] is an integer up to 100
+*/
+/* output:
+ [x1] [average y1]/2^[x1] [stddev y1]
+*/
+
+static double sums[100] = { 0 }, means[100] = { 0 }, deltasq[100] = { 0 };
+static int counts[100] = { 0 };
+
+int main()
+{
+ while(cin)
+ {
+ int x;
+ double y;
+ cin >> x >> y;
+
+ long long div = 1 << x;
+
+ sums[x] += y / div;
+ counts[x]++;
+ }
+ for(int i = 0; i < 100; ++i)
+ {
+ if(counts[i])
+ {
+ means[i] = sums[i] / counts[i];
+ printf("%d %g\n", i, means[i]);
+ }
+ }
+}
diff --git a/tabulate.sh b/tabulate.sh
index 4d10f73..abb6ed3 100755
--- a/tabulate.sh
+++ b/tabulate.sh
@@ -1,11 +1,25 @@
#!/bin/bash
-for i in `seq 10 62`
+for i in `seq 4 10`
do
- rm -f run_"$i".txt
- for j in `seq 1 40`
+ rm -f all_"$i".txt
+ for j in `seq 1 3`
do
- echo -n "$i $j " >> run_"$i".txt
- cat run_"$i"_"$j".txt | awk '/Elapsed/ || /Maximum/ || /User time/ || /System time/' | awk 'BEGIN{line=0}{if(line%4<=1)printf($4" ");if(line %4==2)printf($8" ");if(line%4==3)printf($6" ");}{line+=1}END{printf("\n");}' >> run_"$i".txt
+ echo -n "$i $j " >> all_"$i".txt
+ cat run_"$i"_"$j".txt | awk '/Elapsed/ || /Maximum/ || /User time/ || /System time/' | awk 'BEGIN{line=0}{if(line%4<=1)printf($4" ");if(line %4==2)printf($8" ");if(line%4==3)printf($6" ");}{line+=1}END{printf("\n");}' >> all_"$i".txt
done
+done
+
+rm -f data_create.txt data_modify.txt data_retrieve.txt data_modifyenc.txt data_retrieveenc.txt
+cat all_*.txt | awk '{print $1, $5 >> "data_create.txt";
+ print $1, $9 >> "data_modify.txt"
+ print $1, $13 >> "data_retrieve.txt"
+ print $1, $17 >> "data_modifyenc.txt"
+ print $1, $21 >> "data_retrieveenc.txt"
+}'
+for f in data*.txt
+do
+ echo $f
+ cat $f | awk '{cmd = "echo " $2 " | ../timetosec.sh"; cmd | getline sec; print $1, sec}' > sec_$f
+ cat sec_$f | ../postprocess | sort -n > final_$f
done
diff --git a/testmain.sh b/testmain.sh
index 2c54dad..6a63c64 100755
--- a/testmain.sh
+++ b/testmain.sh
@@ -1,8 +1,8 @@
#!/bin/bash
mkdir -p results
-trials=1
+trials=3
-for i in `seq 8 16`
+for i in `seq 2 16`
do
echo "logleaves "$i
@@ -16,7 +16,7 @@ do
sleep .2
# dummy
- ./testdummy.sh $i $runs 2> results/dummy_"$i"_"$j".txt
- sleep .2
+ #./testdummy.sh $i $runs 2> results/dummy_"$i"_"$j".txt
+ #sleep .2
done
done
diff --git a/timetosec.sh b/timetosec.sh
new file mode 100755
index 0000000..7264dcd
--- /dev/null
+++ b/timetosec.sh
@@ -0,0 +1,2 @@
+#!/bin/bash
+awk -F: '{ print ($1 * 60) + $2 }'