All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] selftests/bpf: suppress readelf stderr when probing for BTF support
@ 2019-01-23 17:24 Stanislav Fomichev
  2019-01-24  1:45 ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Stanislav Fomichev @ 2019-01-23 17:24 UTC (permalink / raw)
  To: netdev; +Cc: davem, ast, daniel, Stanislav Fomichev

Before:
$ make -s -C tools/testing/selftests/bpf
readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF
sections of machine number 247
readelf: Warning: unable to apply unsupported reloc type 10 to section
.debug_info
readelf: Warning: unable to apply unsupported reloc type 1 to section
.debug_info
readelf: Warning: unable to apply unsupported reloc type 10 to section
.debug_info

After:
$ make -s -C tools/testing/selftests/bpf

Signed-off-by: Stanislav Fomichev <sdf@google.com>
---
 tools/testing/selftests/bpf/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
index 70229de510f5..ff3cab5525c1 100644
--- a/tools/testing/selftests/bpf/Makefile
+++ b/tools/testing/selftests/bpf/Makefile
@@ -131,7 +131,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
 BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
 BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
 			  $(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
-			  readelf -S ./llvm_btf_verify.o | grep BTF; \
+			  readelf -S ./llvm_btf_verify.o 2>/dev/null | grep BTF; \
 			  /bin/rm -f ./llvm_btf_verify.o)
 
 ifneq ($(BTF_LLVM_PROBE),)
-- 
2.20.1.321.g9e740568ce-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: suppress readelf stderr when probing for BTF support
  2019-01-23 17:24 [PATCH bpf-next] selftests/bpf: suppress readelf stderr when probing for BTF support Stanislav Fomichev
@ 2019-01-24  1:45 ` Alexei Starovoitov
  2019-01-24  3:15   ` Stanislav Fomichev
  0 siblings, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2019-01-24  1:45 UTC (permalink / raw)
  To: Stanislav Fomichev; +Cc: netdev, davem, ast, daniel

On Wed, Jan 23, 2019 at 09:24:35AM -0800, Stanislav Fomichev wrote:
> Before:
> $ make -s -C tools/testing/selftests/bpf
> readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF
> sections of machine number 247
> readelf: Warning: unable to apply unsupported reloc type 10 to section
> .debug_info
> readelf: Warning: unable to apply unsupported reloc type 1 to section
> .debug_info
> readelf: Warning: unable to apply unsupported reloc type 10 to section
> .debug_info
> 
> After:
> $ make -s -C tools/testing/selftests/bpf
> 
> Signed-off-by: Stanislav Fomichev <sdf@google.com>
> ---
>  tools/testing/selftests/bpf/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> index 70229de510f5..ff3cab5525c1 100644
> --- a/tools/testing/selftests/bpf/Makefile
> +++ b/tools/testing/selftests/bpf/Makefile
> @@ -131,7 +131,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
>  BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
>  BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
>  			  $(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
> -			  readelf -S ./llvm_btf_verify.o | grep BTF; \
> +			  readelf -S ./llvm_btf_verify.o 2>/dev/null | grep BTF; \
>  			  /bin/rm -f ./llvm_btf_verify.o)

Silencing the warning may hide real issue later.
I'd rather fix whatever is necessary in readelf.
Does it use bfd? if so bpf support for bfd was practically complete.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: suppress readelf stderr when probing for BTF support
  2019-01-24  1:45 ` Alexei Starovoitov
@ 2019-01-24  3:15   ` Stanislav Fomichev
  2019-01-24  3:47     ` Alexei Starovoitov
  0 siblings, 1 reply; 4+ messages in thread
From: Stanislav Fomichev @ 2019-01-24  3:15 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: Stanislav Fomichev, netdev, davem, ast, daniel

On 01/23, Alexei Starovoitov wrote:
> On Wed, Jan 23, 2019 at 09:24:35AM -0800, Stanislav Fomichev wrote:
> > Before:
> > $ make -s -C tools/testing/selftests/bpf
> > readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF
> > sections of machine number 247
> > readelf: Warning: unable to apply unsupported reloc type 10 to section
> > .debug_info
> > readelf: Warning: unable to apply unsupported reloc type 1 to section
> > .debug_info
> > readelf: Warning: unable to apply unsupported reloc type 10 to section
> > .debug_info
> > 
> > After:
> > $ make -s -C tools/testing/selftests/bpf
> > 
> > Signed-off-by: Stanislav Fomichev <sdf@google.com>
> > ---
> >  tools/testing/selftests/bpf/Makefile | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> > index 70229de510f5..ff3cab5525c1 100644
> > --- a/tools/testing/selftests/bpf/Makefile
> > +++ b/tools/testing/selftests/bpf/Makefile
> > @@ -131,7 +131,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
> >  BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
> >  BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
> >  			  $(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
> > -			  readelf -S ./llvm_btf_verify.o | grep BTF; \
> > +			  readelf -S ./llvm_btf_verify.o 2>/dev/null | grep BTF; \
> >  			  /bin/rm -f ./llvm_btf_verify.o)
> 
> Silencing the warning may hide real issue later.
> I'd rather fix whatever is necessary in readelf.
> Does it use bfd? if so bpf support for bfd was practically complete.
Are you concerned about the situation where llvm has btf support, but
readelf (binutils) is unaware of it? In this case, we should probably
use llvm's readelf (llvm-readelf binary). We already have a precedent of
using llvm's tools with LLVM_OBJCOPY. Let me try it out tomorrow.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH bpf-next] selftests/bpf: suppress readelf stderr when probing for BTF support
  2019-01-24  3:15   ` Stanislav Fomichev
@ 2019-01-24  3:47     ` Alexei Starovoitov
  0 siblings, 0 replies; 4+ messages in thread
From: Alexei Starovoitov @ 2019-01-24  3:47 UTC (permalink / raw)
  To: Stanislav Fomichev; +Cc: Stanislav Fomichev, netdev, davem, ast, daniel

On Wed, Jan 23, 2019 at 07:15:07PM -0800, Stanislav Fomichev wrote:
> On 01/23, Alexei Starovoitov wrote:
> > On Wed, Jan 23, 2019 at 09:24:35AM -0800, Stanislav Fomichev wrote:
> > > Before:
> > > $ make -s -C tools/testing/selftests/bpf
> > > readelf: Error: Missing knowledge of 32-bit reloc types used in DWARF
> > > sections of machine number 247
> > > readelf: Warning: unable to apply unsupported reloc type 10 to section
> > > .debug_info
> > > readelf: Warning: unable to apply unsupported reloc type 1 to section
> > > .debug_info
> > > readelf: Warning: unable to apply unsupported reloc type 10 to section
> > > .debug_info
> > > 
> > > After:
> > > $ make -s -C tools/testing/selftests/bpf
> > > 
> > > Signed-off-by: Stanislav Fomichev <sdf@google.com>
> > > ---
> > >  tools/testing/selftests/bpf/Makefile | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/tools/testing/selftests/bpf/Makefile b/tools/testing/selftests/bpf/Makefile
> > > index 70229de510f5..ff3cab5525c1 100644
> > > --- a/tools/testing/selftests/bpf/Makefile
> > > +++ b/tools/testing/selftests/bpf/Makefile
> > > @@ -131,7 +131,7 @@ BTF_PAHOLE_PROBE := $(shell $(BTF_PAHOLE) --help 2>&1 | grep BTF)
> > >  BTF_OBJCOPY_PROBE := $(shell $(LLVM_OBJCOPY) --help 2>&1 | grep -i 'usage.*llvm')
> > >  BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \
> > >  			  $(CLANG) -target bpf -O2 -g -c -x c - -o ./llvm_btf_verify.o; \
> > > -			  readelf -S ./llvm_btf_verify.o | grep BTF; \
> > > +			  readelf -S ./llvm_btf_verify.o 2>/dev/null | grep BTF; \
> > >  			  /bin/rm -f ./llvm_btf_verify.o)
> > 
> > Silencing the warning may hide real issue later.
> > I'd rather fix whatever is necessary in readelf.
> > Does it use bfd? if so bpf support for bfd was practically complete.
> Are you concerned about the situation where llvm has btf support, but
> readelf (binutils) is unaware of it? In this case, we should probably
> use llvm's readelf (llvm-readelf binary). We already have a precedent of
> using llvm's tools with LLVM_OBJCOPY. Let me try it out tomorrow.

llvm-readelf or llvm-objdump are fine options too.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-01-24  3:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-23 17:24 [PATCH bpf-next] selftests/bpf: suppress readelf stderr when probing for BTF support Stanislav Fomichev
2019-01-24  1:45 ` Alexei Starovoitov
2019-01-24  3:15   ` Stanislav Fomichev
2019-01-24  3:47     ` Alexei Starovoitov

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.