RFR: 8368818: Remove duplicate dtrace macros

David Holmes dholmes at openjdk.org
Mon Sep 29 04:37:16 UTC 2025


On Sun, 28 Sep 2025 10:45:11 GMT, Francesco Andreuzzi <fandreuzzi at openjdk.org> wrote:

> I propose to move the following macros and constants definition to `objectMonitor.hpp`:
> 
> DTRACE_MONITOR_PROBE_COMMON
> DTRACE_MONITOR_WAIT_PROBE
> DTRACE_MONITOR_PROBE
> HOTSPOT_MONITOR_notify
> HOTSPOT_MONITOR_notifyAll
> 
> They are defined both in `objectMonitor.cpp` and `synchronizer.cpp`.
> 
> Passes tier1 (fastdebug) with `--enable-jvm-feature-dtrace`.

The duplication has existed since `objectMonitor.cpp` was created from content previously in `synchronizer.cpp` back in Java 7 and 6u25 days. All of the DTrace probe macros are defined in .cpp files. Putting these in the header file so they can be shared is a notional convenience but they are not really part of any interface that should be exposed to all code that includes the header. This is not code that gets updated so there is no maintenance effort that I can see. I'm inclined to just leave this alone.

Also `objectMonitor.hpp` should now be including all the headers needed to actually compile these macros - which also seems undesirable.

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

PR Comment: https://git.openjdk.org/jdk/pull/27538#issuecomment-3344827263
PR Comment: https://git.openjdk.org/jdk/pull/27538#issuecomment-3344831961


More information about the hotspot-runtime-dev mailing list