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 33A1143D4E; Tue, 26 Mar 2024 02:59:11 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE5FB40E03; Tue, 26 Mar 2024 02:58:48 +0100 (CET) Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) by mails.dpdk.org (Postfix) with ESMTP id 9F69F40A7F for ; Tue, 26 Mar 2024 02:58:43 +0100 (CET) Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-5a470320194so2656994eaf.3 for ; Mon, 25 Mar 2024 18:58:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711418323; x=1712023123; 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=zmgn2TMY0pSmt2vzjAmFWex3Ac/CzGg0VZQ9Pce9n7s=; b=to3eoP4HY8GfHipxOPYzJb8A95ZvbN8/9BygwujkCG+2ipf7Km5jc1Q3tovZ+iBjiI kN/nEGqS8lf8j2PLT/GogZ4Mz0oi1QI0pax/yGDXkBFbJ/yW8ECvS60xw6F9isW0Dt9y +L5q8m+/lccDbLRUjdvGYn7ijFI2c5h20EsHENPyeujXoqeAKH7dw0DuOmumEkApadeT H+bO2kOoNwcYogQZiamIBKH+zCJENYJ5l9OLS/l7c3QCe+Gn2mQB0t4rSQmYkVoKp/MS AZSFKvw+NwzEECpkjNG6sgSN/fhSlzi+zyzhY+eBksc2B/WGXQdUHfqTGmVN4KUqERDG xbRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711418323; x=1712023123; 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=zmgn2TMY0pSmt2vzjAmFWex3Ac/CzGg0VZQ9Pce9n7s=; b=M0bDMQsmvMN9nkNUYZZJ5csIYblTUFtKnJeXNR/Q+iRS9SzIyrl5FA7y7l4+9slwCm bFJxhJhutf4sitTe1yquw2AqS/V0p/mufTCn1SG1icStMCv8fPQDvRYtCca+s2K9UVMI zt9lkKCGYN2/86+HcYZK+Zk7DwLpe7peTEKIqea0myvq5zHJjs851UPn7qHx0DMqBbLS ojPQJii7+WKIR4gZBRx6N8ymvPr0q7bMX1HQ/ULP8VOqRwdtxKnpRAw5jlBREIiQaENz ddaoRvYSpU88+tsjCeGY8CBr4UacWRwCGy7g8SDAsp+VfimuKgFPJ5CyhcsYRXIPnLry JEpw== X-Gm-Message-State: AOJu0YyI/1aTPSlfckDK8Yh4nmBFvpzE4WAmT+tf9MY2zSlrR1lQZRfl LaoNUH7HrswfQ2s1Ugz0knk5cM5y50FNmxBNzNjRyxJJ8fnLdRqTDgW1ClWUpXBqCmeL/HYcWaL e X-Google-Smtp-Source: AGHT+IHQ/8iRVuQk0enP1qzdMJ80bTg5Kvb7fcTVI74IfhFvwuytvX2JEsx+djWw4YnP+R8y1Iu2bw== X-Received: by 2002:a05:6358:2621:b0:17e:7c4b:bb56 with SMTP id l33-20020a056358262100b0017e7c4bbb56mr10158195rwc.15.1711418322902; Mon, 25 Mar 2024 18:58:42 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id u19-20020a63d353000000b005dc88b232a5sm6571541pgi.26.2024.03.25.18.58.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 18:58:42 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v13 05/11] eal: change rte_exit() output to match rte_log() Date: Mon, 25 Mar 2024 18:57:00 -0700 Message-ID: <20240326015827.825648-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240326015827.825648-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240326015827.825648-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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/eal/common/eal_common_debug.c b/lib/eal/common/eal_common_debug.c index 3e77995896..71bb5a7d34 100644 --- a/lib/eal/common/eal_common_debug.c +++ b/lib/eal/common/eal_common_debug.c @@ -34,17 +34,17 @@ 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); + if (vasprintf(&msg, format, ap) > 0) + rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_EAL, "EAL: Cause - %s", msg); va_end(ap); 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