MODULE bannermonitor (IDENT = 'V01-000', ADDRESSING_MODE (NONEXTERNAL=WORD_RELATIVE), ADDRESSING_MODE (EXTERNAL=GENERAL)) = BEGIN ! !**************************************************************************** !* * !* COPYRIGHT (c) 1984 BY * !* DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS. * !* ALL RIGHTS RESERVED. * !* * !* THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED * !* ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE * !* INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER * !* COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY * !* OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY * !* TRANSFERRED. * !* * !* THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE * !* AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT * !* CORPORATION. * !* * !* DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS * !* SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. * !* * !* * !**************************************************************************** !++ ! FACILITY: BANNER ! ! ABSTRACT: ! ! This module displays performance monitors ! ! ENVIRONMENT: ! ! VAX/VMS operating system. Unprivileged, any mode. ! ! AUTHOR: ! ! CW Hobbs 2-May-1985 ! ! Modified by: ! ! V01-001 CWH1001 CW Hobbs ??-1985 ! ?? ! !-- ! Include files ! REQUIRE 'BANNER'; ! Table of contents ! FORWARD ROUTINE monitor_init : NOVALUE, bannermonitor : NOVALUE; EXTERNAL sd_font, mon : BLOCK [mon_c_length, BYTE], lcl : BLOCK [lcl_c_length, BYTE]; EXTERNAL sch$gl_freecnt, sch$gl_mfycnt, pms$gl_faults, pms$gl_bufio, pms$gl_dirio, pms$gl_preadio, pms$gl_pwritio; pag_plit; pag_code; GLOBAL ROUTINE monitor_init : NOVALUE = !- ! This is the entry point for initializing the monitor areas of the banner ! ! Inputs: ! ! mon - Monitor structure ! lcl_l_vd_id - Display ID of the display to include the clock ! ! Outputs: ! !- BEGIN LOCAL status; ! Routine status ! Create a transformation for the monitor window, map (0,0) (22,7) to the virtual display ! region we have been given ! mon[mon_l_tr_id] = uis$create_transformation (lcl[lcl_l_vd_id], lcl[lcl_l_cons_0], %REF ( IF .lcl[lcl_l_lines] EQL 4 THEN %E'4' ELSE IF .lcl[lcl_l_lines] EQL 5 THEN %E'3' ELSE IF .lcl[lcl_l_lines] EQL 6 THEN %E'2' ELSE IF .lcl[lcl_l_lines] EQL 7 THEN %E'1' ELSE %E'0'), %REF (%E'22'), %REF (%E'8'), mon[mon_f_x], mon[mon_f_y], mon[mon_f_xh], mon[mon_f_yh]); ! Set up the attribute block for the text ! uis$set_font (mon[mon_l_tr_id], lcl[lcl_l_cons_0], mon[mon_l_atb], sd_font); uis$set_writing_mode (mon[mon_l_tr_id], mon[mon_l_atb], mon[mon_l_atb], %REF (uis$c_mode_repl)); ! Place the text on the screen ! IF .lcl[lcl_l_lines] GEQ 8 THEN BEGIN uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'1')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'TTA0 IO'); END; IF .lcl[lcl_l_lines] GEQ 7 THEN BEGIN uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'2')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'WT IO'); END; IF .lcl[lcl_l_lines] GEQ 6 THEN BEGIN uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'3')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'Dua1 IO'); END; IF .lcl[lcl_l_lines] GEQ 5 THEN BEGIN uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'4')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'Dua0 IO'); END; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'5')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'Paging IO'); uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'6')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'Faults'); uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'7')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'Modified'); uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], lcl[lcl_l_cons_0], %REF (%E'8')); ! Top line is 8 uis$text (mon[mon_l_tr_id], mon[mon_l_atb], %ASCID 'Free Pages'); mon[mon_v_initialized] = 1; lcl[lcl_v_ws_purged] = 0; RETURN; END; npag_plit; npag_code; GLOBAL ROUTINE bannermonitor : NOVALUE = !- ! This routine updates the monitor statistics. ! ! Implicit Inputs: ! ! mon - monitor data block ! ! Outputs: ! ! None !- BEGIN LOCAL rate, temp, desc : VECTOR [2, LONG], buffer : VECTOR [10, BYTE], status; BIND fiveb = UPLIT BYTE (' '), ctrstr = %ASCID '!10UL', ctrstr2 = %ASCID '!5SL'; ! Make sure that we have been initialized ! IF NOT .mon[mon_v_initialized] THEN monitor_init (); ! Set up the attribute block for the text ! uis$set_font (mon[mon_l_tr_id], lcl[lcl_l_cons_0], mon[mon_l_atb], sd_font); uis$set_writing_mode (mon[mon_l_tr_id], mon[mon_l_atb], mon[mon_l_atb], %REF (uis$c_mode_repl)); ! If any of the stats has changed, rewrite it ! rate = .sch$gl_freecnt - .mon[mon_l_freecnt]; IF .rate NEQ .mon[mon_l_freecnt_rate] THEN BEGIN mon[mon_l_freecnt_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'8')); ! Top line is 8 uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .sch$gl_freecnt NEQ .mon[mon_l_freecnt] THEN BEGIN mon[mon_l_freecnt] = .sch$gl_freecnt; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_freecnt]); desc[0] = 5; desc[1] = buffer+5; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'10'), %REF (%E'8')); ! Top line is 8 uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; rate = .sch$gl_mfycnt - .mon[mon_l_mfycnt]; IF .rate NEQ .mon[mon_l_mfycnt_rate] THEN BEGIN mon[mon_l_mfycnt_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'7')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .sch$gl_mfycnt NEQ .mon[mon_l_mfycnt] THEN BEGIN mon[mon_l_mfycnt] = .sch$gl_mfycnt; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_mfycnt]); desc[0] = 4; desc[1] = buffer+6; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'11'), %REF (%E'7')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; rate = .pms$gl_faults - .mon[mon_l_faults]; IF .rate NEQ .mon[mon_l_faults_rate] THEN BEGIN mon[mon_l_faults_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'6')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .pms$gl_faults NEQ .mon[mon_l_faults] THEN BEGIN mon[mon_l_faults] = .pms$gl_faults; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_faults]); desc[0] = 9; desc[1] = buffer+1; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'6'), %REF (%E'6')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; temp = .pms$gl_preadio + .pms$gl_pwritio; rate = .temp - .mon[mon_l_pageio]; IF .rate NEQ .mon[mon_l_pageio_rate] THEN BEGIN mon[mon_l_pageio_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'5')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .temp NEQ .mon[mon_l_pageio] THEN BEGIN mon[mon_l_pageio] = .temp; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_pageio]); desc[0] = 6; desc[1] = buffer+4; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'9'), %REF (%E'5')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .lcl[lcl_l_lines] GEQ 5 THEN BEGIN LOCAL iocnt, itmlst : VECTOR [6, LONG]; ! Set up the item list, and get the iocount ! iocnt = 0; itmlst[0] = dvi$_opcnt^16 + 4; itmlst[1] = iocnt; itmlst[2] = itmlst[3] = 0; BEGIN iocnt = 0; $getdviw (devnam=%ascid 'DUA0:', itmlst=itmlst); rate = .iocnt - .mon[mon_l_ni_io]; IF .rate NEQ .mon[mon_l_ni_io_rate] THEN BEGIN mon[mon_l_ni_io_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'4')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .iocnt NEQ .mon[mon_l_ni_io] THEN BEGIN mon[mon_l_ni_io] = .iocnt; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_ni_io]); desc[0] = 6; desc[1] = buffer+4; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'9'), %REF (%E'4')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; END; IF .lcl[lcl_l_lines] GEQ 6 THEN BEGIN iocnt = 0; $getdviw (devnam=%ascid 'DUA1:', itmlst=itmlst); rate = .iocnt - .mon[mon_l_dirio]; IF .rate NEQ .mon[mon_l_dirio_rate] THEN BEGIN mon[mon_l_dirio_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'3')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .iocnt NEQ .mon[mon_l_dirio] THEN BEGIN mon[mon_l_dirio] = .iocnt; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_dirio]); desc[0] = 6; desc[1] = buffer+4; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'9'), %REF (%E'3')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; END; IF .lcl[lcl_l_lines] GEQ 7 THEN BEGIN LOCAL totio, namdsc : VECTOR [2, LONG], nambuf : VECTOR [8, BYTE]; totio = 0; namdsc [1] = nambuf; INCR i FROM 0 TO 10 DO BEGIN iocnt = 0; namdsc [0] = 8; $fao (%ascid 'WTA!UL:', namdsc, namdsc, .i); $getdviw (devnam=namdsc, itmlst=itmlst); totio = .totio + .iocnt; END; iocnt = .totio; rate = .iocnt - .mon[mon_l_dirio1]; IF .rate NEQ .mon[mon_l_dirio1_rate] THEN BEGIN mon[mon_l_dirio1_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'2')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .iocnt NEQ .mon[mon_l_dirio1] THEN BEGIN mon[mon_l_dirio1] = .iocnt; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_dirio1]); desc[0] = 6; desc[1] = buffer+4; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'9'), %REF (%E'2')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; END; IF .lcl[lcl_l_lines] GEQ 8 THEN BEGIN iocnt = 0; $getdviw (devnam=%ascid 'TTA0:', itmlst=itmlst); rate = .iocnt - .mon[mon_l_dirio2]; IF .rate NEQ .mon[mon_l_dirio2_rate] THEN BEGIN mon[mon_l_dirio2_rate] = .rate; desc[0] = 5; IF .rate NEQ 0 THEN BEGIN desc[1] = buffer; $fao (ctrstr2, desc, desc, .rate); END ELSE desc[1] = fiveb; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'16'), %REF (%E'1')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; IF .iocnt NEQ .mon[mon_l_dirio2] THEN BEGIN mon[mon_l_dirio2] = .iocnt; desc[0] = 10; desc[1] = buffer; $fao (ctrstr, desc, desc, .mon[mon_l_dirio2]); desc[0] = 6; desc[1] = buffer+4; uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'9'), %REF (%E'1')); uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); END; END; ! IF .lcl[lcl_l_lines] GEQ 8 ! THEN ! BEGIN ! LOCAL ! totio, ! namdsc : VECTOR [2, LONG], ! nambuf : VECTOR [8, BYTE]; ! totio = 0; ! namdsc [1] = nambuf; ! INCR i FROM 0 TO 20 ! DO ! BEGIN ! iocnt = 0; ! namdsc [0] = 8; ! $fao (%ascid 'XQA!UL:', namdsc, namdsc, .i); ! IF NOT $getdviw (devnam=namdsc, itmlst=itmlst) ! THEN ! EXITLOOP; ! totio = .totio + .iocnt; ! END; ! IF .totio NEQ .mon[mon_l_bufio] ! THEN ! BEGIN ! mon[mon_l_bufio] = .totio; ! desc[0] = 10; ! desc[1] = buffer; ! $fao (ctrstr, desc, desc, .mon[mon_l_bufio]); ! desc[0] = 7; ! desc[1] = buffer+3; ! uis$set_aligned_position (mon[mon_l_tr_id], mon[mon_l_atb], %REF (%E'8'), %REF (%E'1')); ! uis$text (mon[mon_l_tr_id], mon[mon_l_atb], desc); ! END; ! END; END; RETURN; END; END ELUDOM