diff options
author | Dan Wells <dwells@cs.uiuc.edu> | 1998-10-30 19:46:05 (GMT) |
---|---|---|
committer | Dan Wells <dwells@cs.uiuc.edu> | 1998-10-30 19:46:05 (GMT) |
commit | 75b0660dbc6b177e834675e62192a86cb05ae637 (patch) | |
tree | 9536546d7612939ca50440107720633394d601e7 | |
parent | 6089dc90988e659f03cd9028146011f39a3c84cb (diff) | |
download | hdf5-75b0660dbc6b177e834675e62192a86cb05ae637.zip hdf5-75b0660dbc6b177e834675e62192a86cb05ae637.tar.gz hdf5-75b0660dbc6b177e834675e62192a86cb05ae637.tar.bz2 |
[svn-r853] Updated code to better handle new HDF entry points.
-rw-r--r-- | pablo/PabloHDF.c | 41 | ||||
-rw-r--r-- | pablo/PabloHDF_RT.c | 43 | ||||
-rw-r--r-- | pablo/PabloHDF_SDDF.c | 383 |
3 files changed, 131 insertions, 336 deletions
diff --git a/pablo/PabloHDF.c b/pablo/PabloHDF.c index 4907e28..36bf0df 100644 --- a/pablo/PabloHDF.c +++ b/pablo/PabloHDF.c @@ -88,7 +88,6 @@ int fileno ( FILE * ); #define HDFtrace3OPEN__ int HDFtrace3OPEN( const char *, int, mode_t ); -/*#include "Assert_TrLib.h"*/ #include "SDDFparam.h" #include "TraceParam.h" @@ -115,7 +114,7 @@ int OUTPUT_SWITCH; extern void preInitIOTrace( void ); #include "ProcIDs.h" -#include "HDFTrace.h" +#include "HDF5Trace.h" #include "IOTrace.h" #define NO_OUTPUT 0 #define SDDF_OUTPUT 1 @@ -127,6 +126,7 @@ void hdfendtrace_ ( void ) ; void HDFendTrace (void); void HDFendTrace_RT (void); void HDFendTrace_SDDF(void); +void HDFfinalTimeStamp( void ); void startHDFtraceEvent (int ); int computeProcMask (int eventID); int computePacketTag(int eventID); @@ -839,13 +839,13 @@ void *HDFtraceMALLOC(size_t bytes ) size_t byte_req; byte_req = bytes; if ( IOtracingEnabled ) { - HDFtraceIOEvent ( ID_malloc, &byte_req, sizeof(size_t) ); + HDFtraceIOEvent ( ID_malloc, NULL, 0 ); } ptr = malloc( bytes ); if ( IOtracingEnabled ) { - HDFtraceIOEvent ( -ID_malloc, NULL, 0 ); + HDFtraceIOEvent ( -ID_malloc, &byte_req, sizeof(size_t) ); } return ptr ; @@ -860,3 +860,36 @@ void HDFtraceIOEvent( int eventType, void *dataPtr, unsigned dataLen ) HDFtraceEvent_RT( eventType, (HDFsetInfo *)dataPtr, dataLen ); } } +/*======================================================================* +// record the final time stamp * +//======================================================================*/ +void HDFfinalTimeStamp( void ) +{ + TR_LOCK criticalSection; + CLOCK currentTime; + double seconds; + struct { + int packetLength, + packetType, + packetTag, + timeDim; + double Seconds; + int eventID, + node, + dataLen; + } Packet; + + criticalSection = TRlock(); + currentTime = getClock(); + seconds = clockToSeconds( currentTime ); + + Packet.packetLength = sizeof(Packet); + Packet.packetType = PKT_DATA; + Packet.packetTag = FAMILY_EXTERNAL | RECORD_TRACE; + Packet.timeDim = 0; /* use fp time stamp only */ + Packet.Seconds = seconds; /* fp time stamp */ + Packet.eventID = ID_timeStamp; + Packet.node = TRgetNode(); + Packet.dataLen = 0; + putBytes( (void *)&Packet , sizeof(Packet) ); +} diff --git a/pablo/PabloHDF_RT.c b/pablo/PabloHDF_RT.c index 66ecc72..ff04783 100644 --- a/pablo/PabloHDF_RT.c +++ b/pablo/PabloHDF_RT.c @@ -114,7 +114,7 @@ #include "Trace.h" #include "TraceParam.h" #include "ProcIDs.h" -#include "HDFTrace.h" +#include "HDF5Trace.h" #include "SDDFparam.h" #include <string.h> #include <stdio.h> @@ -137,7 +137,7 @@ #endif #define NEG_THREAD_ID -999 -#include "HDFrecord_RT.h" +#include "HDF5record_RT.h" #ifdef HAVE_PARALLEL #include "MPIO_Init.h" @@ -207,6 +207,7 @@ void writeHDFRecDescrptrsRT( void ); void printFileMappingsRT( char *, char **, int ); void _hdfNameDescriptor( void ); void _hdfDescriptorRT( char *, char *, int ); +void HDFfinalTimeStamp( void ); /*======================================================================* // Global variables * //======================================================================*/ @@ -272,6 +273,7 @@ void HDFendTrace_RT( ) char **Names; char* mapFile; + HDFfinalTimeStamp(); /*==============================================================* // Assing pablo ids to named identifiers and tag records * //==============================================================*/ @@ -398,9 +400,9 @@ void HDFtraceEvent_RT( int eventType, char *dataPtr, unsigned dataLen ) currentTime = getClock(); seconds = clockToSeconds( currentTime ); - if ( isBeginIOEvent ( eventType ) ) { + if ( isBeginIOEvent ( eventType ) || eventType == ID_malloc ) { BeginIOEventRecord ( eventType, seconds, dataPtr ) ; - } else if ( isEndIOEvent( eventType ) ) { + } else if ( isEndIOEvent( eventType ) || eventType == -ID_malloc) { EndIOEventRecord ( eventType, seconds, dataPtr ); } else if ( isBeginHDFEvent( eventType ) ) { BeginHDFEventRecord ( eventType , seconds ) ; @@ -988,8 +990,8 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex ) HDFnode_t *Q; struct { int packetLen, - packetTag, packetType, + packetTag, eventID, threadID, nCalls; @@ -1011,17 +1013,19 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex ) + nByteFields*sizeof(int) /* array lens */ + nByteFields*nBkts*sizeof(int) /* byte hist */ + sizeof(int) ; /* Name len */ - Header.packetTag = ( procIndex + 1 )*HDF_FAMILY | RECORD_TRACE ; + Header.packetTag = HDF_SUMMARY_FAMILY + + ( procIndex + 1 )*8 + RECORD_TRACE ; Header.packetType = PKT_DATA; Header.threadID = TRgetNode(); while ( P != NULL ) { Q = P->ptr; - Header.eventID = Q->eventID; - Header.Seconds = Q->record.lastCall; - Header.IncDur = Q->record.incDur; - Header.ExcDur = Q->record.excDur; - Header.HDFid = Q->record.hdfID; - Header.XREFid = Q->record.xRef; + Header.eventID = P->eventID; + Header.nCalls = P->record.nCalls; + Header.Seconds = P->record.lastCall; + Header.IncDur = P->record.incDur; + Header.ExcDur = P->record.excDur; + Header.HDFid = P->record.hdfID; + Header.XREFid = P->record.xRef; memcpy( Packet, &Header, sizeof(Header) ); Packet += sizeof(Header); /*===========================================================* @@ -1030,15 +1034,15 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex ) arrayLen = nTallyFields; memcpy( Packet, &arrayLen, sizeof(int) ); Packet += sizeof(int); - memcpy( Packet, Q->record.times, nTallyFields*sizeof(int) ); - Packet += nTallyFields*sizeof(int); + memcpy( Packet, P->record.times, nTallyFields*sizeof(double) ); + Packet += nTallyFields*sizeof(double); /*===========================================================* // copy length of counts array and counts array to Packet. * //===========================================================*/ arrayLen = nTallyFields; memcpy( Packet, &arrayLen, sizeof(int) ); Packet += sizeof(int); - memcpy( Packet, Q->record.counts, nTallyFields*sizeof(int) ); + memcpy( Packet, P->record.counts, nTallyFields*sizeof(int) ); Packet += nTallyFields*sizeof(int); /*===========================================================* // copy length of bytes array and bytes array to Packet. * @@ -1046,7 +1050,7 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex ) arrayLen = nByteFields; memcpy( Packet, &arrayLen, sizeof(int) ); Packet += sizeof(int); - memcpy( Packet, Q->record.counts, nByteFields*sizeof(int) ); + memcpy( Packet, P->record.bytes, nByteFields*sizeof(int) ); Packet += nByteFields*sizeof(int); /*===========================================================* // copy length of historgram arrays and arrays to Packet. * @@ -1055,7 +1059,7 @@ void HDFSummarySDDF( HDFnode_t *P, int procIndex ) for ( i = 0; i < nByteFields; ++i ) { memcpy( Packet, &arrayLen, sizeof(int) ); Packet += sizeof(int); - memcpy( Packet, Q->record.Hists[i], nBkts*sizeof(int) ); + memcpy( Packet, P->record.Hists[i], nBkts*sizeof(int) ); Packet += nBkts*sizeof(int); } arrayLen = 0; /* name length */ @@ -1375,7 +1379,7 @@ void writeHDFRecDescrptrsRT() # include "HDFentryNames.h" "HDF_Last_Entry" }; - int j; + int j, FAMILY; char BUF1[256], BUF2[256] ; _hdfNameDescriptor(); /* Descriptor for named identifiers */ for ( j = 0; j < NumHDFProcs; ++j ) { @@ -1385,7 +1389,8 @@ void writeHDFRecDescrptrsRT() strcat( BUF2, " Procedure Summary"); strcpy( BUF1, BUF2 ); strcat( BUF1, " Trace"); - _hdfDescriptorRT( BUF1, BUF2, (j+1)*HDF_FAMILY ); + FAMILY = HDF_SUMMARY_FAMILY + (j + 1)*8; + _hdfDescriptorRT( BUF1, BUF2, FAMILY ); } } return; diff --git a/pablo/PabloHDF_SDDF.c b/pablo/PabloHDF_SDDF.c index af57200..6faf551 100644 --- a/pablo/PabloHDF_SDDF.c +++ b/pablo/PabloHDF_SDDF.c @@ -71,7 +71,7 @@ #include "SDDFparam.h" #include "TraceParam.h" #include "Trace.h" -#include "HDFTrace.h" +#include "HDF5Trace.h" void HDFendTrace_SDDF(void); void startHDFtraceEvent(int eventID); void endHDFtraceEvent(int , int , char *, int ); @@ -81,8 +81,6 @@ int writeHDFProcRecordDescriptors( void ); int findHDFProcEvent( int ) ; TR_RECORD *HDFprocEventRecord( int, TR_EVENT *, CLOCK, HDFsetInfo *, unsigned ); TR_RECORD *miscEventRecord( int , TR_EVENT *, CLOCK, void *, unsigned ); -void _hdfTraceEntryDescriptor( void ); -void _hdfTraceExitDescriptor( void ); void _hdfMiscDescriptor( void ); void _hdfProcNameDescriptor( void ); int setEventRecordFunction( int, void * ); @@ -92,6 +90,9 @@ void enableIOdetail( void ); void disableLifetimeSummaries( void ); void disableTimeWindowSummaries( void ); void disableFileRegionSummaries( void ); +void _hdfTraceDescriptor( char *, char *, int ); +void createHDFTraceDescriptor( int ); +void HDFfinalTimeStamp( void ); void initIOTrace( void ); void endIOTrace( void ); @@ -156,24 +157,10 @@ static PROC_ENTRY **procEntryStack =*/ /* array of pointers to */ // records, similarly to record data structures in Trace.h * //======================================================================*/ -/*======================================================================* -// FAMILY_PROCENTRY family Record Data packets: * -//======================================================================*/ -struct procEntryTraceRecordData { - int packetLength; /* bytes in packet */ - int packetType; /* == PKT_DATA */ - int packetTag; /* FAMILY_PROCENTRY | RECORD_TRACE */ - int eventID; /* ID of corresponding event */ - double seconds; /* floating-point timestamp */ - long sourceByte; /* source code byte offset in file */ - int sourceLine; /* source code line number in file */ - int nodeNumber; /* occurred on which node */ -}; -#define procEntryTraceLen 6*sizeof(int) + sizeof(long) + sizeof(double) /*======================================================================* -// FAMILY_PROCEXIT family Record Data packets: * +// TraceRecord Data packets: * //======================================================================*/ -struct procExitTraceRecordData { +struct procTraceRecordData { int packetLength; /* bytes in packet */ int packetType; /* == PKT_DATA */ int packetTag; /* FAMILY_PROCEXIT | RECORD_TRACE */ @@ -184,7 +171,7 @@ struct procExitTraceRecordData { int nameLen; /* Length of file or data set name */ /* name comes next, but no space is allocated */ }; -#define procExitTraceLen 6*sizeof(int) + 3*sizeof(double) +sizeof(long) +#define procTraceRecLen 6*sizeof(int) + sizeof(double) +sizeof(long) /*======================================================================* // misc Record Data packets: * //======================================================================*/ @@ -200,31 +187,6 @@ struct miscTraceRecordData { }; #define miscTraceLen 5*sizeof(int) + 2*sizeof(double) +sizeof(long) /*======================================================================* -// HDFprocName Record Data packets: * -// These are used to pass information about the names of the traced * -// routine in the trace file to the post processing utilities. * -//======================================================================*/ -struct HDFprocNameRecordData { - int packetLength; /* bytes in packet */ - int packetType; /* == PKT_DATA */ - int packetTag; /* FAMILY_HDFPROCNAME | RECORD_TRACE */ - int eventID; /* ID of corresponding event */ - int HDFeventID; /* ID of HDF proc */ - int procIndex; /* Index of HDF proc */ - int numProcs; /* Number of HDF procs */ - int NameLen; /* length of HDF proc Name */ - char *Name; -}; -#define HDFprocNameRecLen 8*sizeof(int) -/*======================================================================* -// Define data structures used to contain source code location data for * -// Pablo instrumenting parser-generated code. * -//======================================================================*/ -static long procByteOffset = -1; /* source code byte offset */ - -static int procLineNumber = -1; /* source code line number */ - -/*======================================================================* // The procEntries array specifies the event IDs of procedure entry * // events. * //======================================================================*/ @@ -307,7 +269,6 @@ void HDFinitTrace_SDDF( char *traceFileName, uint32 procTraceMask ) //======================================================================*/ void HDFendTrace_SDDF(void) { - HDFtraceIOEvent( -ID_timeStamp, 0, 0 ); #ifdef HAVE_MPIOTRACE /*=============================================================== // termintate MPI-IO tracing in the parallel case. This will * @@ -318,6 +279,7 @@ void HDFendTrace_SDDF(void) /*=============================================================== // terminate tracing * //==============================================================*/ + HDFfinalTimeStamp(); endIOTrace(); endTracing(); #endif @@ -391,10 +353,6 @@ int initHDFProcTrace( int numProcs, int *procEntryID ) procEvents[ numProcs+1 ].exitID = -ID_free; setEventRecordFunction( ID_free, miscEventRecord ); setEventRecordFunction( -ID_free, miscEventRecord ); - procEvents[ numProcs+2 ].entryID = ID_timeStamp; - procEvents[ numProcs+2 ].exitID = -ID_timeStamp; - setEventRecordFunction( ID_timeStamp, miscEventRecord ); - setEventRecordFunction( -ID_timeStamp, miscEventRecord ); return SUCCESS; } @@ -448,9 +406,6 @@ int writeHDFProcRecordDescriptors( void ) #endif /* DEBUG */ _hdfMiscDescriptor(); - _hdfTraceEntryDescriptor() ; - _hdfTraceExitDescriptor() ; - _hdfProcNameDescriptor(); #ifdef DEBUG fprintf( debugFile, "writeHDFProcRecordDescriptors done\n" ); @@ -484,19 +439,15 @@ HDFprocEventRecord( int recordType, TR_EVENT *eventPointer, CLOCK timeStamp, static TR_RECORD traceRecord; static void *recordBuffer = NULL; static int bufferLength = 0; - struct procEntryTraceRecordData *entryTraceRecordHeader; - struct procExitTraceRecordData *exitTraceRecordHeader; - struct HDFprocNameRecordData *nameRecord; + struct procTraceRecordData *TraceRecordHeader; int procIndex; int recordFamily; char *namePtr; - int NameLen; - int NameRecLen; - -#ifdef DEBUG - fprintf( debugFile, "HDFprocEventRecord\n" ); - fflush( debugFile ); -#endif /* DEBUG */ + + #ifdef DEBUG + fprintf( debugFile, "HDFprocEventRecord\n" ); + fflush( debugFile ); + #endif /* DEBUG */ /*==============================================================* // Find the index in the tables for the procedure corresponding * @@ -512,25 +463,7 @@ HDFprocEventRecord( int recordType, TR_EVENT *eventPointer, CLOCK timeStamp, // not already been produced. * //==============================================================*/ if ( procEntryCalled[procIndex] == 0 ) { - NameLen = strlen( HDFProcNames[procIndex] ); - NameRecLen = HDFprocNameRecLen + NameLen; - nameRecord = ( struct HDFprocNameRecordData *)malloc( NameRecLen ); - nameRecord->packetLength = NameRecLen; - nameRecord->packetType = PKT_DATA; - nameRecord->packetTag = FAMILY_HDFPROCNAME | RECORD_TRACE; - nameRecord->eventID = ID_HDFprocName; - nameRecord->HDFeventID = abs(eventPointer->eventID); - nameRecord->procIndex = procIndex; - nameRecord->numProcs = NumHDFProcs; - nameRecord->NameLen = NameLen; - /*===========================================================* - // copy procedure name into the packet, write out the packet * - // and set ProcEntryCalled[procIndex] to indicate the name * - // packet was produced. * - //===========================================================*/ - memcpy( &(nameRecord->Name), HDFProcNames[procIndex], NameLen ); - putBytes( (char *)nameRecord , NameRecLen ); - free( nameRecord ); + createHDFTraceDescriptor( procIndex ); procEntryCalled[procIndex] = 1; } /*==============================================================* @@ -538,11 +471,7 @@ HDFprocEventRecord( int recordType, TR_EVENT *eventPointer, CLOCK timeStamp, // exit family event by lookup in the procedure event ID * // matching. * //==============================================================*/ - if ( procEvents[ procIndex ].entryID == eventPointer->eventID ) { - recordFamily = FAMILY_PROCENTRY; - } else { - recordFamily = FAMILY_PROCEXIT; - } + recordFamily = HDF_FAMILY + ( procIndex + 1)*8; /*==============================================================* // The time stamp stored in the event descriptor will be used * // unless one is specified in the timeStamp parameter. * @@ -554,16 +483,7 @@ HDFprocEventRecord( int recordType, TR_EVENT *eventPointer, CLOCK timeStamp, // Determine how many bytes of storage will be needed for the * // contents of the trace record. * //==============================================================*/ - switch (( recordFamily | recordType )) { - - case FAMILY_PROCENTRY | RECORD_TRACE: - traceRecord.recordLength = sizeof *entryTraceRecordHeader; - break; - - case FAMILY_PROCEXIT | RECORD_TRACE: - traceRecord.recordLength = sizeof *exitTraceRecordHeader; - break; - } + traceRecord.recordLength = sizeof *TraceRecordHeader; if ( dataPointer != NULL && dataPointer->setName != NULL ) { traceRecord.recordLength += strlen( dataPointer->setName ); } @@ -590,54 +510,30 @@ HDFprocEventRecord( int recordType, TR_EVENT *eventPointer, CLOCK timeStamp, /*==============================================================* // Load the trace record fields into the allocated buffer * //==============================================================*/ - switch (( recordFamily | recordType )) { - - case FAMILY_PROCENTRY | RECORD_TRACE: - entryTraceRecordHeader = (struct procEntryTraceRecordData *) - recordBuffer; - entryTraceRecordHeader->packetLength = - traceRecord.recordLength; - entryTraceRecordHeader->packetType = PKT_DATA; - entryTraceRecordHeader->packetTag = recordFamily | recordType; - entryTraceRecordHeader->seconds = clockToSeconds( timeStamp ); - entryTraceRecordHeader->eventID = eventPointer->eventID; - entryTraceRecordHeader->nodeNumber = TRgetNode(); - entryTraceRecordHeader->sourceByte = procByteOffset; - entryTraceRecordHeader->sourceLine = procLineNumber; - break; - - case FAMILY_PROCEXIT | RECORD_TRACE: - exitTraceRecordHeader = (struct procExitTraceRecordData *) - recordBuffer; - exitTraceRecordHeader->packetLength = - traceRecord.recordLength; - exitTraceRecordHeader->packetType = PKT_DATA; - exitTraceRecordHeader->packetTag = recordFamily | recordType; - exitTraceRecordHeader->seconds = clockToSeconds( timeStamp ); - exitTraceRecordHeader->eventID = eventPointer->eventID; - exitTraceRecordHeader->nodeNumber = TRgetNode(); - - if ( dataPointer != 0 ) { - exitTraceRecordHeader->setID = dataPointer->setID; - if (dataPointer->setName != NULL ) { - exitTraceRecordHeader->nameLen - = (int)strlen( dataPointer->setName ); - /*================================================* - // copy name directly into the end of the buffer. * - //================================================*/ - namePtr = (char *)exitTraceRecordHeader - + procExitTraceLen; - memcpy( namePtr, dataPointer->setName, - exitTraceRecordHeader->nameLen ); - } else { - exitTraceRecordHeader->nameLen = 0; - } - } else { - exitTraceRecordHeader->setID = NoDSid; - exitTraceRecordHeader->nameLen = 0; - } - break; - } + TraceRecordHeader = (struct procTraceRecordData *)recordBuffer; + TraceRecordHeader->packetLength = traceRecord.recordLength; + TraceRecordHeader->packetType = PKT_DATA; + TraceRecordHeader->packetTag = recordFamily | recordType; + TraceRecordHeader->seconds = clockToSeconds( timeStamp ); + TraceRecordHeader->eventID = eventPointer->eventID; + TraceRecordHeader->nodeNumber = TRgetNode(); + + if ( dataPointer != 0 ) { + TraceRecordHeader->setID = dataPointer->setID; + if (dataPointer->setName != NULL ) { + TraceRecordHeader->nameLen = (int)strlen( dataPointer->setName ); + /*================================================* + // copy name directly into the end of the buffer. * + //================================================*/ + namePtr = (char *)TraceRecordHeader + procTraceRecLen; + memcpy(namePtr, dataPointer->setName, TraceRecordHeader->nameLen); + } else { + TraceRecordHeader->nameLen = 0; + } + } else { + TraceRecordHeader->setID = NoDSid; + TraceRecordHeader->nameLen = 0; + } #ifdef DEBUG fprintf( debugFile, "HDFprocEventRecord done\n" ); @@ -680,23 +576,15 @@ TR_RECORD *miscEventRecord( int recordType, case ID_malloc: case ID_free: miscRecord.seconds = clockToSeconds( timeStamp ) ; - miscRecord.bytes = *(size_t *)dataPointer; miscRecord.eventID = eventID ; break; case -ID_malloc: case -ID_free: + miscRecord.bytes = *(size_t *)dataPointer; miscRecord.duration = clockToSeconds( timeStamp) - miscRecord.seconds; return &traceRecord; /* generate trace record */ break; - case ID_timeStamp: - case -ID_timeStamp: - miscRecord.seconds = clockToSeconds( timeStamp ) ; - miscRecord.bytes = 0; - miscRecord.eventID = eventID ; - miscRecord.duration = 0; - return &traceRecord; - break; default: fprintf( stderr, "miscEventRecord: unknown eventID %d\n", eventID ); break; @@ -738,43 +626,54 @@ int findHDFProcEvent( int eventID ) } return procIndex; } +void createHDFTraceDescriptor( int Inx ) +{ + char BUF1[256], BUF2[256] ; + int FAMILY; + strcpy( BUF2, "HDF "); + strcat( BUF2, HDFProcNames[Inx] ); + strcat( BUF2, " Procedure"); + strcpy( BUF1, BUF2 ); + strcat( BUF1, " Trace"); + + FAMILY = HDF_FAMILY + (Inx + 1)*8; + _hdfTraceDescriptor( BUF1, BUF2, FAMILY ); +} /*======================================================================* // NAME * -// _hdfTraceEntryDescriptor * +// _hdfTraceDescriptor * // Generate a SDDF binary format record descriptor for the * // full trace class of events in the HDF procedure entry * // USAGE * -// _hdfTraceEntryDescriptro() * +// _hdfTraceDescriptro( recordName, recordDescription, recordFamily ) * // RETURNS * // void * //======================================================================*/ -void _hdfTraceEntryDescriptor( void ) +void _hdfTraceDescriptor( char *recordName, + char *recordDescription, + int recordFamily ) { static char recordBuffer[ 4096 ]; int recordLength; -#ifdef DEBUG - fprintf( debugFile, "_hdfTraceEntryDescriptor entered\n" ); - fflush( debugFile ); -#endif /* DEBUG */ hdfRecordPointer = recordBuffer; - /*==================================================================* + /*=================================================================== // Allow space at the beginning of the record for the packet * //length which will be computed after the packet is complete. * //==================================================================*/ sddfWriteInteger( &hdfRecordPointer, 0 ); - /*==================================================================* - // The record type, tag, and name * + /*=================================================================== + // The record type, tag, and name * //==================================================================*/ sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); - sddfWriteInteger( &hdfRecordPointer, ( FAMILY_PROCENTRY | RECORD_TRACE ) ); - sddfWriteString( &hdfRecordPointer, "HDF Procedure Entry Trace" ); - /*==================================================================* + sddfWriteInteger( &hdfRecordPointer, ( recordFamily | RECORD_TRACE ) ); + sddfWriteString( &hdfRecordPointer, recordName ); + /*=================================================================== // The record attribute count and string pair * //==================================================================*/ sddfWriteInteger( &hdfRecordPointer, 1 ); sddfWriteString( &hdfRecordPointer, "description" ); - sddfWriteString( &hdfRecordPointer, "HDF Procedure Entry Trace Record" ); + sddfWriteString( &hdfRecordPointer, recordDescription ); /*==================================================================* // The record field count * //==================================================================*/ @@ -782,78 +681,6 @@ void _hdfTraceEntryDescriptor( void ) /*==================================================================* // Create fields * //==================================================================*/ - WRITE_HDF_FIELD( "Event Identifier", - "Event ID", - "Event Identifier Number", - INTEGER, 0 ); - WRITE_HDF_FIELD( "Seconds", - "Seconds", - "Floating Point Timestamp", - DOUBLE, 0 ); - WRITE_HDF_FIELD( "Source Byte", - "Byte", - "Source Byte Offset", - LONG, 0 ); - WRITE_HDF_FIELD( "Source Line", - "Line", - "Source Line Number", - INTEGER, 0 ); - WRITE_HDF_FIELD( "Processor Number", - "Node", - "Processor number", - INTEGER, 0 ); - - recordLength = (int)(hdfRecordPointer - recordBuffer); - - hdfRecordPointer = recordBuffer; - sddfWriteInteger( &hdfRecordPointer, recordLength ); - - putBytes( recordBuffer, (unsigned) recordLength ); -} -/*======================================================================* -// NAME * -// _hdfTraceExitDescriptor * -// Generate a SDDF binary format record descriptor for the * -// full trace class of events in the HDF procedure exit * -// USAGE * -// _hdfTraceExitDescriptor() * -// RETURNS * -// void * -//======================================================================*/ -void _hdfTraceExitDescriptor( void ) -{ - static char recordBuffer[ 4096 ]; - int recordLength; - -#ifdef DEBUG - fprintf( debugFile, "_hdfExitTraceDescriptor entered\n" ); - fflush( debugFile ); -#endif /* DEBUG */ - hdfRecordPointer = recordBuffer; - /*==================================================================* - // Allow space at the beginning of the record for the packet * - // length which will be computed after the packet is complete. * - //==================================================================*/ - sddfWriteInteger( &hdfRecordPointer, 0 ); - /*==================================================================* - // The record type, tag, and name * - /===================================================================*/ - sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); - sddfWriteInteger( &hdfRecordPointer, ( FAMILY_PROCEXIT | RECORD_TRACE ) ); - sddfWriteString( &hdfRecordPointer, "HDF Procedure Exit Trace" ); - /*==================================================================* - // The record attribute count and string pair * - //==================================================================*/ - sddfWriteInteger( &hdfRecordPointer, 1 ); - sddfWriteString( &hdfRecordPointer, "description" ); - sddfWriteString( &hdfRecordPointer, "HDF Procedure Exit Trace Record" ); - /*==================================================================* - // The record field count * - //==================================================================*/ - sddfWriteInteger( &hdfRecordPointer, 5); - /*==================================================================* - // Create fields * - //==================================================================*/ WRITE_HDF_FIELD( "Event Identifier", "Event ID", "Event Identifier Number", @@ -870,10 +697,11 @@ void _hdfTraceExitDescriptor( void ) "Node", "Processor number", INTEGER, 0 ); - WRITE_HDF_FIELD( "HDF Name", - "HDF Name", "Name of File, Data Set or Dim", + WRITE_HDF_FIELD( "HDF Name", + "HDF Name", "Name of File, Data Set or Dim", CHARACTER, 1 ); + recordLength = (int)(hdfRecordPointer - recordBuffer); hdfRecordPointer = recordBuffer; @@ -881,7 +709,6 @@ void _hdfTraceExitDescriptor( void ) putBytes( recordBuffer, (unsigned) recordLength ); } - /*======================================================================* // NAME * // _hdfMiscDescriptor * @@ -954,75 +781,5 @@ void _hdfMiscDescriptor( void ) putBytes( recordBuffer, (unsigned) recordLength ); } -/*======================================================================* -// NAME * -// _hdfProcNameDescriptor * -// Generate a SDDF binary format record descriptor for the * -// HDFProcName Records * -// USAGE * -// _hdfProcNameDescriptor() * -// RETURNS * -// void * -//======================================================================*/ -void _hdfProcNameDescriptor( void ) -{ - static char recordBuffer[ 4096 ]; - int recordLength; - -#ifdef DEBUG - fprintf( debugFile, "_hdfProcNameDescriptor entered\n" ); - fflush( debugFile ); -#endif /* DEBUG */ - hdfRecordPointer = recordBuffer; - /*==================================================================* - // Allow space at the beginning of the record for the packet * - //length which will be computed after the packet is complete. * - //==================================================================*/ - sddfWriteInteger( &hdfRecordPointer, 0 ); - /*==================================================================* - // The record type, tag, and name * - //==================================================================*/ - sddfWriteInteger( &hdfRecordPointer, PKT_DESCRIPTOR ); - sddfWriteInteger( &hdfRecordPointer, ( FAMILY_HDFPROCNAME| RECORD_TRACE ) ); - sddfWriteString( &hdfRecordPointer, "HDF Procedure Information" ); - /*==================================================================* - // The record attribute count and string pair * - //==================================================================*/ - sddfWriteInteger( &hdfRecordPointer, 1 ); - sddfWriteString( &hdfRecordPointer, "description" ); - sddfWriteString( &hdfRecordPointer, "HDF Proc Info Record" ); - /*==================================================================* - // The record field count * - //==================================================================*/ - sddfWriteInteger( &hdfRecordPointer, 5); - /*==================================================================* - // Create fields * - //==================================================================*/ - WRITE_HDF_FIELD( "Event Identifier", - "Event ID", - "Event Identifier Number", - INTEGER, 0 ); - WRITE_HDF_FIELD( "HDF Proc Event Id", - "HDF Proc Event Identifier", - "HDF Proc Event Identifier Number", - INTEGER, 0 ); - WRITE_HDF_FIELD( "HDF Proc Index", - "HDF Proc Index", - "Index of HDF Proc in Tables", - INTEGER, 0 ); - WRITE_HDF_FIELD( "Num HDF Procs", - "Num HDF Procs", - "Number of HDF Procedures", - INTEGER, 0 ); - WRITE_HDF_FIELD( "HDF Proc Name", - "HDF Proc Name", - "Name of HDF Procedure", - CHARACTER, 1 ); - recordLength = (int)(hdfRecordPointer - recordBuffer); - hdfRecordPointer = recordBuffer; - sddfWriteInteger( &hdfRecordPointer, recordLength ); - - putBytes( recordBuffer, (unsigned) recordLength ); -} /*#endif */ /* HAVE_PABLO */ |