diff mbox series

[v2,7/9] trace: fix metadata dump

Message ID 20221004094418.196544-8-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series Trace subsystem fixes | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

David Marchand Oct. 4, 2022, 9:44 a.m. UTC
The API does not describe that metadata dump is conditioned to enabling
any trace points.

While at it, merge dump unit tests into the generic trace_autotest to
enhance coverage.

Fixes: f6b2d65dcd5d ("trace: implement debug dump")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 app/test/test_trace.c                 | 44 +++++++++------------------
 lib/eal/common/eal_common_trace_ctf.c |  3 --
 2 files changed, 15 insertions(+), 32 deletions(-)

Comments

Sunil Kumar Kori Oct. 12, 2022, 9:28 a.m. UTC | #1
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, October 4, 2022 3:14 PM
> To: dev@dpdk.org
> Cc: skori@mavell.com; Jerin Jacob Kollanukkaran <jerinj@marvell.com>;
> stable@dpdk.org; Sunil Kumar Kori <skori@marvell.com>
> Subject: [EXT] [PATCH v2 7/9] trace: fix metadata dump
> 
> External Email
> 
> ----------------------------------------------------------------------
> The API does not describe that metadata dump is conditioned to enabling
> any trace points.
> 
> While at it, merge dump unit tests into the generic trace_autotest to enhance
> coverage.
> 
> Fixes: f6b2d65dcd5d ("trace: implement debug dump")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  app/test/test_trace.c                 | 44 +++++++++------------------
>  lib/eal/common/eal_common_trace_ctf.c |  3 --
>  2 files changed, 15 insertions(+), 32 deletions(-)
> 

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

> diff --git a/app/test/test_trace.c b/app/test/test_trace.c index
> 2660f52f1d..6bedf14024 100644
> --- a/app/test/test_trace.c
> +++ b/app/test/test_trace.c
> @@ -20,20 +20,6 @@ test_trace(void)
>  	return TEST_SKIPPED;

[snip]

> 
> --
> 2.37.3
diff mbox series

Patch

diff --git a/app/test/test_trace.c b/app/test/test_trace.c
index 2660f52f1d..6bedf14024 100644
--- a/app/test/test_trace.c
+++ b/app/test/test_trace.c
@@ -20,20 +20,6 @@  test_trace(void)
 	return TEST_SKIPPED;
 }
 
-static int
-test_trace_dump(void)
-{
-	printf("trace_dump not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-static int
-test_trace_metadata_dump(void)
-{
-	printf("trace_metadata_dump not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
 #else
 
 static int32_t
@@ -214,6 +200,19 @@  test_generic_trace_points(void)
 	return TEST_SUCCESS;
 }
 
+static int
+test_trace_dump(void)
+{
+	rte_trace_dump(stdout);
+	return 0;
+}
+
+static int
+test_trace_metadata_dump(void)
+{
+	return rte_trace_metadata_dump(stdout);
+}
+
 static struct unit_test_suite trace_tests = {
 	.suite_name = "trace autotest",
 	.setup = NULL,
@@ -226,6 +225,8 @@  static struct unit_test_suite trace_tests = {
 		TEST_CASE(test_trace_point_globbing),
 		TEST_CASE(test_trace_point_regex),
 		TEST_CASE(test_trace_points_lookup),
+		TEST_CASE(test_trace_dump),
+		TEST_CASE(test_trace_metadata_dump),
 		TEST_CASES_END()
 	}
 };
@@ -236,21 +237,6 @@  test_trace(void)
 	return unit_test_suite_runner(&trace_tests);
 }
 
-static int
-test_trace_dump(void)
-{
-	rte_trace_dump(stdout);
-	return 0;
-}
-
-static int
-test_trace_metadata_dump(void)
-{
-	return rte_trace_metadata_dump(stdout);
-}
-
 #endif /* !RTE_EXEC_ENV_WINDOWS */
 
 REGISTER_TEST_COMMAND(trace_autotest, test_trace);
-REGISTER_TEST_COMMAND(trace_dump, test_trace_dump);
-REGISTER_TEST_COMMAND(trace_metadata_dump, test_trace_metadata_dump);
diff --git a/lib/eal/common/eal_common_trace_ctf.c b/lib/eal/common/eal_common_trace_ctf.c
index 335932a271..c6775c3b4d 100644
--- a/lib/eal/common/eal_common_trace_ctf.c
+++ b/lib/eal/common/eal_common_trace_ctf.c
@@ -358,9 +358,6 @@  rte_trace_metadata_dump(FILE *f)
 	char *ctf_meta = trace->ctf_meta;
 	int rc;
 
-	if (!rte_trace_is_enabled())
-		return 0;
-
 	if (ctf_meta == NULL)
 		return -EINVAL;