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 7142843D5B; Thu, 28 Mar 2024 00:30:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE43B42D6A; Thu, 28 Mar 2024 00:30:24 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id D3643410E6 for ; Thu, 28 Mar 2024 00:30:17 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1e0d82c529fso3705055ad.2 for ; Wed, 27 Mar 2024 16:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711582217; x=1712187017; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z1Ss/Jo5pzxKGB7DFQyYr6zCqpXokQnGKUO4mVGS4XE=; b=mUx/umw1WlMHQUSNFOA0WOK/h8SqrhyWxfDhLLHNiJLBIvl8jCYpcvZFJe1vt5BfWZ G2qSUHM0ANLNlOXUPeWz7oFe/yt0MqLMMFt1WtQa8FU/1kg26x6cQOPllv9vuB1KfrG0 Pk/Ad9V5ObJOrv8fSG8+rIA/gdqMr2Oob0jqNdYfJN8OCZUhnRSLdyq+kJwLK+O+Jqv5 xXX27zb/I1H7UflwjT+/xWh66nMY8N7EpybYeg1nU+9pIIrE4QxpIzonEzV7kqXfu4LJ wiuuX/FJXNoa3TLnSnw9FOFIUm/e9D+z4vMKNRWEe1I4kJ4ORuMwvoo2Wym+4KDIjqIC bMMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711582217; x=1712187017; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z1Ss/Jo5pzxKGB7DFQyYr6zCqpXokQnGKUO4mVGS4XE=; b=jQvcowQyWb6Vi7uQxXb1z+LJjhb8LCxiNTIfJlb1YRqyYSurbRb653vPX5l8Y3tVRn feJgdAcDr8J1TaZrKht0s8NZW1cXDMD3t7VMECp/uWpq1YcthX0Y6iFxNFISjv1jOMUq kQwQznYg1PqdH5kyp8tJzLkAJOEQPykXfAlDw5IfUKHlq8kiU4xIfsjxBetnJ5DWjM35 bHzidyZUKOA3sX5+ySxyLUjhyOxN1WIl9sfc63SYezId3XN4d2hq6D+V18Z3N3Fq7Plm l/2hHWHpsae3CEsJmmipCqCU7KLX9jZ+mJBRtpJWm0H3LpT99Kg9ylwOsZpH17ha/tCE NY2g== X-Gm-Message-State: AOJu0YwApM8Lw5APJkNJMHeYKdezcIBzdO/RqAuLhXe3YZKbAkRKjRcv HY4IrDxEVRcaXmVTFOECi+EeOSh1TjYhfSx0RlEKx1sXIOHA+Mg9tKL1p8myMRXLy5CRKEjpZt5 4 X-Google-Smtp-Source: AGHT+IFc1oAxb9dwsdg7Jxp4wRT5zcgPmCkqeTZFZe0KPSKa5Awobim3LfSpHzgJ5q4JhG4D6BHORg== X-Received: by 2002:a17:903:2406:b0:1dd:7da:e0a9 with SMTP id e6-20020a170903240600b001dd07dae0a9mr1457487plo.69.1711582217031; Wed, 27 Mar 2024 16:30:17 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id n15-20020a170902e54f00b001e0fdc6e4ebsm80772plf.175.2024.03.27.16.30.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 16:30:16 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v17 07/15] eal: change rte_exit() output to match rte_log() Date: Wed, 27 Mar 2024 16:28:30 -0700 Message-ID: <20240327233001.83505-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240327233001.83505-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240327233001.83505-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 Signed-off-by: Stephen Hemminger --- 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 3e77995896..ad2be63cbb 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[256]; 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); + vsnprintf(msg, sizeof(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