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 2470A41DD9; Mon, 6 Mar 2023 19:18:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6F2E410F9; Mon, 6 Mar 2023 19:18:23 +0100 (CET) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id B002940A8A for ; Mon, 6 Mar 2023 19:18:21 +0100 (CET) Received: by mail-pj1-f52.google.com with SMTP id kb15so10692668pjb.1 for ; Mon, 06 Mar 2023 10:18:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; t=1678126700; 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=pG/YDtQtmlTsDpbDxIWZ2VwvxQR1Q8Qf/iwLBOYcqp8=; b=4OLuJohwkwTn9F0fe417bFvVLcfIsvOyQEHPiA7f34xhkx4TIbzOT8Yk02723FNHdU XBDs6L3Bb26Xeh+HwcfxW0I9ECrr190DRkbreNOGaDTRkArGsWWha8s4PZPhs5iroVqs kKy/1qhQ4BFZxZKR6l7GKEpRe6phx5dhPSzbDnORj3GO6jBeMb76VtA+0QRlA5ssMmoc s1UZNCfPe1xMJsfp1Waicno0asdaBc+of93yB3vXeFypNlwB1xq/YK1uz/U9SFN2U9tp xBFgMsCuhctlyipCyukS0h1R3V6k7FG+VASJRl5p1A80/ohOd2vM5gSb4Yzw0d311DST /bUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678126700; 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=pG/YDtQtmlTsDpbDxIWZ2VwvxQR1Q8Qf/iwLBOYcqp8=; b=xUUBK7aRJlX2iPIsEdbYMqdnYjAjLej7ENifLIrLZe704cwsC65hlNPP0pZ5TLTOui q6VbavMBSAinObDderAct0N767FVHhuVUGwxzuSPie3fXAfu/zav0hs9lJFw5OU0px4L 9le+/T6Ms44rvdMxZ7F6i6aZ/cAMc4rujmRItiPba1buei3ssZvVFB/aJljfxg34Tmv8 zrrmHsT4XCUSk7Aca6GFvyPWmWfUMFO5fpqp+RZe+W5gs6zaq+XazEZSVodTMZHpQ45x PFijZxy2G12IH2C+6ENATn/THUVfyEViwOoatvpyYt2nyrNsax5RuG+V2Zl6cfDtac2d cnRg== X-Gm-Message-State: AO0yUKWeq1xO1Lfs0956EytZDMM12cCqkadpKQeX8lcoGz+SxZAW2f+1 on+jSVHcSNqy1fSnsU/gdGoHPl+Wh2dn2Rb3z/umHw== X-Google-Smtp-Source: AK7set9pEJHydkdOQXFZ2fMAm7oXEBxPgbkoey/kosgm8rQLOZtzEhKyJDtwhg7v+WUDTcCc54GBJg== X-Received: by 2002:a17:902:f80f:b0:19c:df17:b724 with SMTP id ix15-20020a170902f80f00b0019cdf17b724mr10265916plb.58.1678126700197; Mon, 06 Mar 2023 10:18:20 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e7-20020a170902cf4700b0019adfb96084sm7039155plg.36.2023.03.06.10.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Mar 2023 10:18:19 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v2 1/2] eal: unify logging code for FreeBsd and Linux Date: Mon, 6 Mar 2023 10:18:15 -0800 Message-Id: <20230306181816.97243-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230306181816.97243-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> <20230306181816.97243-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 | 6 ++++++ lib/eal/linux/meson.build | 1 - lib/eal/{linux => unix}/eal_log.c | 0 lib/eal/unix/meson.build | 1 + 4 files changed, 7 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..15326ccc321d 100644 --- a/lib/eal/freebsd/eal.c +++ b/lib/eal/freebsd/eal.c @@ -744,6 +744,12 @@ rte_eal_init(int argc, char **argv) #endif } + if (eal_log_init(logid, 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