代码拉取完成,页面将自动刷新
同步操作将从 src-anolis-os/bcc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 9051043a126a838902b88d144eea1b631d2c3eef Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
Date: Tue, 27 Apr 2021 15:13:12 +0200
Subject: [PATCH] Fix BPF(src_file="foo")
Since commit 75f20a15 ("Use string type for comparison to PATH
elements"), src_file isn't working anymore. Somehow, two wrongs
(ArgString __str__() returning a bytes object and joining a bytes and
what was supposed to be a string) did make a right.
It fixes the following error in netqtop and deadlock:
Traceback (most recent call last):
File "/usr/share/bcc/tools/netqtop", line 207, in <module>
b = BPF(src_file = EBPF_FILE)
File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 335, in __init__
src_file = BPF._find_file(src_file)
File "/usr/lib/python3.6/site-packages/bcc/__init__.py", line 255, in _find_file
t = b"/".join([os.path.abspath(os.path.dirname(argv0.__str__())), filename])
TypeError: sequence item 0: expected a bytes-like object, str found
---
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 90562cd7..eabe0a55 100644
--- a/src/python/bcc/__init__.py
+++ b/src/python/bcc/__init__.py
@@ -252,7 +252,7 @@ DEBUG_BTF = 0x20
if filename:
if not os.path.isfile(filename):
argv0 = ArgString(sys.argv[0])
- t = b"/".join([os.path.abspath(os.path.dirname(argv0.__str__())), filename])
+ t = b"/".join([os.path.abspath(os.path.dirname(argv0.__bytes__())), filename])
if os.path.isfile(t):
filename = t
else:
--
2.30.2
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。