From: Andrey Ignatov <rdna@fb.com>
To: "Toke Høiland-Jørgensen" <toke@redhat.com>
Cc: <daniel@iogearbox.net>, <ast@fb.com>, <bpf@vger.kernel.org>,
<netdev@vger.kernel.org>
Subject: Re: [PATCH bpf] selftests/bpf: Declare bpf_log_buf variables as static
Date: Mon, 2 Mar 2020 08:58:31 -0800 [thread overview]
Message-ID: <20200302165831.GA84713@rdna-mbp> (raw)
In-Reply-To: <20200302145348.559177-1-toke@redhat.com>
Toke Høiland-Jørgensen <toke@redhat.com> [Mon, 2020-03-02 06:54 -0800]:
> The cgroup selftests did not declare the bpf_log_buf variable as static, leading
> to a linker error with GCC 10 (which defaults to -fno-common). Fix this by
> adding the missing static declarations.
>
> Fixes: 257c88559f36 ("selftests/bpf: Convert test_cgroup_attach to prog_tests")
Hi Toke,
Thanks for the fix.
My 257c88559f36 commit was just a split that simply moved this
bpf_log_buf from tools/testing/selftests/bpf/test_cgroup_attach.c to all
new three files as is among many other things. Before that it was moved
as is from samples/ in
ba0c0cc05dda ("selftests/bpf: convert test_cgrp2_attach2 example into kselftest")
and before that it was introduced in
d40fc181ebec ("samples/bpf: Make samples more libbpf-centric")
Though since these are new files I guess having just 257c88559f36 in the
tag should be fine(?) so:
Acked-by: Andrey Ignatov <rdna@fb.com>
> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
> ---
> .../testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c | 2 +-
> tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c | 2 +-
> tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c | 2 +-
> 3 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c
> index 5b13f2c6c402..70e94e783070 100644
> --- a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c
> +++ b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_autodetach.c
> @@ -6,7 +6,7 @@
>
> #define PING_CMD "ping -q -c1 -w1 127.0.0.1 > /dev/null"
>
> -char bpf_log_buf[BPF_LOG_BUF_SIZE];
> +static char bpf_log_buf[BPF_LOG_BUF_SIZE];
>
> static int prog_load(void)
> {
> diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c
> index 2ff21dbce179..139f8e82c7c6 100644
> --- a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c
> +++ b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_multi.c
> @@ -6,7 +6,7 @@
>
> #define PING_CMD "ping -q -c1 -w1 127.0.0.1 > /dev/null"
>
> -char bpf_log_buf[BPF_LOG_BUF_SIZE];
> +static char bpf_log_buf[BPF_LOG_BUF_SIZE];
>
> static int map_fd = -1;
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
> index 9d8cb48b99de..9e96f8d87fea 100644
> --- a/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
> +++ b/tools/testing/selftests/bpf/prog_tests/cgroup_attach_override.c
> @@ -8,7 +8,7 @@
> #define BAR "/foo/bar/"
> #define PING_CMD "ping -q -c1 -w1 127.0.0.1 > /dev/null"
>
> -char bpf_log_buf[BPF_LOG_BUF_SIZE];
> +static char bpf_log_buf[BPF_LOG_BUF_SIZE];
>
> static int prog_load(int verdict)
> {
> --
> 2.25.1
>
--
Andrey Ignatov
next prev parent reply other threads:[~2020-03-02 16:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-02 14:53 [PATCH bpf] selftests/bpf: Declare bpf_log_buf variables as static Toke Høiland-Jørgensen
2020-03-02 16:58 ` Andrey Ignatov [this message]
2020-03-02 17:48 ` Toke Høiland-Jørgensen
2020-03-03 1:03 ` Alexei Starovoitov
2020-03-03 8:09 ` Toke Høiland-Jørgensen
2020-03-03 16:27 ` Alexei Starovoitov
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=20200302165831.GA84713@rdna-mbp \
--to=rdna@fb.com \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.