Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-07-01 Thread Hao Luo
On Tue, Jun 30, 2020 at 7:26 PM Yonghong Song wrote: > > > > On 6/30/20 5:10 PM, Hao Luo wrote: > > Ok, with the help of my colleague Ian Rogers, I think we solved the > > mystery. Clang actually inlined hrtimer_nanosleep() inside > > SyS_nanosleep(), so there is no call to that function throughou

Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-06-30 Thread Yonghong Song
On 6/30/20 5:10 PM, Hao Luo wrote: Ok, with the help of my colleague Ian Rogers, I think we solved the mystery. Clang actually inlined hrtimer_nanosleep() inside SyS_nanosleep(), so there is no call to that function throughout the path of the nanosleep syscall. I've been looking at the functio

Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-06-30 Thread Hao Luo
Ok, with the help of my colleague Ian Rogers, I think we solved the mystery. Clang actually inlined hrtimer_nanosleep() inside SyS_nanosleep(), so there is no call to that function throughout the path of the nanosleep syscall. I've been looking at the function body of hrtimer_nanosleep for quite so

Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-06-30 Thread Bill Wendling
On Tue, Jun 30, 2020 at 3:48 PM Hao Luo wrote: > > On Tue, Jun 30, 2020 at 1:37 PM Yonghong Song wrote: > > > > On 6/30/20 11:49 AM, Hao Luo wrote: > > > The test_vmlinux test uses hrtimer_nanosleep as hook to test tracing > > > programs. But it seems Clang may have done an aggressive optimizatio

Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-06-30 Thread Hao Luo
On Tue, Jun 30, 2020 at 1:37 PM Yonghong Song wrote: > > On 6/30/20 11:49 AM, Hao Luo wrote: > > The test_vmlinux test uses hrtimer_nanosleep as hook to test tracing > > programs. But it seems Clang may have done an aggressive optimization, > > causing fentry and kprobe to not hook on this functio

Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-06-30 Thread Andrii Nakryiko
On Tue, Jun 30, 2020 at 1:47 PM Hao Luo wrote: > > The test_vmlinux test uses hrtimer_nanosleep as hook to test tracing > programs. But it seems Clang may have done an aggressive optimization, > causing fentry and kprobe to not hook on this function properly on a > Clang build kernel. > > A possib

Re: [PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-06-30 Thread Yonghong Song
On 6/30/20 11:49 AM, Hao Luo wrote: The test_vmlinux test uses hrtimer_nanosleep as hook to test tracing programs. But it seems Clang may have done an aggressive optimization, causing fentry and kprobe to not hook on this function properly on a Clang build kernel. Could you explain why it do

[PATCH bpf-next] selftests/bpf: Switch test_vmlinux to use hrtimer_range_start_ns.

2020-06-30 Thread Hao Luo
The test_vmlinux test uses hrtimer_nanosleep as hook to test tracing programs. But it seems Clang may have done an aggressive optimization, causing fentry and kprobe to not hook on this function properly on a Clang build kernel. A possible fix is switching to use a more reliable function, e.g. the