From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C45CA329E for ; Wed, 23 Oct 2019 20:55:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AD4CD1D411; Wed, 23 Oct 2019 20:55:13 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 922991D405 for ; Wed, 23 Oct 2019 20:55:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571856909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T+fOwr/RvH53WM/9d2a7lJJKEo1TirGRuegQIXbabXo=; b=byaN65TGo2owEXSyE8gLBJUQ4lFvv05xNlM5u8Dq0JR60ktzmTNM9gVVf0yme0H7qu9VZq iAeUNmJlW2FCGgORldUCzaCpaVPv+9by8tQPOEKa1x0P1CLOTCR2BuB8RnR7gglOi5UG8g 6LTGBThK0AU3smMHjX0srUqY6l84n2I= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-963h-PITPSKCp8dAdjiqHg-1; Wed, 23 Oct 2019 14:55:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9C19107AD31; Wed, 23 Oct 2019 18:55:03 +0000 (UTC) Received: from dmarchan.remote.csb (ovpn-204-129.brq.redhat.com [10.40.204.129]) by smtp.corp.redhat.com (Postfix) with ESMTP id 42DC660872; Wed, 23 Oct 2019 18:55:00 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stephen@networkplumber.org, anatoly.burakov@intel.com, thomas@monjalon.net, John McNamara , Marko Kovacevic Date: Wed, 23 Oct 2019 20:54:20 +0200 Message-Id: <1571856864-8779-9-git-send-email-david.marchand@redhat.com> In-Reply-To: <1571856864-8779-1-git-send-email-david.marchand@redhat.com> References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com> <1571856864-8779-1-git-send-email-david.marchand@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: 963h-PITPSKCp8dAdjiqHg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH v2 08/12] log: hide internal log structure X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" No need to expose rte_logs, hide it and remove it from the current ABI. Signed-off-by: David Marchand Acked-by: Stephen Hemminger --- Changelog since v1: - updated release notes, --- doc/guides/rel_notes/release_19_11.rst | 2 ++ lib/librte_eal/common/eal_common_log.c | 23 ++++++++++++++++------- lib/librte_eal/common/include/rte_log.h | 20 +++----------------- lib/librte_eal/rte_eal_version.map | 1 - 4 files changed, 21 insertions(+), 25 deletions(-) diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/= release_19_11.rst index 579311d..082c570 100644 --- a/doc/guides/rel_notes/release_19_11.rst +++ b/doc/guides/rel_notes/release_19_11.rst @@ -210,6 +210,8 @@ ABI Changes * eal: removed the ``rte_malloc_virt2phy`` function, replaced by ``rte_malloc_virt2iova`` since v17.11. =20 +* eal: made the ``rte_logs`` struct and global symbol private. + * pci: removed the following deprecated functions since dpdk: =20 - ``eal_parse_pci_BDF`` replaced by ``rte_pci_addr_parse`` diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common= /eal_common_log.c index e0a7bef..57d35a4 100644 --- a/lib/librte_eal/common/eal_common_log.c +++ b/lib/librte_eal/common/eal_common_log.c @@ -17,13 +17,6 @@ =20 #include "eal_private.h" =20 -/* global log structure */ -struct rte_logs rte_logs =3D { -=09.type =3D ~0, -=09.level =3D RTE_LOG_DEBUG, -=09.file =3D NULL, -}; - struct rte_eal_opt_loglevel { =09/** Next list entry */ =09TAILQ_ENTRY(rte_eal_opt_loglevel) next; @@ -58,6 +51,22 @@ struct rte_log_dynamic_type { =09uint32_t loglevel; }; =20 +/** The rte_log structure. */ +struct rte_logs { +=09uint32_t type; /**< Bitfield with enabled logs. */ +=09uint32_t level; /**< Log level. */ +=09FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */ +=09size_t dynamic_types_len; +=09struct rte_log_dynamic_type *dynamic_types; +}; + +/* global log structure */ +static struct rte_logs rte_logs =3D { +=09.type =3D ~0, +=09.level =3D RTE_LOG_DEBUG, +=09.file =3D NULL, +}; + /* per core log */ static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg); =20 diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/commo= n/include/rte_log.h index 1bb0e66..a8d0eb7 100644 --- a/lib/librte_eal/common/include/rte_log.h +++ b/lib/librte_eal/common/include/rte_log.h @@ -26,20 +26,6 @@ extern "C" { #include #include =20 -struct rte_log_dynamic_type; - -/** The rte_log structure. */ -struct rte_logs { -=09uint32_t type; /**< Bitfield with enabled logs. */ -=09uint32_t level; /**< Log level. */ -=09FILE *file; /**< Output file set by rte_openlog_stream, or NULL. */ -=09size_t dynamic_types_len; -=09struct rte_log_dynamic_type *dynamic_types; -}; - -/** Global log information */ -extern struct rte_logs rte_logs; - /* SDK log type */ #define RTE_LOGTYPE_EAL 0 /**< Log related to eal. */ #define RTE_LOGTYPE_MALLOC 1 /**< Log related to malloc. */ @@ -260,7 +246,7 @@ void rte_log_dump(FILE *f); * to rte_openlog_stream(). * * The level argument determines if the log should be displayed or - * not, depending on the global rte_logs variable. + * not, depending on the global log level and the per logtype level. * * The preferred alternative is the RTE_LOG() because it adds the * level and type in the logged string. @@ -291,8 +277,8 @@ int rte_log(uint32_t level, uint32_t logtype, const cha= r *format, ...) * to rte_openlog_stream(). * * The level argument determines if the log should be displayed or - * not, depending on the global rte_logs variable. A trailing - * newline may be added if needed. + * not, depending on the global log level and the per logtype level. + * A trailing newline may be added if needed. * * The preferred alternative is the RTE_LOG() because it adds the * level and type in the logged string. diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_ve= rsion.map index 6d7e0e4..ca9ace0 100644 --- a/lib/librte_eal/rte_eal_version.map +++ b/lib/librte_eal/rte_eal_version.map @@ -45,7 +45,6 @@ DPDK_2.0 { =09rte_log; =09rte_log_cur_msg_loglevel; =09rte_log_cur_msg_logtype; -=09rte_logs; =09rte_malloc; =09rte_malloc_dump_stats; =09rte_malloc_get_socket_stats; --=20 1.8.3.1