From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id 40A3E397D for ; Tue, 27 Mar 2018 20:20:33 +0200 (CEST) Received: from cpe-2606-a000-111b-40b7-640c-26a-4e16-9225.dyn6.twc.com ([2606:a000:111b:40b7:640c:26a:4e16:9225] helo=localhost) by smtp.tuxdriver.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1f0tCl-0006jJ-4a; Tue, 27 Mar 2018 14:20:31 -0400 Date: Tue, 27 Mar 2018 14:19:47 -0400 From: Neil Horman To: Gaetan Rivet Cc: dev@dpdk.org Message-ID: <20180327181946.GB30585@hmswarspite.think-freely.org> References: <86805efc91737ce4ae2b864cadf1508ecd7954f0.1522105876.git.gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86805efc91737ce4ae2b864cadf1508ecd7954f0.1522105876.git.gaetan.rivet@6wind.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Score: -2.9 (--) X-Spam-Status: No Subject: Re: [dpdk-dev] [PATCH v3 01/20] kvargs: remove rte log dependency 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: , X-List-Received-Date: Tue, 27 Mar 2018 18:20:33 -0000 On Tue, Mar 27, 2018 at 01:18:25AM +0200, Gaetan Rivet wrote: > Signed-off-by: Gaetan Rivet > --- > lib/librte_kvargs/rte_kvargs.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_kvargs/rte_kvargs.c b/lib/librte_kvargs/rte_kvargs.c > index 9662375e8..d6b187aac 100644 > --- a/lib/librte_kvargs/rte_kvargs.c > +++ b/lib/librte_kvargs/rte_kvargs.c > @@ -3,10 +3,10 @@ > * Copyright(c) 2014 6WIND S.A. > */ > > +#include > #include > #include > > -#include > #include > > #include "rte_kvargs.h" > @@ -29,7 +29,7 @@ rte_kvargs_tokenize(struct rte_kvargs *kvlist, const char *params) > */ > kvlist->str = strdup(params); > if (kvlist->str == NULL) { > - RTE_LOG(ERR, PMD, "Cannot parse arguments: not enough memory\n"); > + fprintf(stderr, "Cannot parse arguments: not enough memory\n"); > return -1; > } > I'm not entirely sure why any of this is needed. RTE_LOG is basically a wrapper around rte_vlog, which has this block of code: if (f == NULL) { f = default_log_stream; if (f == NULL) { /* * Grab the current value of stderr here, rather than * just initializing default_log_stream to stderr. This * ensures that we will always use the current value * of stderr, even if the application closes and * reopens it. */ f = stderr; } } } It seems to me that if rte_log_openstream hasn't been called yet, we should just dump messages to stderr, just like Keith noted in his other email. If thats not working, thats definately a problem, but regardless, you should be able to use RTE_LOG in your code without issue. Neil