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 1BDC143D73; Fri, 29 Mar 2024 00:52:58 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EED842D2A; Fri, 29 Mar 2024 00:52:22 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 5C0F540042 for ; Fri, 29 Mar 2024 00:52:13 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6e7425a6714so1347980b3a.0 for ; Thu, 28 Mar 2024 16:52:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711669932; x=1712274732; 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=26JyS8a5xAOFLsVay3Kok3WHu0A/W2PjaWn3v8PwBA0=; b=1k+fnV12bTKUuJDYze4R5JC+xJ/DveqNtGqEoquGVLc/dZS/0rVSdQT3yZjuDSl62s 6Zl3PgHuHAN8OGvFoO1NJHXDLVd0z+9CxJwS5atD3r3DebQw0wR5kSTqqhqo//cechJM 8P/XXx3n4qKqLtx7xOkNHWKzZEt3Gi2rgqanIUrDlO764PnkYmn1dOgAqBumdgtPWl3j fwC/lmTT+vW+ZffsdVsG5M7UTG1+EVGO8uUOh4dRh+9aUceIqF6VaTAEPulPQfxU3oGC h6PlAeAxTdhgp8Pj0eNyaIcrHEssl5cvLUukHn7tNOfYx2JRRXTD1QPsqNpLDiqqBJmv ZgiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711669932; x=1712274732; 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=26JyS8a5xAOFLsVay3Kok3WHu0A/W2PjaWn3v8PwBA0=; b=kyjwd33AoajLXnoAD1Wb1jyLFs6hqvxBVQ2HxT7eepHExHduj4C0/elkC1FstmaHxS ZAfTeG456pJG2qiSDZbd8ToPsOD2TIDxtWs6aLKDLOyM18L/ofy5ZDyqdNDHYyXj7QNW ZdYZlEq0LI3dhiVhYllIiQMmnuyeVCR4PJIFbBuDz12t7coYN7RjDS/4WmatygwKYBPn PLrJpXRil/3j1gQXZA/dsrWV/R4kg/SE0hsADlOeOySU8ARGlVLfTgceEF89GiQ5LnRp BTjxKDFuXsapHhvxpfwPqdUMIGGO/YYsC3SMZUfzSyRS++Ll2fqzUnxcWs6qkCWNTFW1 W+YA== X-Gm-Message-State: AOJu0YwXTAwE9FHWxtZ6GAGkUyHArgAzB9Cm3DaI5N485hXVCdgL27dv 4fTu2A0KkFvhKC9rI+AXpgMnqzx61vtcQm0MxpHLLZ8axI74lJMJaNiG1P88ZCdlqcjpEDdyfxo 8 X-Google-Smtp-Source: AGHT+IFDfjn5/pe0ALaeb8l0jNH5ZjWKoXUpibLlP7hnzMMK5a6Zj9ScsIVtfEcK7x8G1op30QqXSA== X-Received: by 2002:a05:6a00:4656:b0:6ea:b7b1:ef26 with SMTP id kp22-20020a056a00465600b006eab7b1ef26mr898452pfb.26.1711669932552; Thu, 28 Mar 2024 16:52:12 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id g21-20020a631115000000b005df58c83e89sm1875650pgl.84.2024.03.28.16.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Mar 2024 16:52:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v18 07/15] eal: change rte_exit() output to match rte_log() Date: Thu, 28 Mar 2024 16:49:37 -0700 Message-ID: <20240328235156.5768-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240328235156.5768-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240328235156.5768-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 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 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