diff --git a/Ryujinx.HLE/HOS/Services/IpcService.cs b/Ryujinx.HLE/HOS/Services/IpcService.cs index 71683ce3c5..d26ada94ac 100644 --- a/Ryujinx.HLE/HOS/Services/IpcService.cs +++ b/Ryujinx.HLE/HOS/Services/IpcService.cs @@ -6,6 +6,7 @@ using Ryujinx.HLE.HOS.Kernel.Ipc; using System; using System.Collections.Generic; using System.IO; +using Ryujinx.Profiler; namespace Ryujinx.HLE.HOS.Services { @@ -95,7 +96,12 @@ namespace Ryujinx.HLE.HOS.Services Logger.PrintDebug(LogClass.KernelIpc, $"{service.GetType().Name}: {processRequest.Method.Name}"); + ProfileConfig profile = Profiles.ServiceCall; + profile.Session = $"{service.GetType().Name}: {processRequest.Method.Name}"; + + Profile.Begin(profile); long result = processRequest(context); + Profile.End(profile); if (_isDomain) { diff --git a/Ryujinx.Profiler/InternalProfile.cs b/Ryujinx.Profiler/InternalProfile.cs index 0f4147d727..ead9ddcc27 100644 --- a/Ryujinx.Profiler/InternalProfile.cs +++ b/Ryujinx.Profiler/InternalProfile.cs @@ -65,12 +65,12 @@ namespace Ryujinx.Profiler return (((double)ticks) / Stopwatch.Frequency) * 1000.0; } - public int GetSession() + public string GetSession() { // Can be called from multiple threads so locked to ensure no duplicate sessions are generated lock (sessionLock) { - return sessionCounter++; + return (sessionCounter++).ToString(); } } } diff --git a/Ryujinx.Profiler/Profile.cs b/Ryujinx.Profiler/Profile.cs index 1c4577a0ed..8f808c2868 100644 --- a/Ryujinx.Profiler/Profile.cs +++ b/Ryujinx.Profiler/Profile.cs @@ -57,10 +57,10 @@ namespace Ryujinx.Profiler End(config); } - public static int GetSession() + public static string GetSession() { if (!ProfilingEnabled()) - return 0; + return null; return ProfileInstance.GetSession(); } } diff --git a/Ryujinx.Profiler/ProfileConfig.cs b/Ryujinx.Profiler/ProfileConfig.cs index 701943b00d..cae8588f1b 100644 --- a/Ryujinx.Profiler/ProfileConfig.cs +++ b/Ryujinx.Profiler/ProfileConfig.cs @@ -7,7 +7,7 @@ namespace Ryujinx.Profiler public struct ProfileConfig { public string Name; - public int? Session; + public string Session; private string cachedTag; @@ -31,5 +31,10 @@ namespace Ryujinx.Profiler Name = "CPU.Test", }; } + + public static ProfileConfig ServiceCall = new ProfileConfig() + { + Name = "ServiceCall", + }; } } diff --git a/Ryujinx.sln b/Ryujinx.sln index f413e8daeb..2b20326c66 100644 --- a/Ryujinx.sln +++ b/Ryujinx.sln @@ -10,6 +10,9 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Tests.Unicorn", "Ryujinx.Tests.Unicorn\Ryujinx.Tests.Unicorn.csproj", "{D8F72938-78EF-4E8C-BAFE-531C9C3C8F15}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.HLE", "Ryujinx.HLE\Ryujinx.HLE.csproj", "{CB92CFF9-1D62-4D4F-9E88-8130EF61E351}" + ProjectSection(ProjectDependencies) = postProject + {4E69B67F-8CA7-42CF-A9E1-CCB0915DFB34} = {4E69B67F-8CA7-42CF-A9E1-CCB0915DFB34} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ChocolArm64", "ChocolArm64\ChocolArm64.csproj", "{2345A1A7-8DEF-419B-9AFB-4DFD41D20D05}" EndProject @@ -23,7 +26,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Luea", "Ryujinx.LLE\Luea.cs EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Common", "Ryujinx.Common\Ryujinx.Common.csproj", "{5FD4E4F6-8928-4B3C-BE07-28A675C17226}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.Profiler", "Ryujinx.Profiler\Ryujinx.Profiler.csproj", "{4E69B67F-8CA7-42CF-A9E1-CCB0915DFB34}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Profiler", "Ryujinx.Profiler\Ryujinx.Profiler.csproj", "{4E69B67F-8CA7-42CF-A9E1-CCB0915DFB34}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution