def METHOD_NAME(self, tid, name):
    self._write(
        name="thread_name",
        ph="M",
        tid=tid,
        args={"name": name},
    )
    self._write(
        name="thread_sort_index",
        ph="M",
        tid=tid,
        args={"sort_index": tid},
    )