From 94849a7394668c57e495b44ef081adaf78924e60 Mon Sep 17 00:00:00 2001 From: Brice Dutheil Date: Mon, 7 Feb 2022 12:09:54 +0100 Subject: [PATCH] wip use jnf variant --- build.gradle.kts | 2 +- .../github/bric3/fireplace/FirePlaceMain.java | 41 ++++++++++--------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fac0805c..dd1f5b3f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -34,7 +34,7 @@ repositories { dependencies { implementation(libs.bundles.flatlaf) // implementation(libs.darklaf) - implementation("com.github.weisj:darklaf-platform-preferences:latest.integration") + implementation("com.github.weisj:darklaf-platform-preferences-jnf:latest.integration") implementation(libs.flightrecorder) // implementation(libs.graal.sdk) diff --git a/src/main/java/com/github/bric3/fireplace/FirePlaceMain.java b/src/main/java/com/github/bric3/fireplace/FirePlaceMain.java index a2571bda..1a305e62 100644 --- a/src/main/java/com/github/bric3/fireplace/FirePlaceMain.java +++ b/src/main/java/com/github/bric3/fireplace/FirePlaceMain.java @@ -100,12 +100,12 @@ public static void main(String[] args) { return events; }).join()); -// otherEvents(events); + // otherEvents(events); -// events.apply(ItemFilters.type(Set.of( -// "jdk.CPULoad" -// ))); + // events.apply(ItemFilters.type(Set.of( + // "jdk.CPULoad" + // ))); setupLaF(); if (Boolean.getBoolean("fireplace.swing.debug")) { @@ -134,7 +134,7 @@ public static void main(String[] args) { jTabbedPane.addTab(ALLOCATIONS, allocationFlameGraphPanel); jTabbedPane.addTab(CPU, cpuFlameGraphPanel); jTabbedPane.setTabPlacement(JTabbedPane.BOTTOM); -// jTabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); + // jTabbedPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); jTabbedPane.addChangeListener(e -> updateTabContent(jTabbedPane, nativeLibs, sysProps, eventSupplier.get())); @@ -236,6 +236,7 @@ private static void setupLaF() { Colors.setDarkMode(false); break; } + // Logger.getLogger("com.github.weisj.darklaf").setLevel(Level.INFO); // Runtime.getRuntime().addShutdownHook(new Thread(() -> manager.enableReporting(false))); } @@ -273,22 +274,22 @@ private static StacktraceTreeModel stackTraceAllocationFun(IItemCollection event return new StacktraceTreeModel(allocCollection, methodFrameSeparator, false -// , JdkAttributes.ALLOCATION_SIZE + // , JdkAttributes.ALLOCATION_SIZE ); -// allocCollection.forEach(eventsCollection -> { -// var stackAccessor = eventsCollection.getType().getAccessor(JfrAttributes.EVENT_STACKTRACE.getKey()); -// eventsCollection.stream().limit(10).forEach(item -> { -// var stack = stackAccessor.getMember(item); -// -// if (stack == null || stack.getFrames() == null) { -// return; -// } -// -// -// }); -// }); + // allocCollection.forEach(eventsCollection -> { + // var stackAccessor = eventsCollection.getType().getAccessor(JfrAttributes.EVENT_STACKTRACE.getKey()); + // eventsCollection.stream().limit(10).forEach(item -> { + // var stack = stackAccessor.getMember(item); + // + // if (stack == null || stack.getFrames() == null) { + // return; + // } + // + // + // }); + // }); } private static StacktraceTreeModel stackTraceCPUFun(IItemCollection events) { @@ -301,7 +302,7 @@ private static StacktraceTreeModel stackTraceCPUFun(IItemCollection events) { return new StacktraceTreeModel(allocCollection, methodFrameSeparator, false -// , JdkAttributes.SAMPLE_WEIGHT + // , JdkAttributes.SAMPLE_WEIGHT ); } @@ -310,7 +311,7 @@ private static void otherEvents(IItemCollection events) { "jdk.CPUInformation", "jdk.OSInformation", "jdk.ActiveRecording", -// "jdk.ActiveSetting", // async profiler settings ? + // "jdk.ActiveSetting", // async profiler settings ? "jdk.JVMInformation" ))).forEach(eventsCollection -> { eventsCollection.stream().limit(10).forEach(event -> {