Description
We have PythonProfiler
which is a class that hides the fact that we have 2 profiler types behind - py-spy or pyperf, and decides itself which one is used.
The decision needs to move out, and each of py-spy & pyperf should implement the interface and be registered separately. This way they can have different settings in their register_profiler
decorator, as suggested here: https://github.com/Granulate/gprofiler/blob/4bcb3aedae1c286d3058a0dc0f559cf88fe5e940/gprofiler/profilers/python.py#L279
This also removes the need for the PythonProfiler
itself (which directs calls at the different underlying classes).
Instead, for each "runtime" such as "python", we'll have a function select_profiler
that gets the mode requested by the user and the list of available profilers (given the architecture & platform) and will run the necessary tests to decide (what is currently implemented in PythonEbpfProfiler.test
)