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 DE8C043D8B; Sat, 30 Mar 2024 04:05:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 24537410FD; Sat, 30 Mar 2024 04:04:53 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id B651940608 for ; Sat, 30 Mar 2024 04:04:46 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6e709e0c123so2226054b3a.1 for ; Fri, 29 Mar 2024 20:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711767886; x=1712372686; 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=yG7CMRwhrRAqzw5vPUy8ufFOpxTnJiGZNgL1geelQA6P/q2IRKgAvJmDLu9Gv1BpAL 7C6R+QeliGNdlsOC9F3JgnRoSHjUD2vlYTW3KoEAry8NmgkwY8CPNayacAjVbsSAP9fP Lm0SLrttRObVVsSoQg06UOYyK4WS/j0H86f+JaRC8nlMrIcXCoHCav4GnMbRwpUORGng hC0looc0BUbe9LDrxwefb5jXJBKuGbCUiuDgvJ6W8oxaUWlPiSbCSAW5W1VkOqEslTKw /m7UgL/gYdYOe7OQx1q7RbFhQAJ38H01hfBvTjTRmpy94FcfZpitrjU/R8wSweUhqvhy MzXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711767886; x=1712372686; 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=AXNf++IpU1r1SpC/t4zRx20YLxds0sesZN/nqE9TdYnDocICqp7fG3Nac3S19XC6rW AH+zgMBVVucc1AT+G5Atl1MBCqjjbHFVUTXaKvaLjGwxGG7LHD7UyBbWZz5s2/VkZteb 25KbcHZTPfkjgGteGwdwpcA4hFmahvuyhfyj/DddIb/HCT00dq1BoaCMyTWdaGD3PO5M hUi4WMzfVGlulxWxOMphWVs13KqQnW/ki9INNsB5mISEKR94Yx0FvSd9To2ClEhsfTrO C3pJe2bQbT7mAWdYgso6ayTA7V6uTZRGHPmnD4J9hpXUIikWHv+JHGqyudtc95TOlWCo u+/w== X-Gm-Message-State: AOJu0YyTos2EMsSa6dvReD49TLcPNYHDaIbBmdDysbjiD/Ejm+deCwz/ NDwbEqw+yQ9LZnMLyBwfYfVhhOWOWsgtsvqFxdqDsm1QVRsU1TE1j81EzZoJigwHZGiHxE7FB47 7 X-Google-Smtp-Source: AGHT+IFWdb4SA+CIwFY9/I3XsKlfMGcdGNg8sQlkDdQIGTrwSuKH6+1f9KievRBE0S/xIc3NchbPbQ== X-Received: by 2002:a05:6a00:9289:b0:6ea:bb00:dae3 with SMTP id jw9-20020a056a00928900b006eabb00dae3mr4182272pfb.0.1711767885945; Fri, 29 Mar 2024 20:04:45 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id o3-20020a056a00214300b006e6288ef4besm3655486pfk.54.2024.03.29.20.04.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 20:04:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v19 07/15] eal: change rte_exit() output to match rte_log() Date: Fri, 29 Mar 2024 20:00:50 -0700 Message-ID: <20240330030429.4630-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240330030429.4630-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240330030429.4630-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