summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHe Zhe <zhe.he@windriver.com>2020-08-14 03:12:32 +0000
committerKhem Raj <raj.khem@gmail.com>2020-08-14 06:56:50 -0700
commit65297fede98499ff59b847a8119146817a36a9cb (patch)
tree483267e8ad34898638f70a688ea39de65ece82cf
parent2353b178067522545cc0e892789d5b87c1213fdd (diff)
downloadmeta-clang-65297fede98499ff59b847a8119146817a36a9cb.tar.gz
bcc: trace: Fix failing to exit loops
/usr/share/bcc/tools/trace do_sys_open -M 1 PID TID COMM FUNC 3740 3740 irqbalance do_sys_open Exception ignored on calling ctypes callback function: <function PerfEventArray.open_perf_buffer.<locals>.raw_cb at 0x7f7c9efea280> Traceback (most recent call last): File "/usr/lib64/python3.8/site-packages/bcc/table.py", line 685, in raw_cb_ callback(cpu, data, size) File "/usr/share/bcc/tools/trace", line 630, in print_event exit() File "/usr/lib64/python3.8/sitebuiltins.py", line 26, in __call_ raise SystemExit(code) SystemExit: None Class Probe::print_event is used as a callback of a ctypes wrapper. With Yocto latest python v3.8.5, the exception raised by exit() is ignored and thus trace cannot exit. Use os._exit(0) instead. Signed-off-by: He Zhe <zhe.he@windriver.com>
-rw-r--r--dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch46
-rw-r--r--dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb1
2 files changed, 47 insertions, 0 deletions
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch
new file mode 100644
index 0000000..e39e21f
--- /dev/null
+++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc/0001-tools-trace.py-Fix-failing-to-exit.patch
@@ -0,0 +1,46 @@
1From a9f59fc8605de1bcca0b6c2d8132585f40c3b9bc Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Thu, 13 Aug 2020 11:25:58 +0800
4Subject: [PATCH] tools/trace.py: Fix failing to exit
5
6Class Probe::print_event is used as a callback of a ctypes wrapper. With
7Yocto latest python v3.8.5, the exception raised by exit() is ignored and
8thus trace cannot exit. Use os._exit(0) instead.
9
10$ /usr/share/bcc/tools/trace do_sys_open -M 1
11PID TID COMM FUNC
123740 3740 irqbalance do_sys_open
13Exception ignored on calling ctypes callback function:
14<function PerfEventArray.open_perf_buffer.<locals>.raw_cb at 0x7f7c9efea280>
15Traceback (most recent call last):
16File "/usr/lib64/python3.8/site-packages/bcc/table.py", line 685, in raw_cb_
17callback(cpu, data, size)
18File "/usr/share/bcc/tools/trace", line 630, in print_event
19exit()
20File "/usr/lib64/python3.8/sitebuiltins.py", line 26, in __call_
21raise SystemExit(code)
22SystemExit: None
23
24Upstream-Status: Pending
25
26Signed-off-by: He Zhe <zhe.he@windriver.com>
27---
28 tools/trace.py | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-)
30
31diff --git a/tools/trace.py b/tools/trace.py
32index 7a61594f..d09dd2a8 100755
33--- a/tools/trace.py
34+++ b/tools/trace.py
35@@ -627,7 +627,7 @@ BPF_PERF_OUTPUT(%s);
36 Probe.event_count += 1
37 if Probe.max_events is not None and \
38 Probe.event_count >= Probe.max_events:
39- exit()
40+ os._exit(0)
41 sys.stdout.flush()
42
43 def attach(self, bpf, verbose):
44--
452.17.1
46
diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb
index 0e55384..a9ae91e 100644
--- a/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb
+++ b/dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb
@@ -18,6 +18,7 @@ SRC_URI = "gitsm://github.com/iovisor/bcc \
18 file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \ 18 file://0001-python-CMakeLists.txt-Remove-check-for-host-etc-debi.patch \
19 file://0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch \ 19 file://0001-tools-opensnoop-snoop-do_sys_openat2-for-kernel-v5.6.patch \
20 file://0001-Replace-kprobe-function-blk_account_io_completion-to.patch \ 20 file://0001-Replace-kprobe-function-blk_account_io_completion-to.patch \
21 file://0001-tools-trace.py-Fix-failing-to-exit.patch \
21 " 22 "
22 23
23SRCREV = "e41f7a3be5c8114ef6a0990e50c2fbabea0e928e" 24SRCREV = "e41f7a3be5c8114ef6a0990e50c2fbabea0e928e"