Google
 

Trailing-Edge - PDP-10 Archives - BB-FB49A-RM - sources/sntana.b36
There are no other files named sntana.b36 in the archive.
%title 'SNT Trace Analyzer'

module SNTANA (ident = 'Version 1.02') =
begin

! Copyright (c) 1984, 1985 by
! DIGITAL EQUIPMENT CORPORATION, Maynard, Massachusetts
!
! 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:	DECnet/SNA TOPS-20 Trace Utility Analyzer.
!
! ABSTRACT:	This module provide routines to analyze the traced data.
!
! ENVIRONMENT:	TOPS-20 Operating Systems, user mode.
!
! AUTHOR:	Dennis Brannon,               CREATION DATE: January 17, 1984
!
! MODIFIED BY:
!
! 	D. Brannon, 11-Oct-84 : VERSION 1.00
!
! 1.01  D. Brannon, 28-Oct-84
!       Replaced references to MSG$INFO with $SNT_INFO.
! 1.02  D. Brannon, 29-Oct-84
!       Replaced SNT$_BADFILE with SNT$_BADINPUT
!--

!
! REQUIRED FILES
!

library 'MONSYM';                       ! Monitor symbols
library 'SNTDEF';                       ! SNT common definitions
library 'SNTLIB';                       ! VMS common definitions
require 'JSYS';                         ! TOPS-20 JSYS declarations

!
! FORWARD REFERENCES
!

forward routine
    ANA$ANALYZE: novalue;


!
! EXTERNAL REFERENCES
!

external
    ST: SNTBLOCK;

external routine
    FIL$OPEN_ANALYZE_FILE,
    FIL$CLOSE_ANALYZE_FILE,
    FIL$OPEN_OUTPUT_FILE,
    FIL$CLOSE_OUTPUT_FILE,
    FIL$GET_RECORD,
    MSG$WRITE_HEADER_RECORD,
    MSG$WRITE_RECORD,
    MSG$WRITE_END_RECORD,
    MEM$GET,
    MEM$RETURN: novalue,
    PSI$TTY_INIT,
    SNT$MSGHANDLER,
    TRC$CTRLZ_TRAP,
    TXT$WRITE,
    USP$ERROR_MESSAGE: novalue,
    USP$GET_TIME_STAMP;
%global_routine ('ANA$ANALYZE') : novalue =

!++
! FUNCTIONAL DESCRIPTION:
!
!       Analyze traced data.
!
! FORMAL PARAMETERS:
!
!       none
!
! ROUTINE VALUE:
!
!       none
!
! SIDE EFFECTS:
!
!       none
!
!--

    begin

    literal
        $TRACE_BUFFERS = 4,
        $DATA_BUFFERS = 6,
        $INFORMATION_BUFFERS = 4,
        $TRACE_SIZE = $MEMORY_BUFFER_SIZE * $TRACE_BUFFERS * 5,
        $DATA_SIZE = $MEMORY_BUFFER_SIZE * $DATA_BUFFERS * 5;


    local
        FIRSTHDR,
        COUNT,
        INPUT,
        OUTPUT,
        INFORMATION,
        DATA,
        BUFFER,
        LENGTH;

    if .ST[ST_ANALYZE_JFN] eql 0            ! Get the trace file JFN
    then jsys_haltf ();                     ! Unlikely to fail here

    INPUT = .ST[ST_ANALYZE_JFN];
    BUFFER = MEM$GET ($TRACE_BUFFERS);
    DATA = MEM$GET ($DATA_BUFFERS);
    ST[STOP_TRACE] = $FALSE;
    COUNT = 0;
    FIRSTHDR = $TRUE;

    while 1 do
       begin                            ! Get data record
       local POINTER, MESSAGE;

       if .ST[STOP_TRACE] then EXITLOOP;
  
       LENGTH = FIL$GET_RECORD (.INPUT, .BUFFER);
       if .LENGTH eql 0 then EXITLOOP;

       COUNT = .COUNT + 1;
       ST[ST_HEADER] = .BUFFER;
       POINTER = ch$ptr (.BUFFER,,8);
       MESSAGE = ch$rchar (.POINTER);

       selectone .MESSAGE of            ! Process records
           set
           [RECORD_MSG_K$TRAPRO]:              ! Data Record
               begin
               MSG$WRITE_RECORD (.ST[ST_OUTPUT_JFN],.BUFFER,.LENGTH);
               end;
           [INIT_MSG_K$TRAPRO]:                ! Header Record
               begin
               if not .FIRSTHDR
               then $SNT_INFO (SNT$_NEWHEADER);
               FIRSTHDR = $FALSE;
               ST[ST_HEADER] = .BUFFER;
               MSG$WRITE_HEADER_RECORD (.ST[ST_OUTPUT_JFN],.ST[ST_HEADER]);
               end;
           [otherwise]:
               $SNT_INFO (SNT$_BADINPUT);
           tes;
       end;

    MSG$WRITE_END_RECORD (.COUNT);
    MEM$RETURN (.BUFFER);               ! Return temporary buffers
    MEM$RETURN (.DATA);

    return;
    end;                                ! End of ANA$ANALYZE
end                                   ! End of SNTANA module
eludom
! Local Modes:
! Mode:BLISS
! Auto Save Mode:2
! Comment Column:40
! Comment Rounding:+1
! End: