RFR: 8321971: Improve the user name detection logic in perfMemory get_user_name_slow
Jaikiran Pai
jpai at openjdk.org
Thu Dec 14 10:19:57 UTC 2023
Can I please get a review of this change which proposes to improve the code in `get_user_name_slow` function, which is used to identify the target JVM owner's user name? This addresses https://bugs.openjdk.org/browse/JDK-8321971.
As noted in that JBS issue, in its current form, the nested loop ends up iterating over the directory contents of `hsperfdata_xxx` directory and then for each iteration it checks if the name of the entry matches the pid. This iteration shouldn't be needed and instead one could look for that file named <pid> within that directory.
No new test has been added, given the nature of this change. Existing tier1, tier2, tier3 and svc_tools tests pass with this change on Linux, Windows and macosx.
-------------
Commit messages:
- 8321971: Improve the user name detection logic in perfMemory get_user_name_slow
Changes: https://git.openjdk.org/jdk/pull/17104/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17104&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8321971
Stats: 179 lines in 2 files changed: 49 ins; 77 del; 53 mod
Patch: https://git.openjdk.org/jdk/pull/17104.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/17104/head:pull/17104
PR: https://git.openjdk.org/jdk/pull/17104
More information about the hotspot-runtime-dev
mailing list