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 ADA7943D85; Sat, 30 Mar 2024 17:45:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 687834067E; Sat, 30 Mar 2024 17:44:56 +0100 (CET) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id 37D93402CC for ; Sat, 30 Mar 2024 17:44:49 +0100 (CET) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5d3907ff128so2173458a12.3 for ; Sat, 30 Mar 2024 09:44:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711817088; x=1712421888; 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=fRmhk+f59GhbuW2UopVoOS3qzLEljlyBAEQA+YtxDY+BP7rBPS9WgHnUr0TujiBO+3 F3hXkLsoSXgW3Up6t7hMTd2vkernK/NeBnHyI+bx3co2Ue/ScIIRLzTjmKEoal00TzQX eKsr/8Mo5KndjydoT90HjkQfIzAcMsEHSX2BmNUYm6X+RBYDsWJn7rzh+QtYT0iMXsJk Ir/xqjZjprVIvkdPU3VLcC4X56Wp+WrxVKg3E2Gb7xLTizp9BB9LdVZTZc2FSSqWF9ZH 41PSUhJ/FMt43K0DXtdKDpW6Bxr//KQoQlny2wjkhI6rVCbLdhgb9d/oy0mFtYq/RqWR O9dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711817088; x=1712421888; 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=W6G0fKqw+QtvF2ReA8xAitmvtUF7Hk+CPzCkn/Yo0eTBomZX1bpcgshifW1oknENmr FdZdhxWu18Q95MbDiAGyafq3hrGl1REbra18ngmD8QphYLIPW8EOlycKxRyI68lCGzoi Sw+OEPt9eQaX0KIuXEGZMYA08f3DlNqperEG9m/iTrC+bi/Bo7w9imm+Hbi6YewyR0IK Y2yTyPzvbgB2DMOjeoaofGQ+CkX6VxVQzgur6KtjB69uzuzXBh18zFC4Ehl3D7eOn+V6 VKzVadeVJgVdYYQF9FmbloAR3Sz7riZMddMDxGVmFQFQYeXsQUzUMnuFMvbziycTNiO4 K2Ew== X-Gm-Message-State: AOJu0Yw+la6Uyx7kYwLqpj1R+YmGGxfzAXVgY7/IKjf40LqWGhDttrRK 6LDcorrV9yl+ESIuQuwu6I4LvBWyR0Ia/wXYQJEwwOlJgie4gtplbtgzN/GdgKgkR7gaN2BMDID B X-Google-Smtp-Source: AGHT+IFZGPW9sRQTpRnRyK0hujsh3378sta95CT0Io4htLYptnhL0bRGOaw1OSio23U5spWefwJz6w== X-Received: by 2002:a17:90a:ac9:b0:29e:d30:5b2c with SMTP id r9-20020a17090a0ac900b0029e0d305b2cmr5329658pje.18.1711817088503; Sat, 30 Mar 2024 09:44:48 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id by1-20020a056a02058100b005dc26144d96sm4192417pgb.75.2024.03.30.09.44.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 09:44:48 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff Subject: [PATCH v20 06/14] eal: change rte_exit() output to match rte_log() Date: Sat, 30 Mar 2024 09:42:17 -0700 Message-ID: <20240330164433.50144-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240330164433.50144-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240330164433.50144-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