Support for multiple profiling levels

This commit is contained in:
Andy Adshead 2019-02-02 03:21:35 +00:00
parent 17a70f2b38
commit 5f3a9eade8
5 changed files with 11 additions and 0 deletions

View file

@ -66,6 +66,8 @@ namespace Ryujinx.Profiler
{
if (!ProfilingEnabled())
return;
if (config.Level > _settings.MaxLevel)
return;
_profileInstance.BeginProfile(config);
}
@ -74,6 +76,8 @@ namespace Ryujinx.Profiler
{
if (!ProfilingEnabled())
return;
if (config.Level > _settings.MaxLevel)
return;
_profileInstance.EndProfile(config);
}

View file

@ -10,6 +10,8 @@ namespace Ryujinx.Profiler
public string SessionGroup;
public string SessionItem;
public int Level;
// Private cached variables
private string _cachedTag;
private string _cachedSession;

View file

@ -11,6 +11,7 @@ namespace Ryujinx.Profiler
public bool FileDumpEnabled { get; set; } = false;
public string DumpLocation { get; set; } = "";
public float UpdateRate { get; set; } = 0.1f;
public int MaxLevel { get; set; } = 0;
// 19531225 = 5 seconds in ticks
public long History { get; set; } = 19531225;

View file

@ -75,6 +75,7 @@ namespace Ryujinx
DumpLocation = profilePath,
UpdateRate = (float)((updateRateHz <= 0) ? -1 : 1.0f / updateRateHz),
History = (long)(Convert.ToDouble(parser.Value("Profiling_History")) * PerformanceCounter.TicksPerSecond),
MaxLevel = Convert.ToInt32(parser.Value("Profiling_Max_Level")),
});
SystemLanguage SetLanguage = Enum.Parse<SystemLanguage>(parser.Value("System_Language"));

View file

@ -34,6 +34,9 @@ Profiling_Update_Rate = 4
#Set how long to keep profiling data in seconds, reduce if profiling is taking too much RAM
Profiling_History = 5
#Set the maximum profiling level. Higher values may cause a heavy load on your system but will allow you to profile in more detail.
Profiling_Max_Level = 0
#System Language list: https://gist.github.com/HorrorTroll/b6e4a88d774c3c9b3bdf54d79a7ca43b
#Change System Language
System_Language = AmericanEnglish