Added generic profiling functions