tests/test_array.py: add clock_nanosleep to attach point
since glibc-2.31, the syscall of sleep is clock_nanosleep instead of
nanosleep
@@ -65,6 +65,8 @@ int do_sys_nanosleep(void *ctx) {
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()
@@ -98,6 +100,8 @@ int do_sys_nanosleep(void *ctx) {
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:
