Async-profiler: (time to) safepoint profiler

Created on 6 Dec 2017  路  5Comments  路  Source: jvm-profiling-tools/async-profiler

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.

enhancement

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

--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.

All 5 comments

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 :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marshallpierce picture marshallpierce  路  6Comments

ryenus picture ryenus  路  5Comments

stsypanov picture stsypanov  路  5Comments

shipilev picture shipilev  路  4Comments

krzysztofslusarski picture krzysztofslusarski  路  6Comments