java: async-profiler: use dump command for truly continuous profiling #569
Labels
defined-and-prioritized
Tickets that have fully defined the desired outcome & are prioritized to be developed.
enhancement
New feature or request
runtime/java
We profile with async-profiler by issuing
start
followed bystop
(which stops profiling and dumps the collected traces).Since async-profiler/async-profiler@868bfec (1~ year) there is a dump command which dumps the collected traces WITHOUT stopping. I was under the impression that it does stop, but realized now during routine reading of the code that it doesn't.
This has several benefits:
It's similar to the change we did with
perf
here.What I propose is, we use the
dump
command, and upon next iterations, theJavaProfiler
will keep the list of "enabled" processes (we can keep theAsyncProfiledProcess
itself) and instead of re-starting, we can only perform thestatus
command to verify AP is truly running (or just skip it and trust AP to be running), wait the interval then issue anotherdump
.We will need to change the cleanup code - currently there is no cleanup done outside of the scope of
_profile_ap_process
. I figure we could do something similar toSystemProfiler.stop
, which stops ongoingperf.map
generation in running NodeJS processes in attach-maps mode - we can stop all active APs inJavaProfiler.stop
(similarly toclean_up_node_maps
called fromSystemProfiler.stop
).Please add relevant tests that use the continuous feature over a few snapshot cycles of gProfiler, and prove that data is sent produced properly each time.
The text was updated successfully, but these errors were encountered: