lkml.org 
[lkml]   [2015]   [May]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v4 06/29] bpf tools: Open eBPF object file and do basic validation
On Wed, May 27, 2015 at 05:19:41AM +0000, Wang Nan wrote:
> This patch defines basic interface of libbpf. 'struct bpf_object' will
> be the handler of each object file. Its internal structure is hide to
> user. eBPF object files are compiled by LLVM as ELF format. In this
> patch, libelf is used to open those files, read EHDR and do basic
> validation according to e_type and e_machine.
>
> All elf related staffs are grouped together and reside in efile field of
> 'struct bpf_object'. bpf_object__elf_finish() is introduced to clear it.
>
> After all eBPF programs in an object file are loaded, related ELF
> information is useless. Close the object file and free those memory.
>
> zfree() and zclose() are introduced to ensure setting NULL pointers and
> negative file descriptors after resources are released.
>
> Signed-off-by: Wang Nan <wangnan0@huawei.com>

the __ notation actually looks good in this context.
Acked-by: Alexei Starovoitov <ast@plumgrid.com>

btw, you didn't cc me on this set, luckily I found it on lkml.



\
 
 \ /
  Last update: 2015-05-28 04:21    [W:0.218 / U:1.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site