public static final int CP_EVENTID_COUNT_POOLALLOC = 0x15;
public static final int CP_EVENTID_COUNT_POOLREUSE = 0x16;
public static final int CP_EVENTID_WORKSCHEDGRAB = 0x20;
+ public static final int CP_EVENTID_WORKSCHEDSUBMIT = 0x21;
public static final int CP_EVENTID_TASKDISPATCH = 0x30;
public static final int CP_EVENTID_PREPAREMEMQ = 0x31;
public static final int CP_EVENTID_TASKEXECUTE = 0x40;
public static final int CP_EVENTID_TASKRETIRE = 0x50;
public static final int CP_EVENTID_TASKSTALLVAR = 0x60;
public static final int CP_EVENTID_TASKSTALLMEM = 0x61;
+ public static final int CP_EVENTID_RCR_TRAVERSE = 0x80;
public static final int CP_EVENTID_DEBUG_A = 0x180;
public static final int CP_EVENTID_DEBUG_B = 0x181;
public static final int CP_EVENTID_DEBUG_C = 0x182;
void initNames() {
eid2name = new Hashtable<Integer, String>();
- eid2name.put( CP_EVENTID_MAIN, "MAIN " );
- eid2name.put( CP_EVENTID_RUNMALLOC, "RUNMALLOC " );
- eid2name.put( CP_EVENTID_RUNFREE, "RUNFREE " );
- eid2name.put( CP_EVENTID_POOLALLOC, "POOLALLOC " );
- eid2name.put( CP_EVENTID_COUNT_POOLALLOC, "POOLALLOC CNT" );
- eid2name.put( CP_EVENTID_COUNT_POOLREUSE, "POOLREUSE CNT" );
- eid2name.put( CP_EVENTID_WORKSCHEDGRAB, "WORKSCHEDGRAB" );
- eid2name.put( CP_EVENTID_TASKDISPATCH, "TASKDISPATCH " );
- eid2name.put( CP_EVENTID_PREPAREMEMQ, "PREPAREMEMQ " );
- eid2name.put( CP_EVENTID_TASKEXECUTE, "TASKEXECUTE " );
- eid2name.put( CP_EVENTID_TASKRETIRE, "TASKRETIRE " );
- eid2name.put( CP_EVENTID_TASKSTALLVAR, "TASKSTALLVAR " );
- eid2name.put( CP_EVENTID_TASKSTALLMEM, "TASKSTALLMEM " );
- eid2name.put( CP_EVENTID_DEBUG_A, "DEBUG A " );
- eid2name.put( CP_EVENTID_DEBUG_B, "DEBUG B " );
- eid2name.put( CP_EVENTID_DEBUG_C, "DEBUG C " );
- eid2name.put( CP_EVENTID_DEBUG_D, "DEBUG D " );
- eid2name.put( CP_EVENTID_DEBUG_E, "DEBUG E " );
- eid2name.put( CP_EVENTID_DEBUG_F, "DEBUG F " );
- eid2name.put( CP_EVENTID_DEBUG_G, "DEBUG G " );
- eid2name.put( CP_EVENTID_DEBUG_H, "DEBUG H " );
- eid2name.put( CP_EVENTID_DEBUG_I, "DEBUG I " );
- eid2name.put( CP_EVENTID_DEBUG_J, "DEBUG J " );
+ eid2name.put( CP_EVENTID_MAIN, "MAIN " );
+ eid2name.put( CP_EVENTID_RUNMALLOC, "RUNMALLOC " );
+ eid2name.put( CP_EVENTID_RUNFREE, "RUNFREE " );
+ eid2name.put( CP_EVENTID_POOLALLOC, "POOLALLOC " );
+ eid2name.put( CP_EVENTID_COUNT_POOLALLOC, "POOLALLOC CNT " );
+ eid2name.put( CP_EVENTID_COUNT_POOLREUSE, "POOLREUSE CNT " );
+ eid2name.put( CP_EVENTID_WORKSCHEDGRAB, "WORKSCHEDGRAB " );
+ eid2name.put( CP_EVENTID_WORKSCHEDSUBMIT, "WORKSCHEDSUBMIT" );
+ eid2name.put( CP_EVENTID_TASKDISPATCH, "TASKDISPATCH " );
+ eid2name.put( CP_EVENTID_PREPAREMEMQ, "PREPAREMEMQ " );
+ eid2name.put( CP_EVENTID_TASKEXECUTE, "TASKEXECUTE " );
+ eid2name.put( CP_EVENTID_TASKRETIRE, "TASKRETIRE " );
+ eid2name.put( CP_EVENTID_TASKSTALLVAR, "TASKSTALLVAR " );
+ eid2name.put( CP_EVENTID_TASKSTALLMEM, "TASKSTALLMEM " );
+ eid2name.put( CP_EVENTID_RCR_TRAVERSE, "RCR TRAVERSE " );
+ eid2name.put( CP_EVENTID_DEBUG_A, "DEBUG A " );
+ eid2name.put( CP_EVENTID_DEBUG_B, "DEBUG B " );
+ eid2name.put( CP_EVENTID_DEBUG_C, "DEBUG C " );
+ eid2name.put( CP_EVENTID_DEBUG_D, "DEBUG D " );
+ eid2name.put( CP_EVENTID_DEBUG_E, "DEBUG E " );
+ eid2name.put( CP_EVENTID_DEBUG_F, "DEBUG F " );
+ eid2name.put( CP_EVENTID_DEBUG_G, "DEBUG G " );
+ eid2name.put( CP_EVENTID_DEBUG_H, "DEBUG H " );
+ eid2name.put( CP_EVENTID_DEBUG_I, "DEBUG I " );
+ eid2name.put( CP_EVENTID_DEBUG_J, "DEBUG J " );
}
Hashtable<Integer, String> eid2name;
long mintime;
long scale;
+ long minObservedTime = Long.MAX_VALUE;
+ long maxObservedTime = Long.MIN_VALUE;
+
+
public Trace( boolean c2txt, String inFile, String outFile, HashSet<Integer> eventset, long mintime, long maxtime, long scale) {
this.eventset=eventset;
this.maxtime=maxtime;
initNames();
+ if( convert2txt ) {
+ try {
+ txtStream = new BufferedWriter( new FileWriter( "events.txt" ) );
+ } catch( Exception e ) { e.printStackTrace(); System.exit( -1 ); }
+ }
+
if (convert2plot) {
printPlotCmd();
}
readThread( i );
}
+ System.out.println( "Minimum observed time stamp: "+minObservedTime );
+ System.out.println( "Maximum observed time stamp: "+maxObservedTime );
+
+ System.out.println( "\nelapsed time: "+(maxObservedTime - minObservedTime) );
+
+
printStats( outFile );
+ if( convert2txt ) {
+ try {
+ txtStream.close();
+ } catch( Exception e ) { e.printStackTrace(); System.exit( -1 ); }
+ }
+
if( convert2plot ) {
try {
bwPlot.write("plot [0:"+(globendtime/scale)+"] [-1:"+(numThreads+1)+"] -3\n");
if( convert2txt ) {
try {
- txtStream = new BufferedWriter( new FileWriter( "events.txt" ) );
-
txtStream.write( "\n\n\n\n" );
txtStream.write( "*************************************************\n" );
txtStream.write( "** Thread "+tNum+"\n" );
timeStamp = readLong( tdata.dataStream );
i += 3;
+
+ if( timeStamp < minObservedTime ) {
+ minObservedTime = timeStamp;
+ }
+
+ if( timeStamp > maxObservedTime ) {
+ maxObservedTime = timeStamp;
+ }
+
+
int eventType = eventRaw & CP_EVENT_MASK;
int eventID = eventRaw >> CP_EVENT_BASESHIFT;
globendtime=nend;
if (nstart<0)
nstart=0;
- bwPlot.write( "set arrow from "+(nstart/scale)+","+thread+" to "+(nend/scale)+","+thread+" lt "+eventID+" nohead\n");
+ bwPlot.write( "set arrow from "+(nstart/scale)+","+thread+
+ " to "+(nend/scale)+","+thread+" lt "+eventID+"\n");
}
} catch( IOException e ) {
e.printStackTrace();