RFR: 8273239: Standardize Ticks APIs return type

Erik Gahlin egahlin at openjdk.java.net
Thu Sep 2 09:04:33 UTC 2021


On Thu, 2 Sep 2021 02:55:43 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Simple change on return types of Ticks API.
>> 
>> The call of `milliseconds()` in `spinYield.cpp` seems a bug to me, because the unit in the message is `usecs`. Therefore, I changed it to `microseconds()`.
>> 
>> Test: tier1
>
> src/hotspot/share/jfr/periodic/jfrThreadCPULoadEvent.cpp line 135:
> 
>> 133:   }
>> 134:   log_trace(jfr)("Measured CPU usage for %d threads in %.3f milliseconds", number_of_threads,
>> 135:     (double)(JfrTicks::now() - event_time).milliseconds());
> 
> I think this one is a simple bug - the wrong format specifier is being used. I don't think this expects to see e.g. 3.6 milliseconds. But confirm with JFR folk.

I don't know what the original intent was, but seems fine to print a fraction now,

-------------

PR: https://git.openjdk.java.net/jdk/pull/5332


More information about the hotspot-dev mailing list