RFR: JDK-8306507: [linux] Print number of memory mappings in error reports [v2]

Thomas Stuefe stuefe at openjdk.org
Mon May 22 11:24:52 UTC 2023


On Mon, 22 May 2023 10:05:26 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

>> Thomas Stuefe has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>> 
>>  - Merge branch 'openjdk:master' into JDK-8306507-Print-number-of-memory-mappings-in-error-reports
>>  - JDK-8306507-Print-number-of-memory-mappings-in-error-reports
>
> src/hotspot/os/linux/os_linux.cpp line 1850:
> 
>> 1848:     st->print_cr("Can not get library information for pid = %d", pid);
>> 1849:   }
>> 1850:   st->print_cr("Total number of mappings: %u", num);
> 
> Should we only print the number of mappings if  `_print_ascii_file` returns `true`? I.e. to avoid the hypothetical output of:
> 
> 
> Can not get library information for pid = <pid>
> Total number of mappings: 0
> 
> 
> How about?
> 
> 
>  unsigned num = 0;
>   if (!_print_ascii_file(fname, st, &num)) {
>     st->print_cr("Can not get library information for pid = %d", pid);
>   } else {
>     st->print_cr("Total number of mappings: %u", num);
>   }

Good catch. Yes, that makes sense.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13555#discussion_r1200376299


More information about the hotspot-runtime-dev mailing list