Skip to content

Commit

Permalink
set cpu profiling variable
Browse files Browse the repository at this point in the history
  • Loading branch information
syncall committed Oct 28, 2023
1 parent fab8570 commit 1e5197e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions code/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
build: finalization
environment:
- EXPERIMENT=${EXPERIMENT}
- CPU_PROFILING=${CPU_PROFILING}
- DEVIATION_ANALYSIS=${DEVIATION_ANALYSIS}
volumes:
- ${HOST_DIR}:/srv/
Expand Down
1 change: 1 addition & 0 deletions code/docker/run_final_analyse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[[ -z "$HOST_DIR" ]] && echo "Need to set HOST_DIR" && exit 1;
[[ -z "$OUT_DIR" ]] && echo "Need to set OUT_DIR" && exit 1;
[[ -z "$CPU_PROFILING" ]] && echo "Need to set CPU_PROFILING" && exit 1;

COMPOSE_FILE=docker-compose.yml

Expand Down
2 changes: 1 addition & 1 deletion code/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def main(input_dirs: List[str], output_dir: str, cpu_profiling: bool, deviation_
logging.info(f'Starting Pre-Analyse of {experiment}')
run_analysis(input_dir, output_dir / experiment, cpu_profiling, 'run_pre_analyse.sh', experiment, deviation_analysis)
logging.info(f'Starting Final-Analyse of {experiment}')
run_analysis(output_dir / experiment, output_dir / f'{experiment}-final', False, 'run_final_analyse.sh', experiment, deviation_analysis)
run_analysis(output_dir / experiment, output_dir / f'{experiment}-final', cpu_profiling, 'run_final_analyse.sh', experiment, deviation_analysis)


if __name__ == '__main__':
Expand Down
4 changes: 1 addition & 3 deletions code/evaluator/evaluate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ parallel -j $PARALLEL_JOBS "dropdb --if-exists root{%}; createdb root{%}; export

python3 /opt/dbscripts/run_tls_analyse.py /srv/timestamper /out

if [ "$CPU_PROFILING" = "True" ]
then

if [[ "$CPU_PROFILING" == "True" ]]; then
for filename in /srv/server/perf*.data; do
mkdir /root/.debug/
tar xf "/srv/server/perf-server.data.tar_$(basename ${filename##*_} .data).bz2" -C ~/.debug
Expand Down
5 changes: 4 additions & 1 deletion code/finalization/create-analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def extract_run(file_name: str):
def analyze_dir(result_dir: pathlib.Path, output_writer: csv.DictWriter):
results = defaultdict(lambda: dict())
result_name = os.path.basename(result_dir)
full_sphincs = False

for file_name in os.listdir(result_dir):
result_file = result_dir / file_name
Expand All @@ -153,6 +154,8 @@ def analyze_dir(result_dir: pathlib.Path, output_writer: csv.DictWriter):
results[run]['kem'] = kem.replace('_', '\\_')
sig = run_vars.get('sig_alg')
results[run]['sig'] = sig.replace('_', '\\_')
if 'sphincssha' in sig:
full_sphincs = True

if run_vars.get('tc') is not None:
results[run]['trafficEmulation'] = run_vars.get('tc')
Expand Down Expand Up @@ -258,7 +261,7 @@ def analyze_dir(result_dir: pathlib.Path, output_writer: csv.DictWriter):
run['kem'] = 'p256'
sig: str = run['sig']

if ('sphincs' not in result_name) and 'sphincsharaka' in sig:
if not full_sphincs and 'sphincsharaka' in sig:
sig = sig.replace('haraka', '').replace('fsimple', '')
run['sig'] = sig

Expand Down
4 changes: 3 additions & 1 deletion code/finalization/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ if [[ $DEVIATION_ANALYSIS == "True" ]]; then
/opt/create-deviation-plot.py $out_name/derivations.csv $out_name/deviations
fi

/opt/eval_profiling.py /srv > $out_name/latencies.csv $out_name/profiling.csv
if [[ "$CPU_PROFILING" == "True" ]]; then
/opt/eval_profiling.py /srv > $out_name/latencies.csv $out_name/profiling.csv
fi

0 comments on commit 1e5197e

Please sign in to comment.