Ejemplo n.º 1
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddArray(name, Statics.Format16(format, TraceLoggingDataType.Char16));
 }
Ejemplo n.º 2
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddScalar(name, Statics.Format64(format, TraceLoggingDataType.UInt64));
 }
Ejemplo n.º 3
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddGroup(name);
 }
Ejemplo n.º 4
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddArray(name, Statics.FormatPtr(format, Statics.UIntPtrType));
 }
Ejemplo n.º 5
0
        public static TraceLoggingDataType Format16(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case EventFieldFormat.String:
                return(TraceLoggingDataType.Char16);

            case EventFieldFormat.Hexadecimal:
                return(TraceLoggingDataType.HexInt16);

#if false
            case EventSourceFieldFormat.Port:
                return(TraceLoggingDataType.Port);

            case EventSourceFieldFormat.Signed:
                return(TraceLoggingDataType.Int16);

            case EventSourceFieldFormat.Unsigned:
                return(TraceLoggingDataType.UInt16);
#endif
            default:
                return(MakeDataType(native, format));
            }
        }
Ejemplo n.º 6
0
        public static TraceLoggingDataType Format64(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case EventFieldFormat.Hexadecimal:
                return(TraceLoggingDataType.HexInt64);

#if false
            case EventSourceFieldFormat.FileTime:
                return(TraceLoggingDataType.FileTime);

            case EventSourceFieldFormat.Signed:
                return(TraceLoggingDataType.Int64);

            case EventSourceFieldFormat.Unsigned:
                return(TraceLoggingDataType.UInt64);
#endif
            default:
                return(MakeDataType(native, format));
            }
        }
Ejemplo n.º 7
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string?name,
     EventFieldFormat format)
 {
     collector.AddNullTerminatedString(name !, Statics.MakeDataType(TraceLoggingDataType.Utf16String, format));
 }
Ejemplo n.º 8
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string?name,
     EventFieldFormat format)
 {
     collector.AddScalar(name !, Statics.MakeDataType(TraceLoggingDataType.Double, format));
 }
Ejemplo n.º 9
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddArray(name, Statics.MakeDataType(TraceLoggingDataType.Guid, format));
 }
Ejemplo n.º 10
0
        public override void WriteMetadata(
            TraceLoggingMetadataCollector collector,
            string name,
            EventFieldFormat format)
        {
            var groupCollector = collector.AddGroup(name);

            if (this.properties != null)
            {
                foreach (var property in this.properties)
                {
                    var propertyFormat    = EventFieldFormat.Default;
                    var propertyAttribute = property.fieldAttribute;
                    if (propertyAttribute != null)
                    {
                        groupCollector.Tags = propertyAttribute.Tags;
                        propertyFormat      = propertyAttribute.Format;
                    }

                    property.typeInfo.WriteMetadata(
                        groupCollector,
                        property.name,
                        propertyFormat);
                }
            }
        }
Ejemplo n.º 11
0
        // Token: 0x060035E0 RID: 13792 RVA: 0x000CF2E6 File Offset: 0x000CD4E6
        public static TraceLoggingDataType Format32(EventFieldFormat format, TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case (EventFieldFormat)1:
            case EventFieldFormat.String:
                break;

            case EventFieldFormat.Boolean:
                return(TraceLoggingDataType.Boolean32);

            case EventFieldFormat.Hexadecimal:
                return(TraceLoggingDataType.HexInt32);

            default:
                if (format == EventFieldFormat.HResult)
                {
                    return(TraceLoggingDataType.HResult);
                }
                break;
            }
            return(Statics.MakeDataType(native, format));
        }
Ejemplo n.º 12
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddGroup(name);
 }
Ejemplo n.º 13
0
        public override void WriteMetadata(
            TraceLoggingMetadataCollector collector,
            string name,
            EventFieldFormat format)
        {
            var groupCollector = collector.AddGroup(name);
            if (this.properties != null)
            {
                foreach (var property in this.properties)
                {
                    var propertyFormat = EventFieldFormat.Default;
                    var propertyAttribute = property.fieldAttribute;
                    if (propertyAttribute != null)
                    {
                        groupCollector.Tags = propertyAttribute.Tags;
                        propertyFormat = propertyAttribute.Format;
                    }

                    property.typeInfo.WriteMetadata(
                        groupCollector,
                        property.name,
                        propertyFormat);
                }
            }
        }
Ejemplo n.º 14
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddBinary(name, Statics.MakeDataType(TraceLoggingDataType.CountedUtf16String, format));
 }
Ejemplo n.º 15
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.BeginBufferedArray();
     this.elementInfo.WriteMetadata(collector, name, format);
     collector.EndBufferedArray();
 }
Ejemplo n.º 16
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string?name,
     EventFieldFormat format)
 {
     collector.BeginBufferedArray();
     this.elementInfo.WriteMetadata(collector, name, format);
     collector.EndBufferedArray();
 }
Ejemplo n.º 17
0
        public override void WriteMetadata(
            TraceLoggingMetadataCollector collector,
            string name,
            EventFieldFormat format)
        {
            var group = collector.AddGroup(name);

            group.AddScalar("HasValue", TraceLoggingDataType.Boolean8);
            this.valueInfo.WriteMetadata(group, "Value", format);
        }
Ejemplo n.º 18
0
        public override void WriteMetadata(
            TraceLoggingMetadataCollector collector,
            string name,
            EventFieldFormat format)
        {
            var group = collector.AddGroup(name);

            this.keyInfo.WriteMetadata(group, "Key", EventFieldFormat.Default);
            this.valueInfo.WriteMetadata(group, "Value", format);
        }
Ejemplo n.º 19
0
        public override void WriteMetadata(
            TraceLoggingMetadataCollector collector,
            string?name,
            EventFieldFormat format)
        {
            // name can be null if the string was used as a top-level object in an event.
            // In that case, use 'message' as the name of the field.
            name ??= "message";

            collector.AddNullTerminatedString(name, Statics.MakeDataType(TraceLoggingDataType.Utf16String, format));
        }
Ejemplo n.º 20
0
 public static TraceLoggingDataType FormatPtr(EventFieldFormat format, TraceLoggingDataType native)
 {
     if (format == EventFieldFormat.Default)
     {
         return(native);
     }
     if (format == EventFieldFormat.Hexadecimal)
     {
         return(Statics.HexIntPtrType);
     }
     return(Statics.MakeDataType(native, format));
 }
Ejemplo n.º 21
0
        // Token: 0x060035DF RID: 13791 RVA: 0x000CF2B3 File Offset: 0x000CD4B3
        public static TraceLoggingDataType Format16(EventFieldFormat format, TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case EventFieldFormat.String:
                return(TraceLoggingDataType.Char16);

            case EventFieldFormat.Hexadecimal:
                return(TraceLoggingDataType.HexInt16);
            }
            return(Statics.MakeDataType(native, format));
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Adjusts the native type based on format.
        /// - If format is default, return native.
        /// - If format is recognized, return the canonical type for that format.
        /// - Otherwise remove existing format from native and apply the requested format.
        /// </summary>
        public static TraceLoggingDataType FormatPtr(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case EventFieldFormat.Hexadecimal:
                return(HexIntPtrType);

            default:
                return(MakeDataType(native, format));
            }
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Adjusts the native type based on format.
        /// - If format is default, return native.
        /// - If format is recognized, return the canonical type for that format.
        /// - Otherwise remove existing format from native and apply the requested format.
        /// </summary>
        public static TraceLoggingDataType Format8(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            return(format switch
            {
                EventFieldFormat.Default => native,
                EventFieldFormat.String => TraceLoggingDataType.Char8,
                EventFieldFormat.Boolean => TraceLoggingDataType.Boolean8,
                EventFieldFormat.Hexadecimal => TraceLoggingDataType.HexInt8,
#if false
                EventSourceFieldFormat.Signed => TraceLoggingDataType.Int8,
                EventSourceFieldFormat.Unsigned => TraceLoggingDataType.UInt8,
#endif
                _ => MakeDataType(native, format),
            });
        /// <summary>
        /// Adjusts the native type based on format.
        /// - If format is default, return native.
        /// - If format is recognized, return the canonical type for that format.
        /// - Otherwise remove existing format from native and apply the requested format.
        /// </summary>
        public static TraceLoggingDataType Format16(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            return format switch
            {
                EventFieldFormat.Default => native,
                EventFieldFormat.String => TraceLoggingDataType.Char16,
                EventFieldFormat.Hexadecimal => TraceLoggingDataType.HexInt16,
#if false
                EventSourceFieldFormat.Port => TraceLoggingDataType.Port,
                EventSourceFieldFormat.Signed => TraceLoggingDataType.Int16,
                EventSourceFieldFormat.Unsigned => TraceLoggingDataType.UInt16,
#endif
                _ => MakeDataType(native, format),
            };
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Adjusts the native type based on format.
        /// - If format is default, return native.
        /// - If format is recognized, return the canonical type for that format.
        /// - Otherwise remove existing format from native and apply the requested format.
        /// </summary>
        public static TraceLoggingDataType Format32(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case EventFieldFormat.Boolean:
                return(TraceLoggingDataType.Boolean32);

            case EventFieldFormat.Hexadecimal:
                return(TraceLoggingDataType.HexInt32);

#if false
            case EventSourceFieldFormat.Ipv4Address:
                return(TraceLoggingDataType.Ipv4Address);

            case EventSourceFieldFormat.ProcessId:
                return(TraceLoggingDataType.ProcessId);

            case EventSourceFieldFormat.ThreadId:
                return(TraceLoggingDataType.ThreadId);

            case EventSourceFieldFormat.Win32Error:
                return(TraceLoggingDataType.Win32Error);

            case EventSourceFieldFormat.NTStatus:
                return(TraceLoggingDataType.NTStatus);
#endif
            case EventFieldFormat.HResult:
                return(TraceLoggingDataType.HResult);

#if false
            case EventSourceFieldFormat.Signed:
                return(TraceLoggingDataType.Int32);

            case EventSourceFieldFormat.Unsigned:
                return(TraceLoggingDataType.UInt32);
#endif
            default:
                return(MakeDataType(native, format));
            }
        }
Ejemplo n.º 26
0
        // Token: 0x06003526 RID: 13606 RVA: 0x000CE2FC File Offset: 0x000CC4FC
        public override void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format)
        {
            TraceLoggingMetadataCollector traceLoggingMetadataCollector = collector.AddGroup(name);

            if (this.properties != null)
            {
                foreach (PropertyAnalysis propertyAnalysis in this.properties)
                {
                    EventFieldFormat    format2        = EventFieldFormat.Default;
                    EventFieldAttribute fieldAttribute = propertyAnalysis.fieldAttribute;
                    if (fieldAttribute != null)
                    {
                        traceLoggingMetadataCollector.Tags = fieldAttribute.Tags;
                        format2 = fieldAttribute.Format;
                    }
                    propertyAnalysis.typeInfo.WriteMetadata(traceLoggingMetadataCollector, propertyAnalysis.name, format2);
                }
            }
        }
Ejemplo n.º 27
0
        public override void WriteMetadata(
            TraceLoggingMetadataCollector collector,
            string name,
            EventFieldFormat format)
        {
            switch (format)
            {
            default:
                collector.AddBinary(name, Statics.MakeDataType(TraceLoggingDataType.Binary, format));
                break;

            case EventFieldFormat.String:
                collector.AddBinary(name, TraceLoggingDataType.CountedMbcsString);
                break;

            case EventFieldFormat.Xml:
                collector.AddBinary(name, TraceLoggingDataType.CountedMbcsXml);
                break;

            case EventFieldFormat.Json:
                collector.AddBinary(name, TraceLoggingDataType.CountedMbcsJson);
                break;

            case EventFieldFormat.Boolean:
                collector.AddArray(name, TraceLoggingDataType.Boolean8);
                break;

            case EventFieldFormat.Hexadecimal:
                collector.AddArray(name, TraceLoggingDataType.HexInt8);
                break;

#if false
            case EventSourceFieldFormat.Signed:
                collector.AddArray(name, TraceLoggingDataType.Int8);
                break;

            case EventSourceFieldFormat.Unsigned:
                collector.AddArray(name, TraceLoggingDataType.UInt8);
                break;
#endif
            }
        }
Ejemplo n.º 28
0
        public override void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format)
        {
            TraceLoggingMetadataCollector collector1 = collector.AddGroup(name);

            if (this.properties == null)
            {
                return;
            }
            foreach (PropertyAnalysis property in this.properties)
            {
                EventFieldFormat    format1             = EventFieldFormat.Default;
                EventFieldAttribute eventFieldAttribute = property.fieldAttribute;
                if (eventFieldAttribute != null)
                {
                    collector1.Tags = eventFieldAttribute.Tags;
                    format1         = eventFieldAttribute.Format;
                }
                property.typeInfo.WriteMetadata(collector1, property.name, format1);
            }
        }
        /// <summary>
        /// Adjusts the native type based on format.
        /// - If format is default, return native.
        /// - If format is recognized, return the canonical type for that format.
        /// - Otherwise remove existing format from native and apply the requested format.
        /// </summary>
        public static TraceLoggingDataType Format32(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            return format switch
            {
                EventFieldFormat.Default => native,
                EventFieldFormat.Boolean => TraceLoggingDataType.Boolean32,
                EventFieldFormat.Hexadecimal => TraceLoggingDataType.HexInt32,
#if false
                EventSourceFieldFormat.Ipv4Address => TraceLoggingDataType.Ipv4Address,
                EventSourceFieldFormat.ProcessId => TraceLoggingDataType.ProcessId,
                EventSourceFieldFormat.ThreadId => TraceLoggingDataType.ThreadId,
                EventSourceFieldFormat.Win32Error => TraceLoggingDataType.Win32Error,
                EventSourceFieldFormat.NTStatus => TraceLoggingDataType.NTStatus,
#endif
                EventFieldFormat.HResult => TraceLoggingDataType.HResult,
#if false
                case EventSourceFieldFormat.Signed:
                    return TraceLoggingDataType.Int32;
Ejemplo n.º 30
0
        /// <summary>
        /// Adjusts the native type based on format.
        /// - If format is default, return native.
        /// - If format is recognized, return the canonical type for that format.
        /// - Otherwise remove existing format from native and apply the requested format.
        /// </summary>
        public static TraceLoggingDataType Format32(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case EventFieldFormat.Boolean:
                return(TraceLoggingDataType.Boolean32);

            case EventFieldFormat.Hexadecimal:
                return(TraceLoggingDataType.HexInt32);

            case EventFieldFormat.HResult:
                return(TraceLoggingDataType.HResult);

            default:
                return(MakeDataType(native, format));
            }
        }
Ejemplo n.º 31
0
        /// <summary>
        /// Adjusts the native type based on format.
        /// - If format is default, return native.
        /// - If format is recognized, return the canonical type for that format.
        /// - Otherwise remove existing format from native and apply the requested format.
        /// </summary>
        public static TraceLoggingDataType Format8(
            EventFieldFormat format,
            TraceLoggingDataType native)
        {
            switch (format)
            {
            case EventFieldFormat.Default:
                return(native);

            case EventFieldFormat.String:
                return(TraceLoggingDataType.Char8);

            case EventFieldFormat.Boolean:
                return(TraceLoggingDataType.Boolean8);

            case EventFieldFormat.Hexadecimal:
                return(TraceLoggingDataType.HexInt8);

            default:
                return(MakeDataType(native, format));
            }
        }
Ejemplo n.º 32
0
        public override void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format)
        {
            var group = collector.AddGroup(name);

            group.AddScalar("Ticks", Statics.MakeDataType(TraceLoggingDataType.FileTime, format));
            group.AddScalar("Offset", TraceLoggingDataType.Int64);
        }
Ejemplo n.º 33
0
 public static TraceLoggingDataType MakeDataType(
     TraceLoggingDataType baseType,
     EventFieldFormat format)
 {
     return((TraceLoggingDataType)(((int)baseType & 0x1f) | ((int)format << 8)));
 }
Ejemplo n.º 34
0
 /// <summary>
 /// When overridden by a derived class, writes the metadata (schema) for
 /// this type. Note that the sequence of operations in WriteMetadata should be
 /// essentially identical to the sequence of operations in
 /// WriteData/WriteObjectData. Otherwise, the metadata and data will not match,
 /// which may cause trouble when decoding the event.
 /// </summary>
 /// <param name="collector">
 /// The object that collects metadata for this object's type. Metadata is written
 /// by calling methods on the collector object. Note that if the type contains
 /// sub-objects, the implementation of this method may need to call the
 /// WriteMetadata method for the type of the sub-object, e.g. by calling
 /// TraceLoggingTypeInfo&lt;SubType&gt;.Instance.WriteMetadata(...).
 /// </param>
 /// <param name="name">
 /// The name of the property that contains an object of this type, or null if this
 /// object is being written as a top-level object of an event. Typical usage
 /// is to pass this value to collector.AddGroup.
 /// </param>
 /// <param name="format">
 /// The format attribute for the field that contains an object of this type.
 /// </param>
 public abstract void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format);
Ejemplo n.º 35
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     var group = collector.AddGroup(name);
     group.AddScalar("HasValue", TraceLoggingDataType.Boolean8);
     this.valueInfo.WriteMetadata(group, "Value", format);
 }
Ejemplo n.º 36
0
 public override void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format)
 {
     var group = collector.AddGroup(name);
     group.AddScalar("Ticks", Statics.MakeDataType(TraceLoggingDataType.FileTime, format));
     group.AddScalar("Offset", TraceLoggingDataType.Int64);
 }
Ejemplo n.º 37
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddBinary(name, Statics.MakeDataType(TraceLoggingDataType.CountedUtf16String, format));
 }
Ejemplo n.º 38
0
 public override void WriteMetadata(
     TraceLoggingMetadataCollector collector,
     string name,
     EventFieldFormat format)
 {
     collector.AddScalar(name, Statics.MakeDataType(TraceLoggingDataType.Double, format));
 }
Ejemplo n.º 39
0
 public override void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format)
 {
     collector.AddScalar(name, formatFunc(format, nativeFormat));
 }