diff mbox series

[v8,bpf-next,01/13] selftests/bpf: Fix resolve_btfids test

Message ID 20200722211223.1055107-2-jolsa@kernel.org
State Changes Requested
Delegated to: BPF Maintainers
Headers show
Series bpf: Add d_path helper | expand

Commit Message

Jiri Olsa July 22, 2020, 9:12 p.m. UTC
The linux/btf_ids.h header is now using CONFIG_DEBUG_INFO_BTF
config, so we need to have it defined when it's available.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andrii Nakryiko July 28, 2020, 8:27 p.m. UTC | #1
On Wed, Jul 22, 2020 at 2:13 PM Jiri Olsa <jolsa@kernel.org> wrote:
>
> The linux/btf_ids.h header is now using CONFIG_DEBUG_INFO_BTF
> config, so we need to have it defined when it's available.
>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---

sure, why not

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

>  tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> index 3b127cab4864..101785b49f7e 100644
> --- a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> +++ b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> @@ -1,5 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0
>
> +#include "autoconf.h"
>  #include <linux/err.h>
>  #include <string.h>
>  #include <bpf/btf.h>
> --
> 2.25.4
>
Jiri Olsa July 29, 2020, 8:06 p.m. UTC | #2
On Tue, Jul 28, 2020 at 01:27:49PM -0700, Andrii Nakryiko wrote:
> On Wed, Jul 22, 2020 at 2:13 PM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > The linux/btf_ids.h header is now using CONFIG_DEBUG_INFO_BTF
> > config, so we need to have it defined when it's available.
> >
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > ---
> 
> sure, why not

actually after rebase I realized Yonghong added
CONFIG_DEBUG_INFO_BTF define in:
  d8dfe5bfe856 ("tools/bpf: Sync btf_ids.h to tools")

I think including 'autoconf.h' is more clean,
on the other hand I don't think we'd get clean
selftest compile without CONFIG_DEBUG_INFO_BTF

should we keep the #define instead?

thanks,
jirka

> 
> Acked-by: Andrii Nakryiko <andriin@fb.com>
> 
> >  tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> > index 3b127cab4864..101785b49f7e 100644
> > --- a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> > +++ b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> > @@ -1,5 +1,6 @@
> >  // SPDX-License-Identifier: GPL-2.0
> >
> > +#include "autoconf.h"
> >  #include <linux/err.h>
> >  #include <string.h>
> >  #include <bpf/btf.h>
> > --
> > 2.25.4
> >
>
Andrii Nakryiko July 29, 2020, 9:38 p.m. UTC | #3
On Wed, Jul 29, 2020 at 1:07 PM Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Tue, Jul 28, 2020 at 01:27:49PM -0700, Andrii Nakryiko wrote:
> > On Wed, Jul 22, 2020 at 2:13 PM Jiri Olsa <jolsa@kernel.org> wrote:
> > >
> > > The linux/btf_ids.h header is now using CONFIG_DEBUG_INFO_BTF
> > > config, so we need to have it defined when it's available.
> > >
> > > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> > > ---
> >
> > sure, why not
>
> actually after rebase I realized Yonghong added
> CONFIG_DEBUG_INFO_BTF define in:
>   d8dfe5bfe856 ("tools/bpf: Sync btf_ids.h to tools")
>
> I think including 'autoconf.h' is more clean,
> on the other hand I don't think we'd get clean
> selftest compile without CONFIG_DEBUG_INFO_BTF
>
> should we keep the #define instead?
>

#define is fine with me

> thanks,
> jirka
>
> >
> > Acked-by: Andrii Nakryiko <andriin@fb.com>
> >
> > >  tools/testing/selftests/bpf/prog_tests/resolve_btfids.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> > > index 3b127cab4864..101785b49f7e 100644
> > > --- a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> > > +++ b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
> > > @@ -1,5 +1,6 @@
> > >  // SPDX-License-Identifier: GPL-2.0
> > >
> > > +#include "autoconf.h"
> > >  #include <linux/err.h>
> > >  #include <string.h>
> > >  #include <bpf/btf.h>
> > > --
> > > 2.25.4
> > >
> >
>
diff mbox series

Patch

diff --git a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
index 3b127cab4864..101785b49f7e 100644
--- a/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
+++ b/tools/testing/selftests/bpf/prog_tests/resolve_btfids.c
@@ -1,5 +1,6 @@ 
 // SPDX-License-Identifier: GPL-2.0
 
+#include "autoconf.h"
 #include <linux/err.h>
 #include <string.h>
 #include <bpf/btf.h>