Skip to contentSkip to conversation

Upgrade fluentbit recipe from version 1.3.5 to 1.9.3

PATCH In review Lekshmi Ravindran 1 participant 2 messages May 20, 2022 – May 27, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Upgrade fluentbit recipe from version 1.3.5 to 1.9.3

The current fluentbit version with oe is much old and outdated. Upgrading to latest version to leverage better stability, performance and newer feature set from the fluentbit project. Source - https://github.com/fluent/fluent-bit/blob/v1.9.3/fluent-bit_1.9.3.bb

Retaining the following 3 patches as suggested by Khem Raj:
1. 0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch
2. cross-build-init-system-detection.patch
3. jemalloc.patch

---
 ...nit-install-location-with-SYSTEM_DIR.patch | 25 ++----
 ...caused-by-using-flb_free-instead-of-.patch | 43 ----------
 ...-ppc-Fix-signature-for-co_create-API.patch | 38 ---------
 ...GV-caused-by-using-flb_free-instead-.patch | 82 -------------------
 .../fluentbit/fluentbit/builtin-nan.patch     | 27 ------
 .../cross-build-init-system-detection.patch   | 41 +++++-----
 .../fluentbit/fluentbit/jemalloc.patch        | 25 +++---
 .../fluentbit/fluentbit_1.9.3.bb              | 69 ++++++++++++++++
 8 files changed, 113 insertions(+), 237 deletions(-)
 delete mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch
 delete mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch
 delete mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch
 delete mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch
 create mode 100644 meta-oe/recipes-extended/fluentbit/fluentbit_1.9.3.bb
meta-oe/recipes-extended/fluentbit/fluentbit/0001-Control-sytemd-unit-install-location-with-SYSTEM_DIR.patch +9 -16
index bf4cda08f..8fa0797b1 100644
@@ -1,28 +1,21 @@
-From 5571f949fa2048b79c197b5b10a11ecb1891cbe9 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Sat, 23 Apr 2022 08:24:34 -0700
-Subject: [PATCH] Control sytemd unit install location with SYSTEM_DIR
-
 This helps building when usrmerge is on
 
-Upstream-Status: Pending
 Signed-off-by: Khem Raj <[email protected]>
----
- src/CMakeLists.txt | 6 +++++-
- 1 file changed, 5 insertions(+), 1 deletion(-)
 
---- a/src/CMakeLists.txt
-+++ b/src/CMakeLists.txt
-@@ -323,7 +323,11 @@ if(FLB_BINARY)
+Index: fluentbit/src/CMakeLists.txt
+===================================================================
+--- fluentbit.orig/src/CMakeLists.txt
++++ fluentbit/src/CMakeLists.txt
+@@ -484,7 +484,11 @@ if(FLB_BINARY)
        "${PROJECT_SOURCE_DIR}/init/systemd.in"
        ${FLB_SYSTEMD_SCRIPT}
        )
--    install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
+-    install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION /lib/systemd/system)
 +    if(SYSTEMD_DIR)
-+        install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION ${SYSTEMD_DIR})
++        install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION ${SYSTEMD_DIR})
 +    else()
-+        install(FILES ${FLB_SYSTEMD_SCRIPT} DESTINATION /lib/systemd/system)
++        install(FILES ${FLB_SYSTEMD_SCRIPT} COMPONENT binary DESTINATION /lib/systemd/system)
 +    endif()
-     install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR})
+     install(DIRECTORY DESTINATION ${FLB_INSTALL_CONFDIR} COMPONENT binary)
    elseif(FLB_UPSTART)
      set(FLB_UPSTART_SCRIPT "${PROJECT_SOURCE_DIR}/init/${FLB_OUT_NAME}.conf")
meta-oe/recipes-extended/fluentbit/fluentbit/0001-bin-fix-SIGSEGV-caused-by-using-flb_free-instead-of-.patch deleted +0 -43

43 lines not on this page · raw message

meta-oe/recipes-extended/fluentbit/fluentbit/0001-ppc-Fix-signature-for-co_create-API.patch deleted +0 -38
deleted file mode 100644
index 1f36c657e..000000000
@@ -1,38 +0,0 @@
-From be4032079c931704f52e29f5da5c01cde24ac842 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Thu, 16 Jan 2020 10:44:58 -0800
-Subject: [PATCH] ppc: Fix signature for co_create API
-
-Upstream-Status: Submitted [https://github.com/fluent/fluent-bit/pull/1886]
-Signed-off-by: Khem Raj <[email protected]>
----
- lib/flb_libco/ppc.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/lib/flb_libco/ppc.c b/lib/flb_libco/ppc.c
-index e6536d56..533256b3 100644
---- a/lib/flb_libco/ppc.c
-+++ b/lib/flb_libco/ppc.c
-@@ -279,7 +279,9 @@ static uint32_t* co_create_(unsigned size, uintptr_t entry) {
-   return t;
- }
- 
--cothread_t co_create(unsigned int size, void (*entry_)(void)) {
-+cothread_t co_create(unsigned int size, void (*entry_)(void),
-+                     size_t *out_size) {
-+
-   uintptr_t entry = (uintptr_t)entry_;
-   uint32_t* t = 0;
- 
-@@ -325,7 +327,7 @@ cothread_t co_create(unsigned int size, void (*entry_)(void)) {
-     t[10] = (uint32_t)(sp >> shift >> shift);
-     t[11] = (uint32_t)sp;
-   }
--
-+  *out_size = size;
-   return t;
- }
- 
--- 
-2.25.0
-
meta-oe/recipes-extended/fluentbit/fluentbit/0002-parser-Fix-SIGSEGV-caused-by-using-flb_free-instead-.patch deleted +0 -82

82 lines not on this page · raw message

meta-oe/recipes-extended/fluentbit/fluentbit/builtin-nan.patch deleted +0 -27
deleted file mode 100644
index 8ffc3be3e..000000000
@@ -1,27 +0,0 @@
-help complier to use intrinsics, clang in few cases e.g. aarch64 can not
-and then requires linking with libm, its the only function needed from libm then
-its good to avoid needing it.
-
-Upstream-Status: Pending
-Signed-off-by: Khem Raj <[email protected]>
-
---- a/include/fluent-bit/stream_processor/flb_sp_timeseries.h
-+++ b/include/fluent-bit/stream_processor/flb_sp_timeseries.h
-@@ -207,7 +207,7 @@ void cb_forecast_calc(struct timeseries
-         result = b0 + b1 * (val->f64 + *forecast->latest_x);
-         break;
-     default:
--        result = nan("");
-+        result = __builtin_nan("");
-         break;
-     }
- 
-@@ -283,7 +283,7 @@ void cb_forecast_r_calc(struct timeserie
-             result = ((val->i64 - b0) / b1) - *forecast->latest_x;
-             break;
-         default:
--            result = nan("");
-+            result = __builtin_nan("");
-             break;
-         }
- 
meta-oe/recipes-extended/fluentbit/fluentbit/cross-build-init-system-detection.patch +22 -19

58 lines not on this page · raw message

meta-oe/recipes-extended/fluentbit/fluentbit/jemalloc.patch +13 -12
index 67b3397a6..b34cf9a24 100644
@@ -1,16 +1,17 @@
 Add  --with-jemalloc-prefix=je_ so it compiles on musl
 
 Signed-off-by: Khem Raj <[email protected]>
-Upstream-Status: Pending
 
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -523,7 +523,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME}
-   # Link to Jemalloc as an external dependency
-   ExternalProject_Add(jemalloc
-     SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1
--    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
-+    CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lib/jemalloc-5.2.1/configure ${AUTOCONF_HOST_OPT} --with-jemalloc-prefix=je_ --with-lg-quantum=3 --enable-cc-silence --prefix=<INSTALL_DIR>
-     CFLAGS=-std=gnu99\ -Wall\ -pipe\ -g3\ -O3\ -funroll-loops
-     BUILD_COMMAND $(MAKE)
-     INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/
+Index: fluentbit/CMakeLists.txt
+===================================================================
+--- fluentbit.orig/CMakeLists.txt
++++ fluentbit/CMakeLists.txt
+@@ -739,7 +739,7 @@ if(FLB_JEMALLOC AND ${CMAKE_SYSTEM_NAME}
+
+   # Add support for options like page size, if empty we default it
+   if(NOT DEFINED FLB_JEMALLOC_OPTIONS OR "${FLB_JEMALLOC_OPTIONS}" STREQUAL "")
+-    set(FLB_JEMALLOC_OPTIONS "--with-lg-quantum=3")
++    set(FLB_JEMALLOC_OPTIONS "--with-jemalloc-prefix=je_ --with-lg-quantum=3")
+   endif()
+   # Split into a list so CMake handles it correctly when passing to configure command
+   separate_arguments(FLB_JEMALLOC_OPTIONS_LIST UNIX_COMMAND ${FLB_JEMALLOC_OPTIONS})
meta-oe/recipes-extended/fluentbit/fluentbit_1.9.3.bb new file +69 -0

70 lines not on this page · raw message

Signature · 1 line
2.34.0.windows.1
#1 lore raw

Hello All,

Please let me know if there is any feedback on this patch.

Thanks,
Lekshmi