move profiling functions to extra.profile module