#!/bin/bash

tool="./alloc-analyser"
trace_dir_1="../../malloc-benchmarks"
trace_dir_2="trace/glibc"
report_dir="../../malloc-benchmarks/doc/report"

program[0]="cfrac"
program[1]="espresso"
program[2]="perl"
program[3]="ghostscript"
program[4]="ls"
program[5]="inkscape"
program[6]="gimp"
program[7]="deluge"
program[8]="vlc"
program[9]="audacity"

COUNTER=0;
while [ $COUNTER -lt ${#program[@]} ]; do
	for i in $( ls ../../malloc-benchmarks/${program[$COUNTER]}/trace/glibc); do
		$tool $trace_dir_1/${program[$COUNTER]}/$trace_dir_2/$i $report_dir/report-$i.htm
	done
	echo "Report of" ${program[$COUNTER]} "are done."
	let COUNTER=COUNTER+1
done

exit 0
