-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8354811: clock_tics_per_sec code duplication between os_linux and os_posix #24720
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back mbaesken! A progress list of the required criteria for merging this PR into |
|
@MBaesken This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 167 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
|
I noticed we have 2 usages here as well jdk/src/hotspot/os/aix/os_perf_aix.cpp Line 121 in 1138a18
Should I call the new method there too ? |
ansteiner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good that the code duplication was removed.
Yes, I think it would make sense if AIX then used os::Posix::clock_tics_per_second() as well. |
src/hotspot/os/linux/os_linux.cpp
Outdated
| &ldummy, &ldummy, &ldummy, &ldummy, &ldummy, | ||
| &user_time, &sys_time); | ||
| if (count != 13) return -1; | ||
| double clock_tics_factor = 1000000000 / os::Posix::clock_tics_per_second(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should rather not add clock_tics_factor but replace clock_tics_per_sec with os::Posix::clock_tics_per_second() in place, but it's maybe just a matter of taste...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I change it.
src/hotspot/os/linux/os_linux.cpp
Outdated
| &ldummy, &ldummy, &ldummy, &ldummy, &ldummy, | ||
| &user_time, &sys_time); | ||
| if (count != 13) return -1; | ||
| double clock_tics_factor = 1000000000 / os::Posix::clock_tics_per_second(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use double here? The right hand side is an int expression and the use of clock_ticks_factor below is in a jlong expression yielding a jlong function result. If you want to avoid integer rounding, you have to cast at least one res operand to double.
RealLucy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now.
RealCLanger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now. Thanks for updating.
|
/integrate |
|
Going to push as commit 7df1bfe.
Your commit was automatically rebased without conflicts. |
Seems some of the clock_tics_per_sec code can be unified (e.g. in os_posix) between os_linux and os_posix.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/24720/head:pull/24720$ git checkout pull/24720Update a local copy of the PR:
$ git checkout pull/24720$ git pull https://git.openjdk.org/jdk.git pull/24720/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 24720View PR using the GUI difftool:
$ git pr show -t 24720Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/24720.diff
Using Webrev
Link to Webrev Comment