def METHOD_NAME(self, **ev):
    ev.setdefault("pid", os.getpid())
    if ev["ph"] != "M":
        ev.setdefault("ts", trio.current_time() * 1e6)
    self.out.write(json.dumps(ev))
    self.out.write(",\n")