On Thu, 22 Oct 2020 04:57:18 GMT, Thomas Stuefe <[email protected]> wrote:
>> Nick Gasson has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Update for review comments
>
> src/hotspot/share/code/codeCache.hpp line 194:
>
>> 192: static void print_summary(outputStream* st, bool detailed = true); //
>> Prints a summary of the code cache usage
>> 193: static void log_state(outputStream* st);
>> 194: static void write_perf_map(outputStream* st);
>
> Seems weird for this function to have an outputStream parameter only to write
> the dump to an unrelated file and ignore the stream for everything but the
> final message.
>
> I would either pass in the file name as an option - preferably configurable -
> and write the last message out here; or just write the whole perf dump to the
> outputstream itself, piping it to jcmd and let the caller do what he wants
> with it (e.g. just redirecting). The latter is what most commands do. Not
> sure how large the perf dump gets though, may be impractical.
OK. I think I'll change it so `write_perf_map()` writes to the `outputStream`
and then `PerfMapDCmd::execute()` handles redirecting it to a file. I don't
think it makes sense to write it directly to the jcmd output though.
> src/hotspot/share/code/codeCache.cpp line 1562:
>
>> 1560: }
>> 1561:
>> 1562: void CodeCache::write_perf_map(outputStream* st) {
>
> Could this whole function possibly live inside os/linux in an own file? Or
> would that expose too many code heap internals?
Probably creates too much dependency between the os layer and the codeCache
internals? I'll put it all in `#ifdef LINUX` though.
-------------
PR: https://git.openjdk.java.net/jdk/pull/760