#!/bin/csh -f
#
# extras - print summary extraneous reads and writes in a test case
#
set usage='usage: extras foo.sim[gz]... '
#
# Part of
#              The STARFISH Parallel file-system simulator
#        (Simulation Tool for Advanced Research in File Systems)
# 
#                               David Kotz
#                           Dartmouth College
#                              Version 3.0
#                              October 1996
#                          dfk@cs.dartmouth.edu

if ($#argv == 0) then
    echo "$usage"
    exit 1
endif

foreach i ($*)
    if ($i =~ */wr*) then
	# it's a read pattern, expect 1280 reads and no writes
	set reads=1280
        set writes=0
    else
	# it's a write pattern, expect 1280 writes and no reads
	set reads=0
        set writes=1280
    endif

    set readwrite=`simex -sim $i -noheader -noname -sum diskread diskwrite`
    echo $readwrite $i | dm x1-$reads x2-$writes s3
end
