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 E29F543D5B; Wed, 27 Mar 2024 01:30:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 06E7242D26; Wed, 27 Mar 2024 01:29:22 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id A08894113D for ; Wed, 27 Mar 2024 01:29:15 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6e703e0e5deso4471092b3a.3 for ; Tue, 26 Mar 2024 17:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711499355; x=1712104155; 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=WymigXrHVEZzpyQ6kflD7zIAR9R4mf4VkX2hJ63oYwLRBBJhCme0xdcMa+O98FAGhX Tfq+uuRsDxrBrp6bGDDAZLghOafgJ+ORIlvyrRyj980pmW7NmjlJPp0+0symDmaOQWwe PHodtGBS1fWTT3ei+/sCwYhbkVYoMTxskaVTVi1W+j0aEPsHjmjNsZ17GOjx/PhWZqvZ +bulMJTrTCKOoCbQocWHw68RSkR2DvjZvhDTkxvUtkqfY67JayrCYr6/v4JUHvKxGO6e K32XEdE5Qi2mwfIrBX/5KQrMineJ+jm7v4PAsZHM6FI/KqgKKzGzAox+7NwaLAVEyJ49 LrnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711499355; x=1712104155; 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=dW3MTJkwC2qsPHhUTeytAk+IkBN0qFZKHkYwqihsWzee9DiwMm0TSS3FGq8tudBGek L4UT8d9IzxQhMHcPn50xbbCFXnbwUzs4EHq41OM+3/KLbFKVFz7aB2W5ADK4Vf4XpAkO 8u/+YWjJXmM2ZpgadwrnuE06/RSYRDzG/4wp6gCuWyPKDeYRY+ZyZLUmh2/pSv5qVLYn mPdiPYx6r6dXoxbis0XsElMeVCpSyZmkZ9Fhw6or3lpETrdFwA13J9KQKIEF628SEcaR 4UvcvFTednKXk66vOrgrrAllz0QFpAvJ73EiDkrrqVFxeQTK/YqQQP+hDreHr9LLMrMD m0gQ== X-Gm-Message-State: AOJu0YxsGOvpMM0wyIY7Eq8xt1gu1ch8SIRxp/Fa9cPU9yOTPXJIlgd7 Fbxyw7KhnzITkWTG/CLHnX1eKO3tMoC+xKfeC6db8GLZlyq3BFfN/Lkjx5WVc80/AW+Fi5jEMrh / X-Google-Smtp-Source: AGHT+IHnItVOiGjZeYVK/k+28YX0bSioWztqUwNFJyP35iJ5qeW7KoY94PtAXngonXAHeTpj17FPrg== X-Received: by 2002:a05:6a21:788e:b0:1a3:a639:ef7c with SMTP id bf14-20020a056a21788e00b001a3a639ef7cmr1640584pzc.1.1711499354848; Tue, 26 Mar 2024 17:29:14 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id w15-20020a17090ad60f00b002a04eef22c5sm225383pju.44.2024.03.26.17.29.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 17:29:14 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v15 07/15] eal: change rte_exit() output to match rte_log() Date: Tue, 26 Mar 2024 17:27:06 -0700 Message-ID: <20240327002859.203006-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240327002859.203006-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240327002859.203006-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