From 1fb00b191cb3efd5b44d18fd2730ac6683626d67 Mon Sep 17 00:00:00 2001 From: Luck Date: Mon, 29 Jul 2024 22:54:12 +0100 Subject: Add more automated tests --- .../me/lucko/spark/common/sampler/async/AsyncProfilerAccess.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'spark-common/src/main/java/me/lucko/spark/common/sampler') 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 7dcb131..84aaa95 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 @@ -73,14 +73,10 @@ public class AsyncProfilerAccess { try { profiler = load(platform); - if (isEventSupported(profiler, ProfilingEvent.ALLOC, false)) { allocationProfilingEvent = ProfilingEvent.ALLOC; } - - if (isEventSupported(profiler, ProfilingEvent.CPU, false)) { - profilingEvent = ProfilingEvent.CPU; - } else if (isEventSupported(profiler, ProfilingEvent.WALL, true)) { + if (isEventSupported(profiler, ProfilingEvent.WALL, true)) { profilingEvent = ProfilingEvent.WALL; } } catch (Exception e) { @@ -213,8 +209,7 @@ public class AsyncProfilerAccess { return false; } - enum ProfilingEvent { - CPU(Events.CPU), + public enum ProfilingEvent { WALL(Events.WALL), ALLOC(Events.ALLOC); -- cgit