scripts to preprocess trace file