From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 7D703A328D
	for <public@inbox.dpdk.org>; Tue, 22 Oct 2019 11:33:29 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 25C2E1BEBD;
	Tue, 22 Oct 2019 11:33:26 +0200 (CEST)
Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com
 [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 475711BEB5
 for <dev@dpdk.org>; Tue, 22 Oct 2019 11:33:25 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1571736804;
 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=n9sZBS755SLRdw+nHNwHB3X5DIoduPOYixFfElc5oms=;
 b=MEzXDfz+kkle5ClNWLT6zHRHc+rBvYW/9MyccIDKCpetE6KhH1BVeDeGmymo4VO4PB5wiO
 vSUvSgwqNnN6IsvZOyL/TNDO00ZKgkRq1mwiIEYupDLOrzWIGsHbtxPg2hi6swwH5w5erU
 sqsHUvjtZMr0831Z4iLf7UKHnOA1juM=
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-276-KMJ60vrgOweKD6qW18i93g-1; Tue, 22 Oct 2019 05:33:21 -0400
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com
 [10.5.11.11])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7E215F0;
 Tue, 22 Oct 2019 09:33:20 +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 839D86012D;
 Tue, 22 Oct 2019 09:33:19 +0000 (UTC)
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: stephen@networkplumber.org, anatoly.burakov@intel.com, thomas@monjalon.net
Date: Tue, 22 Oct 2019 11:32:41 +0200
Message-Id: <1571736761-32134-9-git-send-email-david.marchand@redhat.com>
In-Reply-To: <1571736761-32134-1-git-send-email-david.marchand@redhat.com>
References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com>
X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11
X-MC-Unique: KMJ60vrgOweKD6qW18i93g-1
X-Mimecast-Spam-Score: 0
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable
Subject: [dpdk-dev] [PATCH 8/8] log: hide internal log structure
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

No need to expose rte_logs, hide it and remove it from the current ABI.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 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 -
 3 files changed, 19 insertions(+), 25 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common=
/eal_common_log.c
index cfe9599..3a7ab88 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 <rte_config.h>
 #include <rte_compat.h>
=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