kubectl-prof icon indicating copy to clipboard operation
kubectl-prof copied to clipboard

Allow to override the root-process heuristic

Open ensonic opened this issue 1 year ago • 4 comments

We're using python binaries, but they are packaged into a binary that runs python with the actual python code from itself. Because of that the profiler won't find any process called 'python'. I understand that this is quite a corner case, but would it make sense to allow to override the process name to look for?

ensonic avatar Oct 24 '24 14:10 ensonic

Hi @ensonic, In normal operating mode, the profiler doesn't rely on the process name but on its PID, which it retrieves from the container. Have you tried profiling, and it didn’t work? Perhaps you could try using eBPF to generate a CPU flamegraph.

For my part, I will try a similar scenario with a python binary package.

josepdcs avatar Oct 25 '24 08:10 josepdcs

We're getting Error: could not launch profiler: Error: No python processes found in process ... or any of its subprocesses. Sorry for not including the error in the first post. Where is this coming from? I can't find the error in the codebase.

ensonic avatar Oct 25 '24 10:10 ensonic

@ensonic According the error, py-spy is unable to determine that it's a python application. It's unable to profile this (corner) case.

josepdcs avatar Oct 25 '24 15:10 josepdcs

Good to know that the error is coming from py-spy. I'll poke at it.

ensonic avatar Oct 25 '24 15:10 ensonic