Fix empty file name in traces

Fix the missing/empty file name in the trace files by porting the
"squeeze the source file name into the data structures" code from
timeR.