diff --git a/bcc-0.25.0-Remove-test_free_bcc_memory-python-test.patch b/bcc-0.25.0-Remove-test_free_bcc_memory-python-test.patch new file mode 100644 index 0000000000000000000000000000000000000000..72cd64e4adbd6338c970f58cd0b97d035f0912b6 --- /dev/null +++ b/bcc-0.25.0-Remove-test_free_bcc_memory-python-test.patch @@ -0,0 +1,94 @@ +From 07e8ed8aa129a3b2958fd2180dbb0f942e9f6ff6 Mon Sep 17 00:00:00 2001 +From: yonghong-song +Date: Wed, 21 Feb 2024 23:12:15 -0800 +Subject: [PATCH] Remove test_free_bcc_memory python test (#4917) + +I have seen multiple following test failures on fedora 38 test machine: + + 35: Traceback (most recent call last): + 35: File "/bcc/tests/python/test_free_bcc_memory.py", line 49, in testFreeLLVMMemory + 35: self.assertTrue(rss1 > rss2) + 35: AssertionError: False is not true + +It is possible fedora 38 vm might do something to force release memory. +Let us remove this test as it does not really test any core functionality. + +Signed-off-by: Yonghong Song +--- + tests/python/CMakeLists.txt | 2 -- + tests/python/test_free_bcc_memory.py | 52 ---------------------------- + 2 files changed, 54 deletions(-) + delete mode 100755 tests/python/test_free_bcc_memory.py + +diff --git a/tests/python/CMakeLists.txt b/tests/python/CMakeLists.txt +index a42a16c..a618455 100644 +--- a/tests/python/CMakeLists.txt ++++ b/tests/python/CMakeLists.txt +@@ -79,8 +79,6 @@ add_test(NAME py_test_usdt3 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${TEST_WRAPPER} py_test_usdt3 sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_usdt3.py) + add_test(NAME py_test_license WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${TEST_WRAPPER} py_test_license sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_license.py) +-add_test(NAME py_test_free_bcc_memory WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} +- COMMAND ${TEST_WRAPPER} py_test_free_bcc_memory sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_free_bcc_memory.py) + add_test(NAME py_test_rlimit WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${TEST_WRAPPER} py_test_rlimit sudo ${CMAKE_CURRENT_SOURCE_DIR}/test_rlimit.py) + add_test(NAME py_test_lpm_trie WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + +diff --git a/tests/python/test_free_bcc_memory.py b/tests/python/test_free_bcc_memory.py +deleted file mode 100755 +index 232baa6..0000000 +--- a/tests/python/test_free_bcc_memory.py ++++ /dev/null +@@ -1,52 +0,0 @@ +-#!/usr/bin/env python3 +-# +-# USAGE: test_usdt.py +-# +-# Copyright 2018 Facebook, Inc +-# Licensed under the Apache License, Version 2.0 (the "License") +- +-from __future__ import print_function +-from bcc import BPF +-from unittest import main, skipUnless, TestCase +-from subprocess import Popen, PIPE +-from utils import kernel_version_ge +-import os +- +-class TestFreeLLVMMemory(TestCase): +- def getRssFile(self): +- p = Popen(["cat", "/proc/" + str(os.getpid()) + "/status"], +- stdout=PIPE) +- rss = None +- unit = None +- for line in p.stdout.readlines(): +- if (line.find(b'RssFile') >= 0): +- rss = line.split(b' ')[-2] +- unit = line.split(b' ')[-1].rstrip() +- break +- +- return [rss, unit] +- +- @skipUnless(kernel_version_ge(4,5), "requires kernel >= 4.5") +- def testFreeLLVMMemory(self): +- text = "int test() { return 0; }" +- b = BPF(text=text) +- +- # get the RssFile before freeing bcc memory +- [rss1, unit1] = self.getRssFile() +- self.assertTrue(rss1 != None) +- +- # free the bcc memory +- self.assertTrue(b.free_bcc_memory() == 0) +- +- # get the RssFile after freeing bcc memory +- [rss2, unit2] = self.getRssFile() +- self.assertTrue(rss2 != None) +- +- self.assertTrue(unit1 == unit2) +- +- print("Before freeing llvm memory: RssFile: ", rss1, unit1) +- print("After freeing llvm memory: RssFile: ", rss2, unit2) +- self.assertTrue(rss1 > rss2) +- +-if __name__ == "__main__": +- main() diff --git a/bcc.spec b/bcc.spec index 6a11f1ea18d0fb108f6ae41c4b369dcd84daf235..72fbfe8693b4aa464386da8a2533908422c6600e 100644 --- a/bcc.spec +++ b/bcc.spec @@ -1,4 +1,4 @@ -%global anolis_release .0.1 +%global anolis_release .0.2 # luajit is not available RHEL 8 %bcond_with lua @@ -34,6 +34,7 @@ Patch14: %{name}-%{version}-tools-tcpstates-fix-IPv6-journal.patch Patch15: %{name}-%{version}-clang-check-header-ownership-4928.patch Patch16: %{name}-%{version}-clang-Fix-file_exists_and_ownedby-return-value-4935.patch Patch17: %{name}-%{version}-clang-fail-when-the-kheaders-ownership-is-wrong-4928.patch +Patch18: %{name}-%{version}-Remove-test_free_bcc_memory-python-test.patch Patch1000: %{name}-%{version}-Add-libbpf-with-commit-0667206913b.patch Patch1001: 0001-support-anolis-own-feature-bpf-rich-container.patch @@ -146,6 +147,7 @@ Command line tools for BPF Compiler Collection (BCC) %patch5 -p1 %patch6 -p1 %endif +%patch18 -p1 %build @@ -260,6 +262,10 @@ done %changelog +* Thu Aug 06 2026 PengLAI Code - 0.25.0-9.0.2 +- Remove test_free_bcc_memory python test +- Upstream commit: 07e8ed8aa129a3b2958fd2180dbb0f942e9f6ff6 + * Fri Nov 08 2024 Hui Li - 0.25.0-9.0.1 - Add support for loongarch64 - support bpf rich container (yingyu.dtc@alibaba-inc.com)