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 1127743D17; Thu, 21 Mar 2024 17:19:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E955F42E19; Thu, 21 Mar 2024 17:19:21 +0100 (CET) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by mails.dpdk.org (Postfix) with ESMTP id 1ACA942E05 for ; Thu, 21 Mar 2024 17:19:20 +0100 (CET) Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-42a0ba5098bso8578211cf.0 for ; Thu, 21 Mar 2024 09:19:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711037959; x=1711642759; 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=OchZbGiqZYOKIHTgrKGiYo+f+aYAEtmo0dzG4HlbOOM=; b=iAQ7QrurP7mVx6kh1tMEjYsjCLcCukZ2W4UHScYIGjhATXQzhNwAB1ok5BrfdLibwF fEeWiEPfERHa4z8rhQOSYRs2NioHkHJM92K5teWPLdX96kF9sfBULOmS2PLrAjsiq5OU 2Gel/vfGZY+s4Co3htkAxuDxhK1U5+6jvteRocZDASiBayr3iIs/5fgmdtK3qkGBoTTR HjCdhWSeXaHxGMsSatj+ecSSFBPdXGvReMZAaEZc+1mOjt8L6W+KrZb7QRUJMzt82CJs Lbh9d21ftr0TyXH2JcEpvL747vTvVUzEg3yO8qnOYc92eZyBcOHNhv1gkQuSRZsDe0dO M7aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711037959; x=1711642759; 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=OchZbGiqZYOKIHTgrKGiYo+f+aYAEtmo0dzG4HlbOOM=; b=J5AeuPjZF+TlNo606fUifknR2kyq7be53CVngiJJ5i4bOQyE0Vi9TWIvgQGqOAQlBJ ErrikIOMTd6we52vOJ7CuWWSHB51lMzYUVjAy1QlCiA0efIeXju1eCzFoGZTgAMQYCGz ZEyG0ahhGLAIdoKU4oYzbkhaO0e5AAKbQv3kKOB1NmiudePxzvsh1EQfTqGYo0TdGYck TWLNDf+wyEUjEMpHldHlHihBayNyMCiojO9aIuQUeSY3gtartHbBBgVibDGFsibArxVx SLnoRyPz46wM4sUOyTANHwsUnojHHB94+pQA5YIBlC06u2CvwloJYcUm7KKpBGWUy+qo vteg== X-Gm-Message-State: AOJu0YxBGY6dslU4hRKL7YTbkhNWzPJwha33gInpg6znU9cUYq6A84in LuTQXi5xRiq5RRfwpo0oABGbrkhVX8lBNnKA5t2T4v7nBy7v27j1K4OisyMrGxXFtNo7tWtaZ4Z S X-Google-Smtp-Source: AGHT+IF/FnG2u4VU5tIKfxowIopkyowg6LfbVqrj2H5GZvt02yKJvab7NRbLaMKlsIP+k6DyoPzg+Q== X-Received: by 2002:a05:6358:99a6:b0:17b:b52c:c121 with SMTP id j38-20020a05635899a600b0017bb52cc121mr10487051rwb.13.1711037521063; Thu, 21 Mar 2024 09:12:01 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id w62-20020a638241000000b005e485fbd455sm41815pgd.45.2024.03.21.09.12.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:12:00 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v10 06/10] eal: change rte_exit() output to match rte_log() Date: Thu, 21 Mar 2024 09:00:22 -0700 Message-ID: <20240321161146.340421-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240321161146.340421-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240321161146.340421-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 3e77995896d5..568883830f20 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