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 82A0143D36; Sun, 24 Mar 2024 03:41:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8FDD04064E; Sun, 24 Mar 2024 03:41:29 +0100 (CET) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) by mails.dpdk.org (Postfix) with ESMTP id 0A8B1402E3 for ; Sun, 24 Mar 2024 03:41:24 +0100 (CET) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-29df3333d30so2264893a91.1 for ; Sat, 23 Mar 2024 19:41:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711248083; x=1711852883; 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=w0CHwUH99LTRr59BzckESo/nF08qFhhomDRK57rezcs=; b=1KpBIkMZ2RgCtWpfA/sPyBk8J9ZbioI32dKt/JEp6qcTHooPgYI3vfQYoEbpDcXKUx vvXkIjDhbDbFz/EB3hAb3H2kN9V1vysg2w38ndE/nsPNAz58P7tkhGWd2R87K/cRjyBX hDu2BLVQv+1F0OVhN9ZJBPTMA7aCv9LPkPfCcgVoywuCuvud4uXD41rvuwj6Mnn1yEnk DF7XFenMuDMinICJhdHboIaq/7abGxBntGjfEMeRj9GPopzEnSv6w1UnoaIfqhIbYMFT romgYmgGZMyCkeO63xncImyH5ebBKEL2Q4/Oy5SSkcNrwP/xdljZIq6cO/AW/2JRoSNr Egvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711248083; x=1711852883; 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=w0CHwUH99LTRr59BzckESo/nF08qFhhomDRK57rezcs=; b=O0Cdau+mIrd2bGQbKOdJ+QcNTQGFYW+dOo/YCi+4dqObrGPqTyxWgjGZhVBay2UxTQ DdjY40SlsEYw7THvG0i0JBw6bn2E6eWyHnvv77nk3PvpFbS4bFfYILlhTZJNgHCXtzjc cHjTYTHJOr8DCbJFY/91OX2m+ZQJ1xVZ1SfnlpZuATbkIh+3eG7jDYEn5gQR8ZQwHNRo IuDYuc3URIVcl7OEj11FQpXATpE5HEV53brcML60p7OCM5mpNljjPuedV0Wxznncw0hG a5/MI+3eVfTAsoW7xr1NqoGwJh6EhGDOHsoJ0278Pknla2UJOFLTFxWrVJb2kRM2WHsT 0XIg== X-Gm-Message-State: AOJu0YyfX6txxpmATdZxp4SnQJbsTWH+DUKr02QJibKWE3ITpWrMEi9J z8OsClXTIXC3D+k4N1nw3a5dq2omtD9tyGCNya3dIn720W3esS8yziahFeTvtA39wKfXBL+fEUU Y X-Google-Smtp-Source: AGHT+IEcrGZgiXY9dA6MgMMKrxisAQTLMSL4EHT3h00735eZOVAVwGs7guiBAWiZbPBdScoS61iUdQ== X-Received: by 2002:a05:6a20:6013:b0:1a3:7327:2312 with SMTP id r19-20020a056a20601300b001a373272312mr2749848pza.55.1711248083300; Sat, 23 Mar 2024 19:41:23 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id q17-20020a17090311d100b001dc3c4e7a12sm2244980plh.14.2024.03.23.19.41.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 19:41:22 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v11 4/9] eal: change rte_exit() output to match rte_log() Date: Sat, 23 Mar 2024 19:33:26 -0700 Message-ID: <20240324024109.306614-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324024109.306614-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240324024109.306614-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..3f37879144 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 = NULL; 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); + vasprintf(&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