Skip to content

Commit

Permalink
tests/test_array.py: add clock_nanosleep to attach point
Browse files Browse the repository at this point in the history
since glibc-2.31, the syscall of sleep is clock_nanosleep instead of
nanosleep

Signed-off-by: Chunmei Xu <[email protected]>
  • Loading branch information
xuchunmei000 authored and yonghong-song committed Dec 29, 2020
1 parent 9541149 commit 59ab17e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/python/test_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def lost_cb(lost):
b = BPF(text=text)
b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"),
fn_name="do_sys_nanosleep")
b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"),
fn_name="do_sys_nanosleep")
b["events"].open_perf_buffer(cb, lost_cb=lost_cb)
subprocess.call(['sleep', '0.1'])
b.perf_buffer_poll()
Expand Down Expand Up @@ -98,6 +100,8 @@ def lost_cb(lost):
b = BPF(text=text)
b.attach_kprobe(event=b.get_syscall_fnname("nanosleep"),
fn_name="do_sys_nanosleep")
b.attach_kprobe(event=b.get_syscall_fnname("clock_nanosleep"),
fn_name="do_sys_nanosleep")
b["events"].open_perf_buffer(cb, lost_cb=lost_cb)
online_cpus = get_online_cpus()
for cpu in online_cpus:
Expand Down

0 comments on commit 59ab17e

Please sign in to comment.