Granulate / gprofiler

gProfiler is a system-wide profiler, combining multiple sampling profilers to produce unified visualization of what your CPU is spending time on.
https://profiler.granulate.io
Apache License 2.0
743 stars 54 forks source link

perf: time-out if not signaled to stop #782

Closed Jongy closed 1 year ago

Jongy commented 1 year ago

We run perf in continuous mode, and signal it every interval to dump the data it has collected so far.

If gProfiler for whatever reason does not signal perf, perf will continue accumulating data on disk and there is no limit placed on it. This can happen if gprofiler gets stuck, for example.

What I'd like to have is - perf will automatically stop collecting data after a set interval, like the timeout parameter that we have for async-profiler which stops it after a while. If the interval is X, we could have perf time out after 1.5X time. That's one option. Another option is to cycle the data in the dumped file.

First let's see if perf has any such feature we can use; if not, I suggest we add it to perf with a flag, and pass that flag from gprofiler.