From: John L. <mov...@us...> - 2001-09-06 19:06:26
|
Update of /cvsroot/oprofile/oprofile/dae In directory usw-pr-cvs1:/tmp/cvs-serv4674/dae Modified Files: op_start Log Message: extra sanity checks in op_start Index: op_start =================================================================== RCS file: /cvsroot/oprofile/oprofile/dae/op_start,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- op_start 2001/09/06 18:13:28 1.39 +++ op_start 2001/09/06 19:06:22 1.40 @@ -76,7 +76,6 @@ # we can now default define individual counter setup variable. f=0 while (( $f < $OP_MAX_COUNTERS )); do - CTR_COUNT[$f]=600000 CTR_USER[$f]=1 CTR_KERNEL[$f]=1 f=$(($f+1)) @@ -252,12 +251,22 @@ f=0 while (( $f < $OP_MAX_COUNTERS )); do if [[ ${#CTR_EVENT[$f]} != 0 ]]; then + if [ -z "${CTR_COUNT[$f]}" ]; then + echo "Event but no count specified for counter $f" + exit 1 + fi CTR_EVENT_VAL[$f]=`op_help --cpu-type=$CPUTYPE ${CTR_EVENT[$f]}` if [ -z "${CTR_EVENT_VAL[$f]}" -a ! -z "${CTR_EVENT[$f]}" ]; then echo "Unknown event \"${CTR_EVENT[$f]}\"" exit 1 fi + else + if [ ! -z "${CTR_COUNT[$f]}" ]; then + echo "Count but no event specified for counter $f" + exit 1 + fi fi + f=$(($f+1)) done |