Re: [RFC PATCH v5 06/30] bpf tools: Open eBPF object file and do basic validation

From: Arnaldo Carvalho de Melo
Date: Wed Jun 03 2015 - 17:33:32 EST


Em Mon, Jun 01, 2015 at 07:37:52AM +0000, Wang Nan escreveu:
> 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@xxxxxxxxxx>
> Acked-by: Alexei Starovoitov <ast@xxxxxxxxxxxx>

Plese do:

cd .git/hooks/
mv

To avoid submitting patches that produce this:

[acme@ssdandy linux]$ am /wb/1.patch
Applying: bpf tools: Open eBPF object file and do basic validation
/home/acme/git/linux/.git/rebase-apply/patch:98: trailing whitespace.

/home/acme/git/linux/.git/rebase-apply/patch:145: space before tab in indent.
pr_debug("loading %s\n", path);
warning: 2 lines add whitespace errors.
tools/lib/bpf/libbpf.c:130: trailing whitespace.
+
tools/lib/bpf/libbpf.c:177: space before tab in indent.
+ pr_debug("loading %s\n", path);
[acme@ssdandy linux]$

----------------------------

Fixing it up this time,

- Arnaldo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/