X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Fltt%2Fparser.h;h=a4b3723b094c9c33909afcc9ac700a40137118ae;hb=90440c068855335aa8d9525284690638cde44db4;hp=9052229818062baa5cc34d0c127a8e854a4152ef;hpb=1b44b0b5729fbc82eab287323dc14d12c028dd44;p=lttv.git diff --git a/ltt/branches/poly/ltt/parser.h b/ltt/branches/poly/ltt/parser.h index 90522298..a4b3723b 100644 --- a/ltt/branches/poly/ltt/parser.h +++ b/ltt/branches/poly/ltt/parser.h @@ -1,26 +1,3 @@ -/* - * parser.h: Generate helper declarations and functions to trace events - * from an event description file. - * - * Copyright (C) 2005, Mathieu Desnoyers - * Copyright (C) 2002, Xianxiu Yang - * Copyright (C) 2002, Michel Dagenais - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License Version 2.1 as published by the Free Software Foundation. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - #ifndef PARSER_H #define PARSER_H @@ -87,7 +64,7 @@ char *getQuotedString(parse_file_t *in); char *getName(parse_file_t *in); int getNumber(parse_file_t *in); char *getEqual(parse_file_t *in); -char seekNextChar(parse_file_t *in); +int seekNextChar(parse_file_t *in); void skipComment(parse_file_t * in); void skipEOL(parse_file_t * in); @@ -124,7 +101,11 @@ typedef enum _data_type { NONE } data_type_t; +typedef struct _facility facility_t; +typedef struct _event event_t; + typedef struct _type_descriptor { + facility_t *fac; char * type_name; //used for named type data_type_t type; char *fmt; @@ -134,13 +115,14 @@ typedef struct _type_descriptor { sequence_t labels_description; int already_printed; sequence_t fields; // for structure, array and sequence (field_t type) - int custom_write; /* Should we use a custom write function ? */ + int custom_write; /* Should we use a custom write function ? */ + int network; /* Is the type a in network byte order ? */ } type_descriptor_t; - /* Fields within types or events */ typedef struct _field{ + facility_t *fac; char *name; char *description; type_descriptor_t *type; @@ -149,38 +131,46 @@ typedef struct _field{ /* Events definitions */ -typedef struct _event { +struct _event { + facility_t *fac; char *name; char *description; //type_descriptor_t *type; - sequence_t fields; /* event fields */ + sequence_t fields; /* event fields */ int per_trace; /* Is the event able to be logged to a specific trace ? */ int per_tracefile; /* Must we log this event in a specific tracefile ? */ -} event_t; + int param_buffer; /* For userspace tracing : takes a buffer as parameter? */ + int no_instrument_function; + int high_priority; + int force; + int compact_data; +}; -typedef struct _facility { +struct _facility { char * name; - char * capname; - char * arch; + char * capname; + char * arch; + int align; /* Alignment : default 1, 0 no alignment. */ char * description; sequence_t events; sequence_t unnamed_types; //FIXME : remove table_t named_types; - unsigned int checksum; -} facility_t; + unsigned int checksum; + int user; /* Is this a userspace facility ? */ +}; int getSizeindex(unsigned int value); unsigned long long int getSize(parse_file_t *in); unsigned long getTypeChecksum(unsigned long aCrc, type_descriptor_t * type); void parseFacility(parse_file_t *in, facility_t * fac); -void parseEvent(parse_file_t *in, event_t *ev, sequence_t * unnamed_types, +void parseEvent(facility_t *fac, parse_file_t *in, event_t *ev, sequence_t * unnamed_types, table_t * named_types); -void parseTypeDefinition(parse_file_t *in, +void parseTypeDefinition(facility_t *fac, parse_file_t *in, sequence_t * unnamed_types, table_t * named_types); -type_descriptor_t *parseType(parse_file_t *in, +type_descriptor_t *parseType(facility_t *fac, parse_file_t *in, type_descriptor_t *t, sequence_t * unnamed_types, table_t * named_types); -void parseFields(parse_file_t *in, field_t *f, +void parseFields(facility_t *fac, parse_file_t *in, field_t *f, sequence_t * unnamed_types, table_t * named_types, int tag); @@ -194,8 +184,7 @@ void generateChecksum(char * facName, char * getNameAttribute(parse_file_t *in); char * getFormatAttribute(parse_file_t *in); int getSizeAttribute(parse_file_t *in); -int getValueAttribute(parse_file_t *in); -char * getValueStrAttribute(parse_file_t *in); +int getValueAttribute(parse_file_t *in, long long *value); char * getDescription(parse_file_t *in);