diff mbox series

[1/2] trace: fix size_t field emitter

Message ID 20200825232410.975-1-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers show
Series [1/2] trace: fix size_t field emitter | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Pavan Nikhilesh Bhagavatula Aug. 25, 2020, 11:24 p.m. UTC
From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Add size_t CTF format metadata, this is needed by CTF analyzers to
parse the emitted CTF trace.

Fixes: 262c4ee791c6 ("trace: add size_t field emitter")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 lib/librte_eal/common/eal_common_trace_ctf.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Sunil Kumar Kori Aug. 30, 2020, 7:35 a.m. UTC | #1
>-----Original Message-----
>From: pbhagavatula@marvell.com <pbhagavatula@marvell.com>
>Sent: Wednesday, August 26, 2020 4:54 AM
>To: Jerin Jacob Kollanukkaran <jerinj@marvell.com>; Sunil Kumar Kori
><skori@marvell.com>
>Cc: dev@dpdk.org; Pavan Nikhilesh Bhagavatula
><pbhagavatula@marvell.com>
>Subject: [dpdk-dev] [PATCH 1/2] trace: fix size_t field emitter
>
>From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
>Add size_t CTF format metadata, this is needed by CTF analyzers to
>parse the emitted CTF trace.
>
>Fixes: 262c4ee791c6 ("trace: add size_t field emitter")
>
>Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
>---
> lib/librte_eal/common/eal_common_trace_ctf.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/lib/librte_eal/common/eal_common_trace_ctf.c
>b/lib/librte_eal/common/eal_common_trace_ctf.c
>index 302e2bb74..9dc91df0f 100644
>--- a/lib/librte_eal/common/eal_common_trace_ctf.c
>+++ b/lib/librte_eal/common/eal_common_trace_ctf.c
>@@ -83,6 +83,11 @@ meta_data_type_emit(char **meta, int *offset)
> 		"typealias integer {size = 32; base = x;} := long;\n"
> #endif
> 		"typealias integer {size = 8; signed = false; encoding = ASCII; }
>:= string_bounded_t;\n\n"
>+#ifdef RTE_ARCH_64
>+		"typealias integer {size = 64; base = x;} := size_t;\n"
>+#else
>+		"typealias integer {size = 32; base = x;} := size_t;\n"
>+#endif
> 		"typealias floating_point {\n"
> 		"    exp_dig = 8;\n"
> 		"    mant_dig = 24;\n"
>--
>2.17.1

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

Patch

diff --git a/lib/librte_eal/common/eal_common_trace_ctf.c b/lib/librte_eal/common/eal_common_trace_ctf.c
index 302e2bb74..9dc91df0f 100644
--- a/lib/librte_eal/common/eal_common_trace_ctf.c
+++ b/lib/librte_eal/common/eal_common_trace_ctf.c
@@ -83,6 +83,11 @@  meta_data_type_emit(char **meta, int *offset)
 		"typealias integer {size = 32; base = x;} := long;\n"
 #endif
 		"typealias integer {size = 8; signed = false; encoding = ASCII; } := string_bounded_t;\n\n"
+#ifdef RTE_ARCH_64
+		"typealias integer {size = 64; base = x;} := size_t;\n"
+#else
+		"typealias integer {size = 32; base = x;} := size_t;\n"
+#endif
 		"typealias floating_point {\n"
 		"    exp_dig = 8;\n"
 		"    mant_dig = 24;\n"