8 Star 0 Fork 25

src-anolis-os/bcc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
bcc-0.25.0-Fix-get_kprobe_functions.patch 1.20 KB
一键复制 编辑 原始数据 按行查看 历史
renbo02 提交于 2023-06-30 15:51 +08:00 . update to bcc-0.25.0-2.el8
From c27899b15bca6188d34c0b87b3389eeda2a90cb5 Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Mon, 9 Jan 2023 18:17:20 +0100
Subject: [PATCH] Fix get_kprobe_functions
get_kprobe_functions will not only return a function that matches the
regular expression, but also any function that starts with a
substrings that matches it. This is obviously not the intended
behavior.
The issue is easily fixed by replacing re.match by re.fullmatch.
---
src/python/bcc/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/python/bcc/__init__.py b/src/python/bcc/__init__.py
index 7175b98e..970ddcc2 100644
--- a/src/python/bcc/__init__.py
+++ b/src/python/bcc/__init__.py
@@ -745,7 +745,7 @@ DEBUG_BTF = 0x20
# Exclude all gcc 8's extra .cold functions
elif re.match(b'^.*\.cold(\.\d+)?$', fn):
continue
- if (t.lower() in [b't', b'w']) and re.match(event_re, fn) \
+ if (t.lower() in [b't', b'w']) and re.fullmatch(event_re, fn) \
and fn not in blacklist:
fns.append(fn)
return set(fns) # Some functions may appear more than once
--
2.38.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/bcc.git
git@gitee.com:src-anolis-os/bcc.git
src-anolis-os
bcc
bcc
a8

搜索帮助