bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Song Liu <songliubraving@fb.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Network Development <netdev@vger.kernel.org>,
	"bpf@vger.kernel.org" <bpf@vger.kernel.org>,
	Kernel Team <Kernel-team@fb.com>,
	"ast@kernel.org" <ast@kernel.org>,
	"daniel@iogearbox.net" <daniel@iogearbox.net>,
	"john.fastabend@gmail.com" <john.fastabend@gmail.com>,
	"kpsingh@chromium.org" <kpsingh@chromium.org>
Subject: Re: [PATCH v3 bpf-next 2/2] selftests/bpf: add tests for BPF_F_PRESERVE_ELEMS
Date: Wed, 30 Sep 2020 21:20:14 +0000	[thread overview]
Message-ID: <B592DCBD-56EF-4420-BBC7-AC5A05077D8A@fb.com> (raw)
In-Reply-To: <20200930192647.mgunvnxzb5mmxae7@ast-mbp.dhcp.thefacebook.com>



> On Sep 30, 2020, at 12:26 PM, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> 
> On Wed, Sep 30, 2020 at 08:20:58AM -0700, Song Liu wrote:
>> diff --git a/tools/testing/selftests/bpf/progs/test_pe_preserve_elems.c b/tools/testing/selftests/bpf/progs/test_pe_preserve_elems.c
>> new file mode 100644
>> index 0000000000000..dc77e406de41f
>> --- /dev/null
>> +++ b/tools/testing/selftests/bpf/progs/test_pe_preserve_elems.c
>> @@ -0,0 +1,44 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +// Copyright (c) 2020 Facebook
>> +#include "vmlinux.h"
> 
> Does it actually need vmlinux.h ?
> Just checking to make sure it compiles on older kernels.

We can include linux/bpf.h instead. 

[...]

>> +	long ret;
>> +
>> +	ret = bpf_perf_event_read_value(&array_2, 0, &val, sizeof(val));
>> +	bpf_printk("read_array_2 returns %ld", ret);
> 
> Please remove printk from the tests. It only spams the trace_pipe.
> 
>> +	return ret;
> 
> The return code is already checked as far as I can see.
> That's enough to pass/fail the test, right?

Yes, we can remove the bpf_printk() here. Fixing this in v4.

Thanks,
Song


      reply	other threads:[~2020-09-30 21:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 15:20 [PATCH v3 bpf-next 0/2] introduce BPF_F_PRESERVE_ELEMS Song Liu
2020-09-30 15:20 ` [PATCH v3 bpf-next 1/2] bpf: introduce BPF_F_PRESERVE_ELEMS for perf event array Song Liu
2020-09-30 15:20 ` [PATCH v3 bpf-next 2/2] selftests/bpf: add tests for BPF_F_PRESERVE_ELEMS Song Liu
2020-09-30 19:26   ` Alexei Starovoitov
2020-09-30 21:20     ` Song Liu [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=B592DCBD-56EF-4420-BBC7-AC5A05077D8A@fb.com \
    --to=songliubraving@fb.com \
    --cc=Kernel-team@fb.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@chromium.org \
    --cc=netdev@vger.kernel.org \
    /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).