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 B8EC3A328D
	for <public@inbox.dpdk.org>; Tue, 22 Oct 2019 18:35:23 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 90C711BF13;
	Tue, 22 Oct 2019 18:35:23 +0200 (CEST)
Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com
 [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id E8EE31BF0F
 for <dev@dpdk.org>; Tue, 22 Oct 2019 18:35:22 +0200 (CEST)
Received: by mail-pf1-f195.google.com with SMTP id q7so10974402pfh.8
 for <dev@dpdk.org>; Tue, 22 Oct 2019 09:35:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=OruABIFAwD7CkdDq/RAxDvp3y+AdOQwZBzyD4zYEyco=;
 b=XH81JeCbw/LXQ+mo36w+9cJuNeIedH+o8olmT239i7JQtq667qMtBORSNULHAmOSPK
 OJU7Yf9p5e9NjJJY9J0Mduywt0CiGOD4F/ZNGcTCAhtlOc+VB9co7qTGVj66WGd9UkXq
 PAQsbvEC/PEfELiINs0FwUOrBO202+CNcAWnZ7nq1Q33Z3zWhs26GctlyYqGvkj75Z2r
 6LoA4m5kS/sB3KXMEokPkOpXuiD1i3HjYS56I4/Ti4mSO/38Icr3xvvMWk9FsaW1UZ90
 506ZwKvV8M6Dtahv+7RRt8ZYt+LbrqHCvvJ3UFD0CunwirupAvhZrx4UouhoYXNfE/ry
 RYJA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=OruABIFAwD7CkdDq/RAxDvp3y+AdOQwZBzyD4zYEyco=;
 b=O/IWpi6SsYbyt1zy49mpNHokB5TC/onDjFNwcmphZmgoJQCyKYpdrzNBniRc3p29XB
 eW0FQ3DaMs7rRiAHtBs2ttcjuFKA5GnFIjdrILGA/OhCWkRVz/1kz+KkmYf5XFkverJZ
 CtTbSo/qVfWdpEcEudtJdhEfGOrHis22wQbbMgy34wgmsRt4RLCgyVlXZ1kD+dyp1BJL
 rXuBVwcR2LqOPLNw+IIIBZSVcqw6UNdYLbYdS5h2efU5QbR9YxrrGQ9qiZsFUEG7c6ZG
 c8OLO5374UZCsJ5zlBZ68nDdLYAW5gECICJnDsw1zyGE1IaodrO8qP/b781O9/6yqgAC
 //lA==
X-Gm-Message-State: APjAAAU+7+XUd5oV2ZwGakzM1JDcO0NM5DsnUpyqfgz47phBqRck1ADU
 nXnmfC3W3GTV5T5egwNcSHZRnA==
X-Google-Smtp-Source: APXvYqxuntfZgI6EG3vEu5jiwUPdbudtzfqfLHO5vq2iekrPrcpbLA5JOLZC5rLQBCjnvu9oDM+6Cg==
X-Received: by 2002:a63:9302:: with SMTP id b2mr2187069pge.342.1571762121952; 
 Tue, 22 Oct 2019 09:35:21 -0700 (PDT)
Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])
 by smtp.gmail.com with ESMTPSA id h8sm21722745pfo.64.2019.10.22.09.35.21
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Tue, 22 Oct 2019 09:35:21 -0700 (PDT)
Date: Tue, 22 Oct 2019 09:35:20 -0700
From: Stephen Hemminger <stephen@networkplumber.org>
To: David Marchand <david.marchand@redhat.com>
Cc: dev@dpdk.org, anatoly.burakov@intel.com, thomas@monjalon.net
Message-ID: <20191022093520.6f0919ad@hermes.lan>
In-Reply-To: <1571736761-32134-9-git-send-email-david.marchand@redhat.com>
References: <1571736761-32134-1-git-send-email-david.marchand@redhat.com>
 <1571736761-32134-9-git-send-email-david.marchand@redhat.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Subject: Re: [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>

On Tue, 22 Oct 2019 11:32:41 +0200
David Marchand <david.marchand@redhat.com> wrote:

> 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 @@
>  
>  #include "eal_private.h"
>  
> -/* global log structure */
> -struct rte_logs rte_logs = {
> -	.type = ~0,
> -	.level = RTE_LOG_DEBUG,
> -	.file = NULL,
> -};
> -
>  struct rte_eal_opt_loglevel {
>  	/** Next list entry */
>  	TAILQ_ENTRY(rte_eal_opt_loglevel) next;
> @@ -58,6 +51,22 @@ struct rte_log_dynamic_type {
>  	uint32_t loglevel;
>  };
>  
> +/** The rte_log structure. */
> +struct rte_logs {
> +	uint32_t type;  /**< Bitfield with enabled logs. */
> +	uint32_t level; /**< Log level. */
> +	FILE *file;     /**< Output file set by rte_openlog_stream, or NULL. */
> +	size_t dynamic_types_len;
> +	struct rte_log_dynamic_type *dynamic_types;
> +};
> +
> +/* global log structure */
> +static struct rte_logs rte_logs = {
> +	.type = ~0,
> +	.level = RTE_LOG_DEBUG,
> +	.file = NULL,
> +};
> +
>   /* per core log */
>  static RTE_DEFINE_PER_LCORE(struct log_cur_msg, log_cur_msg);
>  
> diff --git a/lib/librte_eal/common/include/rte_log.h b/lib/librte_eal/common/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>
>  
> -struct rte_log_dynamic_type;
> -
> -/** The rte_log structure. */
> -struct rte_logs {
> -	uint32_t type;  /**< Bitfield with enabled logs. */
> -	uint32_t level; /**< Log level. */
> -	FILE *file;     /**< Output file set by rte_openlog_stream, or NULL. */
> -	size_t dynamic_types_len;
> -	struct 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 char *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_version.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 {
>  	rte_log;
>  	rte_log_cur_msg_loglevel;
>  	rte_log_cur_msg_logtype;
> -	rte_logs;
>  	rte_malloc;
>  	rte_malloc_dump_stats;
>  	rte_malloc_get_socket_stats;

Acked-by: Stephen Hemminger <stephen@networkplumber.org>