Usually if you have a script foo.py you can easily profile it as follows:
python -m cProfile foo.py
However let's imagine I am already running foo as a module with -m:
python -m path.foo
In this case is there a clean way to profile this execution? I have tried:
python -m cProfile -m path.foo
Clearly it did not work but you get what I am trying to do so how do I do it?