netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wenbo Zhang <ethercflow@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: bpf <bpf@vger.kernel.org>, Yonghong Song <yhs@fb.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Networking <netdev@vger.kernel.org>
Subject: Re: [PATCH bpf-next v2] selftests/bpf: test for bpf_get_file_path() from raw tracepoint
Date: Sun, 3 Nov 2019 17:57:36 +0800	[thread overview]
Message-ID: <CABtjQmZugRi4d-UfNtyqUir9FpgjmVWQUi3W2E=MoLi-JV91wQ@mail.gmail.com> (raw)
In-Reply-To: <CAEf4Bzand8qSxqmryyxMNg3FNL-pgokJ4taRrtGq07rdbEjsbA@mail.gmail.com>

> Unless there is a real reason for all this complexity (in which case,
> please spell it out in commit or comments), I think this could be so
> much simpler.

Yes, it could be so much simpler than this implement.

> - you don't have to use perf_buffer to pass data back, just use global data;
> - you can add a filter for PID to only capture data triggered by test
> process and avoid the noise;

Yes, I'll use map instead of perf buffer to communicate.

> - why all those set_affinity dances? Is it just because you used
> existing perf_buffer test which did that to specifically test
> perf_buffer delivering data across every CPU core? Seems like your
> test doesn't care about that...

I used fd2path_loadgen to get hundreds of syscalls between multi usleep, which
may cause it's sched to different cores, but as you say, this test
doesn't care about
that... I'll remove them with perf buffer.

> - do we really need a separate binary generating hundreds of syscalls?
> It's hard to synchronize with test and it seems much simpler to just
> trigger necessary syscalls synchronously from the test itself, no?

This is my fault, necessary syscalls synchronously from the test
itself is enough.

> I have a bunch of more minutia nits, but most of them will go away if
> you simplify your testing approach anyway, so I'll postpone them till
> then.

Thanks a lot. I'll modify a simplified version then recommitted.

Andrii Nakryiko <andrii.nakryiko@gmail.com> 于2019年11月2日周六 下午1:49写道:

>
> On Fri, Nov 1, 2019 at 6:08 AM Wenbo Zhang <ethercflow@gmail.com> wrote:
> >
> > trace fstat events by raw tracepoint sys_enter:newfstat, and handle events
> > only produced by fd2path_loadgen, the fd2path_loadgen call fstat on several
> > different types of files to test bpf_get_file_path's feature.
> > ---
>
> Unless there is a real reason for all this complexity (in which case,
> please spell it out in commit or comments), I think this could be so
> much simpler.
>
> - you don't have to use perf_buffer to pass data back, just use global data;
> - you can add a filter for PID to only capture data triggered by test
> process and avoid the noise;
> - why all those set_affinity dances? Is it just because you used
> existing perf_buffer test which did that to specifically test
> perf_buffer delivering data across every CPU core? Seems like your
> test doesn't care about that...
> - do we really need a separate binary generating hundreds of syscalls?
> It's hard to synchronize with test and it seems much simpler to just
> trigger necessary syscalls synchronously from the test itself, no?
>
> I have a bunch of more minutia nits, but most of them will go away if
> you simplify your testing approach anyway, so I'll postpone them till
> then.
>
> >  tools/testing/selftests/bpf/Makefile          |   8 +-
> >  tools/testing/selftests/bpf/fd2path_loadgen.c |  75 ++++++++++
> >  .../selftests/bpf/prog_tests/get_file_path.c  | 130 ++++++++++++++++++
> >  .../selftests/bpf/progs/test_get_file_path.c  |  58 ++++++++
> >  4 files changed, 269 insertions(+), 2 deletions(-)
> >  create mode 100644 tools/testing/selftests/bpf/fd2path_loadgen.c
> >  create mode 100644 tools/testing/selftests/bpf/prog_tests/get_file_path.c
> >  create mode 100644 tools/testing/selftests/bpf/progs/test_get_file_path.c
> >
>
> [...]

      reply	other threads:[~2019-11-03  9:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01 13:08 [PATCH bpf-next v2] selftests/bpf: test for bpf_get_file_path() from raw tracepoint Wenbo Zhang
2019-11-02  5:48 ` Andrii Nakryiko
2019-11-03  9:57   ` Wenbo Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABtjQmZugRi4d-UfNtyqUir9FpgjmVWQUi3W2E=MoLi-JV91wQ@mail.gmail.com' \
    --to=ethercflow@gmail.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).