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 616FE43CEE; Mon, 18 Mar 2024 23:05:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3FD1640A79; Mon, 18 Mar 2024 23:04:50 +0100 (CET) Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) by mails.dpdk.org (Postfix) with ESMTP id E303640A6E for ; Mon, 18 Mar 2024 23:04:47 +0100 (CET) Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-6e7224cb3f2so1116993b3a.1 for ; Mon, 18 Mar 2024 15:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1710799487; x=1711404287; 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=h26vCz6XxR4JOVNqKDtIA/aTK4iPIJYOD/gXXJVesxQ=; b=rB0bjqdo14vmEsGmQZkiZyzF82a4e4KkjPFJWZkyFk2CrpeVXVAxjPmJ2jhvEs9YKM 4HDJYdrbcsXzwAN6V8KyJKq1nyG9zGgm7xQcpcyuPY0Po7OIKY6V3OJ4s/NhYGUleYgi bnEdbUamkkXQpOockx5YJfiMvxNmRn4VZba6p7KrmADwBwG4CmSf433lgobl6R78MfaW 1UALFG9KByzwq10BEc0AEd1S8kINUs6c/ja9xbhdUm/Sv5UE1BfLA/0LUBjq8jzqqxpd ucaFtQO5h3SpFijc2uoAWH4WkQDVHiF7mxQTZcos7Bv45VOfZUl2tLHb0tCVQvahUuWF oB4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710799487; x=1711404287; 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=h26vCz6XxR4JOVNqKDtIA/aTK4iPIJYOD/gXXJVesxQ=; b=I76z6JEjvWlmHjK/MZyzs+cYNSCPHgVdLUrDoIIOK/FYCxbeSSDyswI/FqjinTCWLU 7kAhb4CM4bCwrzI3HErf/vH2Ql0QkK94fvH+fjEZAnMUSi/284jTgZqUZRXXP9axCmOO 7E/InwfVlk2W7GXU2aV2O5yXolmdUsHqeRlIT1aT4pIN/Fx+Nr7atUwr5cYer7jP8dc3 LMmAAjMI7wO1hVTZxzZzbst+SnJWb4onJ6L9oNlDhpKX1X6cF1OaU/0ahGxRCpiEhCAV xvANz1olzJdZ+WcNCNX6O4Uqc+uqZcV/EnInlSw5f9cH3HfZc89UxCMMBCMtPylfGTr4 Fn4w== X-Gm-Message-State: AOJu0Yz4Ex1HRMYnDWKKDwJS/meCxr2MgDEHp5+Eoc1vtyTWISu0WlVs c2FVFG2oWwDIBg1SROTWTny8UmuE2k2hJRQgttaodWLCA7D6Ce4aybi/oqXQw+jyQ0h0+9cB9l7 O X-Google-Smtp-Source: AGHT+IGG7Mhk7kuaVzqv+0GJ6n5abA1/SkcPzn1eVlUEutzuhD1Nw/3IJIIj2coCrEpjZD6Auv7ITw== X-Received: by 2002:a05:6a20:ce47:b0:1a3:4b24:149a with SMTP id id7-20020a056a20ce4700b001a34b24149amr1256954pzb.29.1710799487098; Mon, 18 Mar 2024 15:04:47 -0700 (PDT) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id y6-20020a637d06000000b005dc88b232a5sm7747140pgc.26.2024.03.18.15.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 15:04:46 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v9 3/5] eal: initialize logging before plugins Date: Mon, 18 Mar 2024 15:02:59 -0700 Message-ID: <20240318220432.7486-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240318220432.7486-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240318220432.7486-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 Want to make sure that as many log messages as possible get added with the real log stream. Signed-off-by: Stephen Hemminger --- lib/eal/freebsd/eal.c | 14 +++++++------- lib/eal/linux/eal.c | 16 ++++++++-------- lib/eal/unix/eal_unix_log.c | 0 3 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 lib/eal/unix/eal_unix_log.c diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 94927472edfe..6f0080c4d8c6 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -593,6 +593,13 @@ rte_eal_init(int argc, char **argv) internal_conf->in_memory = false; } + if (eal_log_init(getprogname(), internal_conf->syslog_facility) < 0) { + rte_eal_init_alert("Cannot init logging."); + rte_errno = ENOMEM; + rte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed); + return -1; + } + if (eal_plugins_init() < 0) { rte_eal_init_alert("Cannot init plugins"); rte_errno = EINVAL; @@ -719,13 +726,6 @@ rte_eal_init(int argc, char **argv) #endif } - if (eal_log_init(getprogname(), internal_conf->syslog_facility) < 0) { - rte_eal_init_alert("Cannot init logging."); - rte_errno = ENOMEM; - rte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed); - return -1; - } - /* in secondary processes, memory init may allocate additional fbarrays * not present in primary processes, so to avoid any potential issues, * initialize memzones first. diff --git a/lib/eal/linux/eal.c b/lib/eal/linux/eal.c index bffeb1f34eb9..e24f24b1b0ce 100644 --- a/lib/eal/linux/eal.c +++ b/lib/eal/linux/eal.c @@ -973,6 +973,14 @@ rte_eal_init(int argc, char **argv) return -1; } + if (eal_log_init(program_invocation_short_name, + internal_conf->syslog_facility) < 0) { + rte_eal_init_alert("Cannot init logging."); + rte_errno = ENOMEM; + rte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed); + return -1; + } + if (eal_plugins_init() < 0) { rte_eal_init_alert("Cannot init plugins"); rte_errno = EINVAL; @@ -1107,14 +1115,6 @@ rte_eal_init(int argc, char **argv) #endif } - if (eal_log_init(program_invocation_short_name, - internal_conf->syslog_facility) < 0) { - rte_eal_init_alert("Cannot init logging."); - rte_errno = ENOMEM; - rte_atomic_store_explicit(&run_once, 0, rte_memory_order_relaxed); - return -1; - } - #ifdef VFIO_PRESENT if (rte_eal_vfio_setup() < 0) { rte_eal_init_alert("Cannot init VFIO"); diff --git a/lib/eal/unix/eal_unix_log.c b/lib/eal/unix/eal_unix_log.c new file mode 100644 index 000000000000..e69de29bb2d1 -- 2.43.0