DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦e993bffb4⟧ Ada Source

    Length: 18432 (0x4800)
    Types: Ada Source
    Notes: 03_class, FILE, R1k_Segment, e3_tag, package V_I_Trace, seg_04b9cd

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦this⟧ 

E3 Source Code



with System;
with Unchecked_Conversion;
with V_I_Krn_Trace;

package V_I_Trace is

    pragma Suppress (All_Checks);
    pragma Suppress (Exception_Tables);
    pragma Not_Elaborated;
    pragma Local_Access;

    subtype Microseconds is Integer;

----------------------------------------------------------------------------
--  Help in logging arguments.
    function To_I is new Unchecked_Conversion (System.Task_Id, Integer);
    function To_I is new Unchecked_Conversion (System.Address, Integer);
    function To_I is new Unchecked_Conversion (Duration, Integer);
    function To_A is new Unchecked_Conversion (Integer, System.Address);
----------------------------------------------------------------------------

-- Services needed by the Event_Log_Manager for the user and the
-- logging of runtime events by the kernel

    type Kind_Of_Event is (Header_Event, Runtime_Event, User_Defined_Event,
                           Kernel_Event, Profile_Event);
    type Event (Logged_Event : Kind_Of_Event := Header_Event);

    -- Event Logging Operations

    type User_Events is
       (Start_Of_Sequence,
        Start_Process,              -- Application initiates a process
        End_Process,                -- Task completes a process
        Start_Buffer_Flush,         -- Automatic, when full or at user request
        End_Buffer_Flush,
        Process_Base_Time,          -- Process established base time
        Event1, Event1a, Event2, Event2a, Event3, Event3a, Event4,
        Event4a, Event5, Event5a, Event6, Event6a, Event7, Event7a,
        Event8, Event8a, Event9, Event9a, Event10, Event10a, No_Event);

    type Runtime_Events is
       (Task_Creation_Begin,  
        Task_Creation_End, Simple_Entry_Call_Req, Simple_Entry_Call_End,
        Timed_Entry_Call_Req, Timed_Entry_Call_End, Timed_Entry_Call_Timeout,
        Cond_Entry_Call_Req, Cond_Entry_Call_End, Simple_Accept_Req,
        Simple_Accept_End, Select_Req, Select_Else_Req, Select_Delay_Req,
        Select_Terminate_Req, Select_End, Select_Else_End,
        Select_Delay_End, Select_Terminate_End, Delay_Req, Delay_Expired,
        Continue_From_Delay, Delay_Until_Req, Delay_Until_Expired,
        Continue_From_Delay_Until, Rte_Exception, Raise_Req,
        Exception_Handler, Task_Begin_Req, Task_Begin_Begin,
        Task_Terminate_Req, Task_Terminate, Task_Abort_Req, Task_Abort,

        Task_Semaphore_Wait, Task_Semaphore_Wait_Complete,
        Task_Semaphore_Wait_Timeout, Task_Semaphore_Signal,

        Memory_Allocate,  
        Memory_Deallocate,

        -- Non-threaded run-time scheduling events
        Switch_To,  
        Switch_To_Idle_Task, Switch_To_Rendezvous_In_Called,

        -- Threaded run-time scheduling events
        Kernel_Signal,  
        Kernel_Wait, Kernel_Wait_Complete, Kernel_Signal_Wait,
        Kernel_Signal_Wait_Complete, Kernel_Timed_Wait,
        Kernel_Timed_Wait_Complete, Kernel_Timed_Wait_Timeout,

        Interrupt_Entry, Interrupt_Exit,

        Breakpoint,            -- Inserted by a.db to explain large time gap

        -- Distributed Ada
        Da_Simple_Entry_Req, Da_Simple_Entry_End, Da_Conditional_Entry_Req,
        Da_Conditional_Entry_End, Da_Timed_Entry_Req, Da_Timed_Entry_End,
        Da_Dt_Write_Req, Da_Dt_Write_End, Da_Dt_Read_Req,
        Da_Dt_Read_End, Da_Rem_Subp_Req, Da_Rem_Subp_End,
        Da_Local_New_Req, Da_Global_Free_Req, Da_Local_Free_Req

        );

    type Profile_Events is (Calls, Returns, Basic_Block,
                            Exceptions, Interrupts, Cache_Flush,
                            Operand_Changed_Address, Operand_Changed_Value,
                            Program_Generated_Value, Continuation_Block);

    type Runtime_Enables is array (Runtime_Events) of Boolean;

--\x09LOG_STRING_SIZE : constant integer := 16;
    subtype Log_String is String (1 .. 16);

    --

    type Event (Logged_Event : Kind_Of_Event := Header_Event) is
        record
            Node : Integer;  
            Task_Id : System.Task_Id;  
            Time_Stamp : Microseconds;
            case Logged_Event is
                when Header_Event =>
                    Task_Name : Integer;
                    Phase : Duration;
                    Period : Duration;
                    Execution_Time : Microseconds;
                    Priority : System.Priority;  
                when Runtime_Event =>
                    Rts_Event : Runtime_Events;  
                    Arg1 : Integer;  
                    Arg2 : Integer;  
                    Arg3 : Integer;  
                    Arg4 : Integer;
                    -- unpublished events
                when Kernel_Event =>
                    Krn_Event : Integer;  
                    P1 : Integer;  
                    P2 : Integer;  
                    P3 : Integer;  
                    P4 : Integer;  
                when User_Defined_Event =>
                    User_Event : User_Events;  
                    Comment : Log_String;
                when Profile_Event =>
                    Prof_Event : Profile_Events;
                    Location : System.Address;
                    Word1 : Integer;
                    Word2 : Integer;
                    Word3 : Integer;
            end case;
        end record;

    Event_Record_Size : Integer;
    pragma Interface_Name (Event_Record_Size, "__V_I_TRACE_EVENT_RECORD_SIZE");
    --
    Auto_Trace : Boolean;
    pragma Interface_Name (Auto_Trace, "__V_I_TRACE_AUTO_TRACE");
    --
    Runtime_Log : Runtime_Enables;
    pragma Interface_Name (Runtime_Log, "__V_I_TRACE_RUNTIME_LOG");
    Runtime_Setup : Runtime_Enables;

    -- Deliberately using constrained array. Allows use of unchecked_conversion
    -- from address to pointer and back. (Vads specific)
    pragma Warnings (Off);
    type Event_Buffer_T is array (Positive) of V_I_Trace.Event;
    type A_Event_Buffer_T is access Event_Buffer_T;
    pragma Warnings (On);
    Event_Buffer : A_Event_Buffer_T;
    Event_Buffer_Size : Integer; -- 4096 Default unless overridden by user
    Event_Buffer_Index : Integer;

    pragma Interface_Name (Event_Buffer, "__V_I_TRACE_EVENT_BUFFER");
    pragma Interface_Name (Event_Buffer_Size, "__V_I_TRACE_EVENT_BUFFER_SIZE");
    pragma Interface_Name (Event_Buffer_Index,
                           "__V_I_TRACE_EVENT_BUFFER_INDEX");


    Wrap_Around : Boolean;
    Log_Overflowed : Boolean;
    Disable_Locking : Boolean;
    Hardware_Logging : Boolean;
    pragma Interface_Name (Wrap_Around, "__V_I_TRACE_WRAP_AROUND");
    pragma Interface_Name (Log_Overflowed, "__V_I_TRACE_LOG_OVERFLOWED");
    pragma Interface_Name (Disable_Locking, "__V_I_TRACE_DISABLE_LOCKING");
    pragma Interface_Name (Hardware_Logging, "__V_I_TRACE_HARDWARE_LOGGING");

    type A_Boolean is access Boolean;
    type A_Integer is access Integer;

    type Trace_Configuration_T is
        record
            -- User configurable
            Runtime_Log : Runtime_Enables;
            Event_Buffer_Size : Integer;         -- number of records
            Event_Buffer : A_Event_Buffer_T;  -- null is don't care
            Wrap_Around : Boolean;
            Hardware_Logging : Boolean;
            Disable_Locking : Boolean;  -- single processor,
                                        -- not logging interrupts
            Nearly_Full_Callout : System.Address;   -- no_addr is don't care
            Nearly_Full_Index : Integer;

            Get_Time_Callout : System.Address;  -- used in user code and
                                                -- task services
            Krn_Get_Time_Callout : System.Address;  -- callable from kernel

            -- Cannot be modified by user
            Event_Buffer_Index : A_Integer;  
            Log_Overflowed : A_Boolean;
            Krn_Log_Enables : V_I_Krn_Trace.Kernel_Enables;
            Init_Logging_Address : System.Address;
            Log_Address : System.Address;
        end record;
    type A_Trace_Configuration_T is access Trace_Configuration_T;

    type Arg_Type is (Arg_Tcb, Arg_Pc, Arg_Time, Arg_Entry, Arg_Priority,
                      Arg_Sema, Arg_Boolean, Arg_Integer, Arg_Address,
                      Arg_Size, Arg_Addr1, Arg_Addr2,  -- DA address components
                      Arg_Id, Arg_Value, Arg_Null);

    type Arg_Descriptor is
        record
            Arg1_Type : Arg_Type;
            Arg2_Type : Arg_Type;
            Arg3_Type : Arg_Type;
            Arg4_Type : Arg_Type;
        end record;


    Arg_Descriptors : array (Runtime_Events) of Arg_Descriptor :=
       (Task_Creation_Begin => (Arg_Priority, Arg_Pc, Arg_Null, Arg_Null),
        Task_Creation_End => (Arg_Tcb, Arg_Pc, Arg_Address, Arg_Null),
        Simple_Entry_Call_Req => (Arg_Tcb, Arg_Entry, Arg_Pc, Arg_Null),
        Simple_Entry_Call_End => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),
        Timed_Entry_Call_Req => (Arg_Tcb, Arg_Entry, Arg_Pc, Arg_Null),
        Timed_Entry_Call_End => (Arg_Tcb, Arg_Boolean, Arg_Null, Arg_Null),
        Timed_Entry_Call_Timeout => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Cond_Entry_Call_Req => (Arg_Tcb, Arg_Entry, Arg_Pc, Arg_Null),
        Cond_Entry_Call_End => (Arg_Tcb, Arg_Boolean, Arg_Null, Arg_Null),
        Simple_Accept_Req => (Arg_Entry, Arg_Pc, Arg_Null, Arg_Null),
        Simple_Accept_End => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Select_Req => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Select_Else_Req => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Select_Delay_Req => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Select_Terminate_Req => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Select_End => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Select_Else_End => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Select_Delay_End => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Select_Terminate_End => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Delay_Req => (Arg_Pc, Arg_Time, Arg_Null, Arg_Null),
        Delay_Expired => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Continue_From_Delay => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Delay_Until_Req => (Arg_Pc, Arg_Time, Arg_Null, Arg_Null),
        Delay_Until_Expired => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Continue_From_Delay_Until => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Rte_Exception => (Arg_Address, Arg_Null, Arg_Null, Arg_Null),
        Raise_Req => (Arg_Address, Arg_Pc, Arg_Null, Arg_Null),
        Exception_Handler => (Arg_Address, Arg_Pc, Arg_Null, Arg_Null),
        Task_Begin_Req => (Arg_Tcb, Arg_Pc, Arg_Null, Arg_Null),
        Task_Begin_Begin => (Arg_Tcb, Arg_Tcb, Arg_Null, Arg_Null),
        Task_Terminate_Req => (Arg_Tcb, Arg_Pc, Arg_Null, Arg_Null),
        Task_Terminate => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Task_Abort_Req => (Arg_Tcb, Arg_Pc, Arg_Null, Arg_Null),
        Task_Abort => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),

        Task_Semaphore_Wait => (Arg_Sema, Arg_Time, Arg_Null, Arg_Null),
        Task_Semaphore_Wait_Complete =>
           (Arg_Sema, Arg_Null, Arg_Null, Arg_Null),
        Task_Semaphore_Wait_Timeout => (Arg_Sema, Arg_Null, Arg_Null, Arg_Null),
        Task_Semaphore_Signal => (Arg_Sema, Arg_Null, Arg_Null, Arg_Null),

        Memory_Allocate => (Arg_Address, Arg_Size, Arg_Pc, Arg_Null),
        Memory_Deallocate => (Arg_Address, Arg_Pc, Arg_Null, Arg_Null),

        Switch_To => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),  
        Switch_To_Idle_Task => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Switch_To_Rendezvous_In_Called =>
           (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),

        Kernel_Signal => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),  
        Kernel_Wait => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),
        Kernel_Wait_Complete => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),
        Kernel_Signal_Wait => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),
        Kernel_Signal_Wait_Complete => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),
        Kernel_Timed_Wait => (Arg_Tcb, Arg_Time, Arg_Null, Arg_Null),
        Kernel_Timed_Wait_Complete => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),
        Kernel_Timed_Wait_Timeout => (Arg_Tcb, Arg_Null, Arg_Null, Arg_Null),

        Interrupt_Entry => (Arg_Integer, Arg_Address, Arg_Null, Arg_Null),
        Interrupt_Exit => (Arg_Integer, Arg_Address, Arg_Null, Arg_Null),

        Breakpoint => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),

        -- Distributed Ada
        Da_Simple_Entry_Req => (Arg_Pc, Arg_Addr1, Arg_Addr2, Arg_Entry),
        Da_Simple_Entry_End => (Arg_Null, Arg_Null, Arg_Null, Arg_Null),
        Da_Conditional_Entry_Req => (Arg_Pc, Arg_Addr1, Arg_Addr2, Arg_Entry),
        Da_Conditional_Entry_End => (Arg_Boolean, Arg_Null, Arg_Null, Arg_Null),
        Da_Timed_Entry_Req => (Arg_Pc, Arg_Addr1, Arg_Addr2, Arg_Entry),
        Da_Timed_Entry_End => (Arg_Boolean, Arg_Null, Arg_Null, Arg_Null),
        Da_Dt_Write_Req => (Arg_Pc, Arg_Address, Arg_Size, Arg_Null),
        Da_Dt_Write_End => (Arg_Address, Arg_Addr1, Arg_Addr2, Arg_Null),
        Da_Dt_Read_Req => (Arg_Pc, Arg_Address, Arg_Size, Arg_Null),
        Da_Dt_Read_End => (Arg_Address, Arg_Addr1, Arg_Addr2, Arg_Null),
        Da_Rem_Subp_Req => (Arg_Pc, Arg_Addr1, Arg_Addr2, Arg_Integer),
        Da_Rem_Subp_End => (Arg_Addr1, Arg_Addr2, Arg_Null, Arg_Null),
        Da_Local_New_Req => (Arg_Pc, Arg_Size, Arg_Null, Arg_Null),
        Da_Global_Free_Req => (Arg_Pc, Arg_Addr1, Arg_Addr2, Arg_Null),
        Da_Local_Free_Req => (Arg_Pc, Arg_Addr1, Arg_Addr2, Arg_Null));

    Profile_Arg_Descriptors : array (Profile_Events) of Arg_Descriptor :=
       (Calls => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Returns => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Basic_Block => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Exceptions => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Interrupts => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Cache_Flush => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Operand_Changed_Address => (Arg_Pc, Arg_Id, Arg_Address, Arg_Null),
        Operand_Changed_Value => (Arg_Pc, Arg_Id, Arg_Value, Arg_Value),
        Program_Generated_Value => (Arg_Pc, Arg_Null, Arg_Null, Arg_Null),
        Continuation_Block => (Arg_Value, Arg_Value, Arg_Value, Arg_Value));

    procedure Rte_Log (Kind : Runtime_Events;
                       P1 : Integer := 0;
                       P2 : Integer := 0;
                       P3 : Integer := 0;
                       P4 : Integer := 0);
    pragma Interface (Ada, Rte_Log);
    pragma Interface_Name (Rte_Log, "__TS_DEBUG_RTE_LOG");

    procedure User_Log (Kind : User_Events; Comment : V_I_Trace.Log_String);
    pragma Interface (Ada, User_Log);
    pragma Interface_Name (User_Log, "__TS_DEBUG_USER_LOG");

    procedure Header_Log (Event_Rec : in out Event);
    pragma Interface (Ada, Header_Log);
    pragma Interface_Name (Header_Log, "__TS_DEBUG_HEADER_LOG");

    ------------------------------------------------------------------

    procedure Log_Call;
    pragma Interface (Ada, Log_Call);
    pragma Interface_Name (Log_Call, "__TRACE_LOG_CALL");

    procedure Log_Return;
    pragma Interface (Ada, Log_Return);
    pragma Interface_Name (Log_Return, "__TRACE_LOG_RETURN");

    procedure Log_Basic_Block;
    pragma Interface (Ada, Log_Basic_Block);
    pragma Interface_Name (Log_Basic_Block, "__TRACE_LOG_BLOCK");

    procedure Log_Variable_Word (Id : Integer; Value : Integer);
    pragma Interface (Ada, Log_Variable_Word);
    pragma Interface_Name (Log_Variable_Word, "__TRACE_LOG_VARIABLE_WORD");

    procedure Log_Variable
                 (Id : Integer; Location : Integer; Bit_Size : Integer);
    pragma Interface (Ada, Log_Variable);
    pragma Interface_Name (Log_Variable, "__TRACE_LOG_VARIABLE");


    ------------------------------------------------------------------

    procedure Init_Logging (Configuration : A_Trace_Configuration_T);
    pragma Interface (Ada, Init_Logging);
    pragma Interface_Name (Init_Logging, "__TS_DEBUG_INIT_LOGGING");

end V_I_Trace;

E3 Meta Data

    nblk1=11
    nid=0
    hdr6=22
        [0x00] rec0=1c rec1=00 rec2=01 rec3=000
        [0x01] rec0=15 rec1=00 rec2=02 rec3=044
        [0x02] rec0=16 rec1=00 rec2=03 rec3=04c
        [0x03] rec0=1b rec1=00 rec2=04 rec3=018
        [0x04] rec0=18 rec1=00 rec2=05 rec3=046
        [0x05] rec0=1a rec1=00 rec2=06 rec3=02c
        [0x06] rec0=16 rec1=00 rec2=07 rec3=038
        [0x07] rec0=16 rec1=00 rec2=08 rec3=04a
        [0x08] rec0=18 rec1=00 rec2=09 rec3=048
        [0x09] rec0=0e rec1=00 rec2=0a rec3=044
        [0x0a] rec0=0e rec1=00 rec2=0b rec3=066
        [0x0b] rec0=13 rec1=00 rec2=0c rec3=084
        [0x0c] rec0=11 rec1=00 rec2=0d rec3=098
        [0x0d] rec0=0f rec1=00 rec2=0e rec3=04e
        [0x0e] rec0=13 rec1=00 rec2=0f rec3=04c
        [0x0f] rec0=1a rec1=00 rec2=10 rec3=01a
        [0x10] rec0=0d rec1=00 rec2=11 rec3=001
    tail 0x21750be66868438bd2c5d 0x42a00088462060003