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 D8000A0560; Tue, 18 Oct 2022 15:27:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 975494280E; Tue, 18 Oct 2022 15:27:39 +0200 (CEST) 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 E27D14282F for ; Tue, 18 Oct 2022 15:27:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666099657; 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: in-reply-to:in-reply-to:references:references; bh=yAnb8nAy0I8jLxTXVVkYpc9Z3EH50hkfLpL1EZ5BU+w=; b=RcO2F250OIisv3pTxZPLmuqyUH34a7vWhBqpfLF11oSpJO0sqlaZrKCyUNizY9P4lnlghc wPJCBg8HKvUu26NCLpGOrZ7c9aMEtL9F02A3Ub1GBlSWJGyY/0C8rk8Z9SXPkabupW/gwM 20PRb81ycLDshkG842VTVXgKrhLsOrA= 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-625-l5riyRABOfK5EBjp2fAnlg-1; Tue, 18 Oct 2022 09:27:34 -0400 X-MC-Unique: l5riyRABOfK5EBjp2fAnlg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8AF973C0218E; Tue, 18 Oct 2022 13:27:33 +0000 (UTC) Received: from localhost.localdomain (ovpn-192-244.brq.redhat.com [10.40.192.244]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9C93C49BB62; Tue, 18 Oct 2022 13:27:32 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: jerinj@marvell.com, skori@marvell.com, stable@dpdk.org Subject: [PATCH v4 07/11] trace: fix metadata dump Date: Tue, 18 Oct 2022 15:26:50 +0200 Message-Id: <20221018132654.3760561-8-david.marchand@redhat.com> In-Reply-To: <20221018132654.3760561-1-david.marchand@redhat.com> References: <20220921120359.2201131-1-david.marchand@redhat.com> <20221018132654.3760561-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Sunil Kumar Kori --- app/test/test_trace.c | 44 +++++++++------------------ lib/eal/common/eal_common_trace_ctf.c | 3 -- 2 files changed, 15 insertions(+), 32 deletions(-) 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; -- 2.37.3