RFR: 8319875: Add macOS implementation for jcmd System.map [v17]

Sonia Zaldana Calles szaldana at openjdk.org
Thu Dec 12 19:56:50 UTC 2024


On Tue, 10 Dec 2024 12:41:00 GMT, Simon Tooke <stooke at openjdk.org> wrote:

>> This is a port of #16301  to macOS.
>> 
>> System.map and System.dump_map are implemented using the macOS API and provide roughly the same information in the same format. Most of the heavy lifting was implemented by @tstuefe in https://github.com/openjdk/jdk/pull/16301 - this PR adds the macOS implementation and enables the common code for macOS 64 bit.
>> 
>> The System.map tests are also reworked to be cleaner for the three implementations.
>> 
>> [sample output using G1GC](https://github.com/user-attachments/files/17558064/g1_map.txt)
>> [sample output using ZGC](https://github.com/user-attachments/files/17558067/zgc_map.txt)
>
> Simon Tooke has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 35 commits:
> 
>  - Merge branch 'openjdk:master' into pr_macos_system_dump
>  - fix crash due to uninitilized pointer
>  - whitespace error
>  - changes from revue
>  - add constant
>  - fix whitespace
>  - combine like 128MB regions
>  - fix trailing whitesdpae errors
>  - latest cleanup, get rid of dll info
>  - change format strings to display all digits properly
>  - ... and 25 more: https://git.openjdk.org/jdk/compare/a6277bb5...c5cb0f97

I am not a Reviewer but this looks good to me. I left a small comment inline. Thanks Simon!

src/hotspot/os/bsd/memMapPrinter_macosx.cpp line 352:

> 350:       break;
> 351:     }
> 352:     ::bzero(&region_info_with_path, sizeof(region_info_with_path));

Should we use memset instead?

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

Marked as reviewed by szaldana (Committer).

PR Review: https://git.openjdk.org/jdk/pull/20953#pullrequestreview-2500635094
PR Review Comment: https://git.openjdk.org/jdk/pull/20953#discussion_r1882788888


More information about the hotspot-runtime-dev mailing list