[RFC PATCH 0/3] Split logging out of EAL
Bruce Richardson
bruce.richardson at intel.com
Mon Aug 29 17:18:58 CEST 2022
Following recent discussion on-list about EAL needing to be broken down
a bit, here is an RFC where logging functionality is split out of EAL
into a separate library. Most parts of this work is fairly straight
forward - there are only two complications:
1. The logging functions use "fnmatch", which is not available on
windows, and so has a compatibility fallback in EAL.
2. There are individual logging files for each supported OS.
For #1, there were really two options to avoid the circular dependency -
either move fnmatch into the log library, or to create a new lower-level
library for such back function fallbacks. For this RFC I've taken the
second option as a better solution. Ideally, more of EAL compat
functions should be moved to such a library if we create one, but for
now, it's only the one function that was needed to be moved.
For #2, this was fixed using standard naming and the build system to
only build the appropriately named file for each OS. The alternative of
creating a subdir per-OS seems overkill for the single-file situation.
NOTE: this is an early RFC based on work I did some time back, and is
intended just to inspire further discussion and work about splitting
EAL, more than necessarily being a patchset for future merging.
Bruce Richardson (3):
os: begin separating some OS compatibility from EAL
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/meson.build | 2 -
lib/kvargs/meson.build | 3 +-
lib/{eal/common => log}/eal_common_log.c | 1 -
lib/{eal/common => log}/eal_log.h | 11 ++++++
.../linux/eal_log.c => log/eal_log_linux.c} | 0
.../eal_log.c => log/eal_log_windows.c} | 0
lib/log/meson.build | 8 ++++
lib/{eal/include => log}/rte_log.h | 0
lib/log/version.map | 39 +++++++++++++++++++
lib/meson.build | 12 +++---
lib/os/freebsd/fnmatch.c | 3 ++
lib/os/linux/fnmatch.c | 3 ++
lib/os/meson.build | 8 ++++
lib/os/os.c | 3 ++
lib/os/version.map | 7 ++++
lib/{eal => os}/windows/fnmatch.c | 0
.../windows/include => os/windows}/fnmatch.h | 0
lib/telemetry/meson.build | 3 +-
lib/telemetry/telemetry.c | 12 +++---
lib/telemetry/telemetry_internal.h | 3 +-
28 files changed, 100 insertions(+), 59 deletions(-)
rename lib/{eal/common => log}/eal_common_log.c (99%)
rename lib/{eal/common => log}/eal_log.h (80%)
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
create mode 100644 lib/os/freebsd/fnmatch.c
create mode 100644 lib/os/linux/fnmatch.c
create mode 100644 lib/os/meson.build
create mode 100644 lib/os/os.c
create mode 100644 lib/os/version.map
rename lib/{eal => os}/windows/fnmatch.c (100%)
rename lib/{eal/windows/include => os/windows}/fnmatch.h (100%)
--
2.34.1
More information about the dev
mailing list