diff options
author | Luck <git@lucko.me> | 2021-12-30 21:34:18 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2021-12-30 21:34:18 +0000 |
commit | 03bfa12bffa4f3116bf8ddac8f6bd528210651c9 (patch) | |
tree | e1269c176d5fadbf14ec1771d07cb0d3f23d16ef /spark-common/src | |
parent | b41bc1f191b8b02cb9f048858a18b299474bb5b6 (diff) | |
download | spark-03bfa12bffa4f3116bf8ddac8f6bd528210651c9.tar.gz spark-03bfa12bffa4f3116bf8ddac8f6bd528210651c9.tar.bz2 spark-03bfa12bffa4f3116bf8ddac8f6bd528210651c9.zip |
Use wallclock sampling instead of itimer
Diffstat (limited to 'spark-common/src')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java | 16 |
1 files changed, 12 insertions, 4 deletions
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; } } |