

; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 1

;

;	0001	MODULE PMS (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'X0003'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  F11ACP Structure Level 1

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This module contains the local performance measurement data base

;	0033	!	and the performance metering routines.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines.

;	0039	!

;	0040	!--

;	0041	!

;	0042	!

;	0043	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  25-Aug-1977  11:30

;	0044	!

;	0045	! REVISION HISTORY:

;	0046	!

;	0047	!   Andrew C. Goldstein, 12-Dec-1977  13:59

;	0048	!   X0002 - Eliminate race conditions between multiple ACP's

;	0049	!

;	0050	!   Andrew C. Goldstein, 22-Feb-1978  9:28

;	0051	!   X0003 - Modify for structure level 2

;	0052	!

;	0053	!**

;	0054	

;	0055	



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 1-1

;

;	0056	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0057	REQUIRE 'SRC$:FCPDEF.B32';

;	0406	

;	0407	

;	0408	FORWARD ROUTINE

;	0409		PMS_START	: NOVALUE,	! start measuring main function

;	0410		PMS_END		: NOVALUE,	! end measuring main function

;	0411		PMS_START_SUB	: NOVALUE,	! start measuring subfunction

;	0412		PMS_END_SUB	: NOVALUE;	! end measuring subfunction



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 2

;

;	0413	!+

;	0414	!

;	0415	! The performance measurement data base consists of the accounting array in

;	0416	! system space, as well as some local storage to keep intermediate figures.

;	0417	! The data accumulated per function (and also broken out for significant

;	0418	! subfunctions) includes the number of functions executed, the number of

;	0419	! modifiers, the number of disk reads, disk writes, and cache reads, the

;	0420	! amount of CPU time, and the number of page faults.

;	0421	!

;	0422	!-

;	0423	

;	0424	!

;	0425	! System space data array. Each measured parameter is contained in a vector

;	0426	! with one entry per function.

;	0427	!

;	0428	

;	0429	EXTERNAL

;	0430		PMS$GL_FCP2	: VECTOR ADDRESSING_MODE (ABSOLUTE);

;	0431						! base of FCP measurement array

;	0432	

;	0433	BIND

;	0434		PMS$GL_COUNT	= PMS$GL_FCP2 + 0	: VECTOR [10],

;	0435		PMS$GL_MCNT	= PMS$GL_FCP2 + 40	: VECTOR [10],

;	0436		PMS$GL_READ	= PMS$GL_FCP2 + 80	: VECTOR [10],

;	0437		PMS$GL_WRITE	= PMS$GL_FCP2 + 120	: VECTOR [10],

;	0438		PMS$GL_CACHE	= PMS$GL_FCP2 + 160	: VECTOR [10],

;	0439		PMS$GL_CPU	= PMS$GL_FCP2 + 200	: VECTOR [10],

;	0440		PMS$GL_PFA	= PMS$GL_FCP2 + 240	: VECTOR [10];

;	0441	

;	0442	!

;	0443	! Running totals maintained by FCP routines.

;	0444	!

;	0445	

;	0446	GLOBAL

;	0447		PMS_TOT_READ,			! total disk reads

;	0448		PMS_TOT_WRITE,			! total disk writes

;	0449		PMS_TOT_CACHE;			! total cache reads

;	0450	

;	0451	!

;	0452	! Base values of parameters at start of this function.

;	0453	!

;	0454	

;	0455	OWN

;	0456		PMS_FNC_READ,

;	0457		PMS_FNC_WRITE,

;	0458		PMS_FNC_CACHE,

;	0459		PMS_FNC_CPU,

;	0460		PMS_FNC_PFA;

;	0461	

;	0462	!

;	0463	! Base values of parameters at start of current subfunction.

;	0464	!

;	0465	

;	0466	

;	0467	GLOBAL



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 2-1

;

;	0468		PMS_SUB_NEST;			! nested subfunction flag

;	0469	

;	0470	OWN

;	0471		PMS_SUB_FUNC,			! subfunction code

;	0472		PMS_SUB_READ,

;	0473		PMS_SUB_WRITE,

;	0474		PMS_SUB_CACHE,

;	0475		PMS_SUB_CPU,

;	0476		PMS_SUB_PFA;



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 3

;

;	0477	GLOBAL ROUTINE PMS_START : NOVALUE =

;	0478	

;	0479	!++

;	0480	!

;	0481	! FUNCTIONAL DESCRIPTION:

;	0482	!

;	0483	!	This routine initiates measurement for the main function being executed.

;	0484	!

;	0485	!

;	0486	! CALLING SEQUENCE:

;	0487	!	PMS_START ()

;	0488	!

;	0489	! INPUT PARAMETERS:

;	0490	!	NONE

;	0491	!

;	0492	! IMPLICIT INPUTS:

;	0493	!	NONE

;	0494	!

;	0495	! OUTPUT PARAMETERS:

;	0496	!	NONE

;	0497	!

;	0498	! IMPLICIT OUTPUTS:

;	0499	!	NONE

;	0500	!

;	0501	! ROUTINE VALUE:

;	0502	!	NONE

;	0503	!

;	0504	! SIDE EFFECTS:

;	0505	!	NONE

;	0506	!

;	0507	!--

;	0508	

;	0509	BEGIN

;	0510	

;	0511	LOCAL

;	0512		PROCESS_HEADER	: REF BBLOCK;	! pointer to FCP process header

;	0513	

;	0514	EXTERNAL

;	0515		CTL$GL_PHD	: REF BBLOCK ADDRESSING_MODE (ABSOLUTE);

;	0516						! address of process header in control region

;	0517	

;	0518	

;	0519	! To initialize measurement, we take copies of the running totals of all the

;	0520	! parameters and stash them, so we can later compute the incremental usage.

;	0521	!

;	0522	

;	0523	PROCESS_HEADER = .CTL$GL_PHD;		! get address of own process header

;	0524	

;	0525	PMS_FNC_READ = .PMS_TOT_READ;

;	0526	PMS_FNC_WRITE = .PMS_TOT_WRITE;

;	0527	PMS_FNC_CACHE = .PMS_TOT_CACHE;

;	0528	PMS_FNC_CPU = .PROCESS_HEADER[PHD$L_CPUTIM];

;	0529	PMS_FNC_PFA = .PROCESS_HEADER[PHD$L_PAGEFLTS];

;	0530	

;	0531	END;					! end of routine PMS_START



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 3-1

;





							    .TITLE  PMS

							    .IDENT  \X0003\



							    .PSECT  $LOCKEDD1$,NOEXE,2



					      00000 PMS_TOT_READ::

							    .BLKB   4

					      00004 PMS_TOT_WRITE::

							    .BLKB   4

					      00008 PMS_TOT_CACHE::

							    .BLKB   4

					      0000C PMS_FNC_READ:

							    .BLKB   4

					      00010 PMS_FNC_WRITE:

							    .BLKB   4

					      00014 PMS_FNC_CACHE:

							    .BLKB   4

					      00018 PMS_FNC_CPU:

							    .BLKB   4

					      0001C PMS_FNC_PFA:

							    .BLKB   4

					      00020 PMS_SUB_NEST::

							    .BLKB   4

					      00024 PMS_SUB_FUNC:

							    .BLKB   4

					      00028 PMS_SUB_READ:

							    .BLKB   4

					      0002C PMS_SUB_WRITE:

							    .BLKB   4

					      00030 PMS_SUB_CACHE:

							    .BLKB   4

					      00034 PMS_SUB_CPU:

							    .BLKB   4

					      00038 PMS_SUB_PFA:

							    .BLKB   4



							    .EXTRN  PMS$GL_FCP2, CTL$GL_PHD



							    .PSECT  $CODE$,NOWRT,2



					 0004 00000 	    .ENTRY  PMS_START, Save R2					      ; 0477

		         52 	0000'  CF  9E 00002 	    MOVAB   PMS_TOT_READ, R2					      ;

		         50 00000000G  9F  D0 00007 	    MOVL    @#CTL$GL_PHD, PROCESS_HEADER			      ; 0523

		    0C   A2	       62  7D 0000E 	    MOVQ    PMS_TOT_READ, PMS_FNC_READ				      ; 0525

		    14   A2	  08   A2  D0 00012 	    MOVL    PMS_TOT_CACHE, PMS_FNC_CACHE			      ; 0527

		    18   A2	  3C   A0  D0 00017 	    MOVL    60(PROCESS_HEADER), PMS_FNC_CPU			      ; 0528

		    1C   A2	  4C   A0  D0 0001C 	    MOVL    76(PROCESS_HEADER), PMS_FNC_PFA			      ; 0529

					   04 00021 	    RET     							      ; 0477



; Routine Size:  34 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 4

;

;	0532	GLOBAL ROUTINE PMS_END : NOVALUE =

;	0533	

;	0534	!++

;	0535	!

;	0536	! FUNCTIONAL DESCRIPTION:

;	0537	!

;	0538	!	This routine ends measurement for the current main function. It

;	0539	!	subtracts the stored base values from the running totals of the

;	0540	!	parameters and accumulates the delta in the system space cells

;	0541	!	for the particular function.

;	0542	!

;	0543	!

;	0544	! CALLING SEQUENCE:

;	0545	!	PMS_END ()

;	0546	!

;	0547	! INPUT PARAMETERS:

;	0548	!	NONE

;	0549	!

;	0550	! IMPLICIT INPUTS:

;	0551	!	IO_PACKET: address of I/O packet of this function

;	0552	!

;	0553	! OUTPUT PARAMETERS:

;	0554	!	NONE

;	0555	!

;	0556	! IMPLICIT OUTPUTS:

;	0557	!	NONE

;	0558	!

;	0559	! ROUTINE VALUE:

;	0560	!	NONE

;	0561	!

;	0562	! SIDE EFFECTS:

;	0563	!	measurement data base updated

;	0564	!

;	0565	!--

;	0566	

;	0567	BEGIN

;	0568	

;	0569	BIND					! table to translate function to array index

;	0570		FUNCTAB		= UPLIT BYTE   (IO$_ACCESS,

;	0571						IO$_CREATE,

;	0572						IO$_DEACCESS,

;	0573						IO$_DELETE,

;	0574						IO$_MODIFY,

;	0575						IO$_ACPCONTROL)

;	0576				: VECTOR [,BYTE];

;	0577	

;	0578	LOCAL

;	0579		D,				! value of parameter change

;	0580		FUNCTION	: BBLOCK[4],	! I/O function code, including modifiers

;	0581		J,				! array index

;	0582		PROCESS_HEADER	: REF BBLOCK;	! address of own process header

;	0583	

;	0584	EXTERNAL

;	0585		IO_PACKET	: REF BBLOCK,	! address of I/O packet

;	0586		CTL$GL_PHD	: REF BBLOCK ADDRESSING_MODE (ABSOLUTE);



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 4-1

;

;	0587						! address of process header in control region

;	0588	

;	0589	! If there is a subfunction open, close it first.

;	0590	!

;	0591	

;	0592	IF .PMS_SUB_NEST NEQ 0

;	0593	THEN

;	0594	    BEGIN

;	0595	    PMS_SUB_NEST = 1;

;	0596	    PMS_END_SUB ();

;	0597	    END;

;	0598	

;	0599	! Derive the table index from the function code by searching the function

;	0600	! code table. If the code is not found, we do not record data.

;	0601	!

;	0602	

;	0603	J =

;	0604	    BEGIN

;	0605	    INCR I FROM 0 TO 5 DO

;	0606	    IF .IO_PACKET[IRP$V_FCODE] EQL .FUNCTAB[.I]

;	0607	    THEN EXITLOOP .I

;	0608	    END;

;	0609	

;	0610	IF .J EQL -1 THEN RETURN;

;	0611	

;	0612	! Compute the deltas and accumulate them into the system space array.

;	0613	! Note that we explicitly compute the change for each parameter and then

;	0614	! add it into the data base cell, to prevent windows in which the value of

;	0615	! the parameter is held in a local. This is because we cannot count on the

;	0616	! compiler to generate simple stores which would be hazard free.

;	0617	!

;	0618	

;	0619	PROCESS_HEADER = .CTL$GL_PHD;

;	0620	FUNCTION = .IO_PACKET[IRP$W_FUNC];

;	0621	

;	0622	PMS$GL_COUNT[.J] = .PMS$GL_COUNT[.J] + 1;

;	0623	IF .FUNCTION[IO$V_ACCESS]

;	0624	THEN PMS$GL_MCNT[.J] = .PMS$GL_MCNT[.J] + 1;

;	0625	IF .FUNCTION[IO$V_CREATE]

;	0626	THEN PMS$GL_MCNT[.J] = .PMS$GL_MCNT[.J] + 1;

;	0627	IF .FUNCTION[IO$V_DELETE]

;	0628	THEN PMS$GL_MCNT[.J] = .PMS$GL_MCNT[.J] + 1;

;	0629	D =  .PMS_TOT_READ - .PMS_FNC_READ;

;	0630	PMS$GL_READ[.J] = .PMS$GL_READ[.J] + .D;

;	0631	D =  .PMS_TOT_WRITE - .PMS_FNC_WRITE;

;	0632	PMS$GL_WRITE[.J] = .PMS$GL_WRITE[.J] + .D;

;	0633	D =  .PMS_TOT_CACHE - .PMS_FNC_CACHE;

;	0634	PMS$GL_CACHE[.J] = .PMS$GL_CACHE[.J] + .D;

;	0635	D =  .PROCESS_HEADER[PHD$L_CPUTIM] - .PMS_FNC_CPU;

;	0636	PMS$GL_CPU[.J] = .PMS$GL_CPU[.J] + .D;

;	0637	D =  .PROCESS_HEADER[PHD$L_PAGEFLTS] - .PMS_FNC_PFA;

;	0638	PMS$GL_PFA[.J] = .PMS$GL_PFA[.J] + .D;

;	0639	

;	0640	END;					! end of routine PMS_END





; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 4-2

;





					      00022	    .BLKB   2

		      38  36  35  34  33  32  00024 P.AAA:  .BYTE   50, 51, 52, 53, 54, 56				      ;

					      0002A	    .BLKB   2



						    FUNCTAB=		P.AAA

							    .EXTRN  IO_PACKET



					 001C 0002C 	    .ENTRY  PMS_END, Save R2,R3,R4				      ; 0532

		         54 	0000'  CF  9E 0002E 	    MOVAB   PMS_SUB_NEST, R4					      ;

		         53 00000000G  9F  9E 00033 	    MOVAB   @#PMS$GL_MCNT, R3					      ;

				       64  D5 0003A 	    TSTL    PMS_SUB_NEST					      ; 0592

				       08  13 0003C 	    BEQL    1$							      ;

		         64 	       01  D0 0003E 	    MOVL    #1, PMS_SUB_NEST					      ; 0595

		  0000V  CF	       00  FB 00041 	    CALLS   #0, PMS_END_SUB					      ; 0596

	   51 	  0000G  CF	       20  C1 00046 1$:     ADDL3   #32, IO_PACKET, R1					      ; 0606

				       50  D4 0004C 	    CLRL    I							      ; 0605

		         52 	  D2 AF40  9A 0004E 2$:     MOVZBL  FUNCTAB[I], R2					      ; 0606

	   61 	         06 	       00  ED 00053 	    CMPZV   #0, #6, (R1), R2					      ;

				       52     00057									      ;

				       07  13 00058 	    BEQL    3$							      ;

	   F0 	         50 	       05  F3 0005A 	    AOBLEQ  #5, I, 2$						      ; 0605

		         50 	       01  CE 0005E 	    MNEGL   #1, J						      ; 0604

	      FFFFFFFF   8F	       50  D1 00061 3$:     CMPL    J, #-1						      ; 0610

				       5C  13 00068 	    BEQL    7$							      ;

		         52 00000000G  9F  D0 0006A 	    MOVL    @#CTL$GL_PHD, PROCESS_HEADER			      ; 0619

		         51 	       61  3C 00071 	    MOVZWL  (R1), FUNCTION					      ; 0620

				  D8 A340  D6 00074 	    INCL    PMS$GL_COUNT[J]					      ; 0622

	   03 	         51 	       06  E1 00078 	    BBC     #6, FUNCTION, 4$					      ; 0623

				     6340  D6 0007C 	    INCL    PMS$GL_MCNT[J]					      ; 0624

	   03 	         51 	       07  E1 0007F 4$:     BBC     #7, FUNCTION, 5$					      ; 0625

				     6340  D6 00083 	    INCL    PMS$GL_MCNT[J]					      ; 0626

	   03 	         51 	       08  E1 00086 5$:     BBC     #8, FUNCTION, 6$					      ; 0627

				     6340  D6 0008A 	    INCL    PMS$GL_MCNT[J]					      ; 0628

	   51 	    E0   A4	  EC   A4  C3 0008D 6$:     SUBL3   PMS_FNC_READ, PMS_TOT_READ, D			      ; 0629

		    28 A340	       51  C0 00093 	    ADDL2   D, PMS$GL_READ[J]					      ; 0630

	   51 	    E4   A4	  F0   A4  C3 00098 	    SUBL3   PMS_FNC_WRITE, PMS_TOT_WRITE, D			      ; 0631

		    50 A340	       51  C0 0009E 	    ADDL2   D, PMS$GL_WRITE[J]					      ; 0632

	   51 	    E8   A4	  F4   A4  C3 000A3 	    SUBL3   PMS_FNC_CACHE, PMS_TOT_CACHE, D			      ; 0633

		    78 A340	       51  C0 000A9 	    ADDL2   D, PMS$GL_CACHE[J]					      ; 0634

	   51 	    3C   A2	  F8   A4  C3 000AE 	    SUBL3   PMS_FNC_CPU, 60(PROCESS_HEADER), D			      ; 0635

		  00A0 C340	       51  C0 000B4 	    ADDL2   D, PMS$GL_CPU[J]					      ; 0636

	   51 	    4C   A2	  FC   A4  C3 000BA 	    SUBL3   PMS_FNC_PFA, 76(PROCESS_HEADER), D			      ; 0637

		  00C8 C340	       51  C0 000C0 	    ADDL2   D, PMS$GL_PFA[J]					      ; 0638

					   04 000C6 7$:     RET     							      ; 0532



; Routine Size:  155 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 5

;

;	0641	GLOBAL ROUTINE PMS_START_SUB (INDEX) : NOVALUE =

;	0642	

;	0643	!++

;	0644	!

;	0645	! FUNCTIONAL DESCRIPTION:

;	0646	!

;	0647	!	This routine starts metering for the indicated subfunction.

;	0648	!

;	0649	!

;	0650	! CALLING SEQUENCE:

;	0651	!	PMS_START_SUB (ARG1)

;	0652	!

;	0653	! INPUT PARAMETERS:

;	0654	!	ARG1: index of measurement array to use

;	0655	!

;	0656	! IMPLICIT INPUTS:

;	0657	!	NONE

;	0658	!

;	0659	! OUTPUT PARAMETERS:

;	0660	!	NONE

;	0661	!

;	0662	! IMPLICIT OUTPUTS:

;	0663	!	NONE

;	0664	!

;	0665	! ROUTINE VALUE:

;	0666	!	NONE

;	0667	!

;	0668	! SIDE EFFECTS:

;	0669	!	NONE

;	0670	!

;	0671	!--

;	0672	

;	0673	BEGIN

;	0674	

;	0675	LOCAL

;	0676		PROCESS_HEADER	: REF BBLOCK;	! pointer to FCP process header

;	0677	

;	0678	EXTERNAL

;	0679		CTL$GL_PHD	: REF BBLOCK ADDRESSING_MODE (ABSOLUTE);

;	0680						! address of process header in control region

;	0681	

;	0682	! We copy the current running totals into subfunction holding cells to

;	0683	! compute the deltas later. Note that since the extend subfunction can be

;	0684	! reentered, we do nothing if the depth count is already non-zero.

;	0685	!

;	0686	

;	0687	PMS_SUB_NEST = .PMS_SUB_NEST + 1;

;	0688	IF .PMS_SUB_NEST NEQ 1 THEN RETURN;

;	0689	PROCESS_HEADER = .CTL$GL_PHD;

;	0690	

;	0691	PMS_SUB_FUNC = .INDEX;

;	0692	PMS_SUB_READ = .PMS_TOT_READ;

;	0693	PMS_SUB_WRITE = .PMS_TOT_WRITE;

;	0694	PMS_SUB_CACHE = .PMS_TOT_CACHE;

;	0695	PMS_SUB_CPU = .PROCESS_HEADER[PHD$L_CPUTIM];



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 5-1

;

;	0696	PMS_SUB_PFA = .PROCESS_HEADER[PHD$L_PAGEFLTS];

;	0697	

;	0698	END;					! end of routine PMS_START_SUB











					 0004 000C7 	    .ENTRY  PMS_START_SUB, Save R2				      ; 0641

		         52 	0000'  CF  9E 000C9 	    MOVAB   PMS_SUB_NEST, R2					      ;

				       62  D6 000CE 	    INCL    PMS_SUB_NEST					      ; 0687

		         01 	       62  D1 000D0 	    CMPL    PMS_SUB_NEST, #1					      ; 0688

				       20  12 000D3 	    BNEQ    1$							      ;

		         50 00000000G  9F  D0 000D5 	    MOVL    @#CTL$GL_PHD, PROCESS_HEADER			      ; 0689

		    04   A2	  04   AC  D0 000DC 	    MOVL    INDEX, PMS_SUB_FUNC					      ; 0691

		    08   A2	  E0   A2  7D 000E1 	    MOVQ    PMS_TOT_READ, PMS_SUB_READ				      ; 0692

		    10   A2	  E8   A2  D0 000E6 	    MOVL    PMS_TOT_CACHE, PMS_SUB_CACHE			      ; 0694

		    14   A2	  3C   A0  D0 000EB 	    MOVL    60(PROCESS_HEADER), PMS_SUB_CPU			      ; 0695

		    18   A2	  4C   A0  D0 000F0 	    MOVL    76(PROCESS_HEADER), PMS_SUB_PFA			      ; 0696

					   04 000F5 1$:     RET     							      ; 0641



; Routine Size:  47 bytes







; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 6

;

;	0699	GLOBAL ROUTINE PMS_END_SUB : NOVALUE =

;	0700	

;	0701	!++

;	0702	!

;	0703	! FUNCTIONAL DESCRIPTION:

;	0704	!

;	0705	!	This routine ends metering for the currently active subfunction.

;	0706	!

;	0707	!

;	0708	! CALLING SEQUENCE:

;	0709	!	PMS_END_SUB ()

;	0710	!

;	0711	! INPUT PARAMETERS:

;	0712	!	NONE

;	0713	!

;	0714	! IMPLICIT INPUTS:

;	0715	!	NONE

;	0716	!

;	0717	! OUTPUT PARAMETERS:

;	0718	!	NONE

;	0719	!

;	0720	! IMPLICIT OUTPUTS:

;	0721	!	NONE

;	0722	!

;	0723	! ROUTINE VALUE:

;	0724	!	NONE

;	0725	!

;	0726	! SIDE EFFECTS:

;	0727	!	measurement data base updated

;	0728	!

;	0729	!--

;	0730	

;	0731	BEGIN

;	0732	

;	0733	LOCAL

;	0734		J,				! array index

;	0735		D,				! parameter difference

;	0736		PROCESS_HEADER	: REF BBLOCK;	! pointer to FCP process header

;	0737	

;	0738	EXTERNAL

;	0739		CTL$GL_PHD	: REF BBLOCK ADDRESSING_MODE (ABSOLUTE);

;	0740						! address of process header in control region

;	0741	

;	0742	! Decrement the nesting count. If non-zero, we are in a nested extend and

;	0743	! do nothing.

;	0744	!

;	0745	

;	0746	PMS_SUB_NEST = .PMS_SUB_NEST - 1;

;	0747	IF .PMS_SUB_NEST NEQ 0 THEN RETURN;

;	0748	

;	0749	! Now compute the delta for each parameter by subtracting the base from the

;	0750	! running total. Record it by adding into the system array. Also deduct

;	0751	! the delta from the charge for the main function by adding it into the

;	0752	! main function base.

;	0753	!



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 6-1

;

;	0754	

;	0755	PROCESS_HEADER = .CTL$GL_PHD;

;	0756	J = .PMS_SUB_FUNC;			! get array index

;	0757	

;	0758	PMS$GL_COUNT[.J] = .PMS$GL_COUNT[.J] + 1;

;	0759	

;	0760	D = .PMS_TOT_READ - .PMS_SUB_READ;

;	0761	PMS$GL_READ[.J] = .PMS$GL_READ[.J] + .D;

;	0762	PMS_FNC_READ = .PMS_FNC_READ + .D;

;	0763	

;	0764	D = .PMS_TOT_WRITE - .PMS_SUB_WRITE;

;	0765	PMS$GL_WRITE[.J] = .PMS$GL_WRITE[.J] + .D;

;	0766	PMS_FNC_WRITE = .PMS_FNC_WRITE + .D;

;	0767	

;	0768	D = .PMS_TOT_CACHE - .PMS_SUB_CACHE;

;	0769	PMS$GL_CACHE[.J] = .PMS$GL_CACHE[.J] + .D;

;	0770	PMS_FNC_CACHE = .PMS_FNC_CACHE + .D;

;	0771	

;	0772	D = .PROCESS_HEADER[PHD$L_CPUTIM] - .PMS_SUB_CPU;

;	0773	PMS$GL_CPU[.J] = .PMS$GL_CPU[.J] + .D;

;	0774	PMS_FNC_CPU = .PMS_FNC_CPU + .D;

;	0775	

;	0776	D = .PROCESS_HEADER[PHD$L_PAGEFLTS] - .PMS_SUB_PFA;

;	0777	PMS$GL_PFA[.J] = .PMS$GL_PFA[.J] + .D;

;	0778	PMS_FNC_PFA = .PMS_FNC_PFA + .D;

;	0779	

;	0780	END;					! end of routine PMS_END_SUB











					 001C 000F6 	    .ENTRY  PMS_END_SUB, Save R2,R3,R4				      ; 0699

		         54 00000000G  9F  9E 000F8 	    MOVAB   @#PMS$GL_COUNT, R4					      ;

		         53 	0000'  CF  9E 000FF 	    MOVAB   PMS_SUB_NEST, R3					      ;

				       63  D7 00104 	    DECL    PMS_SUB_NEST					      ; 0746

				       5C  12 00106 	    BNEQ    1$							      ; 0747

		         52 00000000G  9F  D0 00108 	    MOVL    @#CTL$GL_PHD, PROCESS_HEADER			      ; 0755

		         50 	  04   A3  D0 0010F 	    MOVL    PMS_SUB_FUNC, J					      ; 0756

				     6440  D6 00113 	    INCL    PMS$GL_COUNT[J]					      ; 0758

	   51 	    E0   A3	  08   A3  C3 00116 	    SUBL3   PMS_SUB_READ, PMS_TOT_READ, D			      ; 0760

		    50 A440	       51  C0 0011C 	    ADDL2   D, PMS$GL_READ[J]					      ; 0761

		    EC   A3	       51  C0 00121 	    ADDL2   D, PMS_FNC_READ					      ; 0762

	   51 	    E4   A3	  0C   A3  C3 00125 	    SUBL3   PMS_SUB_WRITE, PMS_TOT_WRITE, D			      ; 0764

		    78 A440	       51  C0 0012B 	    ADDL2   D, PMS$GL_WRITE[J]					      ; 0765

		    F0   A3	       51  C0 00130 	    ADDL2   D, PMS_FNC_WRITE					      ; 0766

	   51 	    E8   A3	  10   A3  C3 00134 	    SUBL3   PMS_SUB_CACHE, PMS_TOT_CACHE, D			      ; 0768

		  00A0 C440	       51  C0 0013A 	    ADDL2   D, PMS$GL_CACHE[J]					      ; 0769

		    F4   A3	       51  C0 00140 	    ADDL2   D, PMS_FNC_CACHE					      ; 0770

	   51 	    3C   A2	  14   A3  C3 00144 	    SUBL3   PMS_SUB_CPU, 60(PROCESS_HEADER), D			      ; 0772

		  00C8 C440	       51  C0 0014A 	    ADDL2   D, PMS$GL_CPU[J]					      ; 0773

		    F8   A3	       51  C0 00150 	    ADDL2   D, PMS_FNC_CPU					      ; 0774

	   51 	    4C   A2	  18   A3  C3 00154 	    SUBL3   PMS_SUB_PFA, 76(PROCESS_HEADER), D			      ; 0776

		  00F0 C440	       51  C0 0015A 	    ADDL2   D, PMS$GL_PFA[J]					      ; 0777

		    FC   A3	       51  C0 00160 	    ADDL2   D, PMS_FNC_PFA					      ; 0778



; Bliss-32 10.1-416	Monday 21-AUG-1978 23:19:14	DBB3:[F11B.SRC]PMS.B32;6					Page 6-2

;

					   04 00164 1$:     RET     							      ; 0699



; Routine Size:  111 bytes





;	0781	

;	0782	END

;	0783	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $LOCKEDD1$     	    60    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $CODE$         	   357  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        20         0       228











; Size:		347 code + 70 data bytes

; Run Time:	00:11.1

; Elapsed Time:	00:21.9

; Memory Used:	303 pages

; Compilation Complete

