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 0EDB4459C3; Wed, 18 Sep 2024 06:59:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EE24842D78; Wed, 18 Sep 2024 06:58:51 +0200 (CEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by mails.dpdk.org (Postfix) with ESMTP id 4B319427C7 for ; Wed, 18 Sep 2024 06:58:45 +0200 (CEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2053f6b8201so60884595ad.2 for ; Tue, 17 Sep 2024 21:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726635524; x=1727240324; 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=B30VFV+4OQMcXu08l6wwjxwPMbB/d4F6z8QFVK6rTJ4=; b=SASwUh8lUXojcgMMKjkPvY4Xlolaj4EzZobDMsPH0xqQVfC0zb1qx6Sg+keCU3LCzy U0ryIvhRspcs4m/MUm0H8n5491LHZS6iVXgBbe4K/WvlqlrM7xr5/TjuZ1Qc1yeuDd98 UZo9Oyu6X2AuPG7w5zclH/jnlw4rveIkK5opOOFo8Gnl0ju56T2Nggl3I21OGnabiCrZ 7y7EXt+Wfxtshgm2Wnub/rtdKy0Q3NyTiwF//Jt5VdjgCVCBKYzmJvh2dFKtP9tzv11P 1qsJvgiGjxVJtrXRsWNcPO9IuicU6eHdmSNSCkb2i96jldt8ahS17RhbXuTHtmFJFrZ4 QygQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726635524; x=1727240324; 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=B30VFV+4OQMcXu08l6wwjxwPMbB/d4F6z8QFVK6rTJ4=; b=L80Hxpr6gKSGlbbECeuI1lHOiFF6EaxaJQ10x1NCIm+Q8TeENulcmrSTQRo99iAbcZ XhIB093/ERb2Gcr/VKnVF0EqS/k6kxZOmauF0xfDui6MXlWqB5rwu/bwGM4sS9YknDkj HzX6pLz2vtnFdBZPOcSDdpPiIOIIkejxNToeXYOozH+2XAbaZPfbLkNb1BO2IDOA1uxx UQWuseKuiSzdSJSnJf/L2X8+ofuPmdkBD26rkaDnU6cUPeotvd971vcj1wptRUKy/W51 pMwfVQjqO4KfwbQ0Q+n9IOnRiyFO527zjqiCQGJu1D6/rpLivp8WhexeGsUaEODhcdwA ZARw== X-Gm-Message-State: AOJu0YwyYb472WtnszGoODghQxTYRiaoLsKAOisDXV7pZcwUYKVesnjH XaNaHiTKRBsCMdU8t23aylitV9yWl6uLMmUUVkdKaLpVQXCv/xHSS1yLq3AZMER4N0FQ+Yt9qmy u X-Google-Smtp-Source: AGHT+IFQXJO2XspByWCAKHN6XXgtYAkg/GaKwGGS0pn8d3tY2e/bp4M2ipns/iX3tYV5gJmkrVxvEg== X-Received: by 2002:a17:902:d4c9:b0:202:435b:211a with SMTP id d9443c01a7336-2076e3086damr307241405ad.12.1726635524485; Tue, 17 Sep 2024 21:58:44 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794746d76sm57179245ad.292.2024.09.17.21.58.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 21:58:44 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v23 06/15] eal: change rte_exit() output to match rte_log() Date: Tue, 17 Sep 2024 21:56:11 -0700 Message-ID: <20240918045830.3798-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240918045830.3798-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240918045830.3798-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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 Acked-by: Morten Brørup --- 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.45.2