From: Mauricio Vásquez Date: Fri, 16 Jul 2021 21:55:36 +0000 (-0500) Subject: tools: Fix filtering by mount namespace X-Git-Tag: v0.21.0~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef330a393be4b472627b1bfa7fbe50934e519e25;p=platform%2Fupstream%2Fbcc.git tools: Fix filtering by mount namespace 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 --- 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; };