diff --git a/managed/CounterStrikeSharp.API/Core/FunctionReference.cs b/managed/CounterStrikeSharp.API/Core/FunctionReference.cs index 83e2fe56a..24dcffc4e 100644 --- a/managed/CounterStrikeSharp.API/Core/FunctionReference.cs +++ b/managed/CounterStrikeSharp.API/Core/FunctionReference.cs @@ -74,25 +74,6 @@ private FunctionReference(Delegate method, FunctionLifetime lifetime) private unsafe CallbackDelegate CreateWrappedCallback() { - var methodName = _targetMethod.Method.DeclaringType?.FullName + "." + _targetMethod.Method.Name; - var profileName = "ScriptCallback::Execute::" + _targetMethod.Method.Name; - - var stackTrace = new StackTrace(2, true); - var firstUserFrame = stackTrace.GetFrames()?.FirstOrDefault(frame => - { - var declaring = frame.GetMethod()?.DeclaringType?.FullName; - return declaring != null && - !declaring.StartsWith("CounterStrikeSharp") && - !declaring.Contains("SafeExecutor") && - !declaring.Contains("FunctionReference"); - }); - - string caller = firstUserFrame != null - ? $"{firstUserFrame.GetMethod()?.DeclaringType?.FullName}.{firstUserFrame.GetMethod()?.Name} @ {firstUserFrame.GetFileName()}:{firstUserFrame.GetFileLineNumber()}" - : "Unknown (no user frame)"; - - Helpers.RegisterCallbackTrace(methodName, 1, profileName, caller); - return context => { try diff --git a/managed/CounterStrikeSharp.API/Core/Helpers.cs b/managed/CounterStrikeSharp.API/Core/Helpers.cs index 313a57ead..d4854dbe3 100644 --- a/managed/CounterStrikeSharp.API/Core/Helpers.cs +++ b/managed/CounterStrikeSharp.API/Core/Helpers.cs @@ -29,8 +29,5 @@ public static class Helpers [SecurityCritical] [DllImport(dllPath, EntryPoint = "InvokeNative")] public static extern void InvokeNative(IntPtr ptr); - - [DllImport(dllPath, EntryPoint = "RegisterCallbackTrace")] - public static extern void RegisterCallbackTrace(string name, int count, string profile, string callerStack); } } diff --git a/src/scripting/callback_manager.cpp b/src/scripting/callback_manager.cpp index 7a66f830c..ded8518bc 100644 --- a/src/scripting/callback_manager.cpp +++ b/src/scripting/callback_manager.cpp @@ -21,33 +21,6 @@ #include "core/log.h" #include "vprof.h" -DLL_EXPORT void RegisterCallbackTrace(const char* name, size_t count, const char* profile, const char* callerStack) -{ - // Dummy logic to prevent compiler from optimizing this function away - volatile size_t hash = 5381; - - if (name) - { - for (const char* c = name; *c; ++c) - hash = ((hash << 5) + hash) + *c; - } - - if (profile) - { - for (const char* c = profile; *c; ++c) - hash = ((hash << 5) + hash) + *c; - } - - if (callerStack) - { - for (int i = 0; callerStack[i] && i < 128; ++i) - hash ^= callerStack[i]; - } - - hash ^= count; - (void)hash; -} - namespace counterstrikesharp { ScriptCallback::ScriptCallback(const char* szName) : m_root_context(fxNativeContext{})