diff --git a/OpenDreamRuntime/DreamThread.cs b/OpenDreamRuntime/DreamThread.cs index a16020ba8e..6f23064695 100644 --- a/OpenDreamRuntime/DreamThread.cs +++ b/OpenDreamRuntime/DreamThread.cs @@ -211,7 +211,10 @@ public static DreamValue Run(DreamProc proc, DreamObject src, DreamObject? usr, var context = new DreamThread(proc.ToString()); if (proc is NativeProc nativeProc) { - return nativeProc.Call(context, src, usr, new(arguments)); + var zone = Profiler.BeginZone(filePath:"Native Proc", lineNumber:0, memberName:nativeProc.Name); + var result = nativeProc.Call(context, src, usr, new(arguments)); + zone?.Dispose(); + return result; } var state = proc.CreateState(context, src, usr, new DreamProcArguments(arguments)); diff --git a/OpenDreamRuntime/Procs/AsyncNativeProc.cs b/OpenDreamRuntime/Procs/AsyncNativeProc.cs index 02a4e43070..81da8138f8 100644 --- a/OpenDreamRuntime/Procs/AsyncNativeProc.cs +++ b/OpenDreamRuntime/Procs/AsyncNativeProc.cs @@ -26,7 +26,7 @@ public sealed class State : ProcState { private AsyncNativeProc? _proc; public override DreamProc? Proc => _proc; - public override (string SourceFile, int Line) TracyLocationId => ("Native Proc", 0); + public override (string SourceFile, int Line) TracyLocationId => ("Async Native Proc", 0); private Func> _taskFunc; private Task? _task; diff --git a/OpenDreamRuntime/Procs/DMProc.cs b/OpenDreamRuntime/Procs/DMProc.cs index 51477eb49b..189068a4d1 100644 --- a/OpenDreamRuntime/Procs/DMProc.cs +++ b/OpenDreamRuntime/Procs/DMProc.cs @@ -488,7 +488,9 @@ public void SetReturn(DreamValue value) { public ProcStatus Call(DreamProc proc, DreamObject? src, DreamProcArguments arguments) { if (proc is NativeProc p) { // Skip a whole song and dance. + var zone = Profiler.BeginZone(filePath:"Native Proc", lineNumber:0, memberName:p.Name); Push(p.Call(Thread, src, Usr, arguments)); + zone?.Dispose(); return ProcStatus.Continue; }