-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure alternative profiling signal #759
Comments
Couldn't async-profiler detect this and choose other signals automatically? The underlying APIs seem to offer the possibility. |
What it can detect automatically is whether a signal has a non-default handler. This does not yet tell if a signal is really used, but this could be sufficient in some cases. However, sometimes async-profiler needs to cooperate with an external process, e.g., system-wide eBPF profiling agent. In these cases, the signal should be set explicitly to be in line with what an external agent uses. |
And maybe warn the user about this fact.
But maybe we could by default make it choose its signals automatically and have a setting to set them explicitly. Or have a |
I'm not sure how important it is right now, but it's an interesting idea. |
When I find time after working on my JEP, I might take a look into this :) |
I pushed the fix to automatically find an available signal if the default one is already used. |
Background
Async-profiler heavily relies on POSIX signals. In
perf_events
anditimer
modes, a profiling event triggers delivery ofSIGPROF
to a currently running thread. Inwall
mode, a thread being sampled receivesSIGVTALRM
. Async-profiler assumes the application does not useSIGPROF
orSIGVTALRM
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 useSIGRTMIN+2
instead ofSIGPROF
for CPU profiling.To change both
cpu
andwall
signals, we'll use syntax likesignal=36/37
.The text was updated successfully, but these errors were encountered: