From patchwork Fri Jan 13 16:19:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 122037 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E4805423C5; Fri, 13 Jan 2023 17:20:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9E07C410EF; Fri, 13 Jan 2023 17:20:18 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 0E1C240E03 for ; Fri, 13 Jan 2023 17:20:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673626817; x=1705162817; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JLNcZf+15bHzKGvgZEhylHhjzrNbH3z0fJo3CmzTyvc=; b=BNe8WMiNFEnzCsyarqV158+qJHbs/d1f5NdIHfmLmtylv9T+OC6hty2D FvS1J3B/zBBG0/T+X9LYOqtrOJANV8kOKs6EfJKhvL+tTrUE5IxiZVOMY zKUWyIaOv/kWDVJmhF9dqwOK+06Oezn7dJa0uhYH1Fes3P3pf1+u2rrH3 kAdBJVBvcCh8og7yOhG04u9UVIEG6v4C3lr7VzG421A0ixe0FfEMiuw5e 16rpbcydsf7j5xjbwlLq3RmDcKyeISmEiWfq+obmeil7vXYcBbXiYPZA1 NOJDssp+oqWcJBzU3w6mhaO95EcpCIa9s6RD61OTKspqc2XyK1gt0UyMC g==; X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="307574994" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="307574994" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2023 08:20:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10589"; a="726757457" X-IronPort-AV: E=Sophos;i="5.97,214,1669104000"; d="scan'208";a="726757457" Received: from silpixa00401459.ir.intel.com (HELO silpixa00401459.ger.corp.intel.com) ([10.237.223.90]) by fmsmga004.fm.intel.com with ESMTP; 13 Jan 2023 08:20:09 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: mb@smartsharesystems.com, david.marchand@redhat.com, Bruce Richardson Subject: [RFC PATCH v2 0/3] Split logging functionality out of EAL Date: Fri, 13 Jan 2023 16:19:58 +0000 Message-Id: <20230113162001.519534-1-bruce.richardson@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220829151901.376754-1-bruce.richardson@intel.com> References: <20220829151901.376754-1-bruce.richardson@intel.com> MIME-Version: 1.0 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 There seems to be a general desire to reduce the size and scope of EAL. To this end, this patchset makes a (very) small step in that direction by taking the logging functionality out of EAL and putting it into its own library that can be built and maintained separately. As with the previous RFC for this, the main obstacle is the "fnmatch" function which is needed by both EAL and the new log function when building on windows. While the function cannot stay in EAL - or we would have a circular dependency, moving it to a new library or just putting it in the log library have the disadvantages that it then "leaks" into the public namespace without an rte_prefix, which could cause issues. Since only a single function is involved, this v2 RFC takes a different approach to v1, and just moves the offending function to be a static function in a header file. This allows use by multiple libs without conflicting names or making it public. The other complication, as explained in v1 RFC was that of multiple implementations for different OS's. This is solved here in the same way as v1, by including the OS in the name and having meson pick the correct file for each build. Since only one file is involved, there seemed little need for replicating EAL's separate subdirectories per-OS. Bruce Richardson (3): eal/windows: move fnmatch function to header file log: separate logging functions out of EAL telemetry: use standard logging lib/eal/common/eal_private.h | 7 - lib/eal/common/meson.build | 1 - lib/eal/freebsd/eal.c | 6 +- lib/eal/include/meson.build | 1 - lib/eal/linux/eal.c | 6 +- lib/eal/linux/meson.build | 1 - lib/eal/meson.build | 2 +- lib/eal/version.map | 17 -- lib/eal/windows/fnmatch.c | 172 ----------------- lib/eal/windows/include/fnmatch.h | 175 ++++++++++++++++-- lib/eal/windows/meson.build | 2 - lib/kvargs/meson.build | 3 +- lib/{eal/common => log}/eal_common_log.c | 1 - lib/{eal/common => log}/eal_log.h | 12 ++ .../linux/eal_log.c => log/eal_log_linux.c} | 0 .../eal_log.c => log/eal_log_windows.c} | 0 lib/log/meson.build | 9 + lib/{eal/include => log}/rte_log.h | 0 lib/log/version.map | 34 ++++ lib/meson.build | 1 + lib/telemetry/meson.build | 3 +- lib/telemetry/telemetry.c | 12 +- lib/telemetry/telemetry_internal.h | 3 +- 23 files changed, 229 insertions(+), 239 deletions(-) delete mode 100644 lib/eal/windows/fnmatch.c rename lib/{eal/common => log}/eal_common_log.c (99%) rename lib/{eal/common => log}/eal_log.h (78%) rename lib/{eal/linux/eal_log.c => log/eal_log_linux.c} (100%) rename lib/{eal/windows/eal_log.c => log/eal_log_windows.c} (100%) create mode 100644 lib/log/meson.build rename lib/{eal/include => log}/rte_log.h (100%) create mode 100644 lib/log/version.map --- 2.34.1