VM.shutdown(VM.exitStatusHPMTrouble);
VM.shutdown(VM.EXIT_STATUS_HPM_TROUBLE);
  static public void setUpHPMinfo() {    if (VM.BuildForHPM && enabled) {      //-#if RVM_WITH_HPM      if(verbose>=2) VM.sysWriteln("VM_HPMs.setUpHPMinfo()");      /*        * Initialize HPM_info.       */      if(verbose>=3) {	VM.sysWrite("VM_HPMs.setUpHPMinfo() number of events ",HPM_info.getNumberOfEvents(),"\n");      }      if (hpm_test) {	Java2HPM.computeCostsToAccessHPM();      }      if (hpm_list_selected_events) {	Java2HPM.listSelectedEvents();      }      HPM_info.setProcessorName(Java2HPM.getProcessorName());      if(verbose>=3 || hpm_processor==true){	VM.sysWrite("\nProcessor name: \"",HPM_info.getProcessorName(),"\" has ",HPM_info.getNumberOfEvents());         VM.sysWrite(" events.\n\n");      }      if (hpm_processor) { // specified "processor" command line argument	VM.shutdown(VM.exitStatusBogusCommandLineArg);      }      if (hpm_list_all_events) {	Java2HPM.listAllEvents();	VM.shutdown(VM.exitStatusBogusCommandLineArg);      }      String []short_names = new String[HPM_info.getNumberOfValues()];      int[]    event_ids   = new int[HPM_info.getNumberOfValues()];      int max_length = 10;      for (int i=0; i<HPM_info.getNumberOfEvents(); i++) {	short_names[ i] = Java2HPM.getEventShortName(i);	int event_id = Java2HPM.getEventId(i);	if (event_id != HPM_info.ids[i+1]) {	  VM.sysWrite  ("***VM_HPMs.setUpHPMinfo() Java2HPM.getEventId(",i,") ");	  VM.sysWrite  (event_id," != HPM_info.ids[",i+1);	  VM.sysWriteln("] ",HPM_info.ids[i+1],"!***");	  VM.shutdown(VM.exitStatusHPMTrouble);	}	if (max_length < short_names[i].length()) max_length=short_names[i].length();	if (verbose>=4){	  VM.sysWrite("short_name[");VM.sysWrite(i+1);		  VM.sysWrite("] \"");VM.sysWrite(short_names[i]);VM.sysWrite("\"\n");	}      }      if(trace) {	// compute trace record size	record_size = SIZE_OF_HEADER + (HPM_info.getNumberOfValues() * SIZE_OF_LONG);      	// open the trace header file	openFileOutputStream(HPM_info.filenamePrefix+".headerFile");	writeHeader();        // There could be a race condition here!        // Alternative is to write all the threads at VM exit.  	// Write thread records	for (int i=1; i < VM_Scheduler.threadAllocationIndex; i++){	  // write header to file.	  VM_Thread thread = VM_Scheduler.threads[i];	  if (thread == null) {	    VM.sysWriteln("VM_HPMs.setUpHPMinfo() VM_Schedule.threads[",i,"] == null");	    continue;	  }	  int global_tid = thread.getGlobalIndex();	  String name = thread.getClass().toString();	  if (verbose>=4) { 	    VM.sysWrite  ("VM_HPMs.setUpHPMinfo() writeIdAndName(",global_tid);	    VM.sysWriteln(", ",name,")"); 	  }	  writeThread(global_tid, i, name );      	}      }      // start collecting trace information      safe = true;      if (verbose>=4)VM.sysWrite("          max_length is ",max_length);      max_length = ((max_length/4)+1)*4; // multiple of 4      if (verbose>=4)VM.sysWriteln(" adjusted max_length is ",max_length);      // format short names to same length      // translate 0-origin to 1-origin short_names arrays      for (int i=1;  i<HPM_info.getNumberOfValues(); i++) {	HPM_info.short_names[i] = short_names[i-1];	for (int j=0; j<max_length - short_names[i-1].length(); j++) {	  HPM_info.short_names[i] += " ";	}	if (trace) {	  writeEvent(i, HPM_info.ids[i], HPM_info.short_names[i]);	}	if (verbose>=4){	  VM.sysWrite("HPM_info.short_name[");VM.sysWrite(i);		  VM.sysWrite("] \"");VM.sysWrite(HPM_info.short_names[i]);VM.sysWrite("\"\n");	}      }      HPM_info.short_names[0] = "REAL_TIME";      int length = HPM_info.short_names[0].length();      for (int j=0; j<max_length - length; j++ ) {	HPM_info.short_names[0] += " ";      }      if (trace) {	writeEvent(0, -1, HPM_info.short_names[0]);	writeMachineType(HPM_info.getProcessorName());	      }      if (verbose>=4){	VM.sysWrite("HPM_info.short_name[0] \"");VM.sysWrite(HPM_info.short_names[0]);	VM.sysWrite("\"\n");      }      //-#endif    }  }