Add data field to compact events
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 15 Mar 2007 04:07:17 +0000 (04:07 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Thu, 15 Mar 2007 04:07:17 +0000 (04:07 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2423 04897980-b3bd-0310-b5e0-8ef037075253

genevent/genevent.c

index 220cbd70f7a36f3ff97c6ace13196bfc31b811c8..799be7be3fa1192c2fa982d3b15e348faa915cfe 100644 (file)
@@ -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;i<event->fields.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) {
This page took 0.024787 seconds and 4 git commands to generate.