iprithv commented on code in PR #15983:
URL: https://github.com/apache/lucene/pull/15983#discussion_r3150259017
##########
build-tools/build-infra/src/main/java/org/apache/lucene/gradle/plugins/java/ProfileResults.java:
##########
@@ -101,10 +101,16 @@ public static void main(String[] args) throws IOException
{
}
/** true if we care about this event */
- static boolean isInteresting(String mode, RecordedEvent event) {
+ static boolean isInteresting(String mode, RecordedEvent event, boolean
hasCPUTimeSamples) {
String name = event.getEventType().getName();
switch (mode) {
case "cpu":
+ if (hasCPUTimeSamples) {
+ // Prefer jdk.CPUTimeSample (Java 25+, JEP 509): samples by CPU
time, not wall-clock
+ // time, so idle threads (like gradle epoll) are inherently excluded
— no filtering
+ // needed. When available, we skip legacy execution samples to avoid
double-counting.
+ return name.equals("jdk.CPUTimeSample");
+ }
return (name.equals("jdk.ExecutionSample") ||
name.equals("jdk.NativeMethodSample"))
Review Comment:
Yes, I expanded the comment to say that explicitly so it matches the code.
Thanks!
--
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]