From acbe182bb5415b0e554b756fd87136783c8b89d8 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Fri, 12 Feb 2021 11:27:01 +0100 Subject: [PATCH] Native image - make it possible to generate the dashboard dump file --- .../main/java/io/quarkus/deployment/pkg/NativeConfig.java | 6 ++++++ .../quarkus/deployment/pkg/steps/NativeImageBuildStep.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java index 7f1afb8520f67..519f056968394 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/NativeConfig.java @@ -336,6 +336,12 @@ public static class Debug { public boolean enabled; } + /** + * Generate the report files for GraalVM Dashboard. + */ + @ConfigItem + public boolean enableDashboardDump; + /** * Supported Container runtimes */ diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index 2838445ba595f..dd27266b26810 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -254,6 +254,12 @@ public NativeImageBuildItem build(NativeConfig nativeConfig, NativeImageSourceJa } else { command.add("-H:-StackTrace"); } + + if (nativeConfig.enableDashboardDump) { + command.add("-H:DashboardDump=" + outputTargetBuildItem.getBaseName() + "_dashboard.dump"); + command.add("-H:+DashboardAll"); + } + String executableName = outputTargetBuildItem.getBaseName() + packageConfig.runnerSuffix; command.add(executableName);