perf script: Add scripting operation process_switch()