Skip to contentSkip to conversation

sysdig: Upgrade to 0.26.5

PATCH In review Khem Raj 2 participants 7 messages Feb 29, 2020 – Mar 12, 2020

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 sysdig: Upgrade to 0.26.5

* License changed to Apache-2.0 upstream as well [1]
* Forward port patches to apply on 0.26
* Just build libb64 from internal modules everything else should be provided by OE recipes
* Disable luajit mips64 since luajit on these arches is not available, fall back to liblua
* Disable build on musl, it needs fixing in sysdig

---
 ...usl-backtrace-APIs-are-glibc-specifi.patch |  37 +++---
 ...0001-fix-build-with-LuaJIT-2.1-betas.patch |  96 ++++++++++++++++
 ...-libsinsp-Port-to-build-with-lua-5.2.patch | 108 ------------------
 .../sysdig/sysdig/fix-uint64-const.patch      |  16 +++
 meta-oe/recipes-extended/sysdig/sysdig_git.bb |  47 +++++---
 5 files changed, 158 insertions(+), 146 deletions(-)
 create mode 100644 meta-oe/recipes-extended/sysdig/sysdig/0001-fix-build-with-LuaJIT-2.1-betas.patch
 delete mode 100644 meta-oe/recipes-extended/sysdig/sysdig/0001-libsinsp-Port-to-build-with-lua-5.2.patch
 create mode 100644 meta-oe/recipes-extended/sysdig/sysdig/fix-uint64-const.patch
meta-oe/recipes-extended/sysdig/sysdig/0001-Fix-build-with-musl-backtrace-APIs-are-glibc-specifi.patch +18 -19
index 7d3f8a19d7..cb80611578 100644
@@ -9,42 +9,41 @@ Signed-off-by: Khem Raj <[email protected]>
  userspace/libsinsp/utils.h   | 2 +-
  2 files changed, 4 insertions(+), 2 deletions(-)
 
-diff --git a/userspace/libsinsp/utils.cpp b/userspace/libsinsp/utils.cpp
-index 8f23f9c..c496a57 100644
 --- a/userspace/libsinsp/utils.cpp
 +++ b/userspace/libsinsp/utils.cpp
-@@ -21,7 +21,9 @@ along with sysdig.  If not, see <http://www.gnu.org/licenses/>.
+@@ -22,7 +22,7 @@ limitations under the License.
  #include <limits.h>
  #include <stdlib.h>
  #include <sys/time.h>
-+#ifdef __GLIBC__
+-#ifndef CYGWING_AGENT
++#if !defined(CYGWING_AGENT) || defined(__GLIBC__)
  #include <execinfo.h>
-+#endif
+ #endif
  #include <unistd.h>
- #include <sys/time.h>
- #include <netdb.h>
-@@ -741,7 +743,7 @@ uint64_t sinsp_utils::get_current_time_ns()
-     return tv.tv_sec * (uint64_t) 1000000000 + tv.tv_usec * 1000;
- }
+@@ -780,6 +780,7 @@ bool sinsp_utils::glob_match(const char
  
--#ifndef _WIN32
-+#if defined(_WIN32) && defined(__GLIBC__)
+ #ifndef CYGWING_AGENT
+ #ifndef _WIN32
++#ifdef __GLIBC__
  void sinsp_utils::bt(void)
  {
  	static const char start[] = "BACKTRACE ------------";
-diff --git a/userspace/libsinsp/utils.h b/userspace/libsinsp/utils.h
-index 600d00b..4ab4650 100644
+@@ -801,6 +802,7 @@ void sinsp_utils::bt(void)
+ 
+ 	free(bt_syms);
+ }
++#endif // Glibc
+ #endif // _WIN32
+ #endif // CYGWING_AGENT
+ 
 --- a/userspace/libsinsp/utils.h
 +++ b/userspace/libsinsp/utils.h
-@@ -79,7 +79,7 @@ public:
+@@ -104,7 +104,7 @@ public:
  
- 	static uint64_t get_current_time_ns();
+ 	static bool glob_match(const char *pattern, const char *string);
  
 -#ifndef _WIN32
 +#if not defined(_WIN32) && defined(__GLIBC__)
  	//
  	// Print the call stack
  	//
--- 
-2.6.2
-
meta-oe/recipes-extended/sysdig/sysdig/0001-fix-build-with-LuaJIT-2.1-betas.patch new file +96 -0

96 lines not on this page · raw message

meta-oe/recipes-extended/sysdig/sysdig/0001-libsinsp-Port-to-build-with-lua-5.2.patch deleted +0 -108

108 lines not on this page · raw message

meta-oe/recipes-extended/sysdig/sysdig/fix-uint64-const.patch new file +16 -0
new file mode 100644
index 0000000000..5c756294b9
@@ -0,0 +1,16 @@
+Fix x86 build
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+
+--- a/userspace/libsinsp/cgroup_limits.cpp
++++ b/userspace/libsinsp/cgroup_limits.cpp
+@@ -9,7 +9,7 @@ namespace {
+ // This reports extremely large values (e.g. almost-but-not-quite 9EiB as set by k8s) as unlimited.
+ // Note: we use the same maximum value for cpu shares/quotas as well; the typical values are much lower
+ // and so should never exceed CGROUP_VAL_MAX either
+-constexpr const int64_t CGROUP_VAL_MAX = (1UL << 42u) - 1;
++constexpr const int64_t CGROUP_VAL_MAX = (1ULL << 42u) - 1;
+ 
+ /**
+  * \brief Read a single int64_t value from cgroupfs
meta-oe/recipes-extended/sysdig/sysdig_git.bb +28 -19

67 lines not on this page · raw message

Signature · 1 line
2.25.1
#1 lore raw

Hi,

added dependency on grpc exists only in meta-networking, so this fails to parse now.

Cheers,

author
#2 lore raw
Quoted 5 lines · Martin Jansa

Hi,

added dependency on grpc exists only in meta-networking, so this fails to parse now.

I think grpc is common enough to belong to meta-oe as well.

Quoted 1 line

Cheers,

#3 lore raw

Should I send the patch to move grpc from meta-networking to meta-oe to fix this or do you have it already?

Quoted 13 lines · Khem Raj
Quoted 4 lines · Martin Jansa

Hi,

added dependency on grpc exists only in meta-networking, so this fails

to parse now.

Quoted 1 line

I think grpc is common enough to belong to meta-oe as well.

Quoted 1 line

Cheers,

author
#4 lore raw
Quoted 3 lines · Martin Jansa

Should I send the patch to move grpc from meta-networking to meta-oe to fix this or do you have it already?

Please send I don’t have it ready

Quoted 17 lines · Khem Raj
Quoted 14 lines
Quoted 4 lines · Martin Jansa

Hi,

added dependency on grpc exists only in meta-networking, so this fails

to parse now.

Quoted 1 line

I think grpc is common enough to belong to meta-oe as well.

Quoted 1 line

Cheers,

#5 lore raw

It doesn't seem to build for aarch64 without the jit in luajit:

| DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /OE/build/tmp-glibc/work/aarch64-oe-linux/sysdig/0.26.5-r0/build --target all --
| ninja: error: 'libluajit-5.1.so', needed by 'userspace/sysdig/csysdig', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/OE/build/tmp-glibc/work/aarch64-oe-linux/sysdig/0.26.5-r0/temp/run.do_compile.51845' failed with exit code 1:
| ninja: error: 'libluajit-5.1.so', needed by 'userspace/sysdig/csysdig', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.

Quoted 28 lines · Khem Raj
Quoted 3 lines · Martin Jansa

Should I send the patch to move grpc from meta-networking to meta-oe to fix this or do you have it already?

Please send I don’t have it ready

Quoted 17 lines · Khem Raj
Quoted 14 lines
Quoted 4 lines · Martin Jansa

Hi,

added dependency on grpc exists only in meta-networking, so this fails

to parse now.

Quoted 1 line

I think grpc is common enough to belong to meta-oe as well.

Quoted 1 line

Cheers,

author
#6 lore raw
Quoted 11 lines · Martin Jansa

It doesn't seem to build for aarch64 without the jit in luajit:

| DEBUG: Executing shell function do_compile
| NOTE: VERBOSE=1 cmake --build /OE/build/tmp-glibc/work/aarch64-oe-linux/sysdig/0.26.5-r0/build --target all --

| ninja: error: 'libluajit-5.1.so <http://libluajit-5.1.so>', needed by 'userspace/sysdig/csysdig', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/OE/build/tmp-glibc/work/aarch64-oe-linux/sysdig/0.26.5-r0/temp/run.do_compile.51845' failed with exit code 1:
| ninja: error: 'libluajit-5.1.so <http://libluajit-5.1.so>', needed by 'userspace/sysdig/csysdig', missing and no known rule to make it
| WARNING: exit code 1 from a shell command.

luajit needs 32bit compiler on build host, so I wonder if thats the case here. I have not yet looked into it, but I have seen this failure on aarch64 as well.

Quoted 30 lines · On Tue, Mar 3, 2020 at 4:27 PM Khem Raj <[email protected]…

On Tue, Mar 3, 2020 at 5:53 AM Martin Jansa <[email protected] <mailto:[email protected]>> wrote:

Should I send the patch to move grpc from meta-networking to meta-oe to fix this or do you have it already?

Please send I don’t have it ready

On Mon, Mar 2, 2020 at 6:22 PM Khem Raj <[email protected] <mailto:[email protected]>> wrote:

On Mon, Mar 2, 2020 at 4:27 AM Martin Jansa <[email protected] <mailto:[email protected]>> wrote:
>
> Hi,
>
> added dependency on grpc exists only in meta-networking,
so this fails to parse now.
>

I think grpc is common enough to belong to meta-oe as well.

> Cheers,