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 1586B41DF6; Mon, 6 Mar 2023 20:28:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8435C410F9; Mon, 6 Mar 2023 20:28:16 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 5298D40A8A for ; Mon, 6 Mar 2023 20:28:14 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id h17-20020a17090aea9100b0023739b10792so9740333pjz.1 for ; Mon, 06 Mar 2023 11:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678130893; 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=dKGr7PUWrmPmcCmVQmXOUcuNvrHWrvXJqvOeVVHo9B4=; b=hvxY0Pdy5BYgJGe2Zt0W6PgkY7C68WcuqOTKmQ+u1kFrh4NvnERgtxYFU3RX8qK8ce AfJ9gTOjgDo4bFTRGBnpsHmKjM0Vad/3ljMuMdA/H5AHiz0+9iyKsgrG7ZyJXnEFK/sH TKHOCTsyuLWq/v0Zx/JY2o/8kQ+A2G/fCKyua9NgETTN6r+DNsGnLbdIS6Wvh4tpbe9S YX9N3yX4B9HBRJn/mP8iL5HXmyB0I5dEUIgPMweFDcghwZgld77e0Rdq2g0CBVbRPQXj E4Oj2a4hFeGpr0zl2DjtR3qHIg3uLwHBn/xzG2EbeVTEx2pVC3NkQ1Q8QfbsNyUxDXfz ErPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678130893; 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=dKGr7PUWrmPmcCmVQmXOUcuNvrHWrvXJqvOeVVHo9B4=; b=a6PkEgHm0qtu7JRVRH9qFV5w3xf+SOrY/pTOjaXyIrkpzaIgEU+eSpofv28vj42iUr Gdr3E7Cl57p9E+S9TiyY4eiOkeP3WQyXJjyxUo9jFhuxqqdxcvSd7bRPf7jE6bXmlyQh dIWK48XwIOxgwfP7peH/NTiY8hNMXWFp05WtT2+F4oyhprl/XsjeIg5ONUEjDiTPhwCm t2Qbjj+poRG6P0KcUqR9DRApy1FLjoJIAdajD5v2IidmPPj0PvfQ7oDcy3tTOoATPrb0 gmmfgqnU0q29NF+64B467K6p6iQTA+qjqTrA/1CV5XxEyZ59qYwEmXDqQB5lzBaP68Mq 2MVQ== X-Gm-Message-State: AO0yUKUPaO5//Go0rMBgBoD3EDlpLxn3M5jf6RAMVwfgdrLSJOlXhouY G/ch3MokwnlK4IBTKIqWxfLz1MnETD96n5kLQnpPmQ== X-Google-Smtp-Source: AK7set/9Z5eWxTSwsMNXJ5bsEmsgitckMpANW+6WrhdiFeVnaTcQCLjhU+kLZ8FNtArvCXAXHjNWvg== X-Received: by 2002:a17:902:a416:b0:19e:bfec:7928 with SMTP id p22-20020a170902a41600b0019ebfec7928mr4148414plq.24.1678130893235; Mon, 06 Mar 2023 11:28:13 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id g22-20020a1709029f9600b001991d6c6c64sm5653476plq.185.2023.03.06.11.28.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 11:28:12 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Bruce Richardson Subject: [PATCH v3 1/2] eal: unify logging code for FreeBsd and Linux Date: Mon, 6 Mar 2023 11:28:09 -0800 Message-Id: <20230306192810.106154-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230306192810.106154-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20230306192810.106154-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 tree. Signed-off-by: Stephen Hemminger --- 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 + 4 files changed, 8 insertions(+), 1 deletion(-) rename lib/eal/{linux => unix}/eal_log.c (100%) diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c index 7db4239c5187..3a53f9e13887 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -51,6 +51,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) @@ -744,6 +745,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 3cccfa36c0a4..1b913acc0681 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