All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Song Liu <songliubraving@fb.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	Andrii Nakryiko <andriin@fb.com>, bpf <bpf@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Kernel Team <Kernel-team@fb.com>
Subject: Re: [PATCH v9 bpf-next 2/3] libbpf: add support for command BPF_ENABLE_STATS
Date: Mon, 4 May 2020 11:32:09 -0700	[thread overview]
Message-ID: <CAEf4BzacguQXgT9GUj2yfdw3M8dM85gBt55Di+CGLCZcYcuK6Q@mail.gmail.com> (raw)
In-Reply-To: <19614603-D8E5-49E9-AB70-A022A409EF03@fb.com>

On Mon, May 4, 2020 at 10:47 AM Song Liu <songliubraving@fb.com> wrote:
>
>
>
> > On May 2, 2020, at 1:00 PM, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> >
> > On Thu, Apr 30, 2020 at 12:15 AM Song Liu <songliubraving@fb.com> wrote:
> >>
> >> bpf_enable_stats() is added to enable given stats.
> >>
> >> Signed-off-by: Song Liu <songliubraving@fb.com>
> > ...
> >> diff --git a/tools/lib/bpf/bpf.h b/tools/lib/bpf/bpf.h
> >> index 335b457b3a25..1901b2777854 100644
> >> --- a/tools/lib/bpf/bpf.h
> >> +++ b/tools/lib/bpf/bpf.h
> >> @@ -231,6 +231,7 @@ LIBBPF_API int bpf_load_btf(void *btf, __u32 btf_size, char *log_buf,
> >> LIBBPF_API int bpf_task_fd_query(int pid, int fd, __u32 flags, char *buf,
> >>                                 __u32 *buf_len, __u32 *prog_id, __u32 *fd_type,
> >>                                 __u64 *probe_offset, __u64 *probe_addr);
> >> +LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type);
> >
> > I see odd warning here while building selftests
> >
> > In file included from runqslower.c:10:
> > .../tools/testing/selftests/bpf/tools/include/bpf/bpf.h:234:38:
> > warning: ‘enum bpf_stats_type’ declared inside parameter list will not
> > be visible outside of this definition or declaration
> >  234 | LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type);
> >
> > Since this warning is printed only when building runqslower
> > and the rest of selftests are fine, I'm guessing
> > it's a makefile issue with order of includes?
> >
> > Andrii, could you please take a look ?
> > Not urgent. Just flagging for visibility.
>
> The following should fix it.
>
> Thanks,
> Song
>
> =========================== 8< ==============================
>
> From 485c28c8e2cbcc22aa8fcda82f8f599411faa755 Mon Sep 17 00:00:00 2001
> From: Song Liu <songliubraving@fb.com>
> Date: Mon, 4 May 2020 10:36:26 -0700
> Subject: [PATCH bpf-next] runqslower: include proper uapi/bpf.h
>
> runqslower doesn't specify include path for uapi/bpf.h. This causes the
> following warning:
>
> In file included from runqslower.c:10:
> .../tools/testing/selftests/bpf/tools/include/bpf/bpf.h:234:38:
> warning: 'enum bpf_stats_type' declared inside parameter list will not
> be visible outside of this definition or declaration
>   234 | LIBBPF_API int bpf_enable_stats(enum bpf_stats_type type);
>
> Fix this by adding -I tools/includ/uapi to the Makefile.
>
> Reported-by: Alexei Starovoitov <ast@kernel.org>
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---

LGTM. Thanks!

Acked-by: Andrii Nakryiko <andriin@fb.com>

>  tools/bpf/runqslower/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/tools/bpf/runqslower/Makefile b/tools/bpf/runqslower/Makefile
> index 8a6f82e56a24..722a29a988cd 100644
> --- a/tools/bpf/runqslower/Makefile
> +++ b/tools/bpf/runqslower/Makefile
> @@ -8,7 +8,8 @@ BPFTOOL ?= $(DEFAULT_BPFTOOL)
>  LIBBPF_SRC := $(abspath ../../lib/bpf)
>  BPFOBJ := $(OUTPUT)/libbpf.a
>  BPF_INCLUDE := $(OUTPUT)
> -INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../lib)
> +INCLUDES := -I$(OUTPUT) -I$(BPF_INCLUDE) -I$(abspath ../../lib)        \
> +       -I$(abspath ../../include/uapi)
>  CFLAGS := -g -Wall
>
>  # Try to detect best kernel BTF source
> --
> 2.24.1
>

  reply	other threads:[~2020-05-04 18:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30  7:15 [PATCH v9 bpf-next 0/3] bpf: sharing bpf runtime stats with Song Liu
2020-04-30  7:15 ` [PATCH v9 bpf-next 1/3] bpf: sharing bpf runtime stats with BPF_ENABLE_STATS Song Liu
2020-04-30  7:15 ` [PATCH v9 bpf-next 2/3] libbpf: add support for command BPF_ENABLE_STATS Song Liu
2020-05-02 20:00   ` Alexei Starovoitov
2020-05-04 17:45     ` Song Liu
2020-05-04 18:32       ` Andrii Nakryiko [this message]
2020-05-10  1:03       ` Alexei Starovoitov
2020-06-21  3:07       ` Andrii Nakryiko
2020-04-30  7:15 ` [PATCH v9 bpf-next 3/3] bpf: add selftest for BPF_ENABLE_STATS Song Liu
2020-04-30 18:16   ` Andrii Nakryiko
2020-05-01 17:56 ` [PATCH v9 bpf-next 0/3] bpf: sharing bpf runtime stats with 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=CAEf4BzacguQXgT9GUj2yfdw3M8dM85gBt55Di+CGLCZcYcuK6Q@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=Kernel-team@fb.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@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 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.