Exemple #1
0
        public unsafe static void TraceDwordAndString(LID lid, uint info, string str)
        {
            DiagnosticContext.TraceTestLocation(lid.Value);
            if (DiagnosticContext.onLIDCallback != null)
            {
                DiagnosticContext.onLIDCallback(lid);
            }
            DiagnosticContext.GetBuffer();
            int  bytes = DiagnosticContext.asciiEncoding.GetBytes(str, 0, Math.Min(103, str.Length), DiagnosticContext.stringBuffer, 0);
            int  num   = Math.Min(bytes, 103) + 1;
            int  num2  = 1 + (num + 7) / 8;
            uint num3  = (uint)((uint)num2 << 28);

            num3 |= 5242880U;
            byte[] array;
            int    num4;

            DiagnosticContext.GetBufferPointer(DiagnosticContext.SizeOfRecordFromSignature(num3), out array, out num4);
            fixed(byte *ptr = &array[num4])
            {
                DiagnosticContext.LocationAndDwordAndStringRecord *ptr2 = (DiagnosticContext.LocationAndDwordAndStringRecord *)ptr;
                ptr2->Lid  = DiagnosticContext.AdjustLID(lid.Value, num3);
                ptr2->Info = info;
            }

            Array.Copy(DiagnosticContext.stringBuffer, 0, array, num4 + DiagnosticContext.LocationAndDwordAndStringRecord.StructSize, num - 1);
            array[num4 + DiagnosticContext.LocationAndDwordAndStringRecord.StructSize + num - 1] = 0;
        }
Exemple #2
0
 public MeasuredScope(LID lid)
 {
     if (DiagnosticContext.cachedStopwatch != null)
     {
         this.stopwatch = DiagnosticContext.cachedStopwatch;
         DiagnosticContext.cachedStopwatch = null;
     }
     else
     {
         this.stopwatch = new Stopwatch();
     }
     this.lid = lid;
     this.stopwatch.Restart();
 }
Exemple #3
0
        public unsafe static void TraceLocation(LID lid)
        {
            DiagnosticContext.TraceTestLocation(lid.Value);
            if (DiagnosticContext.onLIDCallback != null)
            {
                DiagnosticContext.onLIDCallback(lid);
            }
            byte[] array;
            int    num;

            DiagnosticContext.GetBufferPointer(DiagnosticContext.SizeOfRecordFromSignature(268435456U), out array, out num);
            fixed(byte *ptr = &array[num])
            {
                DiagnosticContext.LocationRecord *ptr2 = (DiagnosticContext.LocationRecord *)ptr;
                ptr2->Lid = DiagnosticContext.AdjustLID(lid.Value, 268435456U);
            }
        }
Exemple #4
0
        public unsafe static void TraceDword(LID lid, uint info)
        {
            DiagnosticContext.TraceTestLocation(lid.Value, 0U, info);
            if (DiagnosticContext.onLIDCallback != null)
            {
                DiagnosticContext.onLIDCallback(lid);
            }
            byte[] array;
            int    num;

            DiagnosticContext.GetBufferPointer(DiagnosticContext.SizeOfRecordFromSignature(269484032U), out array, out num);
            fixed(byte *ptr = &array[num])
            {
                DiagnosticContext.LocationAndDwordRecord *ptr2 = (DiagnosticContext.LocationAndDwordRecord *)ptr;
                ptr2->Lid  = DiagnosticContext.AdjustLID(lid.Value, 269484032U);
                ptr2->Info = info;
            }
        }
Exemple #5
0
        public unsafe static void TraceStoreError(LID lid, uint storeError)
        {
            DiagnosticContext.TraceTestLocation(lid.Value, storeError);
            if (DiagnosticContext.onLIDCallback != null)
            {
                DiagnosticContext.onLIDCallback(lid);
            }
            byte[] array;
            int    num;

            DiagnosticContext.GetBufferPointer(DiagnosticContext.SizeOfRecordFromSignature(272629760U), out array, out num);
            fixed(byte *ptr = &array[num])
            {
                DiagnosticContext.LocationAndStoreErrorRecord *ptr2 = (DiagnosticContext.LocationAndStoreErrorRecord *)ptr;
                ptr2->Lid        = DiagnosticContext.AdjustLID(lid.Value, 272629760U);
                ptr2->StoreError = storeError;
            }
        }
Exemple #6
0
        public unsafe static void TraceLong(LID lid, ulong info)
        {
            DiagnosticContext.TraceTestLocation(lid.Value, (uint)(info >> 32), (uint)(info & (ulong)-1));
            if (DiagnosticContext.onLIDCallback != null)
            {
                DiagnosticContext.onLIDCallback(lid);
            }
            byte[] array;
            int    num;

            DiagnosticContext.GetBufferPointer(DiagnosticContext.SizeOfRecordFromSignature(544210944U), out array, out num);
            fixed(byte *ptr = &array[num])
            {
                DiagnosticContext.LocationAndLongRecord *ptr2 = (DiagnosticContext.LocationAndLongRecord *)ptr;
                ptr2->Lid  = DiagnosticContext.AdjustLID(lid.Value, 544210944U);
                ptr2->Info = info;
            }
        }
Exemple #7
0
        public unsafe static void TracePropTagError(LID lid, uint storeError, uint propTag)
        {
            DiagnosticContext.TraceTestLocation(lid.Value, storeError, propTag);
            if (DiagnosticContext.onLIDCallback != null)
            {
                DiagnosticContext.onLIDCallback(lid);
            }
            byte[] array;
            int    num;

            DiagnosticContext.GetBufferPointer(DiagnosticContext.SizeOfRecordFromSignature(543162368U), out array, out num);
            fixed(byte *ptr = &array[num])
            {
                DiagnosticContext.LocationAndStoreErrorAndProptagRecord *ptr2 = (DiagnosticContext.LocationAndStoreErrorAndProptagRecord *)ptr;
                ptr2->Lid        = DiagnosticContext.AdjustLID(lid.Value, 543162368U);
                ptr2->StoreError = storeError;
                ptr2->PropTag    = propTag;
            }
        }
Exemple #8
0
 public static DiagnosticContext.MeasuredScope TraceLatency(LID lid)
 {
     return(new DiagnosticContext.MeasuredScope(lid));
 }