RITA TITLE ' Lovely Rita, Meter Maid...' 00010000 *comment*COPY DMSPIPID Needed for assembling with ESA Pipes. 00020000 *********************************************************************** 00030000 * * * Profile a pipeline by invoking it through RUNPIPE EVENTS. * 00040000 * * 00050000 * Melinda Varian, * 00060000 * Office of Computing and Information Technology, * 00070000 * Princeton University. * 00080000 * * *********************************************************************** * The most current version of this code can be found at: * * http://pucc.princeton.edu/%7Epipeline/ * *********************************************************************** * * 00090000 * Change activity: * 00100000 * 07 May 1997 MWV Enforce CMS-legal filenames. * * 02 May 1997 MWV Support FPL component id. * * 01 Dec 1996 MWV Preserve msglevel setting in old PIPEs. * 00108000 * 11 Nov 1996 MWV Remove unneeded "lookup" from main pipe. * 00108000 * 09 Nov 1996 MWV Accumulate highwater mark storage use. * 00108000 * 26 May 1996 MWV Accumulate values for recursed specs. * 00108000 * 26 May 1996 MWV Support 370 Feature, BatchPipeWorks, etc. * 00109000 * 02 Jul 1995 MWV Support console input (Type 0F event recs). * 00110000 * 31 Jan 1995 jph Make sure nothing is overlaid by S&D codes. * 00110000 * 29 Jan 1995 MWV Replace LINEDITs with APPLMSG. * 00120000 * 10 Oct 1994 MWV Support for "runpipe mask". * 00130000 * 06 Mar 1994 MWV Recognize unsupported Pipes levels. * 00140000 * 05 Mar 1994 MWV Enhance to work with CMS 10 and early * 00150000 * 1.0107. * 00160000 * 03 Mar 1994 MWV Set unique filename based on "name" option. * 00170000 * 19 Nov 1993 jph Support change in "runpipe msglevel" syntax. * 00180000 * 15 Jun 1993 New module by John P. Hartmann, DKIBMVM2(JOHN) * 00190000 * * 00200000 * Based on RITA EXEC by Melinda Varian, PUCC(MAINT) * 00210000 * * 00220000 *********************************************************************** 00230000 SPACE 2 00240000 RITA MODBEG FREETYPE=NONE,TRANSIENT=(YES,GO) 00250000 GO PROC SAREA=NO,ENTRY=NO 00260000 LR R2,R0 Get NPL 00270000 LM R2,R3,4(R2) Get string 00280000 SR R3,R2 Find length 00290000 L R15,=AL1(C' ',0,0,0) 00300000 CLCL R2,R14 Was the command just "RITA"? 00310000 IF NOTEQUAL No, ignore trailing blanks. 00320000 LA R1,0(R3,R2) Back 00330000 REPEAT , 00340000 DECR R1 00350000 CLI 0(R1),C' ' 00360000 UNTIL NOTEQUAL,BCT=R3 00370000 FI , 00380000 IF NOTEQUAL 00390000 C R3,=F'1' Was the command "RITA ?"? 00400000 COND EQUAL,CLI,0(R2),C'?' 00410000 FI , 00420000 IF NOTEQUAL 00430000 C R3,=F'4' 00440000 IF EQUAL 00450000 ICM R0,15,0(R2) Get it then 00460000 O R0,=CL4' ' Was the command "RITA HELP"? 00470000 CL R0,=C'HELP' 00480000 FI , 00490000 FI , 00500000 EJECT , 00510000 *********************************************************************** 00520000 * * 00530000 * There is a subject pipeline to run and measure. First * 00540000 * determine the level of CMS Pipelines so that the "msglevel" * 00550000 * option in the "runpipe" stage can be specified in a * 00560000 * compatible manner and that a decision can be made as to * 00570000 * whether the "msglevel" option and Type 13 event records are * 00580000 * available. If the "msglevel" option is not available, then * 00590000 * the "PreRita" and "PostRita" stages must be used to issue * 00600000 * PIPMOD MSGLEVEL commands. If Type 13 records are not * 00610000 * available, then Type 0B (subtype CM and MS) records must be * 00620000 * processed instead (this is more expensive and provides less * 00630000 * accurate results). If the "mask" option of "runpipe" is * 00640000 * available, it will be used to reduce the number of records * 00650000 * that must be processed by the pipeline. * 00650000 * * 00650000 *********************************************************************** 00660000 SPACE 2 00670000 IF NOTEQUAL For real 00680000 LA R0,FWD Address to store Pipes level. 00690000 PCALL MAKEHEX Convert to hex in DWD field. 00700000 MVC QADDR,DWD Store as "storage" address parm. 00710000 CMSCALL CALLTYP=EPLIST,PLIST=PL,EPLIST=EQL Level into FWD. 00720000 LTR R15,R15 "query level" supported? 00730000 IF NOTZERO No, Pipes version is too old. 00740000 APPLMSG TEXT='Rita requires CMS Pipelines 1.0107 or later.' *00750000 Make some noise. 00760000 GOTOEXIT , Exit. 00770000 FI , 00780000 CLI FWD,X'11' PRPQ? 00790000 IF EQUAL 00800000 CLC FWD,=X'11060127' "runpipe events" supported? 00810000 IF LOW No, Pipes version is too old. 00820000 APPLMSG TEXT='Rita requires CMS Pipelines 1.0107 or later.' *00830000 Make some noise. 00840000 GOTOEXIT , Exit. 00850000 FI , 00860000 CLC FWD,=X'1107006E' "runpipe msglevel" supported? 00870000 IF HIGH Yes, remove old function. 00880000 MVC NEED0B(2),=C'0B' Can discard Type 0B events. 00890000 MVC PRERITA,=CL15' ' Needn't run PreRita. 00900000 MVC POSTRITA,=CL15' ' Needn't run PostRita. 00910000 MVC MSGLEVEL,=C'MSGLEVEL X2001' Use new option. 00920000 CLC FWD,=X'11080017' Below magic level? 00930000 COND LOW,MVI,MSGLEVEL+9,C' ' Yes, blank out the X. 00940000 CLC FWD,=X'1109001A' "runpipe mask" supported? 00950000 IF NOTLOW Yes, add MASK option to pipe. MVC RPMASK,=C'mask 75fe4fff ' MVI NOLOOK,C' ' And blank out the "lookup". MVC NOLOOK+1(NOLOOKE-NOLOOK-1),NOLOOK CLC FWD,=X'110A000F' Extended 09 records? COND HIGH,MVC,RPMASK,=C'mask 75be4fff ' Get 09s. 00960000 FI , FI , 00970000 ELSE , No, ESA. 00980000 CLC FWD(2),=X'2201' "runpipe msglevel" supported? 00990000 IF HIGH Yes, remove old function. 01000000 MVC NEED0B(2),=C'0B' Can discard Type 0B events. 01010000 MVC PRERITA,=CL15' ' Needn't run PreRita. 01020000 MVC POSTRITA,=CL15' ' Needn't run PostRita. 01030000 MVC MSGLEVEL,=C'MSGLEVEL X2001' Use new option. 01040000 CLI FWD,X'30' "runpipe mask" supported? 01050000 IF NOTLOW Yes, add MASK option to pipe. MVC RPMASK,=C'mask 75fe4fff ' MVI NOLOOK,C' ' And blank out the "lookup". MVC NOLOOK+1(NOLOOKE-NOLOOK-1),NOLOOK FI , FI , 01070000 CLC FWD(2),=X'2201' "runpipe events" supported? 01080000 IF LOW No, unless it's 370 Feature. 01090000 CLC FWD(2),=X'2000' 370 Feature? 01100000 IF NOTLOW No, Pipes version is too old. 01110000 APPLMSG TEXT='Rita requires Pipelines from CMS 10 or later.' *01120000 Reject this. 01130000 GOTOEXIT , Exit. 01140000 FI , 01150000 FI , 01160000 FI , 01170000 SPACE 1 01180000 *********************************************************************** 01190000 * * 01200000 * Set the address and length of the subject pipeline in "storage" * 01210000 * stages of two PIPE commands that need to find it. * 01220000 * * 01230000 *********************************************************************** 01240000 LR R0,R2 R0=A(argument string). 01250000 PCALL MAKEHEX Convert to hex in DWD field. 01260000 MVC AB,DWD Copy to "storage" address parm. 01270000 MVC NB,DWD Copy to "storage" address parm. 01280000 CVD R3,DWD R3=L'argument string. 01290000 UNPK AL,DWD Make it decimal characters in... 01300000 OI AL+L'AL-1,C'0' ..."storage" length parm. 01310000 MVC NL,AL And here, too. 01320000 SPACE 1 01330000 *********************************************************************** 01340000 * * 01350000 * Invoke a pipeline to determine output filename. * 01360000 * * 01370000 *********************************************************************** 01380000 LA R0,TPIPFN Address to store name parameter. 01390000 PCALL MAKEHEX Convert to hex in DWD field. 01400000 MVC NADDR,DWD Store as "storage" address parm. 01410000 CMSCALL CALLTYP=EPLIST,PLIST=PL,EPLIST=ENL 01420000 LTR R15,R15 Trouble? 01430000 GOTOEXIT COND=NOTZERO Yes, exit with return code. 01440000 MVC PIPEFN,TPIPFN Save filename in other PIPE. 01450000 SPACE 1 01460000 *********************************************************************** 01470000 * * 01480000 * Invoke a pipeline to determine output filetype. * 01490000 * * 01500000 *********************************************************************** 01510000 LA R0,PIPEFT Address to store name parameter. 01520000 PCALL MAKEHEX Convert to hex in DWD field. 01530000 MVC TADDR,DWD Store as "storage" address parm. 01540000 CMSCALL CALLTYP=EPLIST,PLIST=PL,EPLIST=ETL 01550000 LTR R15,R15 Trouble? 01560000 GOTOEXIT COND=NOTZERO Yes, exit with return code. 01570000 SPACE 1 01580000 *********************************************************************** 01590000 * * 01600000 * Invoke a pipeline to run and measure the subject pipeline. * 01610000 * * 01620000 *********************************************************************** 01630000 LA R2,ARGB 01640000 LA R3,ARGE 01650000 * CMSCALL CALLTYP=PROGRAM,PLIST=DB 01660000 CMSCALL CALLTYP=EPLIST,PLIST=PL,EPLIST=EPL 01670000 LTR R15,R15 Trouble? 01680000 GOTOEXIT COND=NOTZERO 01690000 APPLMSG TEXT=' ' 01700000 APPLMSG TEXT='Detailed output from Rita in &&1.', *01710000 SUB=(CHARA,(PIPEFN,FULLFNL)) 01720000 SPACE 1 01730000 *********************************************************************** 01740000 * * 01750000 * Command was "RITA", "RITA ?", or "RITA HELP", so invoke a * 01760000 * pipeline to display help for Rita. * 01770000 * * 01780000 *********************************************************************** 01790000 ELSE , 01800000 CMSCALL CALLTYP=EPLIST,PLIST=PL,EPLIST=EHL 01810000 FI , 01820000 SPACE 1 01830000 *********************************************************************** 01840000 * * 01850000 * Exit. * 01860000 * * 01870000 *********************************************************************** 01880000 PEXIT RC=(R15) 01890000 SPACE 1 01900000 *********************************************************************** 01910000 * * 01920000 * Subroutine to format a binary number in printable * 01930000 * hexadecimal. * 01940000 * * 01950000 *********************************************************************** 01960000 MAKEHEX PROC SAVE=NO,SAREA=NO,BASE=NO 01970000 ST R0,FWD Make fullword 01980000 UNPK DWD(9),FWD(5) Unpack 01990000 NC DWD,=8X'0F' Strip 02000000 TR DWD,=C'0123456789abcdef' 02010000 PROCEND RC= 02020000 EJECT 1 02030000 FWD DS F 02040000 DWD DS D 02050000 DS D slop 02060000 DB DC CL8'EXEC',CL8'DBGR',CL8'R2isit',2F'-1' 02070000 HELP DC CL8'EXEC',CL8'RITA',2F'-1' 02080000 PL DC CL8'PIPE',2F'-1' 02090000 EPL DC A(PIPE,ARGB,ARGE,0) 02100000 EHL DC A(HPIPE,HARGB,HARGE,0) 02110000 ENL DC A(NPIPE,NARGB,NARGE,0) 02120000 EQL DC A(QPIPE,QARGB,QARGE,0) 02130000 ETL DC A(TPIPE,TARGB,TARGE,0) 02140000 SPACE 1 02150000 HPIPE DC C'pipe ' Display help for Rita. 02160000 HARGB DC C'(listerr) ' 02170000 DC C'rita help' 02180000 HARGE DS 0C 02190000 SPACE 1 02200000 NPIPE DC C'pipe ' Determine filename for output: 02210000 NARGB DC C'(listerr) ' 02220000 DC C'storage ' Load argument into the pipeline. 02230000 NB DS CL8 Its hexadecimal address. 02240000 DC C' ' 02250000 NL DS CL15 Its length. 02260000 DC C'|' 02270000 DC C'change /(/( / |' In case local options too. 02280000 DC C'deblock 1 |' Break up into bytes. 02290000 DC C'inside /(/ /)/ |' Select only options. 02300000 DC C'join * |' Rejoin. 02310000 DC C'split |' Split into words. 02330000 DC C'xlate *-* 00-ff : ' DC C'+ + $ $ - - _ _ # # @ @ ' DC C'a-i A-I j-r J-R s-z S-Z ' DC C'A-I A-I J-R J-R S-Z S-Z ' DC C'0-9 0-9 |' Upper-case and make CMS legal. DC C'inside /NAME/ 1 |' Select name parameter. 02340000 DC C'append literal UNNAMED |' (In case none.) 02350000 DC C'take 1 |' Use only the first one. 02360000 DC C'trunc 8 |' Make it exactly 8 bytes. 02370000 DC C'pad 8 |' 02380000 DC C'storage ' Store in TPIPFN field. 02390000 NADDR DS CL8 Hex address of TPIPFN field. 02400000 DC C' 8 e0' Length and storage key. 02410000 NARGE DS 0C 02420000 SPACE 1 02430000 QPIPE DC C'pipe ' Determine Pipelines level: 02440000 QARGB DC C'(listerr) ' 02450000 DC C'query level |' Issue query. 02460000 DC C'storage ' Store response in FWD field. 02470000 QADDR DS CL8 Hex address of FWD field. 02480000 DC C' 4 e0' Length and storage key. 02490000 QARGE DS 0C 02500000 SPACE 1 02510000 TPIPE DC C'pipe ' Find unused filetype for output: 02520000 TARGB DC C'(listerr) ' 02530000 DC C'literal ' One copy of NNNNNNNN TTTT. 02540000 TPIPFN DS CL8 02550000 DC C' RITA|' 02560000 DC C'dup 998 |' 998 more copies. 02570000 DC C'spec 1-* 1 pad 0 number 14.3 right |' 001-999. 02580000 DC C'not state nodetails quiet |' File exists? 02590000 DC C'spec 14.3 1 |' No, get sequence number. 02600000 DC C'append literal 001|' (In case all exist.) 02610000 DC C'take 1 |' Take first non-existent file. 02620000 DC C'storage ' Store in PIPEFT field. 02630000 TADDR DS CL8 Hex address of PIPEFT field. 02640000 DC C' 3 e0' Length and storage key. 02650000 TARGE DS 0C 02660000 SPACE 1 02670000 PIPE DC C'pipe ' Measure the subject pipeline: 02680000 ARGB DC C'(endchar ? listerr) ' 02690000 DC C'storage ' Load it into the pipeline. 02700000 AB DS CL8 Its hexadecimal address. 02710000 DC C' ' 02720000 AL DS CL15 Its length. 02730000 DC C'|' 02740000 PRERITA DC C'rita prerita |' (Needed for old versions.) 02750000 DC C'runpipe events ' Run the subject pipeline. 02760000 RPMASK DC C' ' Mask on 0,4,6,9,F,10,12,13. 02770000 MSGLEVEL DC C' ' With accounting turned on. 02780000 DC C'|' 02790000 NOLOOK EQU * DC C'l: lookup 1' Discard unneeded events. 02800000 DC C'?' 02810000 DC C'strliteral x010203050708090a0c0d0e11' 02820000 NEED0B DC C' |' Need 0B recs for old versions. 02830000 DC C'deblock 1 |' List of unneeded event types. 02840000 DC C'l: |' Master file for "lookup". 02850000 NOLOOKE EQU * DC C'n: strnfind x00 |' Divert message events. 02860000 DC C'b: strnfind x0B |' Divert dispatcher calls. 02870000 DC C'f: faninany |' Feed events records into Rita. 02880000 DC C'r: rita |' Analyze the events records. 02890000 DC C'trunc 132 |' Make legal for print file. 02900000 DC C'> ' Write detail output file. 02910000 PIPEFN DC C'UNNAMED ',C' RITA' Filename and filetype. 02920000 PIPEFT DC CL3'nnn' Sequence number for filetype. 02930000 FULLFNL EQU *-PIPEFN 02940000 DC C' A' Filemode. 02950000 DC C'?' 02960000 DC C'n: |' Message event records here. 02970000 DC C'o: locate 29.8 /PIN2814I/ |' ESA accounting? 02980000 DC C'change 43-* /,// |' Yes, unpunctuate. 02990000 DC C'f:' Feed to Rita. 03000000 DC C'?' 03010000 DC C'o: |' Not ESA accounting message? 03020000 DC C'p: locate 29.7 /INX177I/ |' PRPQ accounting? 03030000 DC C'change 43-* /,// |' Yes, unpunctuate. 03040000 DC C'f:' Feed it to Rita. 03050000 DC C'?' 03060000 DC C'p: |' Here if not accounting message. 03070000 DC C'locate 35.2 /E/ |' Error message? 03080000 DC C'spec 26-* 1 /./ next |' Yes, extract message. 03090000 DC C'console' Display it. 03100000 DC C'?' 03110000 DC C'b: |' Here if dispatcher call event. 03120000 DC C'c: locate 23.2 /CM/ |' Command event? 03130000 DC C'f:' Yes, feed it to Rita. 03140000 DC C'?' 03150000 DC C'c: |' Here if dispatcher call event. 03160000 DC C'locate 23.2 /MS/ |' Miscellaneous services? 03170000 DC C'f:' Yes, feed it to Rita. 03180000 DC C'?' 03190000 DC C'r: |' Output from user's "console". 03200000 DC C'console' Display it. 03210000 DC C'?' 03220000 DC C'r: |' Rita's summary output to here. 03230000 POSTRITA DC C'rita postrita |' (Needed for old versions.) 03260000 DC C'console' Display it. 03270000 ARGE DS 0C 03280000 PROCEND , 03290000 MODEND , 03300000