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 B0A0EA04B7; Wed, 2 Sep 2020 10:40:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1D84D1C07B; Wed, 2 Sep 2020 10:40:35 +0200 (CEST) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by dpdk.org (Postfix) with ESMTP id D04A51C066 for ; Wed, 2 Sep 2020 10:40:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1599036033; 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: in-reply-to:in-reply-to:references:references; bh=FljF4r5qz4/rdAQV7h4TYdqtZt/48R9QHBmv7ruZJFY=; b=MNVxaDXwrnQVlPugWjqgqpusLO3VP/fXlTlQDGkfcm+O8SS9X8ifH+mhKDx9DyIbX3vlLQ OYCDrsY2IHLh/Y0HS0pAg45BpK9/P2EIl0yRu+zxXp5WuUxVmPbMESNkg284nfL16kCVMU QH318tEm7SWB2NHKWqxM/4ZYbpikwt0= Received: from mail-vk1-f197.google.com (mail-vk1-f197.google.com [209.85.221.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-eDAc5T6kMMyyRIF1imZg2Q-1; Wed, 02 Sep 2020 04:40:31 -0400 X-MC-Unique: eDAc5T6kMMyyRIF1imZg2Q-1 Received: by mail-vk1-f197.google.com with SMTP id p196so1199120vkp.22 for ; Wed, 02 Sep 2020 01:40:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FljF4r5qz4/rdAQV7h4TYdqtZt/48R9QHBmv7ruZJFY=; b=H2OkTxYl9xOrVLOJDaPMacVNsl5gWmWS+hmyzwy/BmsIfAHZ65tpUyNVnpTZ3SJTZI CG6mUSJEJORx4kbEgnAiDzzikDlzkEAdQZtz5Z4TGq9OJbUzPCCJJTBYf3y2QTKDjIcV DGB/KYzI4CIck2ve47l7UE/50sN64mZHyYflMkXat42NY2rsnoDNr8uTD6skr9hX+cFM w7pIYm4+N2EtG0uraMydRlkeofvUQn8Bl3MaAZPQ1RfchCSU4UWtUdkJAU5KW9PGqZSZ eFTdXjFnhD5H/mksLXOwHCbAB1YrQpHMaR59Qqi9OVEhi9MDXc8C/IfRZJSjM1CVfHPX rEKQ== X-Gm-Message-State: AOAM532PCVfQ0MtovLbM3DBXtFtOeIzYxHfQ/3Q/nracTyEw/420zAs4 eJEOb9ODU/zu4d0LrIPzBipvNTBx9HXh3jlH3YAgKYPWET83LeoCXUXKJ42RdGT9RK+Gf1UXvEZ ovXCPTC5IQLwr6QBZFv8= X-Received: by 2002:ab0:6a5:: with SMTP id g34mr4192670uag.53.1599036030242; Wed, 02 Sep 2020 01:40:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt3KJAunfKY63uQA2zhSMvIAcI+v+mzNSGdvCUf0WupuqTIe2UUOY0RBgppYOhKptxnCONCtmTdQqPpUoQRUU= X-Received: by 2002:ab0:6a5:: with SMTP id g34mr4192660uag.53.1599036029960; Wed, 02 Sep 2020 01:40:29 -0700 (PDT) MIME-Version: 1.0 References: <20200827225414.6623-1-stephen@networkplumber.org> In-Reply-To: <20200827225414.6623-1-stephen@networkplumber.org> From: David Marchand Date: Wed, 2 Sep 2020 10:40:19 +0200 Message-ID: To: Stephen Hemminger Cc: Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , dev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH] rte_log: make rte_logs private 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" On Fri, Aug 28, 2020 at 12:54 AM Stephen Hemminger wrote: > > As announced in earlier releases, rte_logs can now be made > internal to eal_common_log. I had prepared this cleanup before my PTO and was about to send it. Just to avoid duplicate work, do you intend to work on other cleanups ? Hiding this symbol is fine, but we must remove the experimental tag on rte_log_get_stream since it becomes the only way to access the log stream. More comments below. Thanks. > > Signed-off-by: Stephen Hemminger > --- > doc/guides/rel_notes/deprecation.rst | 4 ---- > doc/guides/rel_notes/release_20_11.rst | 2 ++ > lib/librte_eal/common/eal_common_log.c | 11 ++++++++--- > lib/librte_eal/include/rte_log.h | 16 ++-------------- > lib/librte_eal/rte_eal_version.map | 1 - > 5 files changed, 12 insertions(+), 22 deletions(-) > > diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst > index 345c38d5b630..5445a4f0a061 100644 > --- a/doc/guides/rel_notes/deprecation.rst > +++ b/doc/guides/rel_notes/deprecation.rst > @@ -77,10 +77,6 @@ Deprecation Notices > * eal: The function ``rte_eal_remote_launch`` will return new error codes > after read or write error on the pipe, instead of calling ``rte_panic``. > > -* eal: The ``rte_logs`` struct and global symbol will be made private to > - remove it from the externally visible ABI and allow it to be updated in the > - future. > - > * eal: The ``rte_dev_event`` structure will be made private to the EAL as no > public API makes use of it. > > diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst > index df227a1773b8..e422ac790912 100644 > --- a/doc/guides/rel_notes/release_20_11.rst > +++ b/doc/guides/rel_notes/release_20_11.rst > @@ -84,6 +84,8 @@ API Changes > Also, make sure to start the actual text at the margin. > ======================================================= > > +* eal: The ``rte_logs`` struct and global symbol was made private > + and is no longer part of the API. Missing double empty line. > > ABI Changes > ----------- > diff --git a/lib/librte_eal/common/eal_common_log.c b/lib/librte_eal/common/eal_common_log.c > index 8835c8fff897..a25766de181a 100644 > --- a/lib/librte_eal/common/eal_common_log.c > +++ b/lib/librte_eal/common/eal_common_log.c > @@ -17,11 +17,16 @@ > > #include "eal_private.h" > > -/* global log structure */ > -struct rte_logs rte_logs = { > +/** The rte_log structure. */ > +static 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; > +} rte_logs = { > .type = ~0, > .level = RTE_LOG_DEBUG, > - .file = NULL, > }; > > struct rte_eal_opt_loglevel { > diff --git a/lib/librte_eal/include/rte_log.h b/lib/librte_eal/include/rte_log.h > index eaf66e4f61de..655c3b39c29e 100644 > --- a/lib/librte_eal/include/rte_log.h > +++ b/lib/librte_eal/include/rte_log.h > @@ -29,18 +29,6 @@ extern "C" { > > struct rte_log_dynamic_type; No need for rte_log_dynamic_type forward declaration anymore if you simply move rte_logs or this type declaration in eal_common_log.c. > > -/** 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. */ > @@ -274,7 +262,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 loglevel settings. > * > * The preferred alternative is the RTE_LOG() because it adds the > * level and type in the logged string. > @@ -305,7 +293,7 @@ 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 > + * not, depending on the loglevel settings. A trailing > * newline may be added if needed. > * > * The preferred alternative is the RTE_LOG() because it adds the > diff --git a/lib/librte_eal/rte_eal_version.map b/lib/librte_eal/rte_eal_version.map > index 0b18e2ef85f9..6b0dfdd9667c 100644 > --- a/lib/librte_eal/rte_eal_version.map > +++ b/lib/librte_eal/rte_eal_version.map > @@ -114,7 +114,6 @@ DPDK_21 { > rte_log_set_level; > rte_log_set_level_pattern; > rte_log_set_level_regexp; > - rte_logs; > rte_malloc; > rte_malloc_dump_stats; > rte_malloc_get_socket_stats; > -- > 2.27.0 > -- David Marchand