.RM 80
.lit
 			PROGRAM ACL
 			***********
 
 
 	SYSTEM ACTIVITY ACCOUNTING PROGRAM
 
 	THE INFORMATION CAPTURING PROGRAM  "..ACL." WAS ORIGINALLY
 	WRITTEN BY DENNIS TING OF THE TORONTO DEC OFFICE.
 
 
 	NOTES --
 
      -	ALL .MAC .FTN .TSK ETC. ASSOCIATED FILES RESIDE IN UIC [1,200].
 	THE ACCOUNTING OUTPUT IS ALWAYS DIRECTED TO A DISK FILE...
  
 		SY0:[1,6]ACCLOG.SYS
  
 	THE ACCOUNTING PROCESS AS EXPECTED WILL ACCESS THIS FILE 
 	FREQUENTLY IN AN APPEND MODE.  THE PROGRAM IS SET UP TO FIRST
 	OPEN A NEW ACCLOG.SYS FILE,  EACH ENTRY IS FORCED TO THE DISK
 	AT THE TIME OF THE EVENT (TASK TERMINATION, SYSTEM USAGE REPORT).
 	THIS WAY IF THE SYSTEM CRASHES, ONLY THE DATA ASSOCIATED WITH
 	THE TASKS ACTIVE AT THE TIME OF THE CRASH WILL BE LOST.  THE
 	PROGRAM IS SUPPOSED TO BE CLEVER ENOUGH NOT TO HAVE TO RE-READ
 	THE DISK FILE FOR EACH ENTRY, JUST WRITE NEW APPENDED DATA TO 
 	THE "DISK" BLOCK HELD IN MEMORY.
  
      - EVERY TASK TERMINATION GENERATES AN ENTRY TO THE ACCLOG.SYS
 	FILE.  THIS INCLUDES ALL SYSTEM TASKS AS WELL AS USER TASKS
 	EG. MCR, SYS, SHF, ETC.  OUR SYSTEM, AN 11/45 WITH..
   
 		2 X RP04, 2 X TU10, DH11 AND 7 TERMINALS.
  
 		THE INFORMATION CAPTURING PROGRAM "..ACL." AND IT'S
 		SHUTDOWN PROGRAM "ACF" ARE WRITTEN IN MACRO.  ALL OF
 		THE ADDITIONAL PROGRAMS FOR REPORTING ETC. ARE WRITTEN
 		IN FORTRAN IV-PLUS.
  
 	ABOUT  500 TO 1500 BLOCKS OF ACCOUNTING INFORMATION ARE GEN-
 	ERATED DURING A NORMAL 24 HOUR DAY.  MOST OF THIS SPACE IS 
 	OCCUPIED BY ENTRIES FOR ...SHF.  
  
 	THE ..ACL. PROGRAM GENERATES A SYSTEM USAGE ENTRY INTO THE
 	FILE ACCLOG.SYS EVERY 1/2 HOUR INDICATING BASICALLY THE
 	AMOUNT OF TIME SPENT IN  USER,SYSTEM AND IDLE STATES.
  
 	BECAUSE OF THE BULK OF DATA BEING ACCUMULATED,  WE DECIDED THAT
 	WE WOULD PERIODICALLY DO A "COMPRESS" OF THE ACCLOG.SYS FILE.
 	IN EFFECT, WHAT IS DONE, ON A HALF HOURLY BASIS, UNDER EACH
 	UIC, FOR EACH TASK, WE SUM ALL THE ACTIVITY AND OUTPUT A
 	SINGLE RECORD TO A TASK FILE CALLED...
 	
 			[1,6]MMDDHH.PAC
 
 	MM = 2 DIGIT MONTH,  DD = 2 DIGIT DAY,  HH = 2 DIGIT HOUR.
 
 	THE SYSTEM ACTIVITY DATA IS OUTPUT TO A SEPARATE FILE CALLED...
 
 			[1,6]MMDDHH.KAC   --   KERNAL ACTIVITY.
 
      - PROGRAM ..ACL. "HOOKS" INTO VARIOUS PARTS OF THE OPERATING
 	SYSTEM AND THEREFORE IF ABORTED,  WILL CRASH THE SYSTEM.
  	A VERY SMALL PROGRAM ...ACF CAN BE INVOKED TO SHUT DOWN
 	THE ACL PROGRAM PEACEFULLY,  IT FLAGS ..ACL. THAT IT
 	IS TIME TO GO AND ACL SHUTS ITSELF DOWN.
 
 	TWO VERSIONS OF ..ACL. EXIST, THEY ARE FOR USE WITH
 	RSX11M V3.0 AND V3.1  (CALLED ACL18 & ACL22).  THESE
 	ROUTINES WILL HAVE TO BE MODIFIED (IF POSSIBLE) FOR
 	USE WITH V3.2 AND M-PLUS.  THE SUPPORT PROGRAMS
 	WILL NOT REQUIRE MODIFICATION.
  
      - A FORTRAN-V-PLUS PROGRAM CALLED ...CPR IS USED TO COMPRESS 
 	OUTPUT OF THE PROGRAM ..ACL. OUTPUT.  THIS TASK SHOULD BE
 	INSTALLED AND SCHEDUALED TO RUN EVERY 6 OR 12 HOURS.
 	(MORE FREQUENTLY IF LIMITED DISK SPACE IS AVAILABLE).
  
 	THE PROGRAM ...CPR SEQUENCE OF EVENTS FOLLOW...
  
  		- SHUT OFF PROGRAM ..ACL. BY INVOKING PROGRAM ..ACF
 		- OPEN FILE [1,6]ACCLOG.SYS;(LATEST VERSION)
 		  WITH A DISPOSITION OF DELETE ON EXIT.
 		- RE-INITIATE PROGRAM ..ACL.
 		- READ THROUGH THE ACCLOG.SYS FILE COPYING
 		  THE PROGRAM DATA TO A SCRATCH RANDOM ACCESS
 		  DATA FILE.  ALSO, OUTPUTTING ANY KERNAL
 		  ACTIVITY TO THE MMDDHH.KAC FILE.
 		- ASSEMBLE THE DATA FROM THE SCRATCH FILE
 		  OUTPUTTING TO FILE MMDDHH.PAC IN AN ORDERLY
 		  COMPRESSED FORM.
  		- EXITING (AT WHICH TIME THE ACCLOG.SYS FILE
 		  IS DELETED).
 
      - ANOTHER PROGRAM CALLED ACLSUM (ALSO FORTRAN) WILL SIMPLY
 	PRINT OUT THE DATA CONTAINED IN THE ACCLOG.SYS FILE.
  
      - IN OUR STARTUP COMMAND FILE, WE HAVE --
  
 		>INS [1,200]ACF
 		>INS [1,200]ACL22
 		>INS [1,200]CPR
 		>SET /UIC=[1,6]
 		>RUN ..ACL.
 		>RUN ...CPR 6H/RSI=6H
  
 	THIS INITIATES THE ACCOUNTING PROCESS AT STARTUP TIME
 	AND SCHEDUALS A COMPRESSION OF THE ACCOUNTING DATA EVERY
 	SIX HOURS.
 
      - PROGRAM ...CPR MAY BE ACTIVATED 3 WAYS...
 
  		1) >CPR
 			THIS IS THE NORMAL RUN WHERE ACF IS INITIATED
 			ACL DIES, THE ACCOUNTING FILE IS OPENED,
 			ACL IS RE-STARTED AND THE COMPRESSION TAKES
 			PLACE.
 
 		2) >CPR END
 			THIS COMMAND IS IN OUR SHUTUP.CMD FILE AS FOLLOWS,
  
 				>SET /UIC=[1,6]
 				>CPR END
  
 			THIS IS THE SAME AS 1) EXCEPT THAT ..ACL. IS
 			NOT RE-STARTED.
 
 		3) >CPR ACCLOG.SYS;4
  			THIS WILL COMPRESS FILE ACCLOG.SYS;4.
 			IT WILL NOT AFFECT THE CURRENT OPERATION
 			OF PROGRAM ..ACL. IN ANY WAY.  ITS NORMAL
 			USAGE IS FOR COMPRESSING ACLLOG.SYS FILES
 			THAT WERE OPEN DURING A SYSTEM CRASH (AFTER
 			UNLOCKING THEM).
  
      - PERIODICALLY AND ESPECIALLY AT THE END OF EACH MONTH, THE ".KAC"
 	AND ".PAC" FILES SHOULD BE APPENDED TO A MONTHLY ACCUMULATION
 	FILE USING PIP.
 
  		>PIP KERN##YY.ACL/AP=MMDDHH.KAC
 		>PIP PROG##YY.ACL/AP=MMDDHH.PAC
 
 	** THIS MUST BE DONE IN CRONALOGICAL ORDER,  ##  IS A 2 DIGIT
 	   NUMBER REPRESENTING THE MONTH.  YY IS A 2 DIGIT YEAR.
 
      - NO TERMINAL USAGE IE LOGON AND LOGOFF IS ACCOUNTED FOR.
 
      - ANOTHER QUICKIE PROGRAM CALLED ...SRP WILL GENERATED A
 	PRINTER GRAPH FROM THE KERN##YY.ACL FILE.
    
      - PROGRAM ..ACL. CURRENTLY WILL USE UP 32 WORDS (I THINK)
 	OF DSR FOR EACH TASK THAT IS ACTIVE UP TO A MAXIMUM OF
 	24 TASKS.  
 
      - ALL TIMES IN THE ACCOUNTING FILE DATA ARE IN TICKS EXCEPT
 	FOR THE HHMMSS IN THE 1/2 HOUR KERNAL DATA.  ALL DEVICE
 	ACTIVITY IS IN TERMS OF COUNT OF QIO CALLS.
 
      - THE COMPRESSION PROGRAM REDUCES THE TASK NAMES TO 3 
 	CHARACTERS.  THE ONLY EXCEPTION TO THIS IS WHEN A 
 	TASK IS NOT INSTALLED AND INVOKED USING >RUN PROG.
 	THIS WILL BE INTERCEPTED BY ..ACL. AS PROGRAM
 	TT##,  IN THIS CASE, THE TASK NAME IS SIMPLY CHANGED
 	TO TT .
  
      - LOOK AT PROGRAM ACCLOG TO DERIVE THE FORMAT OF THE
 	ACLLOG.SYS DATA STRUCTURE.  
 
 			**** N O T E ****
  
 	THERE SEEMS TO BE A VERY DEVIOUS BUG IN THE ACCOUNTING PAROGRAM.
 	WHEN THE SYSTEM IS VERY HEAVILY IN USE,  THE ACL PROGRAM WILL
 	CRASH.  WHEN THIS HAPPENS,  A CHUNK OF POOL SPACE IS LOST AND
 	CANNOT BE RECOVERED UNLESS WE REBOOT.  
  
 
 	A PROGRAM "MJP" HAS BEEN WRITTEN TO GENERATE A MONTHLY COSTING
 	SUMMARY BY PROGRAM NAME WITHIN EACH UIC.  IT HAS JUST RECENTLY
 	BEEN WRITTEN. THERE DOESN'T SEEM TO BE ANY BAD BUGS BUT,  THERE
 	ARE SOME DOUBTS AS TO WHETHER THE PROGRAM DISTRIBUTES COSTS
 	CORRECTLY.  IN OUR CASE,  ALL "PROJECTS" ARE ASSOCIATED WITH
 	UIC'S > GROUP #10,  THEREFORE, ANY ACTIVITY WITHIN GROUPS
 	1 THROUGH 7 ARE ASUMED TO BE OVERHEAD AND THESE COSTS ARE
 	DISTRIBUTED TO EACH UIC'S COST BY BASIS OF EACH LEVEL OF 
 	ACTIVITY.
 
				FEB. - 1980
 				RAY WHITTON
 				QUESTOR SURVEYS LTD.,
 				755-1141
      - FOR THE FORTRAN AND MACRO PROGRAMS,  ALL TKB, F4P AND
 	MAC ".CMD" FILES HAVE BEEN INCLUDED.
  
  
   				GOOD LUCK
