dfb952fa78
Replace our old, clunky timing setup with a much nicer one that is only available if configured with --enable-timing. Add a tool for profiling clock differences between the nodes so you can get more precise timing measurements. I'll ask Artem to update the Github wiki with full instructions on how to use this setup. This commit was SVN r32738.
46 строки
1.1 KiB
Bash
Исполняемый файл
46 строки
1.1 KiB
Bash
Исполняемый файл
#!/bin/bash
|
|
|
|
#####################################################################
|
|
# Evaluate a floating point number expression.
|
|
|
|
function float_eval(){
|
|
float_scale=9
|
|
local stat=0
|
|
local result=0.0
|
|
if [[ $# -gt 0 ]]; then
|
|
result=$(echo "scale=$float_scale; $*" | bc -q 2>/dev/null)
|
|
stat=$?
|
|
if [[ $stat -eq 0 && -z "$result" ]]; then
|
|
stat=1;
|
|
fi
|
|
fi
|
|
echo $result
|
|
return $stat
|
|
}
|
|
|
|
if [ -z "$1" ]; then
|
|
echo "Need the name of a timing file"
|
|
exit 0
|
|
fi
|
|
|
|
thefile=$1
|
|
sed '/^$/d' $thefile > ${thefile}_tmp
|
|
sort ${thefile}_tmp > ${thefile}
|
|
|
|
read line < ${thefile}
|
|
first_ts=`echo $line | awk '{ print $1 }' | sed -e 's/s//'`
|
|
prev_ts=$first_ts
|
|
echo $first_ts
|
|
|
|
while read line ; do
|
|
cur_ts=`echo $line | awk '{ print $1 }' | sed -e 's/s//'`
|
|
dif1=`float_eval "$cur_ts - $first_ts"`
|
|
dif2=`float_eval "$cur_ts - $prev_ts"`
|
|
newline=`echo $line | sed -e "s/$cur_ts/$dif1:$dif2/"`
|
|
prev_ts=$cur_ts
|
|
echo $newline
|
|
done < ${thefile} > ${thefile}_tmp
|
|
|
|
cat ${thefile}_tmp > ${thefile}
|
|
|
|
rm -f ${thefile}_tmp |