From ef330a393be4b472627b1bfa7fbe50934e519e25 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mauricio=20V=C3=A1squez?= Date: Fri, 16 Jul 2021 16:55:36 -0500 Subject: [PATCH] tools: Fix filtering by mount namespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The filtering by mount namespace implementation relies on the redefinition of the "struct mnt_namespace" internal kernel structure. The layout of this structure changed in Linux 5.11 (https://github.com/torvalds/linux/commit/1a7b8969e664d6af328f00fe6eb7aabd61a71d13), this commit adds a conditional on the kernel version to adapt to this change. Signed-off-by: Mauricio Vásquez --- src/python/bcc/containers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/python/bcc/containers.py b/src/python/bcc/containers.py index b55e0500..48c1fcc6 100644 --- a/src/python/bcc/containers.py +++ b/src/python/bcc/containers.py @@ -51,7 +51,10 @@ def _mntns_filter_func_writer(mntnsmap): * more likely to change. */ struct mnt_namespace { + // This field was removed in https://github.com/torvalds/linux/commit/1a7b8969e664d6af328f00fe6eb7aabd61a71d13 + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0) atomic_t count; + #endif struct ns_common ns; }; -- 2.34.1