Integrated: 8326446: The User and System of jdk.CPULoad on Apple M1 are inaccurate
Long Yang
duke at openjdk.org
Fri Mar 8 02:02:59 UTC 2024
On Fri, 23 Feb 2024 07:49:45 GMT, Long Yang <duke at openjdk.org> wrote:
> hi
>
> I would like to fix this.
>
> As the description in [JDK-8326446](https://bugs.openjdk.org/browse/JDK-8326446).
> JFR uses task_info() with flavor TASK_ABSOLUTETIME_INFO to read User and System time. it is not reliable on Apple m1.
>
> Libc provides the [times](https://man7.org/linux/man-pages/man2/times.2.html) function, which uses TASK_BASIC_INFO_COUNT and TASK_THREAD_TIMES_INFO_COUNT. It will also return the real time of the process, and the time unit is the same, which is suitable for solving this problem.
>
> I ran test/jdk/jdk/jfr/event/os/TestCPULoad.java and passed.
>
> I would appreciate it if you could review this.
This pull request has now been integrated.
Changeset: 8dbd4b39
Author: yibo.yl <yibo.yl at alibaba-inc.com>
Committer: Denghui Dong <ddong at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/8dbd4b391f7deb1a46a5f07f0bc46f23d6715ddb
Stats: 30 lines in 1 file changed: 1 ins; 7 del; 22 mod
8326446: The User and System of jdk.CPULoad on Apple M1 are inaccurate
Reviewed-by: mgronlun, egahlin
-------------
PR: https://git.openjdk.org/jdk/pull/17976
More information about the hotspot-jfr-dev
mailing list