Re: [RFC PATCH v3 06/37] bpf tools: Introduce 'bpf' library to tools

Wangnan (F)
2015-05-20T03:48:51Z

在 2015/5/19 1:35, Alexei Starovoitov 写道:
> On 5/17/15 3:56 AM, Wang Nan wrote:
>> This is the first patch of libbpf. The goal of libbpf is to create a
>> standard way for accessing eBPF object files. This patch creates
>> Makefile and Build for it, allows 'make' to build libbpf.a and
>> libbpf.so, 'make install' to put them into proper directories.
>> Most part of Makefile is borrowed from traceevent. Before building,
>> it checks the existance of libelf in Makefile, and deny to build if
>> not found. Instead of throw an error if libelf not found, the error
>> raises in a phony target "elfdep". This design is to ensure
>> 'make clean' still workable even if libelf is not found.
>>
>> Signed-off-by: Wang Nan <wangnan0@huawei.com>
>> ---
> ...
>> +
>> +# Version of eBPF elf file
>> +FILE_VERSION = 1
>
> what that comment suppose to mean?

The format of eBPF objects can be improved in futher. A version number
here is the precaution of backward compatibility. However this patch doesn't
utilize it.

I'd like to append a 'format' section into eBPF object format to let
libbpf know
the version of the object. What do you think?

Thank you.