[v2,4/4] trace: make CTF metadata prettier
diff mbox series

Message ID 20201028210249.9021-5-david.marchand@redhat.com
State Accepted
Delegated to: David Marchand
Headers show
Series
  • Rework CTF event description storage
Related show

Checks

Context Check Description
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-intel-Functional success Functional Testing PASS
ci/checkpatch success coding style OK

Commit Message

David Marchand Oct. 28, 2020, 9:02 p.m. UTC
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>
---
 lib/librte_eal/common/eal_common_trace.c     | 2 +-
 lib/librte_eal/common/eal_common_trace_ctf.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Sunil Kumar Kori Oct. 29, 2020, 8:37 a.m. UTC | #1
>-----Original Message-----
>From: David Marchand <david.marchand@redhat.com>
>Sent: Thursday, October 29, 2020 2:33 AM
>To: dev@dpdk.org
>Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Sunil Kumar Kori
><skori@marvell.com>
>Subject: [EXT] [PATCH v2 4/4] trace: make CTF metadata prettier
>
>External Email
>
>----------------------------------------------------------------------
>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>
>---
> lib/librte_eal/common/eal_common_trace.c     | 2 +-
> lib/librte_eal/common/eal_common_trace_ctf.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
>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 : "");
>--
>2.23.0

Acked-by: Sunil Kumar Kori <skori@mavell.com>

Patch
diff mbox series

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 : "");