patches for DPDK stable branches
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: stable@dpdk.org
Cc: ktraynor@redhat.com, Sunil Kumar Kori <skori@marvell.com>,
	Jerin Jacob <jerinj@marvell.com>
Subject: [PATCH] trace: fix metadata dump
Date: Thu, 24 Nov 2022 09:12:17 +0100	[thread overview]
Message-ID: <20221124081217.2664370-1-david.marchand@redhat.com> (raw)

[ upstream commit d4cbbee345e2ea1126f3f43cbc1fedaf1245feb0 ]

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

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

diff --git a/app/test/test_trace.c b/app/test/test_trace.c
index f62a385af9..7f07de1aa6 100644
--- a/app/test/test_trace.c
+++ b/app/test/test_trace.c
@@ -189,6 +189,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,
@@ -201,6 +214,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()
 	}
 };
@@ -212,20 +227,3 @@ test_trace(void)
 }
 
 REGISTER_TEST_COMMAND(trace_autotest, test_trace);
-
-static int
-test_trace_dump(void)
-{
-	rte_trace_dump(stdout);
-	return 0;
-}
-
-REGISTER_TEST_COMMAND(trace_dump, test_trace_dump);
-
-static int
-test_trace_metadata_dump(void)
-{
-	return rte_trace_metadata_dump(stdout);
-}
-
-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 33e419aac7..94726817b2 100644
--- a/lib/eal/common/eal_common_trace_ctf.c
+++ b/lib/eal/common/eal_common_trace_ctf.c
@@ -359,9 +359,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;
 
-- 
2.38.1


             reply	other threads:[~2022-11-24  8:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24  8:12 David Marchand [this message]
2022-11-28  9:27 ` David Marchand
2022-11-28 10:12   ` Kevin Traynor
2022-11-29 11:55     ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221124081217.2664370-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=jerinj@marvell.com \
    --cc=ktraynor@redhat.com \
    --cc=skori@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).