ammachado commented on code in PR #25173:
URL: https://github.com/apache/camel/pull/25173#discussion_r3677851312
##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/Run.java:
##########
@@ -1344,6 +1354,49 @@ protected void addDependencies(String... deps) {
dependencies.addAll(depsList);
}
+ boolean jfrEnabled() {
+ return debugOptions.jfr || debugOptions.jfrProfile != null;
+ }
+
+ String jfrFileName() {
+ return (name != null ? name : "camel") + ".jfr";
+ }
+
+ /**
+ * Builds the JFR JVM arguments for runtimes that fork a subprocess
(Quarkus, Spring Boot), or {@code null} when JFR
+ * was not requested.
+ */
+ String buildJfrJvmArgs() {
+ if (!jfrEnabled()) {
+ return null;
+ }
+ StringBuilder arg = new StringBuilder();
+ if (jvmArgs != null && jvmArgs.contains("-XX:StartFlightRecording")) {
+ // the explicit JVM argument wins, as two recordings would
otherwise compete for the same file
Review Comment:
Good catch, fixed. Reworded to: "WARN: --jvm-args already starts a flight
recording, skipping -XX:StartFlightRecording from --jfr (Camel runtime
instrumentation is still enabled)" — matches your suggestion.
_Claude Code on behalf of Adriano Machado_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]