initial profiling code added to execute_switch