Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1539584

Re: [PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf

From Joe Stringer <joe@ovn.org>
Newsgroups linux.kernel
Subject Re: [PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf
Date 2016-12-09 19:10 +0100
Message-ID <sMxMl-6wk-35@gated-at.bofh.it> (permalink)
References <sMjq2-5Sr-13@gated-at.bofh.it> <sMjq2-5Sr-41@gated-at.bofh.it> <sMlBw-7ym-7@gated-at.bofh.it> <sMlLc-7BJ-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 8 December 2016 at 21:18, Wangnan (F) <wangnan0@huawei.com> wrote:
>
>
> On 2016/12/9 13:04, Wangnan (F) wrote:
>>
>>
>>
>> On 2016/12/9 10:46, Joe Stringer wrote:
>>
>> [SNIP]
>>
>>>   diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
>>> index 62d89d50fcbd..616bd55f3be8 100644
>>> --- a/tools/lib/bpf/Makefile
>>> +++ b/tools/lib/bpf/Makefile
>>> @@ -149,6 +149,8 @@ CMD_TARGETS = $(LIB_FILE)
>>>     TARGETS = $(CMD_TARGETS)
>>>   +libbpf: all
>>> +
>>
>>
>> Why we need this? I tested this patch without it and it seems to work, and
>> this line causes an extra error:
>>  $ pwd
>>  /home/wn/kernel/tools/lib/bpf
>>  $ make libbpf
>>  ...
>>  gcc -g -Wall -DHAVE_LIBELF_MMAP_SUPPORT -DHAVE_ELF_GETPHDRNUM_SUPPORT
>> -Wbad-function-cast -Wdeclaration-after-statement -Wformat-security
>> -Wformat-y2k -Winit-self -Wmissing-declarations -Wmissing-prototypes
>> -Wnested-externs -Wno-system-headers -Wold-style-definition -Wpacked
>> -Wredundant-decls -Wshadow -Wstrict-aliasing=3 -Wstrict-prototypes
>> -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wformat -Werror
>> -Wall -fPIC -I. -I/home/wn/kernel-hydrogen/tools/include
>> -I/home/wn/kernel-hydrogen/tools/arch/x86/include/uapi
>> -I/home/wn/kernel-hydrogen/tools/include/uapi    libbpf.c all   -o libbpf
>>  gcc: error: all: No such file or directory
>>  make: *** [libbpf] Error 1
>>
>> Thank you.
>
>
> It is not 'caused' by your patch. 'make libbpf' fails without
> your change because it tries to build an executable from
> libbpf.c, but main() is missing.
>
> I think libbpf should never be used as a make target. Your
> new dependency looks strange.

Thanks for the feedback, I sent a patch to address this on top of perf/core:

https://lkml.org/lkml/2016/12/9/518

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf Joe Stringer <joe@ovn.org> - 2016-12-09 03:50 +0100
  Re: [PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf "Wangnan (F)" <wangnan0@huawei.com> - 2016-12-09 06:10 +0100
    Re: [PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf "Wangnan (F)" <wangnan0@huawei.com> - 2016-12-09 06:20 +0100
      Re: [PATCHv3 perf/core 5/7] samples/bpf: Switch over to libbpf Joe Stringer <joe@ovn.org> - 2016-12-09 19:10 +0100

csiph-web