koute / not-perf

A sampling CPU profiler for Linux
Apache License 2.0
868 stars 40 forks source link

Option for not using SIGSTOP/SIGCONT because not all apps take it well #13

Open podusowski opened 4 years ago

podusowski commented 4 years ago

This STOP/CONT pattern is used to avoid data-race between reading /proc and handling things like mmap events from the kernel, isn't it? Anyway, we are profiling some apps that don't take it very well since STOP causes syscalls to return abnormally. It should be fixed but you know, it is not always that easy. Therefore I'm proposing a switch to disable this behavior.

koute commented 4 years ago

Yes, the STOP/CONT are sent because the perf_event_open interface is somewhat broken and AFAIK it's not really possible to use it in a non-racy way with an application which is already running. (It really shows that it was designed mostly with the fork + exec model in mind where you always start a fresh instance when profiling.)