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 C9D9242D5F; Mon, 26 Jun 2023 20:42:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 717EE4282D; Mon, 26 Jun 2023 20:42:54 +0200 (CEST) Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) by mails.dpdk.org (Postfix) with ESMTP id 7A7A84013F for ; Mon, 26 Jun 2023 20:42:52 +0200 (CEST) Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-263036d54b9so579899a91.0 for ; Mon, 26 Jun 2023 11:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1687804971; x=1690396971; 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=c9U9tE8eQy1k4qcUEU4AcbFdTUvpWcsxv69ky9xBapE=; b=uW0hwNlxf2vdvgQfKwJtJdaxv9XAIYGAObq9sw1Vvqlh4Viwjsdb54ajMFJGoFWaMH bv2dZe1arCZMhGBnVpeb+y+HCs/TffoxTXMwjA/l158/dLCPrQdF93ZGKj8gH+WSe67i G2ZFAPQi/LfKudzwPS2Pp9V+Fiyk12xIjcfnhbpVQf6INS4Xr9H1ilHIJoMgLBoo28Ta iOOt/676TWDDoBYlzNV77GFxy50TpGsbv3LiTigJyrC/fpEbA60uZN2MMKl2WzAgBg8Y uqWy0Q+MFqMx3TNnDrouODvfmIbRCDqScHhXOO2AgyJ12LvCH5X94Wo/qM2d8LcdoRof HSSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687804971; x=1690396971; 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=c9U9tE8eQy1k4qcUEU4AcbFdTUvpWcsxv69ky9xBapE=; b=jewwou4TDxRmvB2fP4Q4ln9yWD+ebSThRfaVPYMeCOcnY/9bjxLZVbstPXRLxCOs9q NYkMnPm+/TQdLgXbCzWDeoFzTadJjiWrofFIWYPNytaLgqt7UoRy/Ohl3DntTn1m/llC twxhl+95CB1LwBm4W5g6v6GYsWdZKDTagMub9x2y7Y3V3X1YVKwdG7JPhdmnVeXOvanz v+jbuR3AnbLTkqE5YPsw2r3sBt0VqONwOBxPA0fQHGHXZwMqATpSPUezvFNScJWvJAos CYPt0B0YMG4nmC8B6dMk/Y8VhRynVyTGnL2hecY5HuJ9KsS0odqEF4+1LQkFbCEs8kWq Da/w== X-Gm-Message-State: AC+VfDwZ1gJGD+XyQJfxwhVfGz1keBbAz50z8d1PURqez2XG8UWD98+B RYPV2xXgu/6rD/4xmITmY7m+EpoxaQEIsfKp0x/YFg== X-Google-Smtp-Source: ACHHUZ6lpWXw6fZ+MN5uKbxk/snPMQk7C0yTYuPOjrIru6V1y4Q8CJnyzgF87DHC2zua1EsoTmXvUA== X-Received: by 2002:a17:90b:e8d:b0:262:e598:6046 with SMTP id fv13-20020a17090b0e8d00b00262e5986046mr5662110pjb.28.1687804971389; Mon, 26 Jun 2023 11:42:51 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id h17-20020a17090adb9100b0024e37e0a67dsm4846577pjv.20.2023.06.26.11.42.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Jun 2023 11:42:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Bruce Richardson Subject: [PATCH v4 1/5] eal: unify logging code for FreeBsd and Linux Date: Mon, 26 Jun 2023 11:42:12 -0700 Message-Id: <20230626184223.155390-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230626184223.155390-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20230626184223.155390-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 FreeBSD logging code was not using syslog and did not have the same options as Linux. Move the log writing code to common source tree. Signed-off-by: Stephen Hemminger --- .../freebsd_gsg/freebsd_eal_parameters.rst | 27 +++++++++++++++++++ lib/eal/freebsd/eal.c | 7 +++++ lib/eal/linux/meson.build | 1 - lib/eal/{linux => unix}/eal_log.c | 0 lib/eal/unix/meson.build | 1 + 5 files changed, 35 insertions(+), 1 deletion(-) rename lib/eal/{linux => unix}/eal_log.c (100%) diff --git a/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst b/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst index fba467a2ce92..9270d9fa3bfc 100644 --- a/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst +++ b/doc/guides/freebsd_gsg/freebsd_eal_parameters.rst @@ -18,3 +18,30 @@ FreeBSD-specific EAL parameters ------------------------------- There are currently no FreeBSD-specific EAL command-line parameters available. + +Other options +~~~~~~~~~~~~~ + +* ``--syslog `` + + Set syslog facility. Valid syslog facilities are:: + + auth + cron + daemon + ftp + kern + lpr + mail + news + syslog + user + uucp + local0 + local1 + local2 + local3 + local4 + local5 + local6 + local7 diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 7008303e112a..6df6873e3889 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -52,6 +52,7 @@ #include "eal_hugepages.h" #include "eal_options.h" #include "eal_memcfg.h" +#include "eal_log.h" #include "eal_trace.h" #define MEMSIZE_IF_NO_HUGE_PAGE (64ULL * 1024ULL * 1024ULL) @@ -759,6 +760,12 @@ 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; + 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/meson.build b/lib/eal/linux/meson.build index 5af456db9edb..e99ebed25692 100644 --- a/lib/eal/linux/meson.build +++ b/lib/eal/linux/meson.build @@ -11,7 +11,6 @@ sources += files( 'eal_hugepage_info.c', 'eal_interrupts.c', 'eal_lcore.c', - 'eal_log.c', 'eal_memalloc.c', 'eal_memory.c', 'eal_thread.c', diff --git a/lib/eal/linux/eal_log.c b/lib/eal/unix/eal_log.c similarity index 100% rename from lib/eal/linux/eal_log.c rename to lib/eal/unix/eal_log.c diff --git a/lib/eal/unix/meson.build b/lib/eal/unix/meson.build index cc7d67dd321d..37d07594df29 100644 --- a/lib/eal/unix/meson.build +++ b/lib/eal/unix/meson.build @@ -6,6 +6,7 @@ sources += files( 'eal_file.c', 'eal_filesystem.c', 'eal_firmware.c', + 'eal_log.c', 'eal_unix_memory.c', 'eal_unix_thread.c', 'eal_unix_timer.c', -- 2.39.2