示例#1
0
        public override bool Register()
        {
            if (!base.Register())
            {
                return(false);
            }

            if (HostController.RegisterEvent("Interrupt",
                                             "Interrupt: Vector={0}",
                                             ref eventTypeInterrupt))
            {
                HostController.RegisterEventField(eventTypeInterrupt,
                                                  "Vector",
                                                  0,
                                                  DataType.__int);
            }
            else
            {
                // The event might have been registered already
                // Check whether we foundit already in the table or not

                if (eventTypeInterrupt == 0)
                {
                    return(false);
                }
            }

            return(true);
        }
示例#2
0
        public override bool Register()
        {
            Buffer = new tmpFreeBlockEntry[Count];

            if (Buffer == null)
            {
                return(false);
            }

            if (HostController.RegisterEvent("MemoryFreeBucket",
                                             "Memory free buckets: Count = {0}",
                                             ref EventTypeHandle))
            {
                HostController.RegisterEventField(EventTypeHandle,
                                                  "BlockCount",
                                                  0,
                                                  DataType.__UIntPtr);

                HostController.RegisterEventField(EventTypeHandle,
                                                  "TotalBucketSize",
                                                  0,
                                                  DataType.__UIntPtr);
            }
            else
            {
                // The event might have been registered already
                // Check whether we foundit already in the table or not

                if (EventTypeHandle == 0)
                {
                    return(false);
                }
            }

            unsafe
            {
                fixed(void *ptr = &Buffer[0])
                {
                    DebugBufferAddress = (UIntPtr)ptr;
                }
            }

            // After all internal fields are setup, we can go ahead and register with the controller

            if (!base.Register())
            {
                return(false);
            }

            return(true);
        }
示例#3
0
        public override bool Register()
        {
            Buffer = new tmpInterruptCounter[Count];

            if (Buffer == null)
            {
                return(false);
            }

            if (HostController.RegisterEvent("InterruptCounter",
                                             "InterruptCounter: Hits={0}",
                                             ref EventTypeHandle))
            {
                HostController.RegisterEventField(EventTypeHandle,
                                                  "Hits",
                                                  0,
                                                  DataType.__int);
            }
            else
            {
                // The event might have been registered already
                // Check whether we foundit already in the table or not

                if (EventTypeHandle == 0)
                {
                    return(false);
                }
            }

            unsafe
            {
                fixed(void *ptr = &Buffer[0])
                {
                    DebugBufferAddress = (UIntPtr)ptr;
                }
            }

            // After all internal fields are setup, we can go ahead and register with the controller

            if (!base.Register())
            {
                return(false);
            }

            return(true);
        }
示例#4
0
        public override bool Register()
        {
            if (!base.Register())
            {
                return(false);
            }

            if (HostController.RegisterEvent("SystemMemoryAllocation",
                                             "Memory allocation event: Address={0}, Memory type = {3}",
                                             ref eventTypeMemoryAllocation))
            {
                HostController.RegisterEventField(eventTypeMemoryAllocation,
                                                  "Address",
                                                  0,
                                                  DataType.__UIntPtr);

                HostController.RegisterEventField(eventTypeMemoryAllocation,
                                                  "Size",
                                                  0,
                                                  DataType.__UIntPtr);

                HostController.RegisterEventField(eventTypeMemoryAllocation,
                                                  "ProcessTag",
                                                  0,
                                                  DataType.__uint16);

                HostController.RegisterEventField(eventTypeMemoryAllocation,
                                                  "MemoryType",
                                                  0,
                                                  DataType.__uint16);
            }
            else
            {
                // The event might have been registered already
                // Check whether we foundit already in the table or not

                if (eventTypeMemoryAllocation == 0)
                {
                    return(false);
                }
            }

            return(true);
        }
示例#5
0
        public override bool Register()
        {
            if (!base.Register())
            {
                return(false);
            }

            ����������� if (HostController.RegisterEvent("ProfileEvent",
                                                         "Profile event.",
                                                         ref eventProfileType))
            {
                �
                �
                ��������������� HostController.RegisterEventField(eventProfileType,
                                                                  ������������������������������������������������� "StackTrace",
                                                                  ��������������� ����������������������������������0,
                                                                  ������������������������������������������������� DataType.__arrayType | DataType.__UIntPtr);

                �
                    �����������
            }
            else
            {
                �
                ��������������� // The event might have been registered already
                ��������������� // Check whether we foundit already in the table or not
                �
                    ��������������� if (eventProfileType == 0)
                {
                    ������������������� return(false);

                    ���������������
                }
                �����������
            }
            �            return(true);
        }
示例#6
0
        public override bool Register()
        {
            // Check assumptions for remainder of method.
            if ((base.Register() == false) || (HostController == null))
            {  // BUGBUG AM: base.Register() should check if HostController is null, not all callers
                DebugStub.WriteLine("TcpSessionEventsSource: Improper Registration Environment.");
                return(false);
            }

            // TcpSessionStateChange event registration
            if (HostController.RegisterEvent("TcpSessionStateChange",
                                             "TCP: Ses{0,3} ({1}) State Change to {2}.",
                                             ref stateChangeTypeHandle))
            { // BUGBUG AM: Aliases possible with different structs.  Should pass in Struct and Reflect to get name of runtime type, field names, ...
                if ((!HostController.RegisterEventField(stateChangeTypeHandle, "SessionId", 0, DataType.__uint16)) ||
                    (!HostController.RegisterEventField(stateChangeTypeHandle, "FromState", 0, DataType.__uint8)) ||
                    (!HostController.RegisterEventField(stateChangeTypeHandle, "ToState", 0, DataType.__uint8)))
                {
                    stateChangeTypeHandle = 0;
                }
            }

            // TcpSessionReceivedPacket event registration
            if (HostController.RegisterEvent("TcpSessionReceivedPacket",
                                             "TCP: Ses{0,3} ({1}) Packet ({2}) Len{3,4} received",
                                             ref receivedPacketTypeHandle))
            {
                if ((!HostController.RegisterEventField(receivedPacketTypeHandle, "SessionId", 0, DataType.__uint16)) ||
                    (!HostController.RegisterEventField(receivedPacketTypeHandle, "SessionState", 0, DataType.__uint8)) ||
                    (!HostController.RegisterEventField(receivedPacketTypeHandle, "PacketFlags", 0, DataType.__uint8)) ||
                    (!HostController.RegisterEventField(receivedPacketTypeHandle, "PacketLength", 0, DataType.__uint16)))
                {
                    receivedPacketTypeHandle = 0;
                }
            }

            // TcpSessionReceivedPacket event registration
            if (HostController.RegisterEvent("TcpSessionSendingPacket",
                                             "TCP: Ses{0,3} ({1}) Packet ({2}) Len{3,4} being sent",
                                             ref sendingPacketTypeHandle))
            {
                if ((!HostController.RegisterEventField(sendingPacketTypeHandle, "SessionId", 0, DataType.__uint16)) ||
                    (!HostController.RegisterEventField(sendingPacketTypeHandle, "SessionState", 0, DataType.__uint8)) ||
                    (!HostController.RegisterEventField(sendingPacketTypeHandle, "PacketFlags", 0, DataType.__uint8)) ||
                    (!HostController.RegisterEventField(sendingPacketTypeHandle, "PacketLength", 0, DataType.__uint16)))
                {
                    sendingPacketTypeHandle = 0;
                }
            }

            // TcpSessionTimeout event registration
            if (HostController.RegisterEvent("TcpSessionTimeout",
                                             "TCP: Ses{0,3} ({1}) Timeout of type '{2}' occurred",
                                             ref timeoutTypeHandle))
            {
                if ((!HostController.RegisterEventField(timeoutTypeHandle, "SessionId", 0, DataType.__uint16)) ||
                    (!HostController.RegisterEventField(timeoutTypeHandle, "SessionState", 0, DataType.__uint8)) ||
                    (!HostController.RegisterEventField(timeoutTypeHandle, "TimeoutType", 0, DataType.__uint8)))
                {
                    timeoutTypeHandle = 0;
                }
            }

            // TcpSessionContractCall event registration
            if (HostController.RegisterEvent("TcpSessionContractCall",
                                             "TCP: Ses{0,3} ({1}) Contract EP '{2}' called.",
                                             ref contractCallTypeHandle))
            {
                if ((!HostController.RegisterEventField(contractCallTypeHandle, "SessionId", 0, DataType.__uint16)) ||
                    (!HostController.RegisterEventField(contractCallTypeHandle, "SessionState", 0, DataType.__uint8)) ||
                    (!HostController.RegisterEventField(contractCallTypeHandle, "ContractCall", 0, DataType.__uint8)))
                {
                    contractCallTypeHandle = 0;
                }
            }

            // Make sure all handles were either there before or were created here.
            if ((stateChangeTypeHandle == 0) || (contractCallTypeHandle == 0) ||
                (sendingPacketTypeHandle == 0) || (sendingPacketTypeHandle == 0))
            {
                // Construct an error message
                StringBuilder errorString = new StringBuilder();
                String        conjunction = "TcpSessionEventsSource: Registration Failed for ";

                // State Change
                if (stateChangeTypeHandle == 0)
                {
                    errorString.Append(conjunction);
                    errorString.Append("StateChangeEventType");
                    conjunction = ", ";
                }

                // Received Packet
                if (receivedPacketTypeHandle == 0)
                {
                    errorString.Append(conjunction);
                    errorString.Append("ReceivedPacketEventType");
                    conjunction = ", ";
                }

                // Sending Packet
                if (sendingPacketTypeHandle == 0)
                {
                    errorString.Append(conjunction);
                    errorString.Append("SendingPacketEventType");
                    conjunction = ", ";
                }

                // Timeout
                if (timeoutTypeHandle == 0)
                {
                    errorString.Append(conjunction);
                    errorString.Append("TimeoutEventType");
                    conjunction = ", ";
                }

                // Contract Call
                if (contractCallTypeHandle == 0)
                {
                    errorString.Append(conjunction);
                    errorString.Append("ContractCallEventType");
                    conjunction = ", ";
                }

                // Complete the error message and write it to the debugger.
                errorString.Append(".");
                errorString.Append(Environment.NewLine);
                DebugStub.Write(errorString.ToString());

                // Report the failure.
                return(false);
            }

            // If this is reached then everything worked so report success.
            return(true);
        }
        public override bool Register()
        {
            if (!base.Register())
            {
                return(false);
            }

            if (HostController == null)
            {
                return(false);
            }

            RegisterEnumSymbols();

            DataType2 dt2 = new DataType2();

            string s = "EachSourceClass";

            Transform.For("EachLogMethod");
            string format = EachLogMethod_Format != null ? EachSourceClass.EachLogMethod_Format : "{0}";

            if (HostController.RegisterEvent(s + ".EachLogMethod", format, ref EachLogMethod_Handle))
            {
                DebugStub.WriteLine("register event succeeded");


                Transform.For("eachParam");
                HostController.RegisterEventField(EachSourceClass.EachLogMethod_Handle,
                                                  "eachParam",
                                                  0,
                                                  dt2.__EachParam);
                Transform.EndFor();

                //
                // HACK!!!!! Some instruction is needed here, otherwise, the transform
                // will merge the enumeration below with the one above
                // producing a mismatch in the order of argumets in the structure declaration
                //
                DebugStub.WriteLine("Registering enums");

                Transform.For("eachBasicEnumParam");

                HostController.RegisterEventGenericField(EachSourceClass.EachLogMethod_Handle,
                                                         "eachBasicEnumParam",
                                                         0,
                                                         sizeof(int),
                                                         BasicEnum_Handle);
                Transform.EndFor();
            }
            else
            {
                // The event might have been registered already
                // Check whether we foundit already in the table or not

                if (EachSourceClass.EachLogMethod_Handle == 0)
                {
                    return(false);
                }
            }
            Transform.EndFor();

            return(true);
        }