-
Type:
Bug
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: None
-
Component/s: hotspot
-
b22
| Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
|---|---|---|---|---|---|---|
| JDK-8288401 | 17.0.5 | Goetz Lindenmaier | P4 | Resolved | Fixed | b01 |
When using an interval of < 1 ms, no ExecutionSample events are produced:
It works for 1ms:
`java -XX:StartFlightRecording=filename=flight.jfr,jdk.ExecutionSample#period=1ms CLASS_FILE; jfr print --events jdk.ExecutionSample flight.jfr`
prints events, but
`java -XX:StartFlightRecording=filename=flight.jfr,jdk.ExecutionSample#period=999us CLASS_FILE; jfr print --events jdk.ExecutionSample flight.jfr`
prints no events.
This seems to be a special case for MethodSample events (https://github.com/openjdk/jdk/blob/master/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp#L493-L508): the period interval is converted into integer milliseconds for all events, converting 999us to 0ms, but only for MethodSample (ExecutionSample, ...) does a 0ms interval mean that no events are generated.
Seems to be present in the code since the first public commit of JFR.
It works for 1ms:
`java -XX:StartFlightRecording=filename=flight.jfr,jdk.ExecutionSample#period=1ms CLASS_FILE; jfr print --events jdk.ExecutionSample flight.jfr`
prints events, but
`java -XX:StartFlightRecording=filename=flight.jfr,jdk.ExecutionSample#period=999us CLASS_FILE; jfr print --events jdk.ExecutionSample flight.jfr`
prints no events.
This seems to be a special case for MethodSample events (https://github.com/openjdk/jdk/blob/master/src/hotspot/share/jfr/periodic/sampling/jfrThreadSampler.cpp#L493-L508): the period interval is converted into integer milliseconds for all events, converting 999us to 0ms, but only for MethodSample (ExecutionSample, ...) does a 0ms interval mean that no events are generated.
Seems to be present in the code since the first public commit of JFR.