public static unsafe ProfilerRecorder StartNew(ProfilerCategory category, string statName, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
 {
     fixed(char *c = statName)
     {
         return(new ProfilerRecorder(category, c, statName.Length, capacity, options | ProfilerRecorderOptions.StartImmediately));
     }
 }
        public ProfilerMarker(ProfilerCategory category, string name, string param1Name)
        {
#if ENABLE_PROFILER
            m_P1Type = ProfilerUtility.GetProfilerMarkerDataType <TP1>();
            m_Ptr    = ProfilerUnsafeUtility.CreateMarker(name, category, MarkerFlags.Default, 1);
            ProfilerUnsafeUtility.SetMarkerMetadata(m_Ptr, 0, param1Name, m_P1Type, (byte)ProfilerMarkerDataUnit.Undefined);
#endif
        }
Ejemplo n.º 3
0
        public ProfilerCounter(ProfilerCategory category, string name, ProfilerMarkerDataUnit dataUnit)
        {
#if ENABLE_PROFILER
            m_Type = ProfilerUtility.GetProfilerMarkerDataType <T>();
            m_Ptr  = ProfilerUnsafeUtility.CreateMarker(name, category, MarkerFlags.Counter, 1);
            ProfilerUnsafeUtility.SetMarkerMetadata(m_Ptr, 0, null, m_Type, (byte)dataUnit);
#endif
        }
        public ProfilerCounterValue(ProfilerCategory category, string name, ProfilerMarkerDataUnit dataUnit)
        {
#if ENABLE_PROFILER
            byte dataType = ProfilerUtility.GetProfilerMarkerDataType <T>();
            unsafe
            {
                m_Value = (T *)ProfilerUnsafeUtility.CreateCounterValue(out var counterPtr, name, category, MarkerFlags.Default, dataType, (byte)dataUnit, UnsafeUtility.SizeOf <T>(), ProfilerCounterOptions.FlushOnEndOfFrame);
            }
#endif
        }
Ejemplo n.º 5
0
        public unsafe static ProfilerRecorder StartNew(ProfilerCategory category, string statName, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
        {
            char *ptr = statName;

            if (ptr != null)
            {
                ptr += RuntimeHelpers.OffsetToStringData / 2;
            }
            return(new ProfilerRecorder(category, ptr, statName.Length, capacity, options | ProfilerRecorderOptions.StartImmediately));
        }
 public unsafe ProfilerMarker(ProfilerCategory category, char *name, int nameLen)
 {
     this.m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, nameLen, category, MarkerFlags.Default, 0);
 }
 public ProfilerMarker(ProfilerCategory category, string name)
 {
     this.m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, category, MarkerFlags.Default, 0);
 }
 public unsafe ProfilerMarker(ProfilerCategory category, char *name, int nameLen, MarkerFlags flags)
 {
     m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, nameLen, category, flags, 0);
 }
 public ProfilerMarker(ProfilerCategory category, string name, MarkerFlags flags)
 {
     m_Ptr = ProfilerUnsafeUtility.CreateMarker(name, category, flags, 0);
 }
Ejemplo n.º 10
0
        public unsafe ProfilerRecorder(ProfilerCategory category, char *statName, int statNameLen, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
        {
            ProfilerRecorderHandle byName = ProfilerRecorderHandle.GetByName(category, statName, statNameLen);

            this = ProfilerRecorder.Create(byName, capacity, options);
        }
Ejemplo n.º 11
0
        public ProfilerRecorder(ProfilerCategory category, string statName, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
        {
            ProfilerRecorderHandle byName = ProfilerRecorderHandle.GetByName(category, statName);

            this = ProfilerRecorder.Create(byName, capacity, options);
        }
        public unsafe ProfilerRecorder(ProfilerCategory category, char *statName, int statNameLen, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
        {
            var statHandle = LowLevel.Unsafe.ProfilerRecorderHandle.GetByName(category, statName, statNameLen);

            this = Create(statHandle, capacity, options);
        }
 public unsafe ProfilerRecorder(ProfilerCategory category, string statName, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
 {
     LowLevel.Unsafe.ProfilerRecorderHandle statHandle;
     statHandle = LowLevel.Unsafe.ProfilerRecorderHandle.GetByName(category, statName);
     this       = Create(statHandle, capacity, options);
 }