Profile safepoints / time to safepoint with perf uprobes.
See https://groups.google.com/forum/#!topic/mechanical-sympathy/tepoA7PRFRU
I forgot to say in the message that the cpu burned by the not-stopping thread (here 17998) can be sampled to get an accurate picture of why was preventing it from reaching safepoint. The final 'block' event will likely provide a good idea but the cpu samples data should avoid any guessing.
Thank you for the feedback - I think this would be a valuable feature. Furthermore, this could be generalized to allow switching profiler on and off at other execution points. For example, I have a prototype for profiling only GC phase.
The feature was implemented in ttsp branch (and merged into v2.0)
Two profiler options were added: --begin <begin_func> and --end <end_func>. The profiler automatically starts when execution reaches the function named <begin_func>, and stops as soon as the function <end_func> is executed.
For time-to-safepoint profiling, one may specify
--begin SafepointSynchronize::begin --end RuntimeService::record_safepoint_synchronized
Of course, it's possible to specify different begin/end functions to profile other activities, e.g. garbage collection.
Tested on 2.0 version, looks great
Good. Thanks for confirming @krzysztofslusarski
My pleasure :)
Most helpful comment
The feature was implemented in ttsp branch (and merged into v2.0)
Two profiler options were added:
--begin <begin_func>and--end <end_func>. The profiler automatically starts when execution reaches the function named<begin_func>, and stops as soon as the function<end_func>is executed.For time-to-safepoint profiling, one may specify
Of course, it's possible to specify different begin/end functions to profile other activities, e.g. garbage collection.