Fix: add events with 0 field to field list
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Sep 2012 14:11:09 +0000 (10:11 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 17 Sep 2012 14:11:09 +0000 (10:11 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust/ltt-probes.c

index 1e1407e680d37d0e48b16857fea18e7cd1a60582..d04ce2215a4e2db6b1765d328910565b30341ed7 100644 (file)
@@ -244,6 +244,28 @@ int ltt_probes_get_field_list(struct lttng_ust_field_list *list)
                                probe_desc->event_desc[i];
                        int j;
 
+                       if (event_desc->nr_fields == 0) {
+                               /* Events without fields. */
+                               struct tp_field_list_entry *list_entry;
+
+                               list_entry = zmalloc(sizeof(*list_entry));
+                               if (!list_entry)
+                                       goto err_nomem;
+                               cds_list_add(&list_entry->head, &list->head);
+                               strncpy(list_entry->field.event_name,
+                                       event_desc->name,
+                                       LTTNG_UST_SYM_NAME_LEN);
+                               list_entry->field.event_name[LTTNG_UST_SYM_NAME_LEN - 1] = '\0';
+                               list_entry->field.field_name[0] = '\0';
+                               list_entry->field.type = LTTNG_UST_FIELD_OTHER;
+                               if (!event_desc->loglevel) {
+                                       list_entry->field.loglevel = TRACE_DEFAULT;
+                               } else {
+                                       list_entry->field.loglevel = *(*event_desc->loglevel);
+                               }
+                               list_entry->field.nowrite = 1;
+                       }
+
                        for (j = 0; j < event_desc->nr_fields; j++) {
                                const struct lttng_event_field *event_field =
                                        &event_desc->fields[j];
This page took 0.025602 seconds and 4 git commands to generate.