perf tool: handle errors in synthesized event functions