diff options
-rw-r--r-- | build.gradle | 2 | ||||
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/build.gradle b/build.gradle index 0133b4f..fd6813f 100644 --- a/build.gradle +++ b/build.gradle @@ -13,7 +13,7 @@ subprojects { apply plugin: 'java-library' ext { - pluginVersion = '1.7.1' + pluginVersion = '1.7.2' pluginDescription = 'spark is a performance profiling plugin/mod for Minecraft clients, servers and proxies.' } diff --git a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java index 3dfbbbf..d1c8393 100644 --- a/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java +++ b/spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java @@ -27,6 +27,7 @@ import me.lucko.spark.common.SparkPlatform; import me.lucko.spark.common.util.TemporaryFiles; import one.profiler.AsyncProfiler; +import one.profiler.Events; import java.io.InputStream; import java.net.URL; @@ -60,8 +61,8 @@ public enum AsyncProfilerAccess { profiler = load(); if (isEventSupported(profiler, ProfilingEvent.CPU, false)) { profilingEvent = ProfilingEvent.CPU; - } else if (isEventSupported(profiler, ProfilingEvent.ITIMER, true)) { - profilingEvent = ProfilingEvent.ITIMER; + } else if (isEventSupported(profiler, ProfilingEvent.WALL, true)) { + profilingEvent = ProfilingEvent.WALL; } } catch (Exception e) { profiler = null; @@ -161,11 +162,18 @@ public enum AsyncProfilerAccess { } enum ProfilingEvent { - CPU, ITIMER; + CPU(Events.CPU), + WALL(Events.WALL); + + private final String id; + + ProfilingEvent(String id) { + this.id = id; + } @Override public String toString() { - return name().toLowerCase(Locale.ROOT); + return this.id; } } |