RFR: 8342818: Implement JEP 509: JFR CPU-Time Profiling [v48]

Johannes Bechberger jbechberger at openjdk.org
Wed Jun 4 12:47:36 UTC 2025


On Wed, 4 Jun 2025 12:33:45 GMT, Andrei Pangin <apangin at openjdk.org> wrote:

>> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix timer creation warning
>
> src/hotspot/share/jfr/periodic/sampling/jfrCPUTimeThreadSampler.cpp line 652:
> 
>> 650: bool JfrCPUSamplerThread::init_timers() {
>> 651:   // install sig handler for sig
>> 652:   if ((s8)PosixSignals::install_generic_signal_handler(SIG, (void*)::handle_timer_signal) == -1) {
> 
> Comparing return value to `(void*)-1` would be cleaner.
> But the main problem is that it only checks for `sigaction` failure (which normally never happens), however, we should also check if there was a custom signal handler set _before_ installing our own handler, i.e. old handler is not SIG_IGN or SIG_DFL or `handle_timer_signal`.

Using `sigaction(SIG, NULL, &sa)` ?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25302#discussion_r2126510947


More information about the hotspot-dev mailing list