+ wl(' packet_write_pointer(pkt, %s);', p.name)
+if ret.ctype!='void':
+ if not head_sent:
+ wl(' packet_send_partial(pkt, get_out_fd());')
+ wl(' ret = orig(%s);', ", ".join([p.name for p in params]))
+ head_sent = True
+ wl(' packet_write_%s(pkt, ret);', ret.io[0].replace(' ', '_'))
+wl(' packet_send(pkt, get_out_fd());')
+if not head_sent:
+ wl(' orig(%s);', ", ".join([p.name for p in params]))
+if not func.name.startswith("glX"):
+ wl(' check_error();')
+wl(' tracepoint(FUNC_%s, BREAK_RETURN);', func.name.upper())