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 80C2443D5A; Tue, 26 Mar 2024 18:36:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 153864113D; Tue, 26 Mar 2024 18:36:16 +0100 (CET) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 77122410D3 for ; Tue, 26 Mar 2024 18:36:10 +0100 (CET) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6e6b6f86975so3729568b3a.1 for ; Tue, 26 Mar 2024 10:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1711474569; x=1712079369; 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=gy41fnNZEOidULJp4fmzQB/si1whEexsTvFTwG4Y4kZswmbItnbfsj8CyVK+pd1I7/ WWHpVubRCZMrGzCta69x0gTNteQf5vcpbMcuOJ1QGuviWQ1y2+UAB9Pqup2Gs710bhOH /E/GxZeqsKqe1216y+8qUOsw4GEMCkDd0CeA0vWyt3f/+Xotcuj2OSOORYzGJpAwy9/b L+KGHymYG/9/Gh8slcuCnNDLONlEft0QPiRZxOfMRO4WGRIJXr2ry6cQ+UMy7yNq7MkR Xi7CbqpCQGyF7BsurbsEUU1il5zbqg9YxPDmLDASZ28k0yHkObivNFbSgWbYacXmPLTr M08w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711474569; x=1712079369; 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=lOVA/712E4sbJlJKhAGZFgskJyOyhcaO/J46XAhaI5dq2Sg6HttXox9LykpnSu2GBA 80DYpcQea/4OQ5jsKj+J8QTrmkwgr4Qbv2q99Ro2lJZa0aRmIU/cFgrOqsO6PBvcMxOl Knp1ybhiTDJWXxC9svvgu9c9K0vgB5yjEMke2cu8C//9Bd77V9UtIfLfghA6bmRhbFp7 EgTtw3eIn9wven6QvspQ825OFHd3fzTIpmJJVBFy0RXjiwx0WlH8IY6EU7c/ipQxG2AE aLeNS0FpxrUDE5+oIDX0HeLz6vx82/qlHigo4y7xa2Qt3gf7mwUoy6NNtcyAN5ze+70B zgNA== X-Gm-Message-State: AOJu0Yx6i9prm7PO+kXC4DMpFgeVnttjNcpoON5Lea/SKP+oVwr1cYR5 e7CU7G9FT3WXKIBI4Xh+D0bZ9NUrrNa3Q2VQA+pCNrUE/zUFuLxe686zdSna16NN2Jq2sNzBBfI 5 X-Google-Smtp-Source: AGHT+IG7R2De2rQenbHh+knaBLL6WaEtIWt6kFH1GAvxqamWZobxNQwuMZ4RZAg0QXUYHD1kO0xm5w== X-Received: by 2002:a05:6a00:701e:b0:6ea:c04c:71cb with SMTP id lf30-20020a056a00701e00b006eac04c71cbmr1200172pfb.3.1711474569671; Tue, 26 Mar 2024 10:36:09 -0700 (PDT) Received: from hermes.local (204-195-123-203.wavecable.com. [204.195.123.203]) by smtp.gmail.com with ESMTPSA id u6-20020aa78386000000b006e58da8bb6asm6205546pfm.132.2024.03.26.10.36.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 10:36:09 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v14 07/15] eal: change rte_exit() output to match rte_log() Date: Tue, 26 Mar 2024 10:34:27 -0700 Message-ID: <20240326173552.97249-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240326173552.97249-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240326173552.97249-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