From ad8a5ae153285724db449f3eb6850a3c1c05bcee Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 3 Sep 2024 11:02:28 -0400 Subject: [PATCH 1/2] Enable profiling startForceFirst silently for native image builds [lint] --- .../main/java/com/datadog/profiling/agent/ProfilingAgent.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java index ef04453b990..b26514cc3ad 100644 --- a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java +++ b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java @@ -93,7 +93,8 @@ public static synchronized void run( boolean startForceFirst = configProvider.getBoolean( - PROFILING_START_FORCE_FIRST, PROFILING_START_FORCE_FIRST_DEFAULT); + PROFILING_START_FORCE_FIRST, + Platform.isNativeImage() || PROFILING_START_FORCE_FIRST_DEFAULT); if (!isStartForceFirstSafe()) { log.debug( From a293df12f35c3a41a679ddec11246fb06a7e06ae Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 3 Sep 2024 13:05:13 -0400 Subject: [PATCH 2/2] Always set sFF for native-image, disregard config if specified (unlikely) [lint] --- .../java/com/datadog/profiling/agent/ProfilingAgent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java index b26514cc3ad..31fd469156e 100644 --- a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java +++ b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProfilingAgent.java @@ -92,9 +92,9 @@ public static synchronized void run( final ConfigProvider configProvider = ConfigProvider.getInstance(); boolean startForceFirst = - configProvider.getBoolean( - PROFILING_START_FORCE_FIRST, - Platform.isNativeImage() || PROFILING_START_FORCE_FIRST_DEFAULT); + Platform.isNativeImage() + || configProvider.getBoolean( + PROFILING_START_FORCE_FIRST, PROFILING_START_FORCE_FIRST_DEFAULT); if (!isStartForceFirstSafe()) { log.debug(