SysinternalsEBPF icon indicating copy to clipboard operation
SysinternalsEBPF copied to clipboard

telemetryStart should have a stop mechanism other than signals

Open josalem opened this issue 4 years ago • 1 comments

Currently, teletryStart is a fully blocking call. There appears to be no way to stop tracing without sending a signal that would cause perf_buffer__poll to return <0, .e.g., SIGSTOP or SIGCONT (based on the comments). This can race with the call to perf_buffer_poll which may not be on the stack when the signal arrives.

If you are trying to use this library in-process, it is difficult to control stopping as designed.

An Init->Start->Stop->Fini pattern would be useful for this library.

https://github.com/Sysinternals/SysinternalsEBPF/blob/b9035cf7780c9c733f4be06ff29f7b4fc447b395/telemetryLoader.c#L1432-L1470

josalem avatar Oct 15 '21 21:10 josalem

Agreed. Will get to this in due course. Happy to take suggested code if you've prototyped something. :)

kesheldr avatar Nov 03 '21 15:11 kesheldr