Async-profiler: Allow pausing a recording

Created on 14 Jan 2019  路  2Comments  路  Source: jvm-profiling-tools/async-profiler

We use the gradle-profiler for automatically profiling Gradle builds. It can run many iterations of the same build in order to collect enough data. For many scenarios you want some kind of cleanup step between iterations and you don't want to profile that cleanup. So it would be great if I could tell async-profiler to pause its recording and later resume, keeping the data collected so far intact. That way I don't have to merge profiled data from multiple files later.

enhancement

Most helpful comment

This should be fairly easy to do. I'll consider implementing this feature.

All 2 comments

This should be fairly easy to do. I'll consider implementing this feature.

I've committed the pause/resume feature.

Instead of the pause action, which does not differ from stop, I added new resume action, which works just like start except it does not reset collected data.

Profiling options are not preserved between sessions, i.e. all the previous options should be repeated in the resume command. This is intentional, because 1) it makes easier to run resume/stop sequence without additional checks, whether the profiler starts for the first time or not; 2) it avoids questionable reuse of arguments that could be specified in -agentpath options, attach command, or via Java API.

Additionally, a few improvements were made to improve resume latency, e.g. the profiler now does not parse symbols from the libraries that were parsed earlier.

From user's perspective the changes include

  • resume action in profiler.sh script;
  • resume option for -javaagent;
  • AsyncProfiler.resume(event, interval) method in Java API.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

ryenus picture ryenus  路  5Comments

ceeaspb picture ceeaspb  路  6Comments

nobeh picture nobeh  路  5Comments

ceeaspb picture ceeaspb  路  5Comments

franz1981 picture franz1981  路  4Comments