From 3888436ce256d6b48f9354006a2acc8a25fb6889 Mon Sep 17 00:00:00 2001 From: yangxx Date: Tue, 27 Jan 2004 22:19:25 +0000 Subject: [PATCH] git-svn-id: http://ltt.polymtl.ca/svn@421 04897980-b3bd-0310-b5e0-8ef037075253 --- genevent/Makefile | 21 + genevent/README | 14 + genevent/core.xml | 246 +++++++++ genevent/crc32.tab | 52 ++ genevent/genevent | Bin 0 -> 61858 bytes genevent/genevent.c | 498 ++++++++++++++++++ genevent/genevent.h | 9 + genevent/parser.c | 1175 +++++++++++++++++++++++++++++++++++++++++++ genevent/parser.h | 206 ++++++++ 9 files changed, 2221 insertions(+) create mode 100644 genevent/Makefile create mode 100644 genevent/README create mode 100644 genevent/core.xml create mode 100644 genevent/crc32.tab create mode 100755 genevent/genevent create mode 100644 genevent/genevent.c create mode 100644 genevent/genevent.h create mode 100644 genevent/parser.c create mode 100644 genevent/parser.h diff --git a/genevent/Makefile b/genevent/Makefile new file mode 100644 index 00000000..7a0d8dcb --- /dev/null +++ b/genevent/Makefile @@ -0,0 +1,21 @@ +SHELL = /bin/sh + +CC = gcc + +CFLAGS = -g -o + +all: genevent + +genevent:genevent.o parser.o + $(CC) $(CFLAGS) $@ genevent.o parser.o + +genevent.o: genevent.c genevent.h parser.h + $(CC) -g -c genevent.c + +parser.o: parser.c parser.h + $(CC) -g -c parser.c + +clean: + rm -rf *.o *~ *# + + diff --git a/genevent/README b/genevent/README new file mode 100644 index 00000000..9b34bf42 --- /dev/null +++ b/genevent/README @@ -0,0 +1,14 @@ +The 'genevent' program parses event descriptions and generates +the inline functions to record events in the kernel. + +Right now, the program can only parse simple structure, if a +structure has a nested structure, it will not work. + +There are several files in the directory: + genevent.c, genevent.h, crc32.tab, parser.c and parser.h + +In fact, crc32.tab, parser.c and parser.h are the same files as +those in LTT library. + +'core.xml' is an example event description file. + diff --git a/genevent/core.xml b/genevent/core.xml new file mode 100644 index 00000000..b2e6e004 --- /dev/null +++ b/genevent/core.xml @@ -0,0 +1,246 @@ + + The core facility contains the basic events + + + Facility used in the trace + + + + + + + + + Entry in a given system call + + Syscall entry number in entry.S + Address from which call was made + + + + + Exit from a given system call + + + + Entry in a trap + + Trap number + Address where trap occured + + + + + Exit from a trap + + + + Entry in an irq + + IRQ number + Are we executing kernel code + + + + + Exit from an IRQ + + + + Scheduling change + + Outgoing process + Incoming process + Outgoing process' state + + + + + The kernel timer routine has been called + + + + Hit key part of soft-irq management + + Soft-irq event Id + + + + + Data associated with event + + + + + Hit key part of process management + + Process event ID + + + + + Data associated with event + Data associated with event + + + + + Hit key part of file system + + File system event ID + + + + + Event data + Event data 2 + Name of file operated on + + + + + Hit key part of timer management + + Timer event ID + + + + + Short data + Data associated with event + Data associated with event + + + + + Hit key part of memory management + + Memory event ID + + + + + Data associated with event + + + + + Hit key part of socket communication + + Memory event ID + + + + + Data associated with event + Data associated with event + + + + + Hit key part of System V IPC + + Memory event ID + + + + + Data associated with event + Data associated with event + + + + + Hit key part of network communication + + Memory event ID + + + + + Data associated with event + + +/* + + Block start timestamp + + + + + Block end timestamp + + + + + System time values sent periodically to minimize cycle counter + drift with respect to real time clock and to detect cycle counter roolovers + + + + + + + + + + + + + + + + + + + + + + + + +*/ + + + + diff --git a/genevent/crc32.tab b/genevent/crc32.tab new file mode 100644 index 00000000..d0174ad6 --- /dev/null +++ b/genevent/crc32.tab @@ -0,0 +1,52 @@ + 0x00000000U, 0x77073096U, 0xee0e612cU, 0x990951baU, 0x076dc419U, + 0x706af48fU, 0xe963a535U, 0x9e6495a3U, 0x0edb8832U, 0x79dcb8a4U, + 0xe0d5e91eU, 0x97d2d988U, 0x09b64c2bU, 0x7eb17cbdU, 0xe7b82d07U, + 0x90bf1d91U, 0x1db71064U, 0x6ab020f2U, 0xf3b97148U, 0x84be41deU, + 0x1adad47dU, 0x6ddde4ebU, 0xf4d4b551U, 0x83d385c7U, 0x136c9856U, + 0x646ba8c0U, 0xfd62f97aU, 0x8a65c9ecU, 0x14015c4fU, 0x63066cd9U, + 0xfa0f3d63U, 0x8d080df5U, 0x3b6e20c8U, 0x4c69105eU, 0xd56041e4U, + 0xa2677172U, 0x3c03e4d1U, 0x4b04d447U, 0xd20d85fdU, 0xa50ab56bU, + 0x35b5a8faU, 0x42b2986cU, 0xdbbbc9d6U, 0xacbcf940U, 0x32d86ce3U, + 0x45df5c75U, 0xdcd60dcfU, 0xabd13d59U, 0x26d930acU, 0x51de003aU, + 0xc8d75180U, 0xbfd06116U, 0x21b4f4b5U, 0x56b3c423U, 0xcfba9599U, + 0xb8bda50fU, 0x2802b89eU, 0x5f058808U, 0xc60cd9b2U, 0xb10be924U, + 0x2f6f7c87U, 0x58684c11U, 0xc1611dabU, 0xb6662d3dU, 0x76dc4190U, + 0x01db7106U, 0x98d220bcU, 0xefd5102aU, 0x71b18589U, 0x06b6b51fU, + 0x9fbfe4a5U, 0xe8b8d433U, 0x7807c9a2U, 0x0f00f934U, 0x9609a88eU, + 0xe10e9818U, 0x7f6a0dbbU, 0x086d3d2dU, 0x91646c97U, 0xe6635c01U, + 0x6b6b51f4U, 0x1c6c6162U, 0x856530d8U, 0xf262004eU, 0x6c0695edU, + 0x1b01a57bU, 0x8208f4c1U, 0xf50fc457U, 0x65b0d9c6U, 0x12b7e950U, + 0x8bbeb8eaU, 0xfcb9887cU, 0x62dd1ddfU, 0x15da2d49U, 0x8cd37cf3U, + 0xfbd44c65U, 0x4db26158U, 0x3ab551ceU, 0xa3bc0074U, 0xd4bb30e2U, + 0x4adfa541U, 0x3dd895d7U, 0xa4d1c46dU, 0xd3d6f4fbU, 0x4369e96aU, + 0x346ed9fcU, 0xad678846U, 0xda60b8d0U, 0x44042d73U, 0x33031de5U, + 0xaa0a4c5fU, 0xdd0d7cc9U, 0x5005713cU, 0x270241aaU, 0xbe0b1010U, + 0xc90c2086U, 0x5768b525U, 0x206f85b3U, 0xb966d409U, 0xce61e49fU, + 0x5edef90eU, 0x29d9c998U, 0xb0d09822U, 0xc7d7a8b4U, 0x59b33d17U, + 0x2eb40d81U, 0xb7bd5c3bU, 0xc0ba6cadU, 0xedb88320U, 0x9abfb3b6U, + 0x03b6e20cU, 0x74b1d29aU, 0xead54739U, 0x9dd277afU, 0x04db2615U, + 0x73dc1683U, 0xe3630b12U, 0x94643b84U, 0x0d6d6a3eU, 0x7a6a5aa8U, + 0xe40ecf0bU, 0x9309ff9dU, 0x0a00ae27U, 0x7d079eb1U, 0xf00f9344U, + 0x8708a3d2U, 0x1e01f268U, 0x6906c2feU, 0xf762575dU, 0x806567cbU, + 0x196c3671U, 0x6e6b06e7U, 0xfed41b76U, 0x89d32be0U, 0x10da7a5aU, + 0x67dd4accU, 0xf9b9df6fU, 0x8ebeeff9U, 0x17b7be43U, 0x60b08ed5U, + 0xd6d6a3e8U, 0xa1d1937eU, 0x38d8c2c4U, 0x4fdff252U, 0xd1bb67f1U, + 0xa6bc5767U, 0x3fb506ddU, 0x48b2364bU, 0xd80d2bdaU, 0xaf0a1b4cU, + 0x36034af6U, 0x41047a60U, 0xdf60efc3U, 0xa867df55U, 0x316e8eefU, + 0x4669be79U, 0xcb61b38cU, 0xbc66831aU, 0x256fd2a0U, 0x5268e236U, + 0xcc0c7795U, 0xbb0b4703U, 0x220216b9U, 0x5505262fU, 0xc5ba3bbeU, + 0xb2bd0b28U, 0x2bb45a92U, 0x5cb36a04U, 0xc2d7ffa7U, 0xb5d0cf31U, + 0x2cd99e8bU, 0x5bdeae1dU, 0x9b64c2b0U, 0xec63f226U, 0x756aa39cU, + 0x026d930aU, 0x9c0906a9U, 0xeb0e363fU, 0x72076785U, 0x05005713U, + 0x95bf4a82U, 0xe2b87a14U, 0x7bb12baeU, 0x0cb61b38U, 0x92d28e9bU, + 0xe5d5be0dU, 0x7cdcefb7U, 0x0bdbdf21U, 0x86d3d2d4U, 0xf1d4e242U, + 0x68ddb3f8U, 0x1fda836eU, 0x81be16cdU, 0xf6b9265bU, 0x6fb077e1U, + 0x18b74777U, 0x88085ae6U, 0xff0f6a70U, 0x66063bcaU, 0x11010b5cU, + 0x8f659effU, 0xf862ae69U, 0x616bffd3U, 0x166ccf45U, 0xa00ae278U, + 0xd70dd2eeU, 0x4e048354U, 0x3903b3c2U, 0xa7672661U, 0xd06016f7U, + 0x4969474dU, 0x3e6e77dbU, 0xaed16a4aU, 0xd9d65adcU, 0x40df0b66U, + 0x37d83bf0U, 0xa9bcae53U, 0xdebb9ec5U, 0x47b2cf7fU, 0x30b5ffe9U, + 0xbdbdf21cU, 0xcabac28aU, 0x53b39330U, 0x24b4a3a6U, 0xbad03605U, + 0xcdd70693U, 0x54de5729U, 0x23d967bfU, 0xb3667a2eU, 0xc4614ab8U, + 0x5d681b02U, 0x2a6f2b94U, 0xb40bbe37U, 0xc30c8ea1U, 0x5a05df1bU, + 0x2d02ef8dU diff --git a/genevent/genevent b/genevent/genevent new file mode 100755 index 0000000000000000000000000000000000000000..a187096dcb8f2d9632143651270be6448354497b GIT binary patch literal 61858 zcmeFa349bq`aj$~JxMx~NoK;WA`JHx5^fPhIUEk#m5wYdu)6oorCEZdOrQ@_xTn)jcx-_V~T;@Bew<_hX=Ys-Al8 zdaAmry1ILnfAV-;*EQ?Up&1%;zH6Q45d7x6CrgHCJ}p)2t##Ep<5$yIHl!LjICde; zBL#;Ohk>Js2g-P~Mw$o9$lI2NG7U%X`I^Rq^qNeirhi646KE26Q<5aO3I-u z>XnV-G#u7n1`@eH{;oAn^KbZNdNGdu$oEkBUidwPe6`A-f!{{tyQw_f zu4&ge%@t6F^gbM38}DvrW%B%}Yhztv!U_(J22}o?QAK62Tq}rFln7?wNT8%VKN=1OwETQ3njel7 zR7LX33QEe!t`x{cRly)ii_0p?RcXF9Ve+K02a{xj6COiL&! zB#vx*`HRN-CV$b`_VX8& zSI1v8w)gpq#`Y0^(U1@E7mfT2{-S}$_=^U1n7@$R$X_)2CjO#f9^o$(Im%x)ddN>h z#X9+m25Ryb4b#nEG*&Nv(OI{Y-^7Kq-H1i8Yo*oKKWPZBH(^H}8%#Rj%dMq@L`2iwN z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referenced from anywhere */ + +facility * fac; + +int main(int argc, char** argv) +{ + char *token; + parse_file in; + char buffer[BUFFER_SIZE]; + int i; + + if(argc < 2){ + printf("At least one event definition file is needed\n"); + exit(1); + } + + in.buffer = buffer; + in.error = error_callback; + + for(i = 1 ; i < argc ; i++) { + in.lineno = 0; + in.name = allocAndCopy(argv[i]); + + in.fp = fopen(in.name, "r"); + if(!in.fp ){ + in.error(&in,"cannot open facility input file"); + } + + while(1){ + token = getToken(&in); + if(in.type == ENDFILE) break; + + if(strcmp(token, "<")) in.error(&in,"not a facility file"); + token = getName(&in); + + if(strcmp("facility",token) == 0) { + fac = memAlloc(sizeof(facility)); + fac->name = NULL; + fac->description = NULL; + sequence_init(&(fac->events)); + table_init(&(fac->named_types)); + sequence_init(&(fac->unnamed_types)); + + parseFacility(&in, fac); + + //check if any namedType is not defined + checkNamedTypesImplemented(&fac->named_types); + }else in.error(&in,"facility token was expected"); + + generateFile(argv[i]); + + free(fac->name); + free(fac->description); + freeEvents(&fac->events); + sequence_dispose(&fac->events); + freeNamedType(&fac->named_types); + table_dispose(&fac->named_types); + freeTypes(&fac->unnamed_types); + sequence_dispose(&fac->unnamed_types); + free(fac); + } + + free(in.name); + fclose(in.fp); + + } + return 0; +} + + +/***************************************************************************** + *Function name + * generateFile : generate .c and .h file + *Input Params + * name : name of event definition file + ****************************************************************************/ +void generateFile(char *name){ + char *cName, *hName, *tmp; + FILE * cFp, *hFp; + int nbEvent; + unsigned long checksum=0; + + //remove .xml if it exists + tmp = &name[strlen(name)-4]; + if(strcmp(tmp, ".xml") == 0){ + *tmp = '\0'; + } + + tmp = strrchr(name,'/'); + if(tmp){ + tmp++; + }else{ + tmp = name; + } + + cName = appendString(tmp,".c"); + hName = appendString(tmp,".h"); + cFp = fopen(cName,"w"); + if(!cFp){ + printf("Cannot open the file : %s\n",cName); + exit(1); + } + + hFp = fopen(hName,"w"); + if(!hFp){ + printf("Cannot open the file : %s\n",hName); + exit(1); + } + + free(cName); + free(hName); + + generateChecksum(fac->name, &checksum, &(fac->events)); + + /* generate .h file, event enumeration then structures and functions */ + generateEnumEvent(hFp, fac->name, &nbEvent); + generateStructFunc(hFp, fac->name); + + /* generate .c file, calls to register the facility at init time */ + generateCfile(cFp,fac->name,nbEvent,checksum); + + fclose(hFp); + fclose(cFp); +} + + +/***************************************************************************** + *Function name + * generateEnumEvent : output event enum to .h file + *Input Params + * fp : file to be written to + * facName : name of facility + *Output Params + * nbEvent : number of events in the facility + ****************************************************************************/ +void generateEnumEvent(FILE *fp, char *facName, int * nbEvent) { + int pos = 0; + + //will be removed later + fprintf(fp,"typedef unsigned int trace_facility_t;\n\n"); + fprintf(fp,"extern int trace_new(trace_facility_t fID, u8 eID, int length, char * buf);\n\n"); + + + fprintf(fp,"/**** facility handle ****/\n\n"); + fprintf(fp,"extern trace_facility_t facility_%s;\n\n\n",facName); + + fprintf(fp,"/**** event type ****/\n\n"); + fprintf(fp,"enum %s_event {\n",facName); + + for(pos = 0; pos < fac->events.position;pos++) { + fprintf(fp," %s", ((event *)(fac->events.array[pos]))->name); + if(pos != fac->events.position-1) fprintf(fp,",\n"); + } + fprintf(fp,"\n};\n\n\n"); + + // fprintf(fp,"/**** number of events in the facility ****/\n\n"); + // fprintf(fp,"int nbEvents_%s = %d;\n\n\n",facName, fac->events.position); + *nbEvent = fac->events.position; +} + + +/***************************************************************************** + *Function name + * generateEnumDefinition: generate enum definition if it exists + *Input Params + * fp : file to be written to + * fHead : enum type + ****************************************************************************/ +void generateEnumDefinition(FILE * fp, type_descriptor * type){ + int pos; + + fprintf(fp,"enum {\n"); + for(pos = 0; pos < type->labels.position; pos++){ + fprintf(fp," %s", type->labels.array[pos]); + if (pos != type->labels.position - 1) fprintf(fp,",\n"); + } + fprintf(fp,"\n};\n\n\n"); +} + +/***************************************************************************** + *Function name + * generateStrucTFunc: output structure and function to .h file + *Input Params + * fp : file to be written to + * facName : name of facility + ****************************************************************************/ +void generateStructFunc(FILE * fp, char * facName){ + event * ev; + field * fld; + type_descriptor * td; + int pos, pos1; + int hasStrSeq, flag, structCount, seqCount,strCount, whichTypeFirst=0; + + for(pos = 0; pos < fac->events.position; pos++){ + ev = (event *) fac->events.array[pos]; + //yxx if(ev->nested)continue; + fprintf(fp,"/**** structure and trace function for event: %s ****/\n\n",ev->name); + if(ev->type == 0){ // event without type + fprintf(fp,"static inline void trace_%s_%s(void){\n",facName,ev->name); + fprintf(fp," trace_new(facility_%s, %s, 0, NULL);\n",facName,ev->name); + fprintf(fp,"};\n\n\n"); + continue; + } + + //if fields contain enum, print out enum definition + for(pos1 = 0; pos1 < ev->type->fields.position; pos1++){ + fld = (field *)ev->type->fields.array[pos1]; + if(fld->type->type == ENUM) generateEnumDefinition(fp, fld->type); + } + + //default: no string, array or sequence in the event + hasStrSeq = 0; + whichTypeFirst = 0; + + //structure for kernel + flag = 0; + structCount = 0; + for(pos1 = 0; pos1 < ev->type->fields.position; pos1++){ + fld = (field *)ev->type->fields.array[pos1]; + td = fld->type; + if( td->type != STRING && td->type != SEQUENCE && td->type != ARRAY){ + if(whichTypeFirst == 0) whichTypeFirst = 1; //struct first + if(flag == 0){ + flag = 1; + fprintf(fp,"struct %s_%s_%d{\n",ev->name,facName,++structCount); + } + fprintf(fp, " %s %s; /* %s */\n",getTypeStr(td),fld->name,fld->description ); + }else{ + if(whichTypeFirst == 0) whichTypeFirst = 2; //string or sequence or array first + hasStrSeq++; + if(flag) + fprintf(fp,"} __attribute__ ((packed));\n\n"); + flag = 0; + } + } + if(flag) + fprintf(fp,"} __attribute__ ((packed));\n\n"); + + //trace function : function name and parameters + seqCount = 0; + strCount = 0; + fprintf(fp,"static inline void trace_%s_%s(",facName,ev->name); + for(pos1 = 0; pos1 < ev->type->fields.position; pos1++){ + fld = (field *)ev->type->fields.array[pos1]; + td = fld->type; + if(td->type == ARRAY ){ + fprintf(fp,"%s * %s",getTypeStr(td), fld->name); + }else if(td->type == STRING){ + fprintf(fp,"short int strLength_%d, %s * %s",++strCount, getTypeStr(td), fld->name); + }else if(td->type == SEQUENCE){ + fprintf(fp,"%s seqLength_%d, %s * %s",uintOutputTypes[td->size], ++seqCount,getTypeStr(td), fld->name); + }else fprintf(fp,"%s %s",getTypeStr(td), fld->name); + if(pos1 != ev->type->fields.position -1)fprintf(fp,", "); + } + fprintf(fp,"){\n"); + + //length of buffer : length of all structures + fprintf(fp," int bufLength = "); + for(pos1=0;pos1name, facName,pos1+1); + if(pos1 != structCount-1) fprintf(fp," + "); + } + + //length of buffer : length of all arrays, sequences and strings + seqCount = 0; + strCount = 0; + flag = 0; + for(pos1 = 0; pos1 < ev->type->fields.position; pos1++){ + fld = (field *)ev->type->fields.array[pos1]; + td = fld->type; + if(td->type == SEQUENCE || td->type==STRING ||td->type==ARRAY){ + if(structCount || flag > 0) fprintf(fp," + "); + if(td->type == SEQUENCE) fprintf(fp,"sizeof(%s) + sizeof(%s) * seqLength_%d",uintOutputTypes[td->size], getTypeStr(td), ++seqCount); + else if(td->type==STRING) fprintf(fp,"strLength_%d + 1", ++strCount); + else if(td->type==ARRAY) fprintf(fp,"sizeof(%s) * %d", getTypeStr(td),td->size); + if(structCount == 0) flag = 1; + } + } + fprintf(fp,";\n"); + + //allocate buffer + fprintf(fp," char buff[bufLength];\n"); + + //declare a char pointer if needed + if(structCount + hasStrSeq > 1) fprintf(fp," char * ptr = buff;\n"); + + //allocate memory for new struct and initialize it + if(whichTypeFirst == 1){ //struct first + for(pos1=0;pos1name, facName,ev->name, facName); + else fprintf(fp," struct %s_%s_%d __%d;\n",ev->name, facName,pos1+1,pos1+1); + } + }else if(whichTypeFirst == 2){ + for(pos1=0;pos1name, facName,pos1+1,pos1+1); + } + fprintf(fp,"\n"); + + if(structCount) fprintf(fp," //initialize structs\n"); + flag = 0; + structCount = 0; + for(pos1 = 0; pos1 < ev->type->fields.position; pos1++){ + fld = (field *)ev->type->fields.array[pos1]; + td = fld->type; + if(td->type != ARRAY && td->type != SEQUENCE && td->type != STRING){ + if(flag == 0){ + flag = 1; + structCount++; + if(structCount > 1) fprintf(fp,"\n"); + } + if(structCount == 1 && whichTypeFirst == 1) fprintf(fp, " __1->%s = %s;\n",fld->name,fld->name ); + else fprintf(fp, " __%d.%s = %s;\n",structCount ,fld->name,fld->name); + }else flag = 0; + } + if(structCount) fprintf(fp,"\n"); + + //set ptr to the end of first struct if needed; + if(whichTypeFirst == 1 && structCount + hasStrSeq > 1){ + fprintf(fp,"\n //set ptr to the end of the first struct\n"); + fprintf(fp," ptr += sizeof(struct %s_%s_1);\n\n",ev->name, facName); + } + + //copy struct, sequence and string to buffer + seqCount = 0; + strCount = 0; + flag = 0; + structCount = 0; + for(pos1 = 0; pos1 < ev->type->fields.position; pos1++){ + fld = (field *)ev->type->fields.array[pos1]; + td = fld->type; + if(td->type != STRING && td->type != SEQUENCE && td->type != ARRAY){ + if(flag == 0) structCount++; + flag++; + if((structCount > 1 || whichTypeFirst == 2) && flag == 1){ + fprintf(fp," //copy struct to buffer\n"); + fprintf(fp," memcpy(ptr, &__%d, sizeof(struct %s_%s_%d));\n",structCount, ev->name, facName,structCount); + fprintf(fp," ptr += sizeof(struct %s_%s_%d);\n\n",ev->name, facName,structCount); + } + }else if(td->type == SEQUENCE){ + flag = 0; + fprintf(fp," //copy sequence length and sequence to buffer\n"); + fprintf(fp," *ptr = seqLength_%d;\n",++seqCount); + fprintf(fp," ptr += sizeof(%s);\n",uintOutputTypes[td->size]); + fprintf(fp," memcpy(ptr, %s, sizeof(%s) * seqLength_%d);\n",fld->name, getTypeStr(td), seqCount); + fprintf(fp," ptr += sizeof(%s) * seqLength_%d;\n\n",getTypeStr(td), seqCount ); + }else if(td->type==STRING){ + flag = 0; + fprintf(fp," //copy string to buffer\n"); + fprintf(fp," if(strLength_%d > 0){\n",++strCount); + fprintf(fp," memcpy(ptr, %s, strLength_%d + 1);\n", fld->name, strCount); + fprintf(fp," ptr += strLength_%d + 1;\n",strCount); + fprintf(fp," }else{\n"); + fprintf(fp," *ptr = '\\0';\n"); + fprintf(fp," ptr += 1;\n"); + fprintf(fp," }\n\n"); + }else if(td->type==ARRAY){ + flag = 0; + fprintf(fp," //copy array to buffer\n"); + fprintf(fp," memcpy(ptr, %s, sizeof(%s) * %d);\n", fld->name, getTypeStr(td), td->size); + fprintf(fp," ptr += sizeof(%s) * %d;\n\n",getTypeStr(td), td->size); + } + } + if(structCount + seqCount > 1) fprintf(fp,"\n"); + + //call trace function + fprintf(fp,"\n //call trace function\n"); + fprintf(fp," trace_new(facility_%s, %s, bufLength, buff);\n",facName,ev->name); + fprintf(fp,"};\n\n\n"); + } + +} + +/***************************************************************************** + *Function name + * getTypeStr : generate type string + *Input Params + * td : a type descriptor + *Return Values + * char * : type string + ****************************************************************************/ +char * getTypeStr(type_descriptor * td){ + type_descriptor * t ; + + switch(td->type){ + case INT: + return intOutputTypes[td->size]; + case UINT: + return uintOutputTypes[td->size]; + case FLOAT: + return floatOutputTypes[td->size]; + case STRING: + return "char"; + case ENUM: + return uintOutputTypes[td->size]; + case ARRAY: + case SEQUENCE: + t = td->nested_type; + switch(t->type){ + case INT: + return intOutputTypes[t->size]; + case UINT: + return uintOutputTypes[t->size]; + case FLOAT: + return floatOutputTypes[t->size]; + case STRING: + return "char"; + case ENUM: + return uintOutputTypes[t->size]; + default : + error_callback(NULL,"Nested struct is not supportted"); + break; + } + break; + case STRUCT: //for now we do not support nested struct + error_callback(NULL,"Nested struct is not supportted"); + break; + default: + error_callback(NULL,"No type information"); + break; + } + return NULL; +} + +/***************************************************************************** + *Function name + * generateCfile : generate a .c file + *Input Params + * fp : file to be written to + * facName : name of facility + * nbEvent : number of events in the facility + * checksum : checksum for the facility + ****************************************************************************/ +void generateCfile(FILE * fp, char * facName, int nbEvent, unsigned long checksum){ + //will be removed later + fprintf(fp,"typedef unsigned int trace_facility_t;\n\n"); + + fprintf(fp,"static unsigned long checksum = %lu;\n\n",checksum); + fprintf(fp,"/* facility handle */\n"); + fprintf(fp,"trace_facility_t facility_%s;\n\n",facName); + + fprintf(fp,"static void __init facility_%s_init(){\n",facName); + fprintf(fp," facility_%s = trace_register_facility_by_checksum(\"%s\", checksum,%d);\n",facName,facName,nbEvent); + fprintf(fp,"}\n\n"); + + fprintf(fp,"static void __exit facility_%s_exit(){\n",facName); + fprintf(fp,"}\n\n"); + + fprintf(fp,"module_init(facility_%s_init);\n",facName); + fprintf(fp,"module_exit(facility_%s_exit);\n",facName); +} + + diff --git a/genevent/genevent.h b/genevent/genevent.h new file mode 100644 index 00000000..2e2050ca --- /dev/null +++ b/genevent/genevent.h @@ -0,0 +1,9 @@ + +void generateFile(char * file); +void generateEnumEvent(FILE * fp,char * facName, int * nbEvent); +void generateStructFunc(FILE * fp, char * facName); +void generateCfile(FILE * fp, char * facName, int nbEvent, unsigned long checksum); +void generateEnumDefinition(FILE * fp, type_descriptor * fHead); +char * getTypeStr(type_descriptor * td); + + diff --git a/genevent/parser.c b/genevent/parser.c new file mode 100644 index 00000000..b6561ca5 --- /dev/null +++ b/genevent/parser.c @@ -0,0 +1,1175 @@ +/* + +parser.c: Generate helper declarations and functions to trace events + from an event description file. + +Copyright (C) 2002, Xianxiu Yang +Copyright (C) 2002, Michel Dagenais +This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by +the Free Software Foundation; version 2 of the License. + +This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* This program reads the ".xml" event definitions input files + and constructs structure for each event. + + The program uses a very simple tokenizer, called from a hand written + recursive descent parser to fill a data structure describing the events. + The result is a sequence of events definitions which refer to type + definitions. + + A table of named types is maintained to allow refering to types by name + when the same type is used at several places. Finally a sequence of + all types is maintained to facilitate the freeing of all type + information when the processing of an ".xml" file is finished. */ + +#include +#include +#include +#include +#include + + +#include "parser.h" + + +/***************************************************************************** + *Function name + * getSize : translate from string to integer + *Input params + * in : input file handle + *Return values + * size + *****************************************************************************/ + +int getSize(parse_file *in) +{ + char *token; + + token = getToken(in); + if(in->type == NUMBER) { + if(strcmp(token,"1") == 0) return 0; + else if(strcmp(token,"2") == 0) return 1; + else if(strcmp(token,"4") == 0) return 2; + else if(strcmp(token,"8") == 0) return 3; + } + else if(in->type == NAME) { + if(strcmp(token,"short") == 0) return 4; + else if(strcmp(token,"medium") == 0) return 5; + else if(strcmp(token,"long") == 0) return 6; + } + in->error(in,"incorrect size specification"); + return -1; +} + +/***************************************************************************** + *Function name + * error_callback : print out error info + *Input params + * in : input file handle + * msg : message to be printed + ****************************************************************************/ + +void error_callback(parse_file *in, char *msg) +{ + if(in) + printf("Error in file %s, line %d: %s\n", in->name, in->lineno, msg); + else + printf("%s\n",msg); + exit(1); +} + +/***************************************************************************** + *Function name + * memAlloc : allocate memory + *Input params + * size : required memory size + *return value + * void * : pointer to allocate memory or NULL + ****************************************************************************/ + +void * memAlloc(int size) +{ + void * addr; + if(size == 0) return NULL; + addr = malloc(size); + if(!addr){ + printf("Failed to allocate memory"); + exit(1); + } + return addr; +} + +/***************************************************************************** + *Function name + * allocAndCopy : allocate memory and initialize it + *Input params + * str : string to be put in memory + *return value + * char * : pointer to allocate memory or NULL + ****************************************************************************/ + +char *allocAndCopy(char *str) +{ + char * addr; + if(str == NULL) return NULL; + addr = (char *)memAlloc(strlen(str)+1); + strcpy(addr,str); + return addr; +} + +/************************************************************************** + * Function : + * getNameAttribute,getFormatAttribute,getSizeAttribute,getValueAttribute + * getValueStrAttribute + * Description : + * Read the attribute from the input file. + * + * Parameters : + * in , input file handle. + * + * Return values : + * address of the attribute. + * + **************************************************************************/ + +char * getNameAttribute(parse_file *in) +{ + char * token, car; + token = getName(in); + if(strcmp("name",token))in->error(in,"name was expected"); + getEqual(in); + + car = seekNextChar(in); + if(car == EOF)in->error(in,"name was expected"); + else if(car == '\"')token = getQuotedString(in); + else token = getName(in); + return token; +} + +char * getFormatAttribute(parse_file *in) +{ + char * token; + + //format is an option + token = getToken(in); + if(strcmp("/",token) == 0 || strcmp(">",token) == 0){ + ungetToken(in); + return NULL; + } + + if(strcmp("format",token))in->error(in,"format was expected"); + getEqual(in); + token = getQuotedString(in); + return token; +} + +int getSizeAttribute(parse_file *in) +{ + char * token; + getName(in); + getEqual(in); + + return getSize(in); +} + +int getValueAttribute(parse_file *in) +{ + char * token; + getName(in); + getEqual(in); + + return getNumber(in); +} + +//for