From: David Marchand Date: Wed, 28 Oct 2020 21:02:49 +0000 (+0100) Subject: trace: make CTF metadata prettier X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=f4d2ad3aa9898d3cf1d3039ea18cf63c5ef5753e;p=dpdk.git trace: make CTF metadata prettier 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 Acked-by: Sunil Kumar Kori --- diff --git a/lib/librte_eal/common/eal_common_trace.c b/lib/librte_eal/common/eal_common_trace.c index bc031ca719..24e27387b1 100644 --- a/lib/librte_eal/common/eal_common_trace.c +++ b/lib/librte_eal/common/eal_common_trace.c @@ -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); diff --git a/lib/librte_eal/common/eal_common_trace_ctf.c b/lib/librte_eal/common/eal_common_trace_ctf.c index 22615c4e73..33e419aac7 100644 --- a/lib/librte_eal/common/eal_common_trace_ctf.c +++ b/lib/librte_eal/common/eal_common_trace_ctf.c @@ -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 : "");