internal AutoScope(ProfilerMarker <TP1> marker, TP1 p1)
            {
#if ENABLE_PROFILER
                m_Marker = marker;
                m_Marker.Begin(p1);
#endif
            }
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         Unity.Profiling.ProfilerMarker o;
         System.String a1;
         checkType(l, 2, out a1);
         o = new Unity.Profiling.ProfilerMarker(a1);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
            internal AutoScope(ProfilerMarker <TP1, TP2, TP3> marker, TP1 p1, TP2 p2, TP3 p3)
            {
#if ENABLE_PROFILER
                m_Marker = marker;
                m_Marker.Begin(p1, p2, p3);
#endif
            }
        public static unsafe void Begin(this ProfilerMarker marker, ulong metadata)
        {
            var data = new ProfilerMarkerData
            {
                Type = (byte)ProfilerMarkerDataType.UInt64,
                Size = (uint)UnsafeUtility.SizeOf <ulong>(),
                Ptr  = &metadata
            };

            ProfilerUnsafeUtility.BeginSampleWithMetadata(marker.Handle, 1, &data);
        }
        public static unsafe void Begin(this ProfilerMarker marker, string metadata)
        {
            var data = new ProfilerMarkerData {
                Type = (byte)ProfilerMarkerDataType.String16
            };

            fixed(char *c = metadata)
            {
                data.Size = ((uint)metadata.Length + 1) * 2;
                data.Ptr  = c;
                ProfilerUnsafeUtility.BeginSampleWithMetadata(marker.Handle, 1, &data);
            }
        }
Beispiel #6
0
 static public int ctor_s(IntPtr l)
 {
     try {
         Unity.Profiling.ProfilerMarker o;
         o = new Unity.Profiling.ProfilerMarker();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 static public int constructor(IntPtr l)
 {
     try {
         Unity.Profiling.ProfilerMarker o;
         System.String a1;
         checkType(l, 2, out a1);
         o = new Unity.Profiling.ProfilerMarker(a1);
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
	static public int constructor(IntPtr l) {
		try {
			int argc = LuaDLL.lua_gettop(l);
			Unity.Profiling.ProfilerMarker o;
			if(argc==2){
				System.String a1;
				checkType(l,2,out a1);
				o=new Unity.Profiling.ProfilerMarker(a1);
				pushValue(l,true);
				pushValue(l,o);
				return 2;
			}
			else if(argc<=2){
				o=new Unity.Profiling.ProfilerMarker();
				pushValue(l,true);
				pushValue(l,o);
				return 2;
			}
			return error(l,"New object failed.");
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Beispiel #9
0
 public static ProfilerRecorder StartNew(ProfilerMarker marker, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
 {
     return(new ProfilerRecorder(marker, capacity, options | ProfilerRecorderOptions.StartImmediately));
 }
Beispiel #10
0
 public ProfilerRecorder(ProfilerMarker marker, int capacity = 1, ProfilerRecorderOptions options = ProfilerRecorderOptions.Default)
 {
     this = ProfilerRecorder.Create(ProfilerRecorderHandle.Get(marker), capacity, options);
 }