Add profiler zone for native library loading
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include "Engine/Input/Gamepad.h"
|
||||
#include "Engine/Input/Keyboard.h"
|
||||
#include "Engine/Input/Mouse.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include <sys/resource.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include <sys/syscall.h>
|
||||
@@ -1082,6 +1083,8 @@ bool AndroidPlatform::SetEnvironmentVariable(const String& name, const String& v
|
||||
|
||||
void* AndroidPlatform::LoadLibrary(const Char* filename)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
ZoneText(filename, StringUtils::Length(filename));
|
||||
const StringAsANSI<> filenameANSI(filename);
|
||||
void* result = dlopen(filenameANSI.Get(), RTLD_LAZY);
|
||||
if (!result)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "Engine/Threading/Threading.h"
|
||||
#include "Engine/Engine/Engine.h"
|
||||
#include "Engine/Engine/CommandLine.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include <unistd.h>
|
||||
#include <cstdint>
|
||||
#include <stdlib.h>
|
||||
@@ -482,6 +483,8 @@ bool ApplePlatform::SetEnvironmentVariable(const String& name, const String& val
|
||||
|
||||
void* ApplePlatform::LoadLibrary(const Char* filename)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
ZoneText(filename, StringUtils::Length(filename));
|
||||
const StringAsANSI<> filenameANSI(filename);
|
||||
void* result = dlopen(filenameANSI.Get(), RTLD_LAZY | RTLD_LOCAL);
|
||||
if (!result)
|
||||
|
||||
@@ -640,7 +640,8 @@ Window* GDKPlatform::CreateWindow(const CreateWindowSettings& settings)
|
||||
|
||||
void* GDKPlatform::LoadLibrary(const Char* filename)
|
||||
{
|
||||
ASSERT(filename);
|
||||
PROFILE_CPU();
|
||||
ZoneText(filename, StringUtils::Length(filename));
|
||||
void* handle = ::LoadLibraryW(filename);
|
||||
if (!handle)
|
||||
{
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "Engine/Input/Input.h"
|
||||
#include "Engine/Input/Mouse.h"
|
||||
#include "Engine/Input/Keyboard.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "IncludeX11.h"
|
||||
#include <sys/resource.h>
|
||||
#include <sys/sysinfo.h>
|
||||
@@ -3069,6 +3070,8 @@ int32 LinuxPlatform::CreateProcess(CreateProcessSettings& settings)
|
||||
|
||||
void* LinuxPlatform::LoadLibrary(const Char* filename)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
ZoneText(filename, StringUtils::Length(filename));
|
||||
const StringAsANSI<> filenameANSI(filename);
|
||||
void* result = dlopen(filenameANSI.Get(), RTLD_LAZY | RTLD_LOCAL);
|
||||
if (!result)
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "Engine/Platform/MessageBox.h"
|
||||
#include "Engine/Engine/Engine.h"
|
||||
#include "Engine/Engine/CommandLine.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "../Win32/IncludeWindowsHeaders.h"
|
||||
#include <VersionHelpers.h>
|
||||
#include <ShellAPI.h>
|
||||
@@ -1242,6 +1243,8 @@ Window* WindowsPlatform::CreateWindow(const CreateWindowSettings& settings)
|
||||
void* WindowsPlatform::LoadLibrary(const Char* filename)
|
||||
{
|
||||
ASSERT(filename);
|
||||
PROFILE_CPU();
|
||||
ZoneText(filename, StringUtils::Length(filename));
|
||||
|
||||
// Add folder to search path to load dependency libraries
|
||||
StringView folder = StringUtils::GetDirectoryName(filename);
|
||||
|
||||
Reference in New Issue
Block a user