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 255D843D55; Wed, 27 Mar 2024 17:48:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 93ABC42830; Wed, 27 Mar 2024 17:47:47 +0100 (CET) Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by mails.dpdk.org (Postfix) with ESMTP id 4E561410E3 for ; Wed, 27 Mar 2024 17:47:42 +0100 (CET) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-6e6fb9a494aso94601b3a.0 for ; Wed, 27 Mar 2024 09:47:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711558061; x=1712162861; 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=oLG7VPi14UvWYVk3aGh7lj8Ghj5O66kgZqk3Rk0fLAD/1Zirwr0MzrjyF1R7U8BUjR FMTqooTFyVqKZ1vPuaWXIjKaS1yX+Pk3mov8IHAibncUwfPRVOun385Fshr3gZTx8e/f UWWa3KdrN8tClHtFYERK9JsPQWVhoRotsE4ee0VLjRPfATT6smHwwtoF7pXyJHiNt7cb qOmOHlCm4rpNkP1r8F+Fh9rT/9ZbjcCWXL2G6M8cizV4FIDI+E7rlAYTGLiUgGsnf8xb FA5AWpiErlTV6oJ+rL16ZcSMoC0wj3iFTWOefLn8r3sQSWPnyo2wsZbz5oFKCoyO/6ka /p8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711558061; x=1712162861; 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=Z61FIaDXwj3qfEp1HnAyu92cwSqHmEIR6bRZvRz71UYMGE4NQjQKozRnXwx9DCK3ro bO30oGFGSvOJjHURHe6wzgkmjIMqqeNM8g5kHaqXgK9inTIKqq/o+WpxjfUNnSfo0M7r Vlni8qecm7At+TR2mZtk099Ukey/yMJ4BO6I1pK4nsgbBS9Xh8Jett4FCzJhITCPIBN4 BRI14+60Mv/QwB3y3HX1Qt7PE06Xwl151Bq3m1wOT1JukAN+3sYNk5NHPvBHjyxau27T 8TMemL4OLTBAXMYcFydp3IBwJ3VaagdOmXlZ8QagRwR7GYqld7eJPARju1e/utAxuwIL 1nXQ== X-Gm-Message-State: AOJu0Ywyu2Hiti/suPSs0EMZZnKUjwTSW/H7GuSBoIHqjH4LYXB737CX x5MzTKzmU0oHsgsOUhbb1Du8rQZ6RJQXTPD7t/KqpaEsE5fO+fS88rChL4qZQI21hhuUjUoQAIc m X-Google-Smtp-Source: AGHT+IFtK117H8tpJZOlFu6czXRngkLIhYRlgUHgVZ3lGYK15BgHWxOrNh0zsScSOQQlZWjFL9D7Tw== X-Received: by 2002:a05:6a20:bca9:b0:1a3:df1a:271e with SMTP id fx41-20020a056a20bca900b001a3df1a271emr481164pzb.19.1711558061535; Wed, 27 Mar 2024 09:47:41 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id a33-20020a056a0011e100b006e580678dfbsm5160873pfu.193.2024.03.27.09.47.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:47:41 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v16 07/15] eal: change rte_exit() output to match rte_log() Date: Wed, 27 Mar 2024 09:45:25 -0700 Message-ID: <20240327164726.68732-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240327164726.68732-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240327164726.68732-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