rmuir commented on code in PR #15983:
URL: https://github.com/apache/lucene/pull/15983#discussion_r3150351097


##########
build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/java/ProfileResults.java:
##########
@@ -121,6 +128,37 @@ static boolean isGradlePollThread(RecordedThread thread) {
     return (thread != null && thread.getJavaName().startsWith("/127.0.0.1"));
   }
 
+  /**
+   * Pre-scan recording files for CPU sampling strategy. Returns whether any 
{@code
+   * jdk.CPUTimeSample} events appear in the inputs. Throws if recordings mix 
those with legacy
+   * wall-clock samples ({@code jdk.ExecutionSample} / {@code 
jdk.NativeMethodSample}); only one
+   * CPU sampler should be enabled in JFR settings.
+   */
+  static boolean resolveCpuTimeSampling(List<String> files) throws IOException 
{

Review Comment:
   Remove the whole function as the two files are mutually exclusive. This is 
very verbose and not needed.



##########
build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/java/ProfileResults.java:
##########
@@ -173,6 +213,10 @@ public static void printReport(
     if (count < 1) {
       throw new IllegalArgumentException("tests.profile.count must be 
positive");
     }
+
+    // Pre-scan recordings: decide CPU-time vs legacy sampling and reject 
mixed configurations.
+    boolean hasCPUTimeSamples = "cpu".equals(mode) && 
resolveCpuTimeSampling(files);

Review Comment:
   nuke this one too



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to