From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  2-NOV-1989 19:31
To:	MRGATE::"ARISIA::EVERHART"
Subj:	Spinlock monitoring program, part 3 of 3

Received: From UCBVAX.BERKELEY.EDU by GIZMO.SRI.COM with TCP; Wed,  1 NOV 89 18:01:58 PDT
Received: by ucbvax.Berkeley.EDU (5.61/1.39)
	id AA23533; Wed, 1 Nov 89 17:48:19 -0800
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 1 Nov 89 17:05:28 GMT
From: amdahl!rtech!jim@ames.arc.nasa.gov  (Jim Gessling)
Organization: Relational Technology Inc. Alameda, CA 94501
Subject: Spinlock monitoring program, part 3 of 3
Message-Id: <3956@rtech.rtech.com>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com


+-+-+-+ Beginning of part 3 +-+-+-+
X`009CALLG`009QIO_PARAM, G`094SYS$QIO`009; output it
X`009MOVW`009#100, FAOO
X;
X; figure out how many characters to draw in bar. 40 chars = whole bar
X`009CVTLF`009RANGE, -(SP)
X`009DIVF3`009#40.0, (SP), -(SP)
X`009CVTLF`009(R5), R4
X`009DIVF3`009(SP), R4, R6`032
X`009CVTFL`009R6, R4
X`009CMPL`009R4, #40`009`009`009; limit to 40
X`009BLEQ`00930$
X`009MOVL`009#40, R4
X30$:`009PUSHL`009R4
X`009PUSHL`009R2
X`009PUSHAB`009FAOO                          `032
X`009PUSHAW`009FAOO
X`009PUSHAB`009BAR
X`009CALLS`009#5, G`094SYS$FAO`009`009; fao it
X`009MOVZWL`009FAOO, QIO_PARAM+32
X`009MOVL`009FAOO+4, QIO_PARAM+28
X`009CALLG`009QIO_PARAM, G`094SYS$QIO`009; output it
X`009MOVW`009#100, FAOO
X;
X`009ADDL`009#LBLOCK_SIZE, R3
X`009ADDL`009#2, R2
X`009CMPL`009#25, R2
X`009BEQL`00940$
X`009BRW`00910$`009
X
X; blank out the rest of the bars
X20$:`009PUSHL`009R2
X`009PUSHAB`009FAOO
X`009PUSHAW`009FAOO
X`009PUSHAB`009BLANK
X`009CALLS`009#4, G`094SYS$FAO
X`009MOVZWL`009FAOO, QIO_PARAM+32
X`009MOVL`009FAOO+4, QIO_PARAM+28
X`009CALLG`009QIO_PARAM, G`094SYS$QIO`009; output`032
X`009MOVW`009#100, FAOO
X`009ADDL`009#2, R2
X`009CMPL`009#25, R2
X`009BNEQ`00920$
X`009
X; done`009`009
X40$:`009MOVL`009#1, R0
X`009RET
X
X;
X; main routine, simple loop for each option
X`009.ENTRY`009spinlock,0
X
X; be sure we are on an SMP system
X`009MOVZBL`009SGN$GB_MULTIPROCESSING, R4`009; check multiprocessing param`032
X`009CMPL`009R4, #1`009`009`009; 1 means full checking loaded
X`009BEQL`00910$`009
X`009PUSHL`009#SPINLOCK_NOTSMP`009; blow out if not SMP
X`009CALLS`009#1, G`094LIB$SIGNAL`009`009
X                                                           `032
X10$:
X; set up for terminal output
X`009JSB`009INITIO`009
X; get command line parameters, wait_time, display_type and range
X`009CALLS`009#0, GET_PARAM
X;
X; set up data structure, in kernel mode to count locks
X`009$CMKRNL_S  COUNT_LOCKS
X`009BLBS`009R0, 15$
X`009$EXIT_S CODE=R0`009
X
X15$:`009MOVL`009R1, NUM_LOCKS`009`009`009`009; pass count back
X
X`009CALLS`009#0, GET_MEM
X`009$CMKRNL_S  GET_DATA`009`009; initial load of data structure
X`009BLBS`009R0, 17$
X`009$EXIT_S CODE=R0`009
X
X17$:`009CALLS`009#0, DISPLAY_SCREEN `009; draw empty screen
X
X20$:`009PUSHAF`009WAIT_TIME`009
X`009CALLS`009#1, G`094LIB$WAIT`009`009; wait for next go round
X
X`009$CMKRNL_S UPDATE_DATA`009`009; update counters
X
X`009CALLS`009#0, SORT_DATA`009`009; sorts based on display type
X
X`009CALLS`009#0, UPDATE_SCREEN`009; draw new stuff on screen
X
X`009BRB`00920$
X
X`009MOVL`009#1, R0
X`009RET
X
X`009.END`009spinlock
$ GOSUB UNPACK_FILE

$ FILE_IS = "SPINLOCK_ERR.MSG"
$ CHECKSUM_IS = 271213154
$ COPY SYS$INPUT VMS_SHARE_DUMMY.DUMMY
X`009  .Title`009SPINLOCK error messages
X
X! written by jjgessling, December, 1988
X
X`009  .Facility`009SPINLOCK,667/PREFIX=SPINLOCK_
X`009  .Ident`009'SPINLOCK Version 1.0'
X
X     .Severity  fatal
X
X`009NOTSMP       <Full checking SMP not loaded, nothing to monitor>
X        NOCLI        <Error accessing command line>
X`009NOTDONE`009     <This option not done yet, just you wait>
X
X     .Severity`009error
X
X     .Severity warning
X
X     .End
$ GOSUB UNPACK_FILE
$ EXIT
-+-+-+-+-+ End of part 3 +-+-+-+-+-

