if (options.generate_statistics && (tr instanceof TraceCounterRecord)) { options.generateStatistics((TraceCounterRecord)tr, records_index); }
  static private TraceRecord[] readTraceRecords(DataInputStream input_file, String trace_filename)  {    TraceRecord[] records = new TraceRecord[2];    int records_index = 0;    TraceRecord tr;    trace_file_vpid = -1;    trace_file_start_wall_time = 0;    while (true) {      if (records.length <= records_index) {	// grow trace record array	int old_length = records.length;	TraceRecord[] trs = new TraceRecord[records.length*2];	for (int i=0; i<old_length; i++) {	  trs[i] = records[i];	}	records = trs;      }      // read record's fields      tr = readTraceRecord(input_file);      if (tr == null) break;      records[records_index] = tr;      // generate statistics      if (options.generate_statistics && (tr instanceof TraceCounterRecord)) {	options.generateStatistics((TraceCounterRecord)tr, records_index);      }      // write record's fields      if (options.print_trace && options.print_local) {	printTraceRecord(tr, records_index);      }      records_index++;      //      updateCummulativeCounters(tr);    } // end while    if(options.verbose>=1) System.out.println("readTraceRecords() read "+records_index+" trace records from "+trace_filename);    // Create array with length is number of trace records    TraceRecord[] r_records = new TraceRecord[records_index];    for (int i=0; i<records_index; i++) {       r_records[i] = records[i];    }    return r_records;  }