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 E39D443CE8; Mon, 18 Mar 2024 19:33:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7A7B540DCD; Mon, 18 Mar 2024 19:32:54 +0100 (CET) Received: from mail-oi1-f179.google.com (mail-oi1-f179.google.com [209.85.167.179]) by mails.dpdk.org (Postfix) with ESMTP id E66F0406B4 for ; Mon, 18 Mar 2024 19:32:48 +0100 (CET) Received: by mail-oi1-f179.google.com with SMTP id 5614622812f47-3c19aaedfdaso2635673b6e.2 for ; Mon, 18 Mar 2024 11:32:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1710786768; x=1711391568; 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=3FYikwK1xwpaJxKVUawI2osEKSAMSAZcBjVrL37SoHo=; b=YdVGC2BItv4sF20G0l+ULP7m1CTnU+STnP8h1cDjCSrRgXgTocukzcRE2ZRPk+iqwI AnUvw+QQya0lOA4XNTrVPCl29WIf4UkwbkEE8c4ZKg1itUziVduP5Fb91A1C6UOMRkhW KrWL1nVaxOvEq3IbI9Hbb1V58OiZLiH7iJQsCqzxZvwpZ1ZIiwuv8bPGfZoxL2ere4YA elsa22Q4phW14Zf+lCtvaUVR4hNvP053FNrHErx1QEZIgBVFHUjGzS7CtGIJei5zx0fd xhGMi4Pc3gYSBaG52aHztIRsgJwDm3VBdamVT0ZE5F6NPrUs1IeDmbQv/j33rDbPQwbJ EIcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710786768; x=1711391568; 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=3FYikwK1xwpaJxKVUawI2osEKSAMSAZcBjVrL37SoHo=; b=tJ5G3WbbDiEVBlI4NkUW5I/fzuWIOQ4dlxDQHVLjw38+OQpfrJY0jSIItpsCI8YEG7 rUAJJsqtEgzPrlW0HW5jEuvWXze7uohrpVkQFYIeIAi9c98qIbaZK3O5Ro8+JVxElSGt C8v69sxiAa4Xs6WKeBXFhTSan9dMD9vwfTjRNdNt/7P+ayXtYRi/w1QioQWYS+gqpAzh 1X+vwcRwrV/z3CgK6uJE9wr/PMJc4Ro3A8xsIgXUwwsKm9TBVUTLOMwuWfcIp3gngDD6 zcC1PTyNWrJ4UG4f65O+I4B0WEb6aojh18TTpZF1YjpyIQarToBqk/STjknwM1hZh1LR oZnw== X-Gm-Message-State: AOJu0YyKEz0ByOiuWGs3S/4W1st8tdQKXr/9bLznJ4/S0xLZPChAXrHX 8j2GyV8gfmLcA68qCzBYtfT4dedvVUx/yBErUWEsvHtacWRe1a4V7yyZOV9YukmFTSj89SiCQVT R X-Google-Smtp-Source: AGHT+IHtOpaiFIkpZenvb0Qz2zevPnfqU1vGqH9xpYhDG7gQzP2VgUSf+ULAWdwf71NW8YtFBKOWHQ== X-Received: by 2002:a05:6870:8304:b0:220:65ba:ca3a with SMTP id p4-20020a056870830400b0022065baca3amr15519303oae.14.1710786768325; Mon, 18 Mar 2024 11:32:48 -0700 (PDT) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id x6-20020aa784c6000000b006e4e93f4f17sm8186593pfn.117.2024.03.18.11.32.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 11:32:47 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v8 5/5] eal: initialize logging before plugins Date: Mon, 18 Mar 2024 11:30:06 -0700 Message-ID: <20240318183233.142330-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240318183233.142330-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20240318183233.142330-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 | 16 ++++++++-------- lib/eal/linux/eal.c | 16 ++++++++-------- lib/eal/unix/eal_unix_log.c | 0 3 files changed, 16 insertions(+), 16 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 b4f8d68b0a65..e4f00f31fbdd 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -592,6 +592,14 @@ rte_eal_init(int argc, char **argv) internal_conf->in_memory = false; } + 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; @@ -718,14 +726,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; - } - /* 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