add statprof and cProfile hooks