#!/bin/sh
#
# Copyright (C) 2008-2009 FAUmachine Team <info@faumachine.org>.
# This program is free software. You can redistribute it and/or modify it
# under the terms of the GNU General Public License, either version 2 of
# the License, or (at your option) any later version. See COPYING.
#

grep 'CPU_SIM STAT' $1 | tail -1000000 > /tmp/x.$$

cat /tmp/x.$$ \
| sort -u \
| while read sim stat inst ; do
	echo -n $inst
	grep $inst /tmp/x.$$ | wc -l
done
echo -n "sum "
cat /tmp/x.$$ | wc -l

rm -f /tmp/x.$$
