Return the profiling function set with sys.setprofile. See the profiler chapter in the library manual.
sys/getprofile
getprofile