May I ask what's the map that fd 0 is mapped to? IIUC, it looks like
the tests (of tracing programs) access the map of fd 0 and the
verifier complains the map is not preallocated. I think it's faster
just ask here.
Thanks,
Hao
On Thu, Oct 29, 2020 at 1:49 PM Hao Luo wrote:
>
> S
Sure, let me take a look at it.
On Thu, Oct 29, 2020 at 1:43 PM Andrii Nakryiko
wrote:
>
> Hao,
>
> This seems to be coming from resolve_pseudo_ldimm64(), could you
> please take a look? Thanks!
>
> -- Andrii
>
> On Thu, Oct 29, 2020 at 5:58 AM kernel test robot wrote:
> >
> > Greeting,
> >
> >
On Tue, Oct 20, 2020 at 10:10 AM Andrii Nakryiko
wrote:
>
> On Tue, Oct 20, 2020 at 10:05 AM Hao Luo wrote:
> >
> > Thanks for reporting this and cc'ing me. I forgot to update the error
> > messages when renaming the flags. I will send a patch to fix the error
&g
Thanks for reporting this and cc'ing me. I forgot to update the error
messages when renaming the flags. I will send a patch to fix the error
message.
The commit
commit f3d9054ba8ff1df0fc44e507e3a01c0964cabd42
Author: Hao Luo
AuthorDate: Wed Jul 8 13:44:10 2020 -0700
btf_encoder:
Ack. Sent one with just deletion.
Hao
On Tue, Oct 6, 2020 at 7:04 PM Alexei Starovoitov
wrote:
>
> On Tue, Oct 06, 2020 at 06:23:13PM -0700, Hao Luo wrote:
> > Commit 4976b718c355 ("bpf: Introduce pseudo_btf_id") switched
> > the order of check_subprogs() a
k for subprogs comes first. It's now
pointless to validate that half of ldimm64 won't be the last
instruction.
Tested:
# ./test_verifier
Summary: 1129 PASSED, 537 SKIPPED, 0 FAILED
and the full set of bpf selftests.
Fixes: 4976b718c355 ("bpf: Introduce pseudo_btf_id")
Sig
k for subprogs comes first. It's now
pointless to validate that half of ldimm64 won't be the last
instruction.
Tested:
# ./test_verifier
Summary: 1129 PASSED, 537 SKIPPED, 0 FAILED
and the full set of bpf selftests.
Fixes: 4976b718c355 ("bpf: Introduce pseudo_btf_id")
Sig
On Tue, Oct 6, 2020 at 5:43 PM Andrii Nakryiko
wrote:
>
> On Tue, Oct 6, 2020 at 4:45 PM Hao Luo wrote:
> >
> > Commit 4976b718c355 ("bpf: Introduce pseudo_btf_id") switched
> > the order of check_subprogs() and resolve_pseudo_ldimm() in
> > the verif
k for subprogs comes
first. Fix the expection of the error message.
Tested:
# ./test_verifier
Summary: 1130 PASSED, 538 SKIPPED, 0 FAILED
and the full set of bpf selftests.
Fixes: 4976b718c355 ("bpf: Introduce pseudo_btf_id")
Signed-off-by: Hao Luo
---
tools/testing/selftests/bpf/ver
Ack. Will do.
On Tue, Oct 6, 2020 at 12:05 PM Alexei Starovoitov
wrote:
>
> On Tue, Sep 29, 2020 at 4:50 PM Hao Luo wrote:
> >
> > - ret = replace_map_fd_with_map_ptr(env);
> > - if (ret < 0)
> > - goto skip_full_check;
> > -
&g
Thanks, Alexei and Andrii and other reviewers for the comments. It's a
pleasure to work with you and contribute to bpf.
Hao
On Fri, Oct 2, 2020 at 3:16 PM Alexei Starovoitov
wrote:
>
> On Tue, Sep 29, 2020 at 11:48 PM Hao Luo wrote:
> >
> > Ah, this is the bug in pahole
PM Alexei Starovoitov
wrote:
>
> On Tue, Sep 29, 2020 at 4:50 PM Hao Luo wrote:
> >
> > v3 -> v4:
> > - Rebasing
> > - Cast bpf_[per|this]_cpu_ptr's parameter to void __percpu * before
> >passing into per_cpu_ptr.
>
&g
On Mon, Sep 21, 2020 at 11:11 AM Andrii Nakryiko
wrote:
>
> On Thu, Sep 17, 2020 at 12:14 PM Hao Luo wrote:
> >
> > I need to cast the pointer to "const void __percpu *" before passing
> > into per_cpu_ptr. I will update and resend.
>
> You can try jus
Hi, Andrii,
Thanks for taking a look. Sorry for the late reply. Spent some time on
rebasing and fixing a build issue in my development environment that
started happening in v5.9.
On Mon, Sep 21, 2020 at 11:09 AM Andrii Nakryiko
wrote:
>
> On Wed, Sep 16, 2020 at 3:39 PM Hao Luo
: Hao Luo
---
.../testing/selftests/bpf/prog_tests/ksyms.c | 38 --
.../selftests/bpf/prog_tests/ksyms_btf.c | 70 +++
.../selftests/bpf/progs/test_ksyms_btf.c | 23 ++
tools/testing/selftests/bpf/trace_helpers.c | 27 +++
tools/testing/selftests/bpf
y: Andrii Nakryiko
Signed-off-by: Hao Luo
---
include/linux/bpf_verifier.h | 7 ++
include/linux/btf.h| 15
include/uapi/linux/bpf.h | 36 +++---
kernel/bpf/btf.c | 15
kernel/bpf/verifier.c | 125 +
void') will not have such btf_id,
but it has the symbol's address (read from kallsyms) and its value is
treated as a raw pointer.
Acked-by: Andrii Nakryiko
Signed-off-by: Hao Luo
---
tools/lib/bpf/libbpf.c | 112 -
1 file changed, 99 insertions(
program.
Acked-by: Andrii Nakryiko
Signed-off-by: Hao Luo
---
include/linux/bpf.h| 2 ++
include/uapi/linux/bpf.h | 13 +
kernel/bpf/helpers.c | 14 ++
kernel/bpf/verifier.c | 11 ---
kernel/trace/bpf_trace.c | 2
or kernel BTF that does not have VARs encoded, the
selftests will be skipped.
[1]
https://git.kernel.org/pub/scm/devel/pahole/pahole.git/commit/?id=f3d9054ba8ff1df0fc44e507e3a01c0964cabd42
[2] https://www.spinics.net/lists/dwarves/msg00451.html
Hao Luo (6):
bpf: Introduce pseudo_btf_id
b
-off-by: Hao Luo
---
include/linux/bpf.h| 4 +++
include/linux/btf.h| 11 ++
include/uapi/linux/bpf.h | 18 ++
kernel/bpf/btf.c | 10 --
kernel/bpf/helpers.c | 18 ++
kernel/bpf/verifier.c | 64
type PTR_TO_MEM, which also supports direct pointer
dereference.
Acked-by: Andrii Nakryiko
Signed-off-by: Hao Luo
---
.../selftests/bpf/prog_tests/ksyms_btf.c | 18 +++
.../selftests/bpf/progs/test_ksyms_btf.c | 32 +++
2 files changed, 50 insertions(+)
diff --git a/
t WARNING on bpf-next/master]
>
> url:
> https://github.com/0day-ci/linux/commits/Hao-Luo/bpf-BTF-support-for-ksyms/20200917-064052
> base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git
> master
> config: powerpc-randconfig-s032-20200916 (attached as .confi
Selftests for typed ksyms. Tests two types of ksyms: one is a struct,
the other is a plain int. This tests two paths in the kernel. Struct
ksyms will be converted into PTR_TO_BTF_ID by the verifier while int
typed ksyms will be converted into PTR_TO_MEM.
Signed-off-by: Hao Luo
---
.../testing
program.
Acked-by: Andrii Nakryiko
Signed-off-by: Hao Luo
---
include/linux/bpf.h| 2 ++
include/uapi/linux/bpf.h | 13 +
kernel/bpf/helpers.c | 14 ++
kernel/bpf/verifier.c | 11 ---
kernel/trace/bpf_trace.c | 2
can also read the address of the
ksym's corresponding kernel var from kallsyms and use that to fill
dst_reg.
Therefore, the proper functionality of pseudo_btf_id depends on (1)
kallsyms and (2) the encoding of kernel global VARs in pahole, which
should be available since pahole v1.18.
Sign
type PTR_TO_MEM, which also supports direct pointer
dereference.
Acked-by: Andrii Nakryiko
Signed-off-by: Hao Luo
---
.../selftests/bpf/prog_tests/ksyms_btf.c | 18 +++
.../selftests/bpf/progs/test_ksyms_btf.c | 32 +++
2 files changed, 50 insertions(+)
diff --git a/
-off-by: Hao Luo
---
include/linux/bpf.h| 4 +++
include/linux/btf.h| 11 ++
include/uapi/linux/bpf.h | 18 ++
kernel/bpf/btf.c | 10 --
kernel/bpf/helpers.c | 18 ++
kernel/bpf/verifier.c | 64
void') will not have such btf_id,
but it has the symbol's address (read from kallsyms) and its value is
treated as a raw pointer.
Signed-off-by: Hao Luo
---
tools/lib/bpf/libbpf.c | 112 -
1 file changed, 99 insertions(+), 13 deletions(-)
d
le/pahole.git/commit/?id=f3d9054ba8ff1df0fc44e507e3a01c0964cabd42
[2] https://www.spinics.net/lists/dwarves/msg00451.html
Hao Luo (6):
bpf: Introduce pseudo_btf_id
bpf/libbpf: BTF support for typed ksyms
selftests/bpf: ksyms_btf to test typed ksyms
bpf: Introduce bpf_per_cpu_ptr()
bpf: In
Thanks for taking a look!
On Fri, Sep 4, 2020 at 1:15 PM Andrii Nakryiko
wrote:
>
> On Thu, Sep 3, 2020 at 3:35 PM Hao Luo wrote:
> >
> > Test bpf_per_cpu_ptr() and bpf_this_cpu_ptr(). Test two paths in the
> > kernel. If the base pointer points to a struct, the ret
Thanks for taking a look!
On Fri, Sep 4, 2020 at 1:09 PM Andrii Nakryiko
wrote:
>
> On Thu, Sep 3, 2020 at 3:35 PM Hao Luo wrote:
> >
> > Add bpf_this_cpu_ptr() to help access percpu var on this cpu. This
> > helper always returns a valid pointer, therefore no need to
Thanks for review, Andrii.
One question, should I add bpf_{per, this}_cpu_ptr() to the
bpf_base_func_proto() in kernel/bpf/helpers.c?
On Fri, Sep 4, 2020 at 1:04 PM Andrii Nakryiko
wrote:
>
> On Thu, Sep 3, 2020 at 3:35 PM Hao Luo wrote:
> >
> > Add bpf_per_cpu_ptr() to
Thanks for taking a look, Andrii.
On Fri, Sep 4, 2020 at 12:49 PM Andrii Nakryiko
wrote:
>
> On Thu, Sep 3, 2020 at 3:35 PM Hao Luo wrote:
> >
> > Selftests for typed ksyms. Tests two types of ksyms: one is a struct,
> > the other is a plain int. This tests two pat
Will follow the libbpf logging convention. Thanks for the suggestions.
On Fri, Sep 4, 2020 at 12:34 PM Andrii Nakryiko
wrote:
>
> On Thu, Sep 3, 2020 at 3:34 PM Hao Luo wrote:
> >
> > If a ksym is defined with a type, libbpf will try to find the ksym's btf
> > info
Andrii,
Sorry for the late reply. Your suggestions are concrete and helpful. I
can apply them in v3.
Thanks!
Hao
On Fri, Sep 4, 2020 at 12:05 PM Andrii Nakryiko
wrote:
>
> On Thu, Sep 3, 2020 at 3:34 PM Hao Luo wrote:
> >
> > Pseudo_btf_id is a type of ld_imm insn that asso
Selftests for typed ksyms. Tests two types of ksyms: one is a struct,
the other is a plain int. This tests two paths in the kernel. Struct
ksyms will be converted into PTR_TO_BTF_ID by the verifier while int
typed ksyms will be converted into PTR_TO_MEM.
Signed-off-by: Hao Luo
---
.../testing
program.
Signed-off-by: Hao Luo
---
include/linux/bpf.h| 1 +
include/uapi/linux/bpf.h | 14 ++
kernel/bpf/verifier.c | 10 +++---
kernel/trace/bpf_trace.c | 14 ++
tools/include/uapi/linux/bpf.h | 14 ++
5 files changed, 50
void') will not have such btf_id,
but it has the symbol's address (read from kallsyms) and its value is
treated as a raw pointer.
Signed-off-by: Hao Luo
---
tools/lib/bpf/libbpf.c | 116 -
1 file changed, 102 insertions(+), 14 deletions(-)
d
-off-by: Hao Luo
---
include/linux/bpf.h| 3 ++
include/linux/btf.h| 11 ++
include/uapi/linux/bpf.h | 17 +
kernel/bpf/btf.c | 10 --
kernel/bpf/verifier.c | 66 +++---
kernel/trace/bpf_trace.c
dwarves/msg00451.html
Hao Luo (6):
bpf: Introduce pseudo_btf_id
bpf/libbpf: BTF support for typed ksyms
bpf/selftests: ksyms_btf to test typed ksyms
bpf: Introduce bpf_per_cpu_ptr()
bpf: Introduce bpf_this_cpu_ptr()
bpf/selftests: Test for bpf_per_cpu_ptr() and bpf_this_cpu_ptr()
can also read the address of the
ksym's corresponding kernel var from kallsyms and use that to fill
dst_reg.
Therefore, the proper functionality of pseudo_btf_id depends on (1)
kallsyms and (2) the encoding of kernel global VARs in pahole, which
should be available since pahole v1.18.
Sign
type PTR_TO_MEM, which also supports direct pointer
dereference.
Acked-by: Andrii Nakryiko
Signed-off-by: Hao Luo
---
.../selftests/bpf/prog_tests/ksyms_btf.c | 10 +++
.../selftests/bpf/progs/test_ksyms_btf.c | 26 +++
2 files changed, 36 insertions(+)
diff --git a/
The returned value of bpf_object__open_file() should be checked with
libbpf_get_error() rather than NULL. This fix prevents test_progs from
crash when test_global_data.o is not present.
Signed-off-by: Hao Luo
---
tools/testing/selftests/bpf/prog_tests/global_data_init.c | 3 ++-
1 file changed
No problem! Let me update and resend.
On Thu, Sep 3, 2020 at 11:50 AM Andrii Nakryiko
wrote:
>
> On Thu, Sep 3, 2020 at 11:02 AM Hao Luo wrote:
> >
> > The returned value of bpf_object__open_file() should be checked with
> > IS_ERR() rather than NULL. This fix makes t
The returned value of bpf_object__open_file() should be checked with
IS_ERR() rather than NULL. This fix makes test_progs not crash when
test_global_data.o is not present.
Signed-off-by: Hao Luo
---
tools/testing/selftests/bpf/prog_tests/global_data_init.c | 2 +-
1 file changed, 1 insertion
On Tue, Sep 1, 2020 at 4:55 PM Andrii Nakryiko
wrote:
>
> On Tue, Sep 1, 2020 at 1:35 PM Hao Luo wrote:
> >
> > On Tue, Sep 1, 2020 at 11:11 AM Andrii Nakryiko
> > wrote:
> > >
> > > On Thu, Aug 27, 2020 at 3:29 PM Hao Luo wrote:
> > > >
&
On Tue, Sep 1, 2020 at 11:11 AM Andrii Nakryiko
wrote:
>
> On Thu, Aug 27, 2020 at 3:29 PM Hao Luo wrote:
> >
> > On Fri, Aug 21, 2020 at 3:37 PM Andrii Nakryiko
> > wrote:
> > >
> > > On Wed, Aug 19, 2020 at 3:42 PM Hao Luo wrote:
> > > >
On Tue, Sep 1, 2020 at 11:12 AM Andrii Nakryiko
wrote:
>
> On Thu, Aug 27, 2020 at 8:42 PM Hao Luo wrote:
> >
[...]
> > > >
> > > > -extern const struct rq runqueues __ksym; /* struct type global var. */
> > > > +extern const struc
Thanks for taking a look!
On Fri, Aug 21, 2020 at 8:30 PM Andrii Nakryiko
wrote:
>
> On Wed, Aug 19, 2020 at 3:42 PM Hao Luo wrote:
> >
> > Test bpf_per_cpu_ptr(). Test two paths in the kernel. If the base
> > pointer points to a struct, the returned reg is of type P
On Fri, Aug 21, 2020 at 3:37 PM Andrii Nakryiko
wrote:
>
> On Wed, Aug 19, 2020 at 3:42 PM Hao Luo wrote:
> >
> > If a ksym is defined with a type, libbpf will try to find the ksym's btf
> > information from kernel btf. If a valid btf entry for the ksym is found,
>
On Sat, Aug 22, 2020 at 12:55 AM Andrii Nakryiko
wrote:
>
> On Sat, Aug 22, 2020 at 12:49 AM Hao Luo wrote:
> >
> > On Fri, Aug 21, 2020 at 8:31 PM Andrii Nakryiko
> > wrote:
> > >
> > > On Fri, Aug 21, 2020 at 8:26 PM Andrii Nakryiko
> > >
Yonghong,
An update on this thread. I successfully reproduced this issue on a
8.2.0 gcc compiler, It looks like gcc 4.9 did not have this issue. I
was also using clang which did not show this bug.
It seems having a DW_AT_specification that refers to another
DW_TAG_variable isn't handled in pahole
On Fri, Aug 21, 2020 at 8:31 PM Andrii Nakryiko
wrote:
>
> On Fri, Aug 21, 2020 at 8:26 PM Andrii Nakryiko
> wrote:
> >
> > On Wed, Aug 19, 2020 at 3:42 PM Hao Luo wrote:
> > >
> > > Add bpf_per_cpu_ptr() to help bpf programs access percpu vars.
> >
On Fri, Aug 21, 2020 at 4:03 PM Andrii Nakryiko
wrote:
>
> On Thu, Aug 20, 2020 at 10:32 AM Yonghong Song wrote:
> >
> >
> >
> > On 8/19/20 3:40 PM, Hao Luo wrote:
> > > Selftests for typed ksyms. Tests two types of ksyms: one is a struct,
> > > t
ublic APIs.
Hao
On Fri, Aug 21, 2020 at 7:43 PM Andrii Nakryiko
wrote:
>
> On Fri, Aug 21, 2020 at 5:43 PM Hao Luo wrote:
> >
> > On Fri, Aug 21, 2020 at 2:50 PM Andrii Nakryiko
> > wrote:
> > >
> > > On Thu, Aug 20, 2020 at 10:22 AM Yonghong Song wrote:
On Fri, Aug 21, 2020 at 2:50 PM Andrii Nakryiko
wrote:
>
> On Thu, Aug 20, 2020 at 10:22 AM Yonghong Song wrote:
> >
> >
> >
> > On 8/19/20 3:40 PM, Hao Luo wrote:
> > > For a ksym to be safely dereferenced and accessed, its type defined in
> >
On Thu, Aug 20, 2020 at 2:53 PM Alexei Starovoitov
wrote:
>
> Why did you choose to do it during main do_check() walk instead of this
> pre-pass ?
> check_ld_imm() can be called multiple times for the same insn,
> so it's faster and less surprising to do it during
> replace_map_fd_with_map_ptr()
Yonghong,
Thank you for taking a look. Explicitly cc'ing Arnaldo to see if he
has any immediate insights. In the meantime, I'll dedicate time to
investigate this issue you found.
Thanks,
Hao
On Thu, Aug 20, 2020 at 8:23 AM Yonghong Song wrote:
>
>
>
> On 8/19/20
Propagate BPF_PSEUDO_BTF_ID from include/linux/uapi/bpf.h to
tools/include/linux/uapi/bpf.h.
Signed-off-by: Hao Luo
---
tools/include/uapi/linux/bpf.h | 38 ++
1 file changed, 29 insertions(+), 9 deletions(-)
diff --git a/tools/include/uapi/linux/bpf.h b/tools
Add bpf_per_cpu_ptr() to help bpf programs access percpu vars.
bpf_per_cpu_ptr() has the same semantic as per_cpu_ptr() in the kernel
except that it may return NULL. This happens when the cpu parameter is
out of range. So the caller must check the returned value.
Signed-off-by: Hao Luo
void') will not have such btf_id,
but it has the symbol's address (read from kallsyms) and its value is
treated as a raw pointer.
Signed-off-by: Hao Luo
---
tools/lib/bpf/libbpf.c | 130 -
1 file changed, 114 insertions(+), 16 deletions(-)
d
also supports direct pointer dereference.
Signed-off-by: Hao Luo
---
.../testing/selftests/bpf/prog_tests/ksyms_btf.c | 4
.../testing/selftests/bpf/progs/test_ksyms_btf.c | 15 ++-
2 files changed, 18 insertions(+), 1 deletion(-)
diff --git a/tools/testing/selftests/bpf/prog_
For a ksym to be safely dereferenced and accessed, its type defined in
bpf program should basically match its type defined in kernel. Implement
a help function for a quick matching, which is used by libbpf when
resolving the kernel btf_id of a ksym.
Signed-off-by: Hao Luo
---
tools/lib/bpf
Sync tools/include/linux/uapi/bpf.h with include/linux/uapi/bpf.h
Signed-off-by: Hao Luo
---
tools/include/uapi/linux/bpf.h | 15 +++
1 file changed, 15 insertions(+)
diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
index 468376f2910b..7e3dfb2bbb86
Selftests for typed ksyms. Tests two types of ksyms: one is a struct,
the other is a plain int. This tests two paths in the kernel. Struct
ksyms will be converted into PTR_TO_BTF_ID by the verifier while int
typed ksyms will be converted into PTR_TO_MEM.
Signed-off-by: Hao Luo
---
.../selftests
VAR, its name and type.
- Checks in libbpf on type compatibility of ksyms.
- Add bpf_per_cpu_ptr() to access kernel percpu vars. Introduced
new ARG and RET types for this helper.
Hao Luo (8):
bpf: Introduce pseudo_btf_id
bpf: Propagate BPF_PSEUDO_BTF_ID to uapi headers in /tools
bpf: I
can also read the address of the
ksym's corresponding kernel var from kallsyms and use that to fill
dst_reg.
Therefore, the proper functionality of pseudo_btf_id depends on (1)
kallsyms and (2) the encoding of kernel global VARs in pahole, which
should be available since pahole v1.18.
Sign
Ack. Will have that in v2.
Hao
On Mon, Jul 20, 2020 at 7:37 PM Andrii Nakryiko
wrote:
>
> On Mon, Jul 20, 2020 at 1:28 PM Hao Luo wrote:
> >
> > >
> > > This should ideally look like a real global variable extern:
> > >
> > > extern const s
>
> This should ideally look like a real global variable extern:
>
> extern const struct rq runqueues __ksym;
>
>
> But that's the case for non-per-cpu variables. You didn't seem to
> address per-CPU variables in this patch set. How did you intend to
> handle that? We should look at a possible BPF
Andrii,
Thanks for taking a look at this. You comments are clear, I will fix them in v2.
> Also, in the next version, please split kernel part and libbpf part
> into separate patches.
>
Got it. Will do.
> I don't think that's the right approach. It can't be the best effort.
> It's actually pret
Extend ksyms.c selftest to make sure BTF enables direct loads of ksyms.
Note that test is done against the kernel btf extended with kernel VARs.
Signed-off-by: Hao Luo
---
tools/testing/selftests/bpf/prog_tests/ksyms.c | 2 ++
tools/testing/selftests/bpf/progs/test_ksyms.c | 14
o carry the ksym's address (64bits) as well as
its btf_id (32bits), pseudo_btf_id uses ld_imm64's both imm and off
fields.
Signed-off-by: Hao Luo
---
include/uapi/linux/bpf.h | 37 +++--
kernel/bpf/verifier.c | 26 +++---
tools/include/ua
pahole changes that encode kernel vars into
btf.
Hao Luo (2):
bpf: BTF support for __ksym externs
selftests/bpf: Test __ksym externs with BTF
include/uapi/linux/bpf.h | 37 ++
kernel/bpf/verifier.c | 26 --
tools/incl
l_attach 0 nsec
test_vmlinux:PASS:tp 0 nsec
test_vmlinux:PASS:raw_tp 0 nsec
test_vmlinux:PASS:tp_btf 0 nsec
test_vmlinux:PASS:kprobe 0 nsec
test_vmlinux:PASS:fentry 0 nsec
Signed-off-by: Hao Luo
Acked-by: Andrii Nakryiko
---
Changelog since v1:
- More accurate commit messages
tools/testing/self
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 the
quite some time, but clearly overlooked the
caller of hrtimer_nanosleep. hrtimer_nanosleep is pretty short and
there are many constants, inlining would not be too surprising.
Sigh...
Hao
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 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 kp
nsec
test_vmlinux:PASS:raw_tp 0 nsec
test_vmlinux:PASS:tp_btf 0 nsec
test_vmlinux:PASS:kprobe 0 nsec
test_vmlinux:PASS:fentry 0 nsec
Signed-off-by: Hao Luo
---
tools/testing/selftests/bpf/progs/test_vmlinux.c | 16
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/tools/testing/self
78 matches
Mail list logo