Fix variadic attributes
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Oct 2022 20:16:01 +0000 (16:16 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 24 Oct 2022 20:16:01 +0000 (16:16 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/tracer.c

index 761c337c9f41d63fbdb871d19e98558d530a632b..933b8be72ec5e01f8adfc8e25f94d2bedc9a40ca 100644 (file)
@@ -987,6 +987,8 @@ void tracer_print_static_fields(const struct side_event_description *desc,
        }
        if (nr_items)
                *nr_items = i;
+       if (side_sav_len)
+               printf(" ]");
 }
 
 void tracer_call(const struct side_event_description *desc,
@@ -996,8 +998,6 @@ void tracer_call(const struct side_event_description *desc,
        int nr_fields = 0;
 
        tracer_print_static_fields(desc, sav_desc, &nr_fields);
-       if (nr_fields)
-               printf(" ]");
        printf("\n");
 }
 
@@ -1015,9 +1015,11 @@ void tracer_call_variadic(const struct side_event_description *desc,
                printf("ERROR: unexpected non-variadic event description\n");
                abort();
        }
-       printf("%s", var_struct_len && !nr_fields ? ", fields: [ " : "");
+       printf("%s", var_struct->nr_attr && nr_fields ? ", " : "");
+       print_attributes("attributes:: ", var_struct->attr, var_struct->nr_attr);
+       printf("%s", var_struct_len && (nr_fields || var_struct->nr_attr) ? ", fields:: [ " : "");
        for (i = 0; i < var_struct_len; i++, nr_fields++) {
-               printf("%s", nr_fields ? ", " : "");
+               printf("%s", i ? ", " : "");
                printf("%s:: ", var_struct->fields[i].field_name);
                tracer_print_dynamic(&var_struct->fields[i].elem);
        }
This page took 0.042172 seconds and 4 git commands to generate.