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 B361243D49; Mon, 25 Mar 2024 21:54:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E84840E01; Mon, 25 Mar 2024 21:54:26 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 088F940DC9 for ; Mon, 25 Mar 2024 21:54:22 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1de0f92e649so33573235ad.0 for ; Mon, 25 Mar 2024 13:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711400061; x=1712004861; 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=YrntsEdpEVyL47oWwHuqFl6TxCojmU46YHLV/zgnqOCBJT+fvw6cRYnGJ+0pfo60Ir FaEqqx8GIV6dPCNqph7c0Rau9iE2W6As06rGK65uR3Vl/0eAvN9tEADs2kHGniVxLSCc lAYxk1tz2HBYsDD2XS+MxMg9oBAi7GOj3m2SwA0ltmD0YeLpF9XV0S85NxGS5sP+UNHz WbYZyYBTdFcaZSbGG6lljZHoXpShVrxjhIEV4msT4vfFAfUovXnd4Dtji2B70mxxExL8 PF7l/TWCbBClHuppDR+VOrC+2NNtnxs2oDNzDJ92iZfjGZErXzzg/ga63Rdz85ai860f PkIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711400061; x=1712004861; 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=lS+KvMxd5fZ+xPMvknVQh4OOf60EGE4vQiHWdVRWp/No48EhmE6Ng+G/iKx4FoSyYc omPYpauIckzwUCmilORSx6Ic2BCsqSnK0lO9FcN+Co9J3y+zHdwXw0E6YdzOXk5R6nE8 ShTi42QVu/DqGAfwoSXFGtYy0PfSyJXl58yJem1MVHPeOQ3TQr1l/UuJGZ25EWmZEmYd QxJxss+aNyNXbmLI3y100YdAyqbXbnrWVb1dUi0F8FyHAPN3YBkW8Ayj+vk+91SZtEdD bp8+5O0ii0m6b0vvV3fH73i0hbaoCfGY5epDbSOJn6SSodOfxC5UT/KTzqi88i9Aasv5 NAdA== X-Gm-Message-State: AOJu0YyQQdNuU8un+UE7O34GPh26dtBJa4WCZnW/3LkqV4lXGalcLxo8 57Yr5iIW6HxdiWECgNSnhLLSSGigCZhvXN+uMLe//zr2v6LpPR33NDTdUyZx4/aak+9/KZO4QLA l X-Google-Smtp-Source: AGHT+IEeL9pZhpam8vOao1u0mYWfDq0I9aAiKtGdnXaSVs8ACq0nSZwTblQeh00purQzr4CLzjR15w== X-Received: by 2002:a17:902:7208:b0:1e0:b1a7:473e with SMTP id ba8-20020a170902720800b001e0b1a7473emr776969plb.67.1711400061104; Mon, 25 Mar 2024 13:54:21 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id b18-20020a170903229200b001e0b5eee802sm3164487plh.123.2024.03.25.13.54.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 13:54:20 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v12 05/14] eal: change rte_exit() output to match rte_log() Date: Mon, 25 Mar 2024 13:47:02 -0700 Message-ID: <20240325205405.669897-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325205405.669897-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240325205405.669897-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