From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 59D95A00C2 for ; Thu, 24 Nov 2022 09:12:37 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3793742DAA; Thu, 24 Nov 2022 09:12:37 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 20E5F42C4D for ; Thu, 24 Nov 2022 09:12:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669277554; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5ciqxIkLZwc/woqOodMvXfJN49iKlB5wf83KS9wcYWk=; b=ZDQvTpUBd/EC47RFgj6s95wRw0VCkFNSYCkeq7+mGjHMTY34PhI6NqcUiJWFvivkMVfRJx p2fboB0GgvVf23mgXVTVeiD++UfqWQ7TocISrO5WQh0W787DcAge5jBW7aCq/Vh5VT9AHv MbszG95O3rcUYy8IWP3pVZ9rz9D5/C8= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-103-UBm2XN6TMTuvCSZ5l_d5bQ-1; Thu, 24 Nov 2022 03:12:30 -0500 X-MC-Unique: UBm2XN6TMTuvCSZ5l_d5bQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7AF793803501; Thu, 24 Nov 2022 08:12:30 +0000 (UTC) Received: from localhost.localdomain (ovpn-194-0.brq.redhat.com [10.40.194.0]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F8D4C15BA5; Thu, 24 Nov 2022 08:12:29 +0000 (UTC) From: David Marchand To: stable@dpdk.org Cc: ktraynor@redhat.com, Sunil Kumar Kori , Jerin Jacob Subject: [PATCH] trace: fix metadata dump Date: Thu, 24 Nov 2022 09:12:17 +0100 Message-Id: <20221124081217.2664370-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org [ 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 Acked-by: Sunil Kumar Kori --- 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