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 ECA9F459C0; Tue, 17 Sep 2024 22:42:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A080B427E6; Tue, 17 Sep 2024 22:42:00 +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 26677427BA for ; Tue, 17 Sep 2024 22:41:54 +0200 (CEST) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-20551e2f1f8so55384185ad.2 for ; Tue, 17 Sep 2024 13:41:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1726605713; x=1727210513; 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=nj0wR+hh3/2MTya1Dh7GKedmNW8dX4rmAuRCv2CwzVT7iIDN5vjoRPOELNB7V+qMk8 oc3j2jHFwhvSW4PDtLFGJ49EhoXjlByv0i0dFvxyMDOeRxm0Ob9cl3ZCM02ds5ggJO3U 0vaVCFwlv1k5APtBR7UJegDRE46FaMWiZdovPGZOBnmTnfqL+xIBWF/MNVw9PoOLM4D1 ZQcYGUJMqRssfb+1DUCzMjQFbDuM+nbKywFmwnI7F9eZYxlNJHTcWVFafEZ6WXgvZh/3 7jC1fvY6yKaI45Fdb801AKdLbdP+oXhRt1QW2YZNXLHtfbY3627EQf/ZCRBxJLloobaq DobA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726605713; x=1727210513; 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=jEmFYwO+AQVmA2xr+f+1NRPIY8Y2HbzRetL2zNdmMBG9Cu7aqwr9BHYA4yE5e5TyZd 2mh2RoIKUNppDwLC5JeXln5fw55ukZQxDgSfjpCYDDmZU4ZPCaSuhApRm+b+CIRM3OWz kh3U0nrvwpWly6VDwdvvtYmLZxP+SnY65kVPwUfmtzi5ZfCKkAlOdSPCprmmqzd9ll0N kFk+/iDJkA+pJdb6vGnKZTUCIWCSksIMHN7CxyHi0U3XciyhACVJtR0THvXFjy4sdDZZ fFmUBX2W1+VGCTLybiv18tkXK98MsY7FWSZ/0mxQPJf/bPeDIUOVkT5tGK+axdDfyIhQ jNcg== X-Gm-Message-State: AOJu0YzNSxgc+wSIngKVf3lwUfSyRBtylO6Vu7DJxkq0j+WjSNQwXrke ZYJrd4NQ1VsXUmz5VUdIxSsdvoEPbdCmxIg3pdfZ2Fa0AYTgUeTwUn8Lwl560hAWmlcy33zaICh q X-Google-Smtp-Source: AGHT+IG766ZLzsjbF8SlpzT4NKnh1bTAdzOiyiHx1WPuaQZjaNU+Bv8MnhPIfs4qDGc8+3I3JjXbNw== X-Received: by 2002:a17:902:e882:b0:202:2d:c87 with SMTP id d9443c01a7336-20781b47304mr252376295ad.12.1726605713338; Tue, 17 Sep 2024 13:41:53 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20794731afasm53830425ad.272.2024.09.17.13.41.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Sep 2024 13:41:53 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , =?UTF-8?q?Morten=20Br=C3=B8rup?= Subject: [PATCH v22 06/15] eal: change rte_exit() output to match rte_log() Date: Tue, 17 Sep 2024 13:35:48 -0700 Message-ID: <20240917203828.414701-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240917203828.414701-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240917203828.414701-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