<facility name=core>
- <description>The core facility contains the basic events</description>
+ <description>The core facility contains the basic tracing related events</description>
<event name=facility_load>
- <description>Facility used in the trace</description>
+ <description>Facility is loaded</description>
<struct>
<field name="name"><string/></field>
<field name="checksum"><uint size=4/></field>
- <field name="base_code"><uint size=4/></field>
+ <field name="id"><uint size=4/></field>
</struct>
</event>
- <event name=syscall_entry>
- <description>Entry in a given system call</description>
+ <event name=facility_unload>
+ <description>Facility is unloaded</description>
<struct>
- <field name="syscall_id"> <description>Syscall entry number in entry.S</description> <uint size=1/> </field>
- <field name="address"> <description>Address from which call was made</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=syscall_exit>
- <description>Exit from a given system call</description>
- </event>
-
- <event name=trap_entry>
- <description>Entry in a trap</description>
- <struct>
- <field name="trap_id"> <description>Trap number</description> <uint size=2/> </field>
- <field name="address"> <description>Address where trap occured</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=trap_exit>
- <description>Exit from a trap</description>
- </event>
-
- <event name=irq_entry>
- <description>Entry in an irq</description>
- <struct>
- <field name="irq_id"> <description>IRQ number</description> <uint size=1/> </field>
- <field name="kernel"> <description>Are we executing kernel code</description> <uint size=1/> </field>
- </struct>
- </event>
-
- <event name=irq_exit>
- <description>Exit from an IRQ</description>
- </event>
-
- <event name=schedchange>
- <description>Scheduling change</description>
- <struct>
- <field name="out"> <description>Outgoing process</description> <uint size=4/> </field>
- <field name="in"> <description>Incoming process</description> <uint size=4/> </field>
- <field name="out_state"> <description>Outgoing process' state</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=kernel_timer>
- <description>The kernel timer routine has been called</description>
- </event>
-
- <event name=soft_irq>
- <description>Hit key part of soft-irq management</description>
- <struct>
- <field name="event_sub_id"> <description>Soft-irq event Id</description>
- <enum size=1>
- <label name=TRACE_EV_SOFT_IRQ_BOTTOM_HALF value=1/>
- <label name=TRACE_EV_SOFT_IRQ_SOFT_IRQ/>
- <label name=TRACE_EV_SOFT_IRQ_TASKLET_ACTION/>
- <label name=TRACE_EV_SOFT_IRQ_TASKLET_HI_ACTION/>
- </enum>
- </field>
-
- <field name="event_data"> <description>Data associated with event</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=process>
- <description>Hit key part of process management</description>
- <struct>
- <field name="event_sub_id"> <description>Process event ID</description>
- <enum size=1>
- <label name=TRACE_EV_PROCESS_KTHREAD value=1/>
- <label name=TRACE_EV_PROCESS_FORK/>
- <label name=TRACE_EV_PROCESS_EXIT/>
- <label name=TRACE_EV_PROCESS_WAIT/>
- <label name=TRACE_EV_PROCESS_SIGNAL/>
- <label name=TRACE_EV_PROCESS_WAKEUP/>
- </enum>
- </field>
-
- <field name="event_data1"> <description>Data associated with event</description> <uint size=4/> </field>
- <field name="event_data2"> <description>Data associated with event</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=file_system>
- <description>Hit key part of file system</description>
- <struct>
- <field name="event_sub_id"> <description>File system event ID</description>
- <enum size=1>
- <label name=TRACE_EV_FILE_SYSTEM_BUF_WAIT_START value=1/>
- <label name=TRACE_EV_FILE_SYSTEM_BUF_WAIT_END/>
- <label name=TRACE_EV_FILE_SYSTEM_EXEC/>
- <label name=TRACE_EV_FILE_SYSTEM_OPEN/>
- <label name=TRACE_EV_FILE_SYSTEM_CLOSE/>
- <label name=TRACE_EV_FILE_SYSTEM_READ/>
- <label name=TRACE_EV_FILE_SYSTEM_WRITE/>
- <label name=TRACE_EV_FILE_SYSTEM_SEEK/>
- <label name=TRACE_EV_FILE_SYSTEM_IOCTL/>
- <label name=TRACE_EV_FILE_SYSTEM_SELECT/>
- <label name=TRACE_EV_FILE_SYSTEM_POLL/>
- </enum>
- </field>
-
- <field name="event_data1"> <description>Event data </description> <uint size=4/> </field>
- <field name="event_data2"> <description>Event data 2</description> <uint size=4/> </field>
- <field name="file_name"> <description>Name of file operated on </description> <string/> </field>
- </struct>
- </event>
-
- <event name=timer>
- <description>Hit key part of timer management</description>
- <struct>
- <field name="event_sub_id"> <description>Timer event ID</description>
- <enum size=1>
- <label name=TRACE_EV_TIMER_EXPIRED value=1/>
- <label name=TRACE_EV_TIMER_SETITIMER/>
- <label name=TRACE_EV_TIMER_SETTIMEOUT/>
- </enum>
- </field>
-
- <field name="event_sdata"> <description>Short data</description> <uint size=1/> </field>
- <field name="event_data1"> <description>Data associated with event</description> <uint size=4/> </field>
- <field name="event_data2"> <description>Data associated with event</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=memory>
- <description>Hit key part of memory management</description>
- <struct>
- <field name="event_sub_id"> <description>Memory event ID</description>
- <enum size=1>
- <label name=TRACE_EV_MEMORY_PAGE_ALLOC value=1/>
- <label name=TRACE_EV_MEMORY_PAGE_FREE/>
- <label name=TRACE_EV_MEMORY_SWAP_IN/>
- <label name=TRACE_EV_MEMORY_SWAP_OUT/>
- <label name=TRACE_EV_MEMORY_PAGE_WAIT_START/>
- <label name=TRACE_EV_MEMORY_PAGE_WAIT_END/>
- </enum>
- </field>
-
- <field name="event_data"> <description>Data associated with event</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=socket>
- <description>Hit key part of socket communication</description>
- <struct>
- <field name="event_sub_id"> <description>Memory event ID</description>
- <enum size=1>
- <label name=TRACE_EV_SOCKET_CALL value=1/>
- <label name=TRACE_EV_SOCKET_CREATE/>
- <label name=TRACE_EV_SOCKET_SEND/>
- <label name=TRACE_EV_SOCKET_RECEIVE/>
- </enum>
- </field>
-
- <field name="event_data1"> <description>Data associated with event</description> <uint size=4/> </field>
- <field name="event_data2"> <description>Data associated with event</description> <uint size=4/> </field>
- </struct>
- </event>
-
- <event name=ipc>
- <description>Hit key part of System V IPC</description>
- <struct>
- <field name="event_sub_id"> <description>Memory event ID</description>
- <enum size=1>
- <label name=TRACE_EV_IPC_CALL value=1/>
- <label name=TRACE_EV_IPC_MSG_CREATE/>
- <label name=TRACE_EV_IPC_SEM_CREATE/>
- <label name=TRACE_EV_IPC_SHM_CREATE/>
- </enum>
- </field>
-
- <field name="event_data1"> <description>Data associated with event</description> <uint size=4/> </field>
- <field name="event_data2"> <description>Data associated with event</description> <uint size=4/> </field>
- </struct>
+ <field name="id"><uint size=4/></field>
+ </struct>
</event>
- <event name=network>
- <description>Hit key part of network communication</description>
- <struct>
- <field name="event_sub_id"> <description>Memory event ID</description>
- <enum size=1>
- <label name=TRACE_EV_NETWORK_PACKET_IN value=1/>
- <label name=TRACE_EV_NETWORK_PACKET_OUT/>
- </enum>
- </field>
-
- <field name="event_data"> <description>Data associated with event</description> <uint size=4/> </field>
- </struct>
- </event>
-/*
<event name=block_start>
<description>Block start timestamp</description>
- <typeref name=block_timestamp/>
+ <struct>
+ <field name="timestamp"><typeref name=timestamp/></field>
+ <field name="block_id"><uint size=4/></field>
+ </struct>
</event>
<event name=block_end>
<description>Block end timestamp</description>
- <typeref name=block_timestamp/>
- </event>
-
- <event name=time_heartbeat>
- <description>System time values sent periodically to minimize cycle counter
- drift with respect to real time clock and to detect cycle counter roolovers
- </description>
- <typeref name=timestamp/>
+ <field name="timestamp"><typeref name=timestamp/></field>
+ <field name="block_id"><uint size=4/></field>
</event>
- <type name=block_timestamp>
- <struct>
- <field name=timestamp><typeref name=timestamp/></field>
- <field name=block_id><uint size=4/></field>
- </struct>
- </type>
-
<type name=timestamp>
<struct>
- <field name=time><typeref name=timespec/></field>
+ <field name="time"><typeref name=timespec/></field>
<field name="cycle_count"><uint size=8/></field>
</struct>
</type>
<field name="nanoseconds"><uint size=4/></field>
</struct>
</type>
-*/
</facility>
-
-
--- /dev/null
+<facility name=fs>
+ <description>The fs facility contains events related to file system operation</description>
+
+ <event name=buf_wait_start>
+ <description>Staring to wait for a buffer</description>
+ <struct>
+ <field name="address"> <description>Address of the buffer head.</description> <pointer/> </field>
+ </struct>
+ </event>
+
+ <event name=buf_wait_end>
+ <description>Ending to wait for a buffer</description>
+ <struct>
+ <field name="address"> <description>Address of the buffer head.</description> <pointer/> </field>
+ </struct>
+ </event>
+
+ <event name=exec>
+ <description>Executing a file</description>
+ <struct>
+ <field name="filename"> <description>File name</description> <string/> </field>
+ </struct>
+ </event>
+
+ <event name=open>
+ <description>Opening a file</description>
+ <struct>
+ <field name="filename"> <description>File name</description> <string/> </field>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=close>
+ <description>Closing a file descriptor</description>
+ <struct>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=read>
+ <description>Reading from a file descriptor</description>
+ <struct>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ <field name="count"> <description>Number of bytes to read</description> <size_t/> </field>
+ </struct>
+ </event>
+
+ <event name=write>
+ <description>Write to a file descriptor</description>
+ <struct>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ <field name="count"> <description>Number of bytes to write</description> <size_t/> </field>
+ </struct>
+ </event>
+
+ <event name=seek>
+ <description>Seek a file descriptor</description>
+ <struct>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ <field name="offset"> <description>Number of bytes to write</description> <off_t/> </field>
+ <field name="origin"> <description>Number of bytes to write</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=ioctl>
+ <description>Do a IOCTL on a file descriptor</description>
+ <struct>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ <field name="cmd"> <description>Command</description> <uint size=4/> </field>
+ <field name="arg"> <description>Argument</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=select>
+ <description>Do a select on a file descriptor</description>
+ <struct>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ <field name="timeout"> <description>Time out</description> <ulong/> </field>
+ </struct>
+ </event>
+
+ <event name=poll>
+ <description>Do a poll on a file descriptor</description>
+ <struct>
+ <field name="fd"> <description>File descriptor</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+</facility>
#include <stdlib.h>
#include <string.h>
+#include <ctype.h>
#include <stdio.h>
#include <stdarg.h>
#include <linux/errno.h>
#include "parser.h"
#include "genevent.h"
+
/* Named types may be referenced from anywhere */
facility * fac;
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");
+ 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]);
generateChecksum(fac->name, &checksum, &(fac->events));
/* generate .h file, event enumeration then structures and functions */
- generateEnumEvent(hFp, fac->name, &nbEvent);
- generateStructFunc(hFp, fac->name);
+ fprintf(hFp, "#ifndef _LTT_FACILITY_%s_H_\n",fac->capname);
+ fprintf(hFp, "#define _LTT_FACILITY_%s_H_\n\n",fac->capname);
+ generateEnumEvent(hFp, fac->name, &nbEvent, checksum);
+ generateTypeDefs(hFp);
+ generateStructFunc(hFp, fac->name,checksum);
+ fprintf(hFp, "#endif //_LTT_FACILITY_%s_H_\n",fac->capname);
/* generate .c file, calls to register the facility at init time */
generateCfile(cFp,fac->name,nbEvent,checksum);
*Output Params
* nbEvent : number of events in the facility
****************************************************************************/
-void generateEnumEvent(FILE *fp, char *facName, int * nbEvent) {
+void generateEnumEvent(FILE *fp, char *facName, int * nbEvent, unsigned long checksum) {
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,"#include <linux/ltt-log.h>\n\n");
fprintf(fp,"/**** facility handle ****/\n\n");
- fprintf(fp,"extern trace_facility_t facility_%s;\n\n\n",facName);
+ fprintf(fp,"extern trace_facility_t ltt_facility_%s_%X;\n\n\n",facName, checksum);
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);
+ fprintf(fp,"\t%s", ((event *)(fac->events.array[pos]))->name);
if(pos != fac->events.position-1) fprintf(fp,",\n");
}
fprintf(fp,"\n};\n\n\n");
}
+/*****************************************************************************
+ *Function name
+ * printStruct : Generic struct printing function
+ *Input Params
+ * fp : file to be written to
+ * len : number of fields
+ * array : array of field info
+ * name : basic struct name
+ * facName : name of facility
+ * whichTypeFirst : struct or array/sequence first
+ * hasStrSeq : string or sequence present?
+ * structCount : struct postfix
+ ****************************************************************************/
+static void
+printStruct(FILE * fp, int len, void ** array, char * name, char * facName,
+ int * whichTypeFirst, int * hasStrSeq, int * structCount)
+{
+ int flag = 0;
+ int pos;
+ field * fld;
+ type_descriptor * td;
+
+ for (pos = 0; pos < len; pos++) {
+ fld = (field *)array[pos];
+ 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",
+ name, facName);
+ if (structCount) {
+ fprintf(fp, "_%d {\n",
+ ++*structCount);
+ } else {
+ fprintf(fp, " {\n");
+ }
+ }
+ fprintf(fp, "\t%s %s; /* %s */\n",
+ getTypeStr(td),fld->name,fld->description );
+ } else {
+ if (*whichTypeFirst == 0) {
+ //string or sequence or array first
+ *whichTypeFirst = 2;
+ }
+ (*hasStrSeq)++;
+ if(flag) {
+ fprintf(fp,"} __attribute__ ((packed));\n\n");
+ }
+ flag = 0;
+ }
+ }
+
+ if(flag) {
+ fprintf(fp,"} __attribute__ ((packed));\n\n");
+ }
+}
+
+
+/*****************************************************************************
+ *Function name
+ * generateHfile : Create the typedefs
+ *Input Params
+ * fp : file to be written to
+ ****************************************************************************/
+void
+generateTypeDefs(FILE * fp)
+{
+ int pos, tmp = 1;
+
+ fprintf(fp, "/**** Basic Type Definitions ****/\n\n");
+
+ for (pos = 0; pos < fac->named_types.values.position; pos++) {
+ type_descriptor * type =
+ (type_descriptor*)fac->named_types.values.array[pos];
+ printStruct(fp, type->fields.position, type->fields.array,
+ "", type->type_name, &tmp, &tmp, NULL);
+ fprintf(fp, "typedef struct _%s %s;\n\n",
+ type->type_name, type->type_name);
+ }
+}
+
+
/*****************************************************************************
*Function name
* generateEnumDefinition: generate enum definition if it exists
fprintf(fp,"enum {\n");
for(pos = 0; pos < type->labels.position; pos++){
- fprintf(fp," %s", type->labels.array[pos]);
+ fprintf(fp,"\t%s", type->labels.array[pos]);
if (pos != type->labels.position - 1) fprintf(fp,",\n");
}
fprintf(fp,"\n};\n\n\n");
* fp : file to be written to
* facName : name of facility
****************************************************************************/
-void generateStructFunc(FILE * fp, char * facName){
+void generateStructFunc(FILE * fp, char * facName, unsigned long checksum){
event * ev;
field * fld;
type_descriptor * td;
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,"\tltt_log_event(ltt_facility_%s_%X, %s, 0, NULL);\n",facName,checksum,ev->name);
fprintf(fp,"};\n\n\n");
continue;
}
//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");
+
+ //structure for kernel
+ printStruct(fp, ev->type->fields.position, ev->type->fields.array,
+ ev->name, facName, &whichTypeFirst, &hasStrSeq, &structCount);
//trace function : function name and parameters
seqCount = 0;
fprintf(fp,"){\n");
//length of buffer : length of all structures
- fprintf(fp," int bufLength = ");
+ fprintf(fp,"\tint bufLength = ");
for(pos1=0;pos1<structCount;pos1++){
fprintf(fp,"sizeof(struct %s_%s_%d)",ev->name, facName,pos1+1);
if(pos1 != structCount-1) fprintf(fp," + ");
fprintf(fp,";\n");
//allocate buffer
- fprintf(fp," char buff[bufLength];\n");
+ fprintf(fp,"\tchar buff[bufLength];\n");
//declare a char pointer if needed
- if(structCount + hasStrSeq > 1) fprintf(fp," char * ptr = buff;\n");
+ if(structCount + hasStrSeq > 1) fprintf(fp,"\tchar * ptr = buff;\n");
//allocate memory for new struct and initialize it
if(whichTypeFirst == 1){ //struct first
for(pos1=0;pos1<structCount;pos1++){
- if(pos1==0) fprintf(fp," struct %s_%s_1 * __1 = (struct %s_%s_1 *)buff;\n",ev->name, facName,ev->name, facName);
- else fprintf(fp," struct %s_%s_%d __%d;\n",ev->name, facName,pos1+1,pos1+1);
+ if(pos1==0) fprintf(fp,"\tstruct %s_%s_1 * __1 = (struct %s_%s_1 *)buff;\n",ev->name, facName,ev->name, facName);
+ else fprintf(fp,"\tstruct %s_%s_%d __%d;\n",ev->name, facName,pos1+1,pos1+1);
}
}else if(whichTypeFirst == 2){
for(pos1=0;pos1<structCount;pos1++)
- fprintf(fp," struct %s_%s_%d __%d;\n",ev->name, facName,pos1+1,pos1+1);
+ fprintf(fp,"\tstruct %s_%s_%d __%d;\n",ev->name, facName,pos1+1,pos1+1);
}
fprintf(fp,"\n");
- if(structCount) fprintf(fp," //initialize structs\n");
+ if(structCount) fprintf(fp,"\t//initialize structs\n");
flag = 0;
structCount = 0;
for(pos1 = 0; pos1 < ev->type->fields.position; pos1++){
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);
+ if(structCount == 1 && whichTypeFirst == 1) fprintf(fp, "\t__1->%s = %s;\n",fld->name,fld->name );
+ else fprintf(fp, "\t__%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);
+ fprintf(fp,"\n\t//set ptr to the end of the first struct\n");
+ fprintf(fp,"\tptr += sizeof(struct %s_%s_1);\n\n",ev->name, facName);
}
//copy struct, sequence and string to buffer
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);
+ fprintf(fp,"\t//copy struct to buffer\n");
+ fprintf(fp,"\tmemcpy(ptr, &__%d, sizeof(struct %s_%s_%d));\n",structCount, ev->name, facName,structCount);
+ fprintf(fp,"\tptr += 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 );
+ fprintf(fp,"\t//copy sequence length and sequence to buffer\n");
+ fprintf(fp,"\t*ptr = seqLength_%d;\n",++seqCount);
+ fprintf(fp,"\tptr += sizeof(%s);\n",uintOutputTypes[td->size]);
+ fprintf(fp,"\tmemcpy(ptr, %s, sizeof(%s) * seqLength_%d);\n",fld->name, getTypeStr(td), seqCount);
+ fprintf(fp,"\tptr += 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");
+ fprintf(fp,"\t//copy string to buffer\n");
+ fprintf(fp,"\tif(strLength_%d > 0){\n",++strCount);
+ fprintf(fp,"\t\tmemcpy(ptr, %s, strLength_%d + 1);\n", fld->name, strCount);
+ fprintf(fp,"\t\tptr += strLength_%d + 1;\n",strCount);
+ fprintf(fp,"\t}else{\n");
+ fprintf(fp,"\t\t*ptr = '\\0';\n");
+ fprintf(fp,"\t\tptr += 1;\n");
+ fprintf(fp,"\t}\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);
+ fprintf(fp,"\t//copy array to buffer\n");
+ fprintf(fp,"\tmemcpy(ptr, %s, sizeof(%s) * %d);\n", fld->name, getTypeStr(td), td->size);
+ fprintf(fp,"\tptr += 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\t//call trace function\n");
+ fprintf(fp,"\tltt_log_event(ltt_facility_%s_%X, %s, bufLength, buff);\n",facName,checksum,ev->name);
fprintf(fp,"};\n\n\n");
}
return intOutputTypes[td->size];
case UINT:
return uintOutputTypes[td->size];
+ case POINTER:
+ return "void *";
+ case LONG:
+ return "long";
+ case ULONG:
+ return "unsigned long";
+ case SIZE_T:
+ return "size_t";
+ case SSIZE_T:
+ return "ssize_t";
+ case OFF_T:
+ return "off_t";
case FLOAT:
return floatOutputTypes[td->size];
case STRING:
t = td->nested_type;
switch(t->type){
case INT:
- return intOutputTypes[t->size];
+ return intOutputTypes[t->size];
case UINT:
- return uintOutputTypes[t->size];
+ return uintOutputTypes[t->size];
+ case POINTER:
+ return "void *";
+ case LONG:
+ return "long";
+ case ULONG:
+ return "unsigned long";
+ case SIZE_T:
+ return "size_t";
+ case SSIZE_T:
+ return "ssize_t";
+ case OFF_T:
+ return "off_t";
case FLOAT:
- return floatOutputTypes[t->size];
+ return floatOutputTypes[t->size];
case STRING:
- return "char";
+ return "char";
case ENUM:
- return uintOutputTypes[t->size];
+ return uintOutputTypes[t->size];
default :
- error_callback(NULL,"Nested struct is not supportted");
- break;
+ error_callback(NULL,"Nested struct is not supportted");
+ break;
}
break;
case STRUCT: //for now we do not support nested struct
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,"\tfacility_%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);
void generateFile(char * file);
-void generateEnumEvent(FILE * fp,char * facName, int * nbEvent);
-void generateStructFunc(FILE * fp, char * facName);
+void generateHfile(FILE *);
+void generateTypeDefs(FILE *);
+void generateEnumEvent(FILE * fp,char * facName, int * nbEvent, unsigned long checksum);
+void generateStructFunc(FILE * fp, char * facName, unsigned long checksum);
void generateCfile(FILE * fp, char * facName, int nbEvent, unsigned long checksum);
void generateEnumDefinition(FILE * fp, type_descriptor * fHead);
char * getTypeStr(type_descriptor * td);
--- /dev/null
+<facility name=heartbeat>
+ <description>The heartbeat facility has event related to heartbeat timer</description>
+
+ <event name=time_heartbeat>
+ <description>System time values sent periodically to detect cycle counter
+ rollovers. Useful when only the 32 LSB of the TSC are saved in events
+ header : we save the full 64 bits in this event.
+ </description>
+ <typeref name=timestamp/>
+ </event>
+
+ <type name=timestamp>
+ <struct>
+ <field name=time><typeref name=timespec/></field>
+ <field name="cycle_count"><uint size=8/></field>
+ </struct>
+ </type>
+
+ <type name=timespec>
+ <struct>
+ <field name="seconds"><uint size=4/></field>
+ <field name="nanoseconds"><uint size=4/></field>
+ </struct>
+ </type>
+
+</facility>
--- /dev/null
+<facility name=ipc>
+ <description>The ipc facility contains events related to Inter Process Communication</description>
+
+ <event name=call>
+ <descriptiona>IPC call</description>
+ <struct>
+ <field name="call_number"> <description>Number of IPC call</description> <uint size=4/> </field>
+ <field name="first"> <description>First argument</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=msg_create>
+ <description>Get an IPC message queue identifier</description>
+ <struct>
+ <field name="id"> <description>Message queue identifier</description><long/> </field>
+ <field name="flags"> <description>Message flags</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=sem_create>
+ <description>Get an IPC semaphore identifier</description>
+ <struct>
+ <field name="id"> <description>Semaphore identifier</description> <long/> </field>
+ <field name="flags"> <description>Semaphore flags</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=shm_create>
+ <description>Get an IPC shared memory identifier</description>
+ <struct>
+ <field name="id"> <description>Shared memory identifier</description> <long/> </field>
+ <field name="flags"> <description>Shared memory flags</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+</facility>
--- /dev/null
+<facility name=kernel>
+ <description>The kernel facility has events related to kernel execution status.</description>
+
+ <event name=syscall_entry>
+ <description>System call entry</description>
+ <struct>
+ <field name="syscall_id"> <description>Syscall entry number in entry.S</description> <uint size=1/> </field>
+ <field name="address"> <description>Address from which call was made</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=syscall_exit>
+ <description>System call exit</description>
+ </event>
+
+ <event name=trap_entry>
+ <description>Entry in a trap</description>
+ <struct>
+ <field name="trap_id"> <description>Trap number</description> <uint size=2/> </field>
+ <field name="address"> <description>Address where trap occured</description> <pointer/> </field>
+ </struct>
+ </event>
+
+ <event name=trap_exit>
+ <description>Exit from a trap</description>
+ </event>
+
+ <event name=soft_irq_entry>
+ <description>Soft IRQ entry</description>
+ <struct>
+ <field name="softirq_id"> <description>Soft IRQ number</description> <pointer/> </field>
+ </struct>
+ </event>
+
+ <event name=soft_irq_exit>
+ <description>Soft IRQ exit</description>
+ <struct>
+ <field name="softirq_id"> <description>Soft IRQ number</description> <pointer/> </field>
+ </struct>
+ </event>
+
+ <event name=tasklet_entry>
+ <description>Tasklet entry</description>
+ <struct>
+ <field name="priority"> <description>Tasklet priority</description> <typeref name=tasklet_priority/> </field>
+ <field name="address"> <description>Tasklet function address</description> <pointer/> </field>
+ </struct>
+ </event>
+
+ <event name=tasklet_exit>
+ <description>Tasklet exit</description>
+ <struct>
+ <field name="priority"> <description>Tasklet priority</description> <typeref name=tasklet_priority/> </field>
+ <field name="address"> <description>Tasklet function address</description> <pointer/> </field>
+ </struct>
+ </event>
+
+ <event name=irq_entry>
+ <description>Entry in an irq</description>
+ <struct>
+ <field name="irq_id"> <description>IRQ number</description> <uint size=4/> </field>
+ <field name="mode"> <description>Are we executing kernel code</description> <typeref name=irq_mode/> </field>
+ </struct>
+ </event>
+
+ <event name=irq_exit>
+ <description>Exit from an IRQ</description>
+ </event>
+
+
+
+ <type name=tasklet_priority>
+ <enum size=1>
+ <label name=LOW value=0/> <description>Low priority tasklet</description>
+ <label name=HIGH value=1/> <description>High priority tasklet</description>
+ </enum>
+ </type>
+
+ <type name=irq_mode>
+ <enum size=1>
+ <label name=user value=0/> <description>User context</description>
+ <label name=kernel value=1/> <description>Kernel context</description>
+ </enum>
+ </type>
+
+</facility>
--- /dev/null
+<facility name=memory>
+ <description>The memory facility has memory management events.</description>
+
+ <event name=page_alloc>
+ <description>Page allocation</description>
+ <struct>
+ <field name="order"> <description>Order of the page to allocate</description> <uint size=4/> </field>
+ <field name="address"> <description>Assigned page address, or 0 if
+ failed.</description> <ulong/> </field>
+ </struct>
+ </event>
+
+ <event name=page_free>
+ <description>Page free</description>
+ <struct>
+ <field name="order"> <description>Order of the page to free</description> <uint size=4/> </field>
+ <field name="address"> <description>Address of the page to free.</description> <ulong/> </field>
+ </struct>
+ </event>
+
+ <event name=swap_in>
+ <description>Page swapped into memory</description>
+ <struct>
+ <field name="address"> <description>Address of the page to swap in.</description> <ulong/> </field>
+ </struct>
+ </event>
+
+ <event name=swap_out>
+ <description>Page swapped to disk</description>
+ <struct>
+ <field name="address"> <description>Address of the page to swap out.</description> <ulong/> </field>
+ </struct>
+ </event>
+
+ <event name=page_wait_start>
+ <description>Staring to wait for a page</description>
+ <struct>
+ <field name="address"> <description>Address of the page we wait for.</description> <ulong/> </field>
+ </struct>
+ </event>
+
+ <event name=page_wait_end>
+ <description>Ending wait for a page</description>
+ <struct>
+ <field name="address"> <description>Address of the page we wait for.</description> <ulong/> </field>
+ </struct>
+ </event>
+
+</facility>
--- /dev/null
+<facility name=network>
+ <description>The network facility contains events related to low level network operations</description>
+
+ <event name=packet_in>
+ <description>A packet is arriving</description>
+ <struct>
+ <field name="skbuff"> <description>Socket buffer pointer : identify the socket buffer</description> <pointer/> </field>
+ <field name="protocol"> <description>Protocol of the packet</description> <uint size=2/> </field>
+ </struct>
+ </event>
+
+ <event name=packet_out>
+ <description>We send a packet</description>
+ <struct>
+ <field name="skbuff"> <description>Socket buffer pointer : identify the socket buffer</description> <pointer/> </field>
+ <field name="protocol"> <description>Protocol of the packet</description> <uint size=2/> </field>
+ </struct>
+ </event>
+
+</facility>
#include "parser.h"
+/* helper function */
+void strupper(char *string)
+{
+ char *ptr = string;
+
+ while(*ptr != '\0') {
+ *ptr = toupper(*ptr);
+ ptr++;
+ }
+}
+
+
+int getSizeindex(int value)
+{
+ switch(value) {
+ case 1:
+ return 0;
+ case 2:
+ return 1;
+ case 4:
+ return 2;
+ case 8:
+ return 3;
+ default:
+ printf("Error : unknown value size %d\n", value);
+ exit(-1);
+ }
+}
+
/*****************************************************************************
*Function name
* getSize : translate from string to integer
event *ev;
fac->name = allocAndCopy(getNameAttribute(in));
+ fac->capname = allocAndCopy(fac->name);
+ strupper(fac->capname);
getRAnglebracket(in);
fac->description = getDescription(in);
getForwardslash(in);
getRAnglebracket(in);
}
+ else if(strcmp(token,"pointer") == 0) {
+ t->type = POINTER;
+ t->size = 0;
+ t->fmt = allocAndCopy(getFormatAttribute(in));
+ getForwardslash(in);
+ getRAnglebracket(in);
+ }
+ else if(strcmp(token,"long") == 0) {
+ t->type = LONG;
+ t->size = 0;
+ t->fmt = allocAndCopy(getFormatAttribute(in));
+ getForwardslash(in);
+ getRAnglebracket(in);
+ }
+ else if(strcmp(token,"ulong") == 0) {
+ t->type = ULONG;
+ t->size = 0;
+ t->fmt = allocAndCopy(getFormatAttribute(in));
+ getForwardslash(in);
+ getRAnglebracket(in);
+ }
+ else if(strcmp(token,"size_t") == 0) {
+ t->type = SIZE_T;
+ t->size = 0;
+ t->fmt = allocAndCopy(getFormatAttribute(in));
+ getForwardslash(in);
+ getRAnglebracket(in);
+ }
+ else if(strcmp(token,"ssize_t") == 0) {
+ t->type = SSIZE_T;
+ t->size = 0;
+ t->fmt = allocAndCopy(getFormatAttribute(in));
+ getForwardslash(in);
+ getRAnglebracket(in);
+ }
+ else if(strcmp(token,"off_t") == 0) {
+ t->type = OFF_T;
+ t->size = 0;
+ t->fmt = allocAndCopy(getFormatAttribute(in));
+ getForwardslash(in);
+ getRAnglebracket(in);
+ }
else if(strcmp(token,"float") == 0) {
t->type = FLOAT;
t->size = getSizeAttribute(in);
in->buffer[0] = car;
pos = 1;
while((car = getc(fp)) != EOF && pos < BUFFER_SIZE) {
- if(!isalnum(car)) {
+ if(!(isalnum(car) || car == '_')) {
ungetc(car,fp);
break;
}
if(car == EOF)ungetc(car, in->fp);
}
-int isalpha(char c)
-{
- int i,j;
- if(c == '_')return 1;
- i = c - 'a';
- j = c - 'A';
- if((i>=0 && i<26) || (j>=0 && j<26)) return 1;
- return 0;
-}
-
-int isalnum(char c)
-{
- return (isalpha(c) || isdigit(c));
-}
-
/*****************************************************************************
*Function name
* checkNamedTypesImplemented : check if all named types have definition
case UINT:
str = uintOutputTypes[type->size];
break;
+ case POINTER:
+ str = allocAndCopy("void *");
+ flag = 1;
+ break;
+ case LONG:
+ str = allocAndCopy("long");
+ flag = 1;
+ break;
+ case ULONG:
+ str = allocAndCopy("unsigned long");
+ flag = 1;
+ break;
+ case SIZE_T:
+ str = allocAndCopy("size_t");
+ flag = 1;
+ break;
+ case SSIZE_T:
+ str = allocAndCopy("ssize_t");
+ flag = 1;
+ break;
+ case OFF_T:
+ str = allocAndCopy("off_t");
+ flag = 1;
+ break;
case FLOAT:
str = floatOutputTypes[type->size];
break;
void skipComment(parse_file * in);
void skipEOL(parse_file * in);
-int isalpha(char car);
-int isalnum(char car);
/* Some constants */
typedef enum _data_type {
INT,
UINT,
+ POINTER,
+ LONG,
+ ULONG,
+ SIZE_T,
+ SSIZE_T,
+ OFF_T,
FLOAT,
STRING,
ENUM,
NONE
} data_type;
-
/* Event type descriptors */
typedef struct _type_descriptor {
typedef struct _facility {
char * name;
+ char * capname;
char * description;
sequence events;
sequence unnamed_types;
--- /dev/null
+<facility name=process>
+ <description>The process facility has events related to process handling in
+ the kernel.</description>
+
+ <event name=fork>
+ <description>Process fork</description>
+ <struct>
+ <field name="parent_pid"> <description>PID of the parent process</description> <uint size=4/> </field>
+ <field name="child_pid"> <description>PID of the child process</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=kernel_thread>
+ <description>Just created a new kernel thread</description>
+ <struct>
+ <field name="pid"> <description>PID of the kernel thread</description> <uint size=4/> </field>
+ <field name="function"> <description>Function called</description> <pointer/> </field>
+ </struct>
+ </event>
+
+
+ <event name=exit>
+ <description>Process exit</description>
+ <struct>
+ <field name="pid"> <description>PID of the process</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=wait>
+ <description>Process wait</description>
+ <struct>
+ <field name="parent_pid"> <description>PID of the waiting process</description> <uint size=4/> </field>
+ <field name="child_pid"> <description>PID of the process waited for</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=free>
+ <description>Process kernel data structure free (end of life of a zombie)</description>
+ <struct>
+ <field name="pid"> <description>PID of the freed process</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=kill>
+ <description>Process kill system call</description>
+ <struct>
+ <field name="pid"> <description>PID of the process</description> <uint size=4/> </field>
+ <field name="target_pid"> <description>PID of the process to kill</description> <uint size=4/> </field>
+ <field name="signal"> <description>Signal number</description> <typeref name=signal_name/> </field>
+ </struct>
+ </event>
+
+ <event name=signal>
+ <description>Process signal reception</description>
+ <struct>
+ <field name="pid"> <description>PID of the receiving process</description> <uint size=4/> </field>
+ <field name="signal"> <description>Signal number</description> <typeref name=signal_name/> </field>
+ </struct>
+ </event>
+
+ <event name=wakeup>
+ <description>Process wakeup</description>
+ <struct>
+ <field name="pid"> <description>PID of the receiving process</description> <uint size=4/> </field>
+ <field name="state"> <description>State of the awakened process. -1 unrunnable, 0 runnable, >0 stopped.</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=schedchange>
+ <description>Scheduling change</description>
+ <struct>
+ <field name="out"> <description>Outgoing process</description> <uint size=4/> </field>
+ <field name="in"> <description>Incoming process</description> <uint size=4/> </field>
+ <field name="out_state"> <description>Outgoing process' state. -1 unrunnable, 0 runnable, >0 stopped.</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+ <type name=signal_name>
+ <enum size=4>
+ <label name=SIGHUP value=1/> <description>Hangup (POSIX).</description>
+ <label name=SIGINT value=2/> <description>Interrupt (ANSI).</description>
+ <label name=SIGQUIT value=3/> <description>Quit (POSIX).</description>
+ <label name=SIGILL value=4/> <description>Illegal instruction (ANSI).</description>
+ <label name=SIGTRAP value=5/> <description>Trace trap (POSIX).</description>
+ <label name=SIGABRT value=6/> <description>Abort (ANSI).</description>
+ <label name=SIGBUS value=7/> <description>BUS error (4.2 BSD).</description>
+ <label name=SIGFPE value=8/> <description>Floating-point exception (ANSI).</description>
+ <label name=SIGKILL value=9/> <description>Kill, unblockable (POSIX).</description>
+ <label name=SIGUSR1 value=10/> <description>User-defined signal 1 (POSIX).</description>
+ <label name=SIGSEGV value=11/> <description>Segmentation violation (ANSI).</description>
+ <label name=SIGUSR2 value=12/> <description>User-defined signal 2 (POSIX).</description>
+ <label name=SIGPIPE value=13/> <description>Broken pipe (POSIX).</description>
+ <label name=SIGALRM value=14/> <description>Alarm clock (POSIX).</description>
+ <label name=SIGTERM value=15/> <description>Termination (ANSI).</description>
+ <label name=SIGSTKFLT value=16/> <description>Stack fault.</description>
+
+ <label name=SIGCHLD value=17/> <description>Child status has changed (POSIX).</description>
+ <label name=SIGCONT value=18/> <description>Continue (POSIX).</description>
+ <label name=SIGSTOP value=19/> <description>Stop, unblockable (POSIX).</description>
+ <label name=SIGTSTP value=20/> <description>Keyboard stop (POSIX).</description>
+ <label name=SIGTTIN value=21/> <description>Background read from tty (POSIX).</description>
+ <label name=SIGTTOU value=22/> <description>Background write to tty (POSIX).</description>
+ <label name=SIGURG value=23/> <description>Urgent condition on socket (4.2 BSD).</description>
+ <label name=SIGXCPU value=24/> <description>CPU limit exceeded (4.2 BSD).</description>
+ <label name=SIGXFSZ value=25/> <description>File size limit exceeded (4.2 BSD).</description>
+ <label name=SIGVTALRM value=26/> <description>Virtual alarm clock (4.2 BSD).</description>
+ <label name=SIGPROF value=27/> <description>Profiling alarm clock (4.2 BSD).</description>
+ <label name=SIGWINCH value=28/> <description>Window size change (4.3 BSD, Sun).</description>
+ <label name=SIGIO value=29/> <description>I/O now possible (4.2 BSD). (aka SIGPOLL)</description>
+ <label name=SIGPWR value=30/> <description>Power failure restart (System V).</description>
+ <label name=SIGSYS value=31/> <description>Bad system call.</description>
+ </enum>
+ </type>
+
+
+</facility>
--- /dev/null
+<facility name=s390_kernel>
+ <description>The kernel facility has events related to kernel execution status.</description>
+
+ <event name=trap_entry>
+ <description>Entry in a trap</description>
+ <struct>
+ <field name="trap_id"> <description>Trap number</description> <uint size=8/> </field>
+ <field name="address"> <description>Address where trap occured</description> <pointer/> </field>
+ </struct>
+ </event>
+
+</facility>
--- /dev/null
+<facility name=socket>
+ <description>The socket facility contains events related to sockets</description>
+
+ <event name=call>
+ <descriptiona>Generic socket call : FIXME : should be more detailed.</description>
+ <struct>
+ <field name="call_number"> <description>Number of socket call</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=create>
+ <description>Create a socket</description>
+ <struct>
+ <field name="family"> <description>Socket family</description> <int size=4/> </field>
+ <field name="type"> <description>Socket type</description> <int size=4/> </field>
+ <field name="protocol"> <description>Socket protocol</description> <int size=4/> </field>
+ <field name="fd"> <description>Socket file descriptor</description> <int size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=sendmsg>
+ <description>Sending a socket message</description>
+ <struct>
+ <field name="socket"> <description>Socket structure address</description> <pointer/> </field>
+ <field name="family"> <description>Socket family</description> <int size=4/> </field>
+ <field name="type"> <description>Socket type</description> <int size=4/> </field>
+ <field name="protocol"> <description>Socket protocol</description> <int size=4/> </field>
+ <field name="size"> <description>Size of the message</description> <size_t/> </field>
+ </struct>
+ </event>
+
+ <event name=recvmsg>
+ <description>Receiving a socket message</description>
+ <struct>
+ <field name="socket"> <description>Socket structure address</description> <pointer/> </field>
+ <field name="family"> <description>Socket family</description> <int size=4/> </field>
+ <field name="type"> <description>Socket type</description> <int size=4/> </field>
+ <field name="protocol"> <description>Socket protocol</description> <int size=4/> </field>
+ <field name="size"> <description>Size of the message</description> <size_t/> </field>
+ </struct>
+ </event>
+
+
+
+
+
+</facility>
--- /dev/null
+<facility name=timer>
+ <description>The timer facility has events related to timer events in the kernel.</description>
+
+ <event name=expired>
+ <description>A timer or itimer has expired.</description>
+ <struct>
+ <field name="pid"> <description>PID of the process to wake up.</description> <uint size=4/> </field>
+ </struct>
+ </event>
+
+ <event name=softirq>
+ <description>The timer softirq is currently runned.</description>
+ </event>
+
+ <event name=set_itimer>
+ <description>An interval timer is set.</description>
+ <struct>
+ <field name="which"> <description>kind of interval timer.</description>
+ <typeref name=itimer_kind>
+ </field>
+ <field name="interval"> <description>timer interval.</description>
+ <typeref name=timeval>
+ </field>
+ <field name="value"> <description>current value.</description>
+ <typeref name=timeval>
+ </field>
+ </struct>
+ </event>
+
+ <type name=itimer_kind>
+ <enum size=4>
+ <label name=ITIMER_REAL value=0/> <description>decrements in real time,
+ and delivers SIGALRM upon expiration.</description>
+ <label name=ITIMER_VIRTUAL value=1/> <description>decrements only when the
+ process is executing, and delivers SIGVTALRM upon expiration.</description>
+ <label name=ITIMER_PROF value=2/> <description>decrements both when the
+ process executes and when the system is executing on behalf of the
+ process. Coupled with ITIMER_VIRTUAL, this timer is usually used to
+ profile the time spent by the application in user and kernel space.
+ SIGPROF is delivered upon expiration.</description>
+ </enum>
+ </type>
+
+ <type name=timeval>
+ <struct>
+ <field name="seconds"><uint size=4/></field>
+ <field name="microseconds"><uint size=4/></field>
+ </struct>
+ </type>
+
+</facility>