diff mbox series

perf test: Fix basic bpf filtering test

Message ID 20200817072754.58344-1-sumanthk@linux.ibm.com
State Not Applicable
Delegated to: BPF Maintainers
Headers show
Series perf test: Fix basic bpf filtering test | expand

Commit Message

Sumanth Korikkar Aug. 17, 2020, 7:27 a.m. UTC
BPF basic filtering test fails on s390x (when vmlinux debuginfo is
utilized instead of /proc/kallsyms)

Info:
- bpf_probe_load installs the bpf code at do_epoll_wait.
- For s390x, do_epoll_wait resolves to 3 functions including inlines.
  found inline addr: 0x43769e
  Probe point found: __s390_sys_epoll_wait+6
  found inline addr: 0x437290
  Probe point found: do_epoll_wait+0
  found inline addr: 0x4375d6
  Probe point found: __se_sys_epoll_wait+6
- add_bpf_event  creates evsel for every probe in a BPF object. This
  results in 3 evsels.

Solution:
- Expected result = 50% of the samples to be collected from epoll_wait *
  number of entries present in the evlist.

Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/tests/bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sumanth Korikkar Aug. 25, 2020, 8:32 a.m. UTC | #1
Kind Ping. Thank you.

On 8/17/20 9:27 AM, Sumanth Korikkar wrote:
> BPF basic filtering test fails on s390x (when vmlinux debuginfo is
> utilized instead of /proc/kallsyms)
>
> Info:
> - bpf_probe_load installs the bpf code at do_epoll_wait.
> - For s390x, do_epoll_wait resolves to 3 functions including inlines.
>    found inline addr: 0x43769e
>    Probe point found: __s390_sys_epoll_wait+6
>    found inline addr: 0x437290
>    Probe point found: do_epoll_wait+0
>    found inline addr: 0x4375d6
>    Probe point found: __se_sys_epoll_wait+6
> - add_bpf_event  creates evsel for every probe in a BPF object. This
>    results in 3 evsels.
>
> Solution:
> - Expected result = 50% of the samples to be collected from epoll_wait *
>    number of entries present in the evlist.
>
> Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> Reviewed-by: Thomas Richter <tmricht@linux.ibm.com>
> ---
>   tools/perf/tests/bpf.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
> index 5d20bf8397f0..cd77e334e577 100644
> --- a/tools/perf/tests/bpf.c
> +++ b/tools/perf/tests/bpf.c
> @@ -197,7 +197,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
>   		perf_mmap__read_done(&md->core);
>   	}
>   
> -	if (count != expect) {
> +	if (count != expect * evlist->core.nr_entries) {
>   		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
>   		goto out_delete_evlist;
>   	}
Arnaldo Carvalho de Melo Sept. 1, 2020, 3:17 p.m. UTC | #2
Em Tue, Aug 25, 2020 at 10:32:45AM +0200, Sumanth Korikkar escreveu:
> Kind Ping. Thank you.

I've applied it already, will go to Linus today.

- Arnaldo
 
> On 8/17/20 9:27 AM, Sumanth Korikkar wrote:
> > BPF basic filtering test fails on s390x (when vmlinux debuginfo is
> > utilized instead of /proc/kallsyms)
> > 
> > Info:
> > - bpf_probe_load installs the bpf code at do_epoll_wait.
> > - For s390x, do_epoll_wait resolves to 3 functions including inlines.
> >    found inline addr: 0x43769e
> >    Probe point found: __s390_sys_epoll_wait+6
> >    found inline addr: 0x437290
> >    Probe point found: do_epoll_wait+0
> >    found inline addr: 0x4375d6
> >    Probe point found: __se_sys_epoll_wait+6
> > - add_bpf_event  creates evsel for every probe in a BPF object. This
> >    results in 3 evsels.
> > 
> > Solution:
> > - Expected result = 50% of the samples to be collected from epoll_wait *
> >    number of entries present in the evlist.
> > 
> > Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> > Reviewed-by: Thomas Richter <tmricht@linux.ibm.com>
> > ---
> >   tools/perf/tests/bpf.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
> > index 5d20bf8397f0..cd77e334e577 100644
> > --- a/tools/perf/tests/bpf.c
> > +++ b/tools/perf/tests/bpf.c
> > @@ -197,7 +197,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
> >   		perf_mmap__read_done(&md->core);
> >   	}
> > -	if (count != expect) {
> > +	if (count != expect * evlist->core.nr_entries) {
> >   		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
> >   		goto out_delete_evlist;
> >   	}
> 
> -- 
> Sumanth Korikkar
>
diff mbox series

Patch

diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 5d20bf8397f0..cd77e334e577 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -197,7 +197,7 @@  static int do_test(struct bpf_object *obj, int (*func)(void),
 		perf_mmap__read_done(&md->core);
 	}
 
-	if (count != expect) {
+	if (count != expect * evlist->core.nr_entries) {
 		pr_debug("BPF filter result incorrect, expected %d, got %d samples\n", expect, count);
 		goto out_delete_evlist;
 	}