diff --git a/Ryujinx.HLE/HOS/Services/IpcService.cs b/Ryujinx.HLE/HOS/Services/IpcService.cs index d26ada94ac..a840786c57 100644 --- a/Ryujinx.HLE/HOS/Services/IpcService.cs +++ b/Ryujinx.HLE/HOS/Services/IpcService.cs @@ -97,7 +97,8 @@ 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.SessionGroup = service.GetType().Name; + profile.SessionItem = processRequest.Method.Name; Profile.Begin(profile); long result = processRequest(context); diff --git a/Ryujinx.Profiler/DumpProfile.cs b/Ryujinx.Profiler/DumpProfile.cs index e2012129e7..7908254bd2 100644 --- a/Ryujinx.Profiler/DumpProfile.cs +++ b/Ryujinx.Profiler/DumpProfile.cs @@ -8,12 +8,13 @@ namespace Ryujinx.Profiler { public static void ToFile(string path, InternalProfile profile) { - String fileData = "Name,Session,Count,Average(ms),Total(ms)\r\n"; + String fileData = "Name,Session Group,Session Item,Count,Average(ms),Total(ms)\r\n"; foreach (var time in profile.Timers.OrderBy(key => key.Key.Tag)) { fileData += $"{time.Key.Name}," + - $"{time.Key.Session}," + + $"{time.Key.SessionGroup}," + + $"{time.Key.SessionItem}," + $"{time.Value.Count}," + $"{profile.ConvertTicksToMS(time.Value.AverageTime)}," + $"{profile.ConvertTicksToMS(time.Value.TotalTime)}\r\n"; diff --git a/Ryujinx.Profiler/ProfileConfig.cs b/Ryujinx.Profiler/ProfileConfig.cs index cae8588f1b..4accb4253e 100644 --- a/Ryujinx.Profiler/ProfileConfig.cs +++ b/Ryujinx.Profiler/ProfileConfig.cs @@ -7,19 +7,47 @@ namespace Ryujinx.Profiler public struct ProfileConfig { public string Name; - public string Session; + public string SessionGroup, SessionItem; - private string cachedTag; + private string cachedTag, cachedSession; public string Tag { get { if (cachedTag == null) - cachedTag = $"{Name}{(Session == null ? "" : $" ({Session})")}"; + cachedTag = $"{Name}{(Session == "" ? "" : $" ({Session})")}"; return cachedTag; } } + + public string Session + { + get + { + if (cachedSession == null) + { + if (SessionGroup != null && SessionItem != null) + { + cachedSession = $"{SessionGroup}: {SessionItem}"; + } + else if (SessionGroup != null) + { + cachedSession = $"{SessionGroup}"; + } + else if (SessionItem != null) + { + cachedSession = $"---: {SessionItem}"; + } + else + { + cachedSession = ""; + } + } + + return cachedSession; + } + } } public static class Profiles @@ -28,7 +56,8 @@ namespace Ryujinx.Profiler { public static ProfileConfig Test = new ProfileConfig() { - Name = "CPU.Test", + Name = "CPU", + SessionGroup = "Test" }; }