Update ctf_writer.c

Add trace writer