From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4920B43D18; Thu, 21 Mar 2024 18:04:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C367342830; Thu, 21 Mar 2024 18:04:52 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id EDDBB427E1 for ; Thu, 21 Mar 2024 18:04:51 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 1DE6220B74C0; Thu, 21 Mar 2024 10:04:51 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 1DE6220B74C0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1711040691; bh=iCKT5QHwzmjPgT4tXuO49/9uZdu//jWrgB8p/coenr8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eksNHStpM3ab32CPf2uFl2n+u2bjLd7YsqV8PSmWRQRDq4u8pp0FwmdnLhnt7+s3a Vgc83cCrv0eYoi6lfxgagsgE0xRSmoYGm30u1Bz07wYDysttdHBVuyzfTCI4lSrrff hWQoDc4FFSi95DYkxkoXtlDAak1auZzrMIAa7FV0= Date: Thu, 21 Mar 2024 10:04:51 -0700 From: Tyler Retzlaff To: Stephen Hemminger Cc: dev@dpdk.org Subject: Re: [PATCH v10 06/10] eal: change rte_exit() output to match rte_log() Message-ID: <20240321170451.GB27371@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240321161146.340421-1-stephen@networkplumber.org> <20240321161146.340421-7-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240321161146.340421-7-stephen@networkplumber.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, Mar 21, 2024 at 09:00:22AM -0700, Stephen Hemminger wrote: > The rte_exit() output format confuses the timestamp and coloring > options. Change it to use be a single line with proper prefix. > > Before: > [ 0.006481] EAL: Error - exiting with code: 1 > Cause: [ 0.006489] Cannot init EAL: Permission denied > > After: > [ 0.006238] EAL: Error - exiting with code: 1 > [ 0.006250] EAL: Cause: Cannot init EAL: Permission denied it is better but maybe : -> - for Cause? [ 0.006238] EAL: Error - exiting with code: 1 [ 0.006250] EAL: Cause - Cannot init EAL: Permission denied > > Signed-off-by: Stephen Hemminger > --- ACked-by: Tyler Retzlaff > lib/eal/common/eal_common_debug.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/lib/eal/common/eal_common_debug.c b/lib/eal/common/eal_common_debug.c > index 3e77995896d5..568883830f20 100644 > --- a/lib/eal/common/eal_common_debug.c > +++ b/lib/eal/common/eal_common_debug.c > @@ -34,17 +34,18 @@ void > rte_exit(int exit_code, const char *format, ...) > { > va_list ap; > + char *msg = NULL; > > if (exit_code != 0) > - RTE_LOG(CRIT, EAL, "Error - exiting with code: %d\n" > - " Cause: ", exit_code); > + EAL_LOG(CRIT, "Error - exiting with code: %d", exit_code); > > va_start(ap, format); > - rte_vlog(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, format, ap); > + vasprintf(&msg, format, ap); > va_end(ap); > > + rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "EAL: Cause: %s", msg); > + > if (rte_eal_cleanup() != 0 && rte_errno != EALREADY) > - EAL_LOG(CRIT, > - "EAL could not release all resources"); > + EAL_LOG(CRIT, "EAL could not release all resources"); > exit(exit_code); > } > -- > 2.43.0