-
Notifications
You must be signed in to change notification settings - Fork 937
Description
Background
Async-profiler heavily relies on POSIX signals. In perf_events
and itimer
modes, a profiling event triggers delivery of SIGPROF
to a currently running thread. In wall
mode, a thread being sampled receives SIGVTALRM
. Async-profiler assumes the application does not use SIGPROF
or SIGVTALRM
for other purposes.
Furthermore, since a signal handler is a global property of a process, it is not possible to run two instances of async-profiler on the same process concurrently. For example, this can be helpful for doing some ad-hoc profiling with a custom configuration while continuous profiling is already running.
Proposal
Introduce new signal
argument to override the default profiling signal(s). It can be used to configure continuous profiler to avoid conflict with an ad-hoc profiler.
E.g. -agentlib:asyncProfiler=start,event=cpu,signal=36
will force async-profiler use SIGRTMIN+2
instead of SIGPROF
for CPU profiling.
To change both cpu
and wall
signals, we'll use syntax like signal=36/37
.