trace: make CTF metadata prettier
authorDavid Marchand <david.marchand@redhat.com>
Wed, 28 Oct 2020 21:02:49 +0000 (22:02 +0100)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 29 Oct 2020 21:49:22 +0000 (22:49 +0100)
This is simply a cosmetic change.

Before:
event {
    id = 17;
    name = "lib.eal.alarm.set";
    fields := struct {
        uint64_t us;uintptr_t cb_fn;uintptr_t cb_arg;int32_t rc;
    };
};

After:
event {
    id = 17;
    name = "lib.eal.alarm.set";
    fields := struct {
        uint64_t us;
        uintptr_t cb_fn;
        uintptr_t cb_arg;
        int32_t rc;
    };
};

Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Sunil Kumar Kori <skori@mavell.com>
lib/librte_eal/common/eal_common_trace.c
lib/librte_eal/common/eal_common_trace_ctf.c

index bc031ca..24e2738 100644 (file)
@@ -435,7 +435,7 @@ __rte_trace_point_emit_field(size_t sz, const char *in, const char *datatype)
        fixup = trace_metadata_fixup_field(in);
        if (fixup != NULL)
                in = fixup;
-       rc = asprintf(&field, "%s%s %s;",
+       rc = asprintf(&field, "%s        %s %s;\n",
                RTE_PER_LCORE(ctf_field) != NULL ?
                        RTE_PER_LCORE(ctf_field) : "",
                datatype, in);
index 22615c4..33e419a 100644 (file)
@@ -232,7 +232,7 @@ meta_event_emit(char **meta, int *offset, struct trace_point *tp)
                "    id = %d;\n"
                "    name = \"%s\";\n"
                "    fields := struct {\n"
-               "        %s\n"
+               "%s"
                "    };\n"
                "};\n\n", trace_id_get(tp->handle), tp->name,
                tp->ctf_field != NULL ? tp->ctf_field : "");