RFR: 8274178: G1: Occupancy value in IHOP logging and JFR event is inaccurate [v4]
Thomas Schatzl
tschatzl at openjdk.org
Thu Nov 13 09:49:29 UTC 2025
On Thu, 13 Nov 2025 09:30:17 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> src/hotspot/share/gc/g1/g1IHOPControl.cpp line 189:
>>
>>> 187: }
>>> 188:
>>> 189: void G1AdaptiveIHOPControl::send_jfr_event(G1NewTracer* tracer, size_t occupancy) {
>>
>> Why `jfr` in the name? There is nothing related to `jfr` in this context.
>
> Because this is what the method does. Send a JFR/trace event. I think the new name is more concise about that. Similar to the other name that is now called `print_log` to explicitly call out that we are printing the log message.
>
> In Hotspot, a "trace event" or just "event" is always a JFR event as opposed to printing log output.
>
> I can rename it back if you think the old name was more concise. Maybe it is better wrt to the `G1NewTracer` used here.
I.e. the identifier `jfr` is throughout the GC code (from quick searching) always associated to `events` or the `tracer`. We already use names like `*JFRTracer*` (in G1) or `_jfr_tracer` (in ZGC) to (apparently to me) make it clear that the related code is about jfr.
To me the term tracing is too generic, whenever I read such a name I always need to think about what kind of tracing for what is actually meant, as opposed to printing a (text) log message. With something like "jfr" in the name it is very clear that this is not something generic.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28175#discussion_r2522624794
More information about the hotspot-gc-dev
mailing list