From: compudj Date: Thu, 15 Mar 2007 04:07:17 +0000 (+0000) Subject: Add data field to compact events X-Git-Tag: v0.12.20~1066 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=c902404990f997d6d5476424e68478de7645655d;p=lttv.git Add data field to compact events git-svn-id: http://ltt.polymtl.ca/svn@2423 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/genevent/genevent.c b/genevent/genevent.c index 220cbd70..799be7be 100644 --- a/genevent/genevent.c +++ b/genevent/genevent.c @@ -1610,7 +1610,13 @@ int print_event_logging_function(char *basename, facility_t *fac, fprintf(fd, "ltt_facility_%s_%X, event_%s_%s,\n", fac->name, fac->checksum, fac->name, event->name); print_tabs(3, fd); - fprintf(fd, "reserve_size, before_hdr_pad, tsc, compact_data);\n"); + if(event->compact_data) { + assert(event->fields.position > 0); + field_t *field = (field_t*)(event->fields.array[0]); + fprintf(fd, "reserve_size, before_hdr_pad, tsc, lttng_param_%s);\n", + field->name); + } else + fprintf(fd, "reserve_size, before_hdr_pad, tsc, 0);\n"); } print_tabs(2, fd); fprintf(fd, "*to_base += before_hdr_pad + after_hdr_pad + header_size;\n"); @@ -1621,7 +1627,10 @@ int print_event_logging_function(char *basename, facility_t *fac, for(unsigned int i=0;ifields.position;i++){ field_t *field = (field_t*)(event->fields.array[i]); type_descriptor_t *type = field->type; - + + /* First param is compacted in the header */ + if(event->compact_data && i == 0) + continue; /* Set from */ print_tabs(2, fd); switch(type->type) {