First/parse_log.sh

14 lines
492 B
Bash
Raw Normal View History

#!/bin/sh
set -eu
if ! [ "$#" = 1 ]
then
echo $0 \<simlog json file\>
exit 1
fi
CYCLES=$(cat "$1" | json2tsv | sed -n '/^\.end_of_simulation_data\.cycles_run_for\t/s/\.end_of_simulation_data\.cycles_run_for\tn\t//p' )
INSTRUCTIONS=$(cat "$1" | json2tsv | sed -n '/^\.end_of_simulation_data\.instructions_executed\t/s/\.end_of_simulation_data\.instructions_executed\tn\t//p' )
echo executed $INSTRUCTIONS instructions with an IPC=$(echo "$INSTRUCTIONS/$CYCLES" | bc -l|grep -o '^.*\...')