diff options
author | He Zhe <zhe.he@windriver.com> | 2020-08-14 03:12:32 +0000 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-08-14 06:56:50 -0700 |
commit | 65297fede98499ff59b847a8119146817a36a9cb (patch) | |
tree | 483267e8ad34898638f70a688ea39de65ece82cf | |
parent | 2353b178067522545cc0e892789d5b87c1213fdd (diff) | |
download | meta-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.patch | 46 | ||||
-rw-r--r-- | dynamic-layers/openembedded-layer/recipes-devtools/bcc/bcc_0.15.0.bb | 1 |
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 @@ | |||
1 | From a9f59fc8605de1bcca0b6c2d8132585f40c3b9bc Mon Sep 17 00:00:00 2001 | ||
2 | From: He Zhe <zhe.he@windriver.com> | ||
3 | Date: Thu, 13 Aug 2020 11:25:58 +0800 | ||
4 | Subject: [PATCH] tools/trace.py: Fix failing to exit | ||
5 | |||
6 | Class Probe::print_event is used as a callback of a ctypes wrapper. With | ||
7 | Yocto latest python v3.8.5, the exception raised by exit() is ignored and | ||
8 | thus trace cannot exit. Use os._exit(0) instead. | ||
9 | |||
10 | $ /usr/share/bcc/tools/trace do_sys_open -M 1 | ||
11 | PID TID COMM FUNC | ||
12 | 3740 3740 irqbalance do_sys_open | ||
13 | Exception ignored on calling ctypes callback function: | ||
14 | <function PerfEventArray.open_perf_buffer.<locals>.raw_cb at 0x7f7c9efea280> | ||
15 | Traceback (most recent call last): | ||
16 | File "/usr/lib64/python3.8/site-packages/bcc/table.py", line 685, in raw_cb_ | ||
17 | callback(cpu, data, size) | ||
18 | File "/usr/share/bcc/tools/trace", line 630, in print_event | ||
19 | exit() | ||
20 | File "/usr/lib64/python3.8/sitebuiltins.py", line 26, in __call_ | ||
21 | raise SystemExit(code) | ||
22 | SystemExit: None | ||
23 | |||
24 | Upstream-Status: Pending | ||
25 | |||
26 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
27 | --- | ||
28 | tools/trace.py | 2 +- | ||
29 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
30 | |||
31 | diff --git a/tools/trace.py b/tools/trace.py | ||
32 | index 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 | -- | ||
45 | 2.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 | ||
23 | SRCREV = "e41f7a3be5c8114ef6a0990e50c2fbabea0e928e" | 24 | SRCREV = "e41f7a3be5c8114ef6a0990e50c2fbabea0e928e" |