-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
17, 21, 25
Currently, JFR tool formats the times with millisecond precision:
```
jdk.ThreadSleep {
startTime = 10:48:56.668 (2025-03-13)
duration = 100 ms
time = 100 ms
eventThread = "main" (javaThreadId = 3)
stackTrace = [
NotifyWaitLatency.work() line: 20
NotifyWaitLatency.main(String[]) line: 4
jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Object, Object[]) line: 104
java.lang.reflect.Method.invoke(Object, Object[]) line: 565
com.sun.tools.javac.launcher.SourceLauncher.execute(MemoryContext, String[]) line: 254
]
}
```
In modern world, a lot can happen within a millisecond. So it would be better to default to microsecond precision. Both timesources supported by JFR (RDTSC and os::elapsed_counter()) have enough enough precision to satisfy microsecond output, so microseconds are meaningful.
I think durations should also be more precise -- for example to compute the endTime precisely from (startTime+duration), but that is a more controversial/style question, so I would like to handle it separately.
```
jdk.ThreadSleep {
startTime = 10:48:56.668 (2025-03-13)
duration = 100 ms
time = 100 ms
eventThread = "main" (javaThreadId = 3)
stackTrace = [
NotifyWaitLatency.work() line: 20
NotifyWaitLatency.main(String[]) line: 4
jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Object, Object[]) line: 104
java.lang.reflect.Method.invoke(Object, Object[]) line: 565
com.sun.tools.javac.launcher.SourceLauncher.execute(MemoryContext, String[]) line: 254
]
}
```
In modern world, a lot can happen within a millisecond. So it would be better to default to microsecond precision. Both timesources supported by JFR (RDTSC and os::elapsed_counter()) have enough enough precision to satisfy microsecond output, so microseconds are meaningful.
I think durations should also be more precise -- for example to compute the endTime precisely from (startTime+duration), but that is a more controversial/style question, so I would like to handle it separately.
- links to
-
Review(master) openjdk/jdk/24029