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 9691744136; Tue, 4 Jun 2024 02:48:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81F25432E6; Tue, 4 Jun 2024 02:47:54 +0200 (CEST) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id C7F50432C8 for ; Tue, 4 Jun 2024 02:47:49 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1f612d7b0f5so31429035ad.0 for ; Mon, 03 Jun 2024 17:47:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1717462069; x=1718066869; 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=MKHbawKXQrEt5skwulEhpJotDioZTTmD5jtzSpifDFHQ0euiKLvET9WXHQntYtoFmH sK53zngqtWIBkJcdX3JM4KdbS72hPYNGNOt927nq1imdbsobVo9qrc8tJbIPPTZ3hClD hDE5e5EGsz9jFPDR7dFRzI6jI7bO0PLT5sPbifiuOp/BoAZS3NhZc/toluujbHimM1xh OffwiE6EWSX4Nprmx1bL+FYp6+bFlwHiDgqvFGkNfwW3MAvBD9blY62qyqTMQ2deHaN4 WhlPOHkiRcNraqW2z5iaVSNhQzj/JZSD4Oxoyqu3jVkGgIEtlINaiBK1HhvEhfX1dLKu d2Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717462069; x=1718066869; 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=lMQVwB6ZEPryw6VKZVQySUykb868qZAOsShVrbzxmHzhO0lZrdXUWdxhtBa8Jjyufb DFaVJlr4KwE7XKBHh3PegMpFaXB8Jht0pOgHK2XCq975zRfcBkqFELK6EN6etkK8ZJej 4vkhpE4dHb+Cz7HaGzhuUYiI562jrhEJxsn5PaCn6lNKIeXA6JBzpZGGNVB3grqZDzU6 9+KYlA51uIYRs0UUjC1Q2M6iykb+FEaqOoWXefuo4/1Z0KZkItHLptBUyHk0JRBTv4wf N+pXlzXE2DwynF0KPGyVQi9b9y3zUrOEglmEK1OS/DZ9wVkkUTa4CxgYRf7gT5kI3ojn U5Hw== X-Gm-Message-State: AOJu0YyNhzcyG/KMqmOrWjJS9amtQ4OdTNAmGUdBYmwiYEE7B06q4saq TYbXneb68UWhPISeNmThkHK7kQ9OnV3G/OM4IoE5TNYmS1HVtxWG/Bi8qRuBgwTp7wqwaHsCCo6 9 X-Google-Smtp-Source: AGHT+IFCBtj7fYuR3okCqCZEU5/bYop6s/4PsryKRKN7sbqDRAfT76gVk1krHqP4Vesjtu4ox6jhbg== X-Received: by 2002:a17:902:d4c2:b0:1f6:6c74:e599 with SMTP id d9443c01a7336-1f6937d0b41mr19112645ad.19.1717462068906; Mon, 03 Jun 2024 17:47:48 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f6323e9aa7sm70381125ad.192.2024.06.03.17.47.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 17:47:48 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v21 06/14] eal: change rte_exit() output to match rte_log() Date: Mon, 3 Jun 2024 17:44:54 -0700 Message-ID: <20240604004731.6654-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240604004731.6654-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240604004731.6654-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