Add uring_args for all build targets in package io_uring backend is enabled with uring_args. Add them to package args. All build targets including static libraries for utils and thresholds and sensor services executables are built consistently. Currently steady timer in utils.cpp fires right away for services build with io_uring enabled like fansensor, hwmontempsensor. https://github.com/openbmc/dbus-sensors/blob/master/src/Utils.cpp#L472 Tested: Added debug print and verified the above timer handler is called 10 seconds after the timer is started as expected. intelcpusensor, which does not use random_access_file with io_uring backend reads sensor values successfully. Services use random_access_file read sensor data successfully. Signed-off-by: Zhikui Ren <zhikui.ren@intel.com> Change-Id: I8cf3a9a0d1ffca459eb6c2c37e4e2220ce5100ac
diff --git a/meson.build b/meson.build index 6c4b8ca..8dfa828 100644 --- a/meson.build +++ b/meson.build
@@ -11,15 +11,14 @@ meson_version: '>=0.58.0', ) -# Note, there is currently an issue with CPUSensor when used in conjunction -# with io_uring. For the moment, we enable uring for all other daemons, but -# we'd like to enable it for all daemons. +# Enable io_uring for all daemons with below flags. +# '-DBOOST_ASIO_HAS_IO_URING', +# '-DBOOST_ASIO_DISABLE_EPOLL', +# '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT', +# Note, there is currently an issue with CPUSensor when used in +# conjunction with io_uring. So it has not been changed to use +# random file access. But we'd like to enable it for all daemons. # https://github.com/openbmc/dbus-sensors/issues/19 -uring_args = [ - '-DBOOST_ASIO_HAS_IO_URING', - '-DBOOST_ASIO_DISABLE_EPOLL', - '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT', -] add_project_arguments( '-Wno-psabi', @@ -32,6 +31,9 @@ '-DBOOST_ALL_NO_LIB', '-DBOOST_ASIO_DISABLE_THREADS', '-DBOOST_ALLOW_DEPRECATED_HEADERS', + '-DBOOST_ASIO_HAS_IO_URING', + '-DBOOST_ASIO_DISABLE_EPOLL', + '-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT', language: 'cpp', )
diff --git a/src/meson.build b/src/meson.build index 0adbabc..9f56c31 100644 --- a/src/meson.build +++ b/src/meson.build
@@ -82,7 +82,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -113,7 +112,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -130,7 +128,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -146,7 +143,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -162,7 +158,6 @@ i2c, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -177,7 +172,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -192,7 +186,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -207,7 +200,6 @@ 'nvmesensor', sources: nvme_srcs, dependencies: nvme_deps, - cpp_args: uring_args, install: true, ) endif @@ -225,7 +217,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif @@ -240,7 +231,6 @@ thresholds_dep, utils_dep, ], - cpp_args: uring_args, install: true, ) endif